-
Notifications
You must be signed in to change notification settings - Fork 0
Deployment
This page covers putting hailsDotGO on your own Linux server: one-time provisioning with deploy/setup.sh, the Caddy reverse proxy, the systemd unit, and the two PowerShell deploy scripts that build on your Windows machine and push over SSH. The reference setup is a small Debian-family VPS with Caddy terminating HTTPS in front of the app on port 8080, and MySQL either local or on a separate host (see Database-Guide).
Internet ── 80/443 ──> Caddy ── localhost:8080 ──> hailsDotGO (systemd, user hailsdotgo)
│
└──> MySQL (localhost:3306 or remote)
The app runs as an unprivileged system user from /opt/hailsdotgo, reads its secrets from /opt/hailsdotgo/app.env, and is managed by systemd. Deploys happen from a workstation: build TypeScript and a Linux binary locally, upload over SSH, restart the service.
Copy the deploy/ directory (plus hailsdotgo.service from the repo root) to the server and run the script once as root from the directory containing those files:
sudo ./setup.shIt performs four steps:
- Installs Caddy from the official Caddy apt repository.
-
Creates the app user and directories: a system user
hailsdotgowith no login shell, and/opt/hailsdotgowithstatic/js,static/css, andtemplatessubdirectories, owned by that user. -
Installs the systemd unit: copies
hailsdotgo.serviceto/etc/systemd/system/, reloads the daemon, and enables the service (it is not started yet, since nothing has been deployed). -
Installs the Caddyfile to
/etc/caddy/Caddyfile(Caddy is not restarted yet).
After your first deploy, finish with systemctl restart caddy and systemctl start hailsdotgo.
The main deploy script connects with BatchMode=yes, which forbids password prompts. Create a key pair, install the public key in the server's authorized_keys, and keep the private key at the path the script expects (~/.ssh/your_deploy_key; the script in the repo looks for %USERPROFILE%\.ssh\hailsdotgo, so either use that name or adjust the script).
Caddy handles HTTPS certificates automatically. The relevant block is just:
pogo.example.com {
encode gzip zstd
reverse_proxy localhost:8080
}Replace the hostname with your own domain (with DNS pointing at the server) before restarting Caddy.
Note for your own install: the example deploy/Caddyfile in the repo contains a second site block that reverse-proxies an unrelated radio service (AzuraCast) running on the author's server. Delete that block. Likewise, deploy/docker-compose.override.yml exists only to move that radio service's web ports off 80/443 so Caddy can own them; unless you also run AzuraCast on the same box, ignore that file entirely.
hailsdotgo.service (repo root) is short enough to read in full:
[Unit]
Description=hailsDotGO Pokemon GO tool
After=network.target
[Service]
Type=simple
User=hailsdotgo
Group=hailsdotgo
WorkingDirectory=/opt/hailsdotgo
ExecStart=/opt/hailsdotgo/hailsDotGO
Restart=always
RestartSec=5
EnvironmentFile=/opt/hailsdotgo/app.env
[Install]
WantedBy=multi-user.targetKey points:
-
Restart=alwayswithRestartSec=5: the app comes back automatically after a crash or an OOM kill. -
EnvironmentFile=/opt/hailsdotgo/app.env: all configuration (database credentials, CSRF key, PayPal, transactional email, GitHub sync) is loaded from this file, which the deploy script generates and uploads with mode600. See Configuration. -
WorkingDirectory=/opt/hailsdotgo: relative defaults likecache/andlocales/resolve under the app directory.
The main deploy script also tracks this unit file: if it changes, the script copies the new version into /etc/systemd/system/ and runs daemon-reload for you.
Run from the repo root on a Windows machine with Go, Node, and Windows OpenSSH installed:
.\deploy.ps1It needs VPS_HOST, VPS_USER, DB_HOST, and SUPERADMIN_USER in your .env (it throws immediately if any is missing) and the SSH key described above. The full cycle:
-
Build:
npm run buildfor the TypeScript bundles, then a linux/amd64 cross-compile withCGO_ENABLED=0and-ldflags "-s -w". -
Generate
app.envfrom your.envvalues (database, superadmin, CSRF, PayPal, transactional email, GitHub, push notifications), written as UTF-8 without BOM. -
Diff against the manifest: every tracked file is hashed with SHA256 and compared to
deploy-manifest.jsonfrom the last successful deploy, so only changed files upload. Tracked files include the binary,static/css/main.css,static/maintenance.html, every template, the systemd unit, every*.jsbundle found instatic/js/(discovered dynamically), and the bundled sprite directory. If nothing changed, the script just refreshesapp.envand exits without touching the service. -
Stop the service (
systemctl stop hailsdotgo), only when there is something to upload. -
Upload: regular files go over
scpwith up to 3 attempts across 3 rounds with randomized waits; the large binary is streamed over SSH stdin (cat > dst) with compression and keepalives, retried up to 5 rounds, because plain scp proved unreliable for it; directories are tarred and piped through SSH. -
Fix up:
chmod +xon the binary,app.envto mode600,chown -R hailsdotgo:hailsdotgo /opt/hailsdotgo, and a systemddaemon-reloadif the unit file changed. -
Start and verify:
systemctl start hailsdotgo, wait, checksystemctl is-active, and tail the journal. The manifest is saved only on success, so a failed deploy retries everything changed next run.
If you prefer something with no manifest and no .env parsing:
.\deploy\deploy.ps1 -VpsUser youruser -VpsHost your.server.com
.\deploy\deploy.ps1 -VpsUser youruser -VpsHost your.server.com -SshPort 2222It builds the same way, then always uploads the binary plus the entire templates/ and static/ trees with scp -r, fixes permissions, and restarts the service. Slower and less clever, but with fewer moving parts. Note it does not generate or upload app.env; manage that file yourself when using this script.
The IV Calculator screenshot scanner calls a self-hosted neural OCR microservice (ocr-service/, RapidOCR). Tesseract is no longer used.
- It is a small Python service that listens on
127.0.0.1:18265and is local-only (never exposed publicly). The Go app reaches it viaOCR_SERVICE_URL(defaulthttp://127.0.0.1:18265/ocr). -
ocr-service/ships its ownsetup.sh,requirements.txt, and ahailsdotgo-ocr.servicesystemd unit. Install it once on the server (creates a venv, installs requirements, enables the unit); seeocr-service/README.md. -
deploy.ps1tracks theocr-servicedirectory: it syncs the file contents to/opt/hailsdotgo-ocrand restarts the OCR service on deploy. A change torequirements.txtstill needs a manualpip installin the service's venv on the server. - The service is optional. If it is down the Screenshot tab still loads and accepts uploads; it just returns empty extraction fields.
The main deploy script also discovers templates/*.html dynamically (the same way it globs the JS bundles), so newly added page templates are always uploaded.
| Path | Contents |
|---|---|
/opt/hailsdotgo/hailsDotGO |
The Go binary |
/opt/hailsdotgo/app.env |
Environment file, mode 600 |
/opt/hailsdotgo/templates/ |
HTML templates, read at startup |
/opt/hailsdotgo/static/ |
CSS, compiled JS bundles, sprites, maintenance.html
|
/opt/hailsdotgo/cache/ |
Runtime game data cache (created by the app, disposable) |
/opt/hailsdotgo/locales/ |
Translation overrides and backup/ (created by the app, back this up) |
/opt/hailsdotgo/hailsdotgo.service |
Uploaded copy of the unit; the live one is in /etc/systemd/system/
|
/etc/caddy/Caddyfile |
Reverse proxy config |
/opt/hailsdotgo-ocr/ |
OCR microservice (synced by deploy.ps1; runs under its own systemd unit) |
| Port | Who | Exposure |
|---|---|---|
| 80, 443 | Caddy | Public (HTTP redirect + HTTPS) |
| 8080 | hailsDotGO | Should be reachable only by Caddy. The app binds :8080 on all interfaces, so use a firewall to block external access to it |
| 3306 | MySQL | Local only, or firewalled to the app host if the database lives elsewhere |
| 18265 | OCR microservice | Bound to 127.0.0.1 only; reached by the app over localhost, never exposed |
Once deployed, see Operations for logs, maintenance toggles, and backups.
Repository | Live site | hailsDotGO is a fan-made project, not affiliated with, endorsed by, or connected to Niantic or The Pokémon Company. Game data comes from community sources credited on the Data Sources page.
Start Here
Features
- Raids and Counters
- DPS Calculator
- IV Calculator
- PvP IV Ranker
- Events
- Shiny Tracking
- Trainer Directory
- Raid Finder
- Social Features
- Trust and Awards
- Bug Reports
- Player Reports
- Store
- Accounts and Roles
- Admin Guide
Self-Hosting
Development
Translations