Compare commits

...

94 Commits

Author SHA1 Message Date
Matt Walsh
2db7f30de7 5.27.1 2025-07-11 22:36:57 -05:00
Matt Walsh
5c7a6ab1a4 fix for rss feed encoding types close #124 2025-07-11 22:36:47 -05:00
Matt Walsh
4b63328b74 update dependencies 2025-07-06 10:54:20 -05:00
Matt Walsh
ae1d004f60 Merge pull request #123 from rmitchellscott/fix-static-envs
fix: url encode envs in static-env-handler. Fixes #122.
2025-07-06 10:36:51 -05:00
Mitchell Scott
7dd4c1dd24 fix: url encode envs in static-env-handler. Fixes #122. 2025-07-04 04:41:56 -06:00
Matt Walsh
1120247c99 include custom rss feed in build #57 2025-06-30 23:32:30 -05:00
Matt Walsh
c5c01e5450 5.27.0 2025-06-30 23:29:46 -05:00
Matt Walsh
0a65221905 update readme for custom rss close #57 2025-06-30 23:29:39 -05:00
Matt Walsh
9f9667c895 add single text scroll option #57 2025-06-28 09:20:36 -05:00
Matt Walsh
fda44e95fc rss feeds scroll, needs additional testing #57 2025-06-28 00:59:40 -05:00
Matt Walsh
945c12e6c6 parse rss feed #57 2025-06-28 00:29:55 -05:00
Matt Walsh
0fde88cd8f restructure current weather scroll to allow add/remove of rss feed #57 2025-06-28 00:29:47 -05:00
Matt Walsh
c6af9a2913 5.26.2 2025-06-27 22:30:05 -05:00
Matt Walsh
11eba84cdb fix for calm/0mph wind close #121 2025-06-27 22:29:56 -05:00
Matt Walsh
b9ead38015 5.26.1 2025-06-27 22:17:00 -05:00
Matt Walsh
3d0178faa1 radar scrolling fix for ios 2025-06-27 22:16:51 -05:00
Matt Walsh
8a2907e02c fix display of null wind speed 2025-06-27 15:35:15 -05:00
Matt Walsh
b870ce1c01 store already processed radar images for reuse on silent reload 2025-06-27 15:29:20 -05:00
Matt Walsh
15107ffe1c 5.26.0 2025-06-27 08:56:14 -05:00
Matt Walsh
efd4e0c66d Remove workers from build processes 2025-06-27 08:56:04 -05:00
Matt Walsh
652d7c5fb0 Merge remote-tracking branch 'origin/radar-no-worker' #74 #140 2025-06-27 08:54:50 -05:00
Matt Walsh
5a80f43f30 add staging gulp tasks 2025-06-26 22:30:42 -05:00
Matt Walsh
6d090cb1c7 streamline radar tile layout calculation #74 2025-06-26 21:23:44 -05:00
Matt Walsh
b5fa3e49d6 remove radar-worker and offscreen canvas to make things easier for ios #74 2025-06-20 22:04:00 -05:00
Matt Walsh
ef0b60a0b8 Merge pull request #117 from rmitchellscott/fix-radar-mime-chrome
fix: radar mime-type in chrome in Docker
2025-06-20 21:12:40 -05:00
Mitchell Scott
dc13140cc4 fix: radar mime-type in chrome 2025-06-20 08:40:52 -06:00
Matt Walsh
5414b1f5bc Merge pull request #116 from arazilsongweaver/bugfix-docker-nginx-config-add-mime-type
Docker: Add mime.types To nginx Configuration
2025-06-20 09:20:49 -05:00
Arazil
1fdc3635e6 Docker: Add mime.types To nginx Configuration
Explicit configuration of nginx MIME types is required for the proper operation the radar viewer.
2025-06-20 08:06:32 -05:00
Matt Walsh
e2cc86cddd 5.25.3 2025-06-19 23:30:56 -05:00
Matt Walsh
92181c716d clean up linking to radar worker 2025-06-19 23:30:44 -05:00
Matt Walsh
208ca3d87f 5.25.2 2025-06-19 22:50:17 -05:00
Matt Walsh
7167bb18fb allow one missing valueon current conditoins #94 #114 2025-06-19 22:50:09 -05:00
Matt Walsh
daa81ebf94 Merge branch 'rmitchellscott-static-docker' 2025-06-19 21:57:08 -05:00
Matt Walsh
543a8df9a2 Merge branch 'static-docker' of github.com:rmitchellscott/ws4kp into rmitchellscott-static-docker 2025-06-19 21:56:39 -05:00
Matt Walsh
b1347bcc3c 5.25.1 2025-06-16 23:10:49 -05:00
Matt Walsh
c7e170b1a3 fix for black radar background on mobile 2025-06-16 23:10:37 -05:00
Matt Walsh
3d75384848 build tool cleanup 2025-06-16 16:00:16 -05:00
Matt Walsh
bf4819b241 5.25.0 2025-06-16 15:48:20 -05:00
Matt Walsh
7dd6050416 Merge branch 'radar-layers' 2025-06-16 15:47:58 -05:00
Matt Walsh
bb0ad8ff32 radar code cleanup #74 #111 2025-06-16 15:47:24 -05:00
Matt Walsh
9eb192146a layers as pre-stretched tiles #74 #111 2025-06-16 15:47:23 -05:00
Matt Walsh
1b6e6ad142 lossless radar tiles 2025-06-16 13:39:54 -05:00
Matt Walsh
f0d4a9e6f0 change radar tile sizes 2025-06-16 13:26:35 -05:00
Matt Walsh
a2cbe7f5c8 stretched tiles 2025-06-14 12:11:41 -05:00
Matt Walsh
57395b8dc7 update eslint via compatability layer with airbnb-base 2025-06-14 11:35:33 -05:00
Mitchell Scott
51bb9696b0 add x-weatherstar header for specific 404 detection 2025-06-13 22:14:14 -06:00
Matt Walsh
a11e783cde 5.24.1 2025-06-13 22:29:35 -05:00
Matt Walsh
e2e22517b6 fix webpack for new radar-worker 2025-06-13 22:27:36 -05:00
Matt Walsh
d8e0399e92 5.24.0 2025-06-13 22:01:59 -05:00
Matt Walsh
f456897520 use background and foreground tiles for fixed parts of the radar #74 #111 2025-06-13 22:01:06 -05:00
Matt Walsh
9303035bb9 tile position correction 2025-06-13 17:58:05 -05:00
Matt Walsh
3c40219003 tile background created, need to fix shifting of tile 2025-06-13 16:44:53 -05:00
Mitchell Scott
6ff7122844 env workaround for static build 2025-06-13 14:51:06 -06:00
Mitchell Scott
9f94ef83ba human readable song title 2025-06-13 10:24:03 -06:00
Mitchell Scott
3236b2ecc3 radar fix for static deployment, slight spelling and grammer fixes in readme 2025-06-13 09:04:39 -06:00
Mitchell Scott
2827913d42 add client-side generation for playlist.json for static builds 2025-06-13 08:37:01 -06:00
Mitchell Scott
1ac514293b create static nginx docker build 2025-06-12 21:35:18 -06:00
Matt Walsh
392b339727 5.23.7 2025-06-12 20:53:28 -05:00
Matt Walsh
852eff8de6 add basic volume control #109 2025-06-12 20:53:23 -05:00
Matt Walsh
c74a15c40c 5.23.6 2025-06-12 13:17:26 -05:00
Matt Walsh
5419425834 fix for large font linux/win differences in extended forecast 2025-06-12 13:16:55 -05:00
Matt Walsh
f3a386079b fix for file didn't load in spc outlook 2025-06-12 13:13:19 -05:00
Matt Walsh
aa43713943 5.23.5 2025-06-12 12:15:10 -05:00
Matt Walsh
1dece10679 cache-busting for radar worker 2025-06-12 12:14:56 -05:00
Matt Walsh
c4f16d786a Merge remote-tracking branch 'origin/static-host' 2025-06-12 12:07:55 -05:00
Matt Walsh
36b8adc019 5.23.4 2025-06-12 09:30:54 -05:00
Matt Walsh
bfe0b4757d Merge branch 'main' of github.com:netbymatt/ws4kp 2025-06-12 09:30:38 -05:00
Matt Walsh
2b61e55783 get current conditions direct from api 2025-06-12 09:30:31 -05:00
Matt Walsh
36c4f451b3 Merge pull request #107 from rmitchellscott/fix-push-on-tag
chore(docker): fix pushing on tag
2025-06-09 15:12:38 -05:00
Mitchell Scott
268d4ae7fa chore(docker): fix pushing on tag 2025-06-07 11:46:00 -06:00
Matt Walsh
1b49e02cd8 5.23.3 2025-06-06 16:40:14 -05:00
Matt Walsh
9a55a6ec39 fix setting boolean-style query string parsing close #106 2025-06-06 16:40:08 -05:00
Matt Walsh
faaf6f770f 5.23.2 2025-06-06 16:31:13 -05:00
Matt Walsh
79e4ed6e8b clean up star4000 large font baseline differences between linux/win 2025-06-06 16:31:05 -05:00
Matt Walsh
f956df1272 5.23.1 2025-06-05 23:34:47 -05:00
Matt Walsh
089ef56b10 add event type to hazard scroll #92 2025-06-05 23:34:25 -05:00
Matt Walsh
c4e8721a2b 5.23.0 2025-06-05 22:02:07 -05:00
Matt Walsh
a2efc2f767 Merge branch 'hazard-scroll-2' #92 2025-06-05 22:01:23 -05:00
Matt Walsh
c0e1c55453 clean up location switching 2025-06-05 21:57:06 -05:00
Matt Walsh
860ca52e2d 5.22.0 2025-06-05 20:47:32 -05:00
Matt Walsh
b891a1e3c0 Merge remote-tracking branch 'origin/radar-tiles' 2025-06-05 20:42:21 -05:00
Matt Walsh
70fb3b5dbe change to radar as a set of tiles for a smaller image download 2025-06-05 14:01:49 -05:00
Matt Walsh
5bcc744867 Merge pull request #104 from rmitchellscott/remove-armv7
Remove ARMv7 from Docker builds
2025-06-05 09:42:44 -05:00
Mitchell Scott
da75226a63 chore(docker)!: remove armv7 support 2025-06-05 06:10:21 -06:00
Matt Walsh
cab4219740 5.21.15 2025-06-04 23:39:42 -05:00
Matt Walsh
9252275436 star large font change to woff for size 2025-06-04 23:39:34 -05:00
Matt Walsh
9d1c21d8ef Merge pull request #103 from rmitchellscott/node24
chore: update dockerfile to Node 24 (LTS)
2025-06-04 21:13:22 -05:00
Matt Walsh
6473f167a8 Merge pull request #102 from rmitchellscott/docker-version-tags
chore: update docker build action, also run on tag action
2025-06-04 21:12:35 -05:00
Mitchell Scott
d280a5b3a9 chore: update dockerfile to Node 24 (LTS) 2025-06-04 14:29:16 -06:00
Mitchell Scott
b195ce042b chore: update docker build action, also run on tag action 2025-06-04 14:13:53 -06:00
Matt Walsh
974a061b44 clean up paths for server and server-dist, remove cors #96 2025-06-02 20:59:35 -05:00
Matt Walsh
7c50f5f1d7 issues changing locations 2025-06-02 15:57:58 -05:00
Matt Walsh
4bf3f4d1e0 scroll triggers properly on red background 2025-06-02 14:48:53 -05:00
Matt Walsh
46da573715 hazard scroll working, needs styling #92 2025-06-01 23:25:07 -05:00
374 changed files with 1720 additions and 1322 deletions

View File

@@ -1,2 +0,0 @@
*.min.*
server/scripts/vendor/*

View File

@@ -1,92 +0,0 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"airbnb-base"
],
"globals": {
"TravelCities": "readonly",
"RegionalCities": "readonly",
"StationInfo": "readonly",
"SunCalc": "readonly",
"NoSleep": "readonly",
"OVERRIDES": "readonly"
},
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [],
"rules": {
"indent": [
"error",
"tab",
{
"SwitchCase": 1
}
],
"no-tabs": 0,
"no-console": 0,
"max-len": 0,
"no-use-before-define": [
"error",
{
"variables": false
}
],
"no-param-reassign": [
"error",
{
"props": false
}
],
"no-mixed-operators": [
"error",
{
"groups": [
[
"&",
"|",
"^",
"~",
"<<",
">>",
">>>"
],
[
"==",
"!=",
"===",
"!==",
">",
">=",
"<",
"<="
],
[
"&&",
"||"
],
[
"in",
"instanceof"
]
],
"allowSamePrecedence": true
}
],
"import/extensions": [
"error",
{
"mjs": "always",
"json": "always"
}
]
},
"ignorePatterns": [
"*.min.js"
]
}

View File

@@ -1,5 +1,12 @@
name: build-docker
on: push
on:
push:
branches:
- '**'
tags:
- 'v*.*.*'
- 'v*.*'
jobs:
build:
@@ -13,7 +20,7 @@ jobs:
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/netbymatt/ws4kp
@@ -27,23 +34,23 @@ jobs:
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
id: docker_build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: .
pull: true
push: ${{ github.ref == 'refs/heads/main' }}
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
platforms: linux/amd64,linux/arm64/v8
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
legacy-peer-deps=true

View File

@@ -1,10 +1,19 @@
FROM node:18-alpine
FROM node:24-alpine AS node-builder
WORKDIR /app
COPY package.json .
COPY package-lock.json .
RUN npm ci
COPY . .
CMD ["node", "index.mjs"]
RUN npm install
RUN npm run build
RUN rm dist/playlist.json
FROM nginx:alpine
COPY static-env-handler.sh /docker-entrypoint.d/01-static-env-handler.sh
RUN chmod +x /docker-entrypoint.d/01-static-env-handler.sh
COPY --from=node-builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -4,7 +4,7 @@ A live version of this project is available at https://weatherstar.netbymatt.com
## About
This project aims to bring back the feel of the 90's with a weather forecast that has the look and feel of The Weather Channel at that time but available in a modern way. This is by no means intended to be a perfect emulation of the WeatherStar 4000, the hardware that produced those wonderful blue and orange graphics you saw during the local forecast on The Weather Channel. If you would like a much more accurate project please see the [WS4000 Simulator](http://www.taiganet.com/). Instead, this project intends to create a simple to use interface with minimal configuration fuss. Some changes have been made to the screens available because either more or less forecast information is available today than was in the 90's. Most of these changes are captured in sections below.
This project aims to bring back the feel of the 90s with a weather forecast that has the look and feel of The Weather Channel at that time but available in a modern way. This is by no means intended to be a perfect emulation of the WeatherStar 4000, the hardware that produced those wonderful blue and orange graphics you saw during the local forecast on The Weather Channel. If you would like a much more accurate project please see the [WS4000 Simulator](http://www.taiganet.com/). Instead, this project intends to create a simple to use interface with minimal configuration fuss. Some changes have been made to the screens available because either more or less forecast information is available today than was in the 90s. Most of these changes are captured in sections below.
## What's your motivation
@@ -76,10 +76,24 @@ services:
### Serving static files
The app can be served as a static set of files on any web server. Run the provided gulp task to create a set of static distribution files:
```
npm run buildDist
npm run build
```
The resulting files will be in the /dist folder in the root of the project. These can then be uploaded to a web server for hosting, no server-side scripting is required.
When using the provided Docker image, the browser will generate `playlist.json`
on the fly by scanning the `/music` directory served by nginx. The image
intentionally omits this file so the page falls back to scanning the directory.
Simply bind mount your music folder and the playlist will be created
automatically. If no files are found in `/music`, the built in tracks located in
`/music/default/` will be used instead.
The nginx configuration also sets the `X-Weatherstar: true` header on all
responses. This uses `add_header ... always` so the header is sent even for
404 responses. When `playlist.json` returns a 404 with this header present, the
browser falls back to scanning the `/music` directory. If you host the static
files elsewhere, be sure to include this header so the playlist can be generated
automatically.
## What's different
I've made several changes to this Weather Star 4000 simulation compared to the original hardware unit and the code that this was forked from.
@@ -88,13 +102,13 @@ I've made several changes to this Weather Star 4000 simulation compared to the o
* A new hour-by-hour graph of the temperature, cloud cover and precipitation chances for the next 24 hours.
* A new hourly forecast display for the next 24 hours is available, and is shown in the style of the travel cities forecast. (off by default because it duplicates the hourly graph)
* The SPC Outlook is shown in the style of the old air quality screen. This shows the probability of severe weather over the next 3 days at your location.
* The "Local Forecast" and "Extended Forecast" provide several additional days of information compared to the original format in the 90's.
* The "Local Forecast" and "Extended Forecast" provide several additional days of information compared to the original format in the 90s.
* The original music has been replaced. More info in [Music](#music).
* Marine forecast (tides) is not available as it is not reliably part of the new API.
* "Flavors" are not present in this simulation. Flavors refer to the order of the weather information that was shown on the original units. Instead, the order of the displays has been fixed and a checkboxes can be used to turn on and off individual displays. The travel forecast has been defaulted to off so only local information shows for new users.
## Sharing a permalink (bookmarking)
Selected displays, the forecast city and widescreen setting are sticky from one session to the next. However if you would like to share your exact configuration or bookmark it, click the "Copy Permalink" (or get "Get Parmalink") near the bottom of the page. A URL will be copied to your clipboard with all of you selected displays and location (or copy it from the page if your browser doesn't support clipboard transfers directly). You can then share this link or add it to your bookmarks.
Selected displays, the forecast city and widescreen setting are sticky from one session to the next. However if you would like to share your exact configuration or bookmark it, click the "Copy Permalink" (or get "Get Permalink") near the bottom of the page. A URL will be copied to your clipboard with all of you selected displays and location (or copy it from the page if your browser doesn't support clipboard transfers directly). You can then share this link or add it to your bookmarks.
Your permalink will be very long. Here is an example for the Orlando International Airport:
```
@@ -112,26 +126,31 @@ Kiosk mode can be activated by a checkbox on the page. Note that there is no way
It's also possible to enter kiosk mode using a permalink. First generate a [Permalink](#sharing-a-permalink-bookmarking), then to the end of it add `&kiosk=true`. Opening this link will load all of the selected displays included in the Permalink, enter kiosk mode immediately upon loading and start playing the forecast.
### Default query string paramaters (environment variables)
When serving this via the built-in Express server, it's possible to define environment variables that direct the user to a default set of paramaters (like the [Permalink](#sharing-a-permalink-bookmarking) above). If a user requests the root page at `http://localhost:8080/` the query string provided by environment variables will be appended to the url thus providing a default configuration.
### Default query string parameters (environment variables)
When serving this via the built-in Express server, it's possible to define environment variables that direct the user to a default set of parameters (like the [Permalink](#sharing-a-permalink-bookmarking) above). If a user requests the root page at `http://localhost:8080/` the query string provided by environment variables will be appended to the url thus providing a default configuration.
Environment variables can be added to the command line as usual, or via a .env file which is parsed with [dotenv](https://github.com/motdotla/dotenv). Both methods have the same effect.
Environment variables that are to be added to the default query string are prefixed with `WSQS_` and then use the same key/value pairs generated by the [Permalink](#sharing-a-permalink-bookmarking) above, with the `- (dash)` character replaced by an `_ (underscore)`. For example, if you wanted to turn the travel forecast on, you would find `travel-checkbox=true` in the permalink, it's matching environment variable becomes `WSQS_travel_checkbox=true`.
Environment variables that are to be added to the default query string are prefixed with `WSQS_` and then use the same key/value pairs generated by the [Permalink](#sharing-a-permalink-bookmarking) above, with the `- (dash)` character replaced by an `_ (underscore)`. For example, if you wanted to turn the travel forecast on, you would find `travel-checkbox=true` in the permalink, its matching environment variable becomes `WSQS_travel_checkbox=true`.
When using the Docker container, these environment variables are read on container start-up to generate the static redirect HTML.
## Music
The WeatherStar had wonderful background music from the smooth jazz and new age genres by artists of the time. Lists of the music that played are available by searching online, but it's all copyrighted music and would be difficult to provide as part of this repository.
I've used AI tools to create WeatherStar-inspired music tracks that are unencumbered by copyright and are included in this repo. Too keep the size down, I've only included 4 tracks. Additional tracks are in a companion repository [ws4kp-music](https://github.com/netbymatt/ws4kp-music).
I've used AI tools to create WeatherStar-inspired music tracks that are unencumbered by copyright and are included in this repo. To keep the size down, I've only included 4 tracks. Additional tracks are in a companion repository [ws4kp-music](https://github.com/netbymatt/ws4kp-music).
If you're looking for the original music that played during forecasts [TWCClassics](https://twcclassics.com/audio/) has thurough documentation of playlists.
If you're looking for the original music that played during forecasts [TWCClassics](https://twcclassics.com/audio/) has thorough documentation of playlists.
### Customizing the music
Placing .mp3 files in the `/server/music` folder will override the default music included in the repo. Subdirectories will not be scanned. When weatherstar loads in the browser it will load a list if available files and randomize the order when it starts playing. On each loop through the available tracks the order will again be shuffled. If you're using the static files method to host your WeatherStar music is located in `/music`.
If using docker, you must pass a local accessible folder to the container in the `/app/server/music` directory.
If using Docker, you can bind mount a local folder containing your music files.
Mount the folder at `/usr/share/nginx/html/music` so the browser can read the
directory listing and build the playlist automatically. If there are no `.mp3`
files in `/music`, the built in tracks from `/music/default/` are used.
```
docker run -p 8080:8080 -v /path/to/local/music:/app/server/music ghcr.io/netbymatt/ws4kp
docker run -p 8080:8080 -v /path/to/local/music:/usr/share/nginx/html/music ghcr.io/netbymatt/ws4kp
```
### Music doesn't auto play
@@ -139,6 +158,11 @@ Ws4kp is muted by default, but if it was unmuted on the last visit it is coded t
Chrome seems to be more lenient on auto play and will eventually let a site auto-play music if you're visited it enough recently and manually clicked to start playing music on each visit. It also has a flag you can add to the command line when launching Chrome: `chrome.exe --autoplay-policy=no-user-gesture-required`. This is the best solution when using Kiosk-style setup.
If you're unable to pre-set the play state before entering kiosk mode (such as with a home dashboard implementation) you can add the query string value below to the url. The browser will still follow the auto play rules outlined above.
```
?settings-mediaPlaying-boolean=true
```
## Community Notes
Thanks to the WeatherStar community for providing these discussions to further extend your retro forecasts!
@@ -148,7 +172,12 @@ Thanks to the WeatherStar community for providing these discussions to further e
* [ws4channels](https://github.com/rice9797/ws4channels) A Dockerized Node.js application to stream WeatherStar 4000 data into Channels DVR using Puppeteer and FFmpeg.
## Customization
A hook is provided as `/server/scripts/custom.js` to allow customizations to your own fork of this project, without accidentally pushing your customizations back upstream to the git repository. An sample file is provided at `/server/scripts/custom.sample.js` and should be renamed to `custom.js` activate it.
A hook is provided as `/server/scripts/custom.js` to allow customizations to your own fork of this project, without accidentally pushing your customizations back upstream to the git repository. A sample file is provided at `/server/scripts/custom.sample.js` and should be renamed to `custom.js` activate it.
When using Docker, mount your `custom.js` file to `/usr/share/nginx/html/scripts/custom.js` to customize the static build.
### RSS feeds and custom scroll
If you would like your Weatherstar to have custom scrolling text in the bottom blue bar, or show headlines from an rss feed turn on the setting for `Enable RSS Feed/Text` and then enter a URL or text in the resulting text box. Then press set.
## Issue reporting and feature requests
@@ -182,4 +211,3 @@ This project is based on the work of [Mike Battaglia](https://github.com/vbguyny
This web site should NOT be used in life threatening weather situations, or be relied on to inform the public of such situations. The Internet is an unreliable network subject to server and network outages and by nature is not suitable for such mission critical use. If you require such access to NWS data, please consider one of their subscription services. The authors of this web site shall not be held liable in the event of injury, death or property damage that occur as a result of disregarding this warning.
The WeatherSTAR 4000 unit and technology is owned by The Weather Channel. This web site is a free, non-profit work by fans. All of the back ground graphics of this web site were created from scratch. The icons were created by Charles Abel and Nick Smith (http://twcclassics.com/downloads/icons.html) as well as by Malek Masoud. The fonts were originally created by Nick Smith (http://twcclassics.com/downloads/fonts.html).

View File

@@ -1,45 +0,0 @@
// pass through api requests
// http(s) modules
import https from 'https';
// url parsing
import queryString from 'querystring';
// return an express router
const cors = (req, res) => {
// add out-going headers
const headers = {};
headers['user-agent'] = '(WeatherStar 4000+, ws4000@netbymatt.com)';
headers.accept = req.headers.accept;
// get query paramaters if the exist
const queryParams = Object.keys(req.query).reduce((acc, key) => {
// skip the paramater 'u'
if (key === 'u') return acc;
// add the paramter to the resulting object
acc[key] = req.query[key];
return acc;
}, {});
let query = queryString.encode(queryParams);
if (query.length > 0) query = `?${query}`;
// get the page
https.get(`https://api.weather.gov${req.path}${query}`, {
headers,
}, (getRes) => {
// pull some info
const { statusCode } = getRes;
// pass the status code through
res.status(statusCode);
// set headers
res.header('content-type', getRes.headers['content-type']);
// pipe to response
getRes.pipe(res);
}).on('error', (e) => {
console.error(e);
});
};
export default cors;

View File

@@ -1,46 +0,0 @@
// pass through api requests
// http(s) modules
import https from 'https';
// url parsing
import queryString from 'querystring';
// return an express router
const outlook = (req, res) => {
// add out-going headers
const headers = {};
headers['user-agent'] = '(WeatherStar 4000+, ws4000@netbymatt.com)';
headers.accept = req.headers.accept;
// get query paramaters if the exist
const queryParams = Object.keys(req.query).reduce((acc, key) => {
// skip the paramater 'u'
if (key === 'u') return acc;
// add the paramter to the resulting object
acc[key] = req.query[key];
return acc;
}, {});
let query = queryString.encode(queryParams);
if (query.length > 0) query = `?${query}`;
// get the page
https.get(`https://www.cpc.ncep.noaa.gov/${req.path}${query}`, {
headers,
}, (getRes) => {
// pull some info
const { statusCode } = getRes;
// pass the status code through
res.status(statusCode);
// set headers
res.header('content-type', getRes.headers['content-type']);
res.header('last-modified', getRes.headers['last-modified']);
// pipe to response
getRes.pipe(res);
}).on('error', (e) => {
console.error(e);
});
};
export default outlook;

View File

@@ -1,46 +0,0 @@
// pass through api requests
// http(s) modules
import https from 'https';
// url parsing
import queryString from 'querystring';
// return an express router
const radar = (req, res) => {
// add out-going headers
const headers = {};
headers['user-agent'] = '(WeatherStar 4000+, ws4000@netbymatt.com)';
headers.accept = req.headers.accept;
// get query paramaters if the exist
const queryParams = Object.keys(req.query).reduce((acc, key) => {
// skip the paramater 'u'
if (key === 'u') return acc;
// add the paramter to the resulting object
acc[key] = req.query[key];
return acc;
}, {});
let query = queryString.encode(queryParams);
if (query.length > 0) query = `?${query}`;
// get the page
https.get(`https://radar.weather.gov${req.path}${query}`, {
headers,
}, (getRes) => {
// pull some info
const { statusCode } = getRes;
// pass the status code through
res.status(statusCode);
// set headers
res.header('content-type', getRes.headers['content-type']);
res.header('last-modified', getRes.headers['last-modified']);
// pipe to response
getRes.pipe(res);
}).on('error', (e) => {
console.error(e);
});
};
export default radar;

105
eslint.config.mjs Normal file
View File

@@ -0,0 +1,105 @@
import { FlatCompat } from '@eslint/eslintrc';
const compat = new FlatCompat({
});
export default [{
ignores: [
'*.min.*',
'server/scripts/vendor/*',
'dist/**/*',
],
},
...compat.config({
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'airbnb-base',
],
globals: {
TravelCities: 'readonly',
RegionalCities: 'readonly',
StationInfo: 'readonly',
SunCalc: 'readonly',
NoSleep: 'readonly',
OVERRIDES: 'readonly',
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [],
rules: {
indent: [
'error',
'tab',
{
SwitchCase: 1,
},
],
'no-tabs': 0,
'no-console': 0,
'max-len': 0,
'no-use-before-define': [
'error',
{
variables: false,
},
],
'no-param-reassign': [
'error',
{
props: false,
},
],
'no-mixed-operators': [
'error',
{
groups: [
[
'&',
'|',
'^',
'~',
'<<',
'>>',
'>>>',
],
[
'==',
'!=',
'===',
'!==',
'>',
'>=',
'<',
'<=',
],
[
'&&',
'||',
],
[
'in',
'instanceof',
],
],
allowSamePrecedence: true,
},
],
'import/extensions': [
'error',
{
mjs: 'always',
json: 'always',
},
],
},
ignorePatterns: [
'*.min.js',
],
}),
];

View File

@@ -89,6 +89,7 @@ const mjsSources = [
'server/scripts/modules/travelforecast.mjs',
'server/scripts/modules/progress.mjs',
'server/scripts/modules/media.mjs',
'server/scripts/modules/custom-rss-feed.mjs',
'server/scripts/index.mjs',
];
@@ -137,10 +138,13 @@ const s3 = s3Upload({
const uploadSources = [
'dist/**',
'!dist/**/*.map',
'!dist/images/**/*',
'!dist/fonts/**/*',
];
const upload = () => src(uploadSources, { base: './dist', encoding: false })
const uploadCreator = (bucket) => () => src(uploadSources, { base: './dist', encoding: false })
.pipe(s3({
Bucket: process.env.BUCKET,
Bucket: bucket,
StorageClass: 'STANDARD',
maps: {
CacheControl: (keyname) => {
@@ -156,10 +160,14 @@ const imageSources = [
'server/images/**',
'!server/images/gimp/**',
];
const uploadImages = () => src(imageSources, { base: './server', encoding: false })
const upload = uploadCreator(process.env.BUCKET);
const uploadPreview = uploadCreator(process.env.BUCKET_PREVIEW);
const uploadImagesCreator = (bucket) => () => src(imageSources, { base: './server', encoding: false })
.pipe(
s3({
Bucket: process.env.BUCKET,
Bucket: bucket,
StorageClass: 'STANDARD',
maps: {
CacheControl: () => 'max-age=31536000',
@@ -167,8 +175,14 @@ const uploadImages = () => src(imageSources, { base: './server', encoding: false
}),
);
const invalidate = () => cloudfront.send(new CreateInvalidationCommand({
DistributionId: process.env.DISTRIBUTION_ID,
const uploadImages = uploadImagesCreator(process.env.BUCKET);
const uploadImagesPreview = uploadImagesCreator(process.env.BUCKET_PREVIEW);
const copyImageSources = () => src(imageSources, { base: './server', encoding: false })
.pipe(dest('./dist'));
const invalidateCreator = (distributionId) => () => cloudfront.send(new CreateInvalidationCommand({
DistributionId: distributionId,
InvalidationBatch: {
CallerReference: (new Date()).toLocaleString(),
Paths: {
@@ -178,21 +192,26 @@ const invalidate = () => cloudfront.send(new CreateInvalidationCommand({
},
}));
const invalidate = invalidateCreator(process.env.DISTRIBUTION_ID);
const invalidatePreview = invalidateCreator(process.env.DISTRIBUTION_ID_PREVIEW);
const buildPlaylist = async () => {
const availableFiles = await reader();
const playlist = { availableFiles };
return file('playlist.json', JSON.stringify(playlist)).pipe(dest('./dist'));
};
const buildDist = series(clean, parallel(buildJs, compressJsData, compressJsVendor, copyCss, compressHtml, copyOtherFiles, buildPlaylist));
const buildDist = series(clean, parallel(buildJs, compressJsData, compressJsVendor, copyCss, compressHtml, copyOtherFiles, copyImageSources, buildPlaylist));
// upload_images could be in parallel with upload, but _images logs a lot and has little changes
// by running upload last the majority of the changes will be at the bottom of the log for easy viewing
const publishFrontend = series(buildDist, uploadImages, upload, invalidate);
const stageFrontend = series(buildDist, uploadImagesPreview, uploadPreview, invalidatePreview);
export default publishFrontend;
export {
buildDist,
invalidate,
stageFrontend,
};

View File

@@ -1,9 +1,10 @@
import updateVendor from './gulp/update-vendor.mjs';
import publishFrontend, { buildDist, invalidate } from './gulp/publish-frontend.mjs';
import publishFrontend, { buildDist, invalidate, stageFrontend } from './gulp/publish-frontend.mjs';
export {
updateVendor,
publishFrontend,
buildDist,
invalidate,
stageFrontend,
};

View File

@@ -1,9 +1,6 @@
import 'dotenv/config';
import express from 'express';
import fs from 'fs';
import corsPassThru from './cors/index.mjs';
import radarPassThru from './cors/radar.mjs';
import outlookPassThru from './cors/outlook.mjs';
import playlist from './src/playlist.mjs';
import OVERRIDES from './src/overrides.mjs';
@@ -13,12 +10,6 @@ const port = process.env.WS4KP_PORT ?? 8080;
// template engine
app.set('view engine', 'ejs');
// cors pass-thru to api.weather.gov
app.get('/stations/*station', corsPassThru);
app.get('/Conus/*radar', radarPassThru);
app.get('/products/*product', outlookPassThru);
app.get('/playlist.json', playlist);
// version
const { version } = JSON.parse(fs.readFileSync('package.json'));
@@ -81,8 +72,6 @@ const geoip = (req, res) => {
// debugging
if (process.env?.DIST === '1') {
// distribution
app.use('/images', express.static('./server/images'));
app.use('/fonts', express.static('./server/fonts'));
app.use('/scripts', express.static('./server/scripts'));
app.use('/geoip', geoip);
app.use('/', express.static('./dist'));
@@ -90,8 +79,11 @@ if (process.env?.DIST === '1') {
// debugging
app.get('/index.html', index);
app.use('/geoip', geoip);
app.use('/resources', express.static('./server/scripts/modules'));
app.get('/', index);
app.get('*name', express.static('./server'));
// cors pass-thru to api.weather.gov
app.get('/playlist.json', playlist);
}
const server = app.listen(port, () => {

26
nginx.conf Normal file
View File

@@ -0,0 +1,26 @@
server {
listen 8080;
server_name localhost;
include mime.types;
types {
text/javascript mjs;
}
root /usr/share/nginx/html;
add_header X-Weatherstar true always;
location / {
index redirect.html index.html index.htm;
try_files $uri $uri/ =404;
}
location /music/ {
autoindex on;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

1380
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "ws4kp",
"version": "5.21.14",
"version": "5.27.1",
"description": "Welcome to the WeatherStar 4000+ project page!",
"main": "index.mjs",
"type": "module",
@@ -23,15 +23,18 @@
"homepage": "https://github.com/netbymatt/ws4kp#readme",
"devDependencies": {
"@aws-sdk/client-cloudfront": "^3.609.0",
"@eslint/eslintrc": "^3.3.1",
"ajv": "^8.17.1",
"del": "^8.0.0",
"eslint": "^8.2.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint": "^9.0.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-import": "^2.10.0",
"gulp": "^5.0.0",
"gulp-awspublish": "^8.0.0",
"gulp-concat": "^2.6.1",
"gulp-ejs": "^5.1.0",
"gulp-file": "^0.4.0",
"gulp-html-minifier-terser": "^7.1.0",
"gulp-rename": "^2.0.0",
"gulp-s3-uploader": "^1.0.6",
"gulp-sass": "^6.0.0",
@@ -42,11 +45,11 @@
"suncalc": "^1.8.0",
"swiped-events": "^1.1.4",
"terser-webpack-plugin": "^5.3.6",
"webpack-stream": "^7.0.0",
"gulp-html-minifier-terser": "^7.1.0"
"webpack": "^5.99.9",
"webpack-stream": "^7.0.0"
},
"dependencies": {
"dotenv": "^16.5.0",
"dotenv": "^17.0.1",
"ejs": "^3.1.5",
"express": "^5.1.0"
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Some files were not shown because too many files have changed in this diff Show More