- Edit
WebApp/tools/config.jsonand set yourclanName. - Run the updater:
This fetches API data (15 calls/minute), writes JSON into
node WebApp/tools/update-data.mjsWebApp/data/, and runsgit add/commit/pushfor the data folder.
Serve WebApp/ with any local static server so the JSON loads correctly.
Example:
python -m http.server --directory WebApp 8000
Then visit http://localhost:8000.
These steps set up automatic data updates (with git push) and local hosting.
- Install packages:
sudo apt update sudo apt install -y git nodejs npm python3 - Ensure Node supports
fetch(Node 18+). Ubuntu 24 ships Node 20. - Set git identity:
git config --global user.name "Your Name" git config --global user.email "you@example.com" - Set up GitHub SSH keys on the Pi (so
git pushworks):Add the key to GitHub, then test with:ssh-keygen -t ed25519 -C "pi-webapp" cat ~/.ssh/id_ed25519.pubssh -T git@github.com
git clone git@github.com:YOUR_ORG/EndGameCrusade.git
cd EndGameCrusade/WebApp
Edit WebApp/tools/config.json and set your clanName.
chmod +x WebApp/tools/run-update.sh
WebApp/tools/run-update.sh
- Copy and edit the service files (replace
piand paths if needed):sudo cp WebApp/tools/webapp-update.service /etc/systemd/system/ sudo cp WebApp/tools/webapp-update.timer /etc/systemd/system/ sudo nano /etc/systemd/system/webapp-update.service - Enable the timer:
sudo systemctl daemon-reload sudo systemctl enable --now webapp-update.timer - Check status/logs:
systemctl status webapp-update.timer journalctl -u webapp-update.service -n 50 --no-pager
- Copy and edit the service file (replace
piand paths if needed):sudo cp WebApp/tools/webapp-serve.service /etc/systemd/system/ sudo nano /etc/systemd/system/webapp-serve.service - Enable the service:
sudo systemctl daemon-reload sudo systemctl enable --now webapp-serve.service - Visit from your LAN:
http://PI_IP:8000 - If UFW is enabled:
sudo ufw allow 8000/tcp