# Professor Oak Challenge Trackers Unified web portal hosting two standalone **Professor Oak Challenge** trackers under a shared landing hub: - **`/`** — Landing hub ([index.html](./index.html)) showing live browser save summaries and launcher cards - **`/oras/`** — Pokémon **Omega Ruby & Alpha Sapphire** tracker ([oras/](./oras/)) - **`/luminescent-platinum/`** — Pokémon **Luminescent Platinum (v2.1)** tracker ([luminescent-platinum/](./luminescent-platinum/)) All progress, save profiles, and toggles persist locally in your browser per game (`poc-tracker:v1:*` for ORAS, `lumi-poc-tracker:v1:*` for Luminescent Platinum), and each tracker has a **← Hub** link in the top header plus **Export Save / Import** JSON backups. --- ## Local Development & Tests Requires Node.js 20+ (no external npm packages or build step required): ```bash # Run unified site + ORAS + Luminescent Platinum test suites npm test # Serve unified site at http://127.0.0.1:4173 npm start ``` --- ## Uploading to Gitea (`git.trevorstocks.ca`) This folder is already initialized with Git and ready to push once you create an empty repository on Gitea: ```bash git remote add origin https://git.trevorstocks.ca//.git git push -u origin main ``` --- ## Hosting in a Standalone Docker Container on Unraid The repository includes a lightweight `nginx:1.27-alpine` [Dockerfile](./Dockerfile), [docker/nginx.conf](./docker/nginx.conf), and [docker-compose.yml](./docker-compose.yml) configured cleanly for reverse proxies (`absolute_redirect off`, `.mjs`/`.webp` MIME types, trailing-slash redirects, `/health` probe, running on uncommon high port `28473`). ### Option A — Build Directly on Unraid (`docker compose`) SSH into your Unraid server (e.g., into `/mnt/user/appdata/professor-oak-tracker`): ```bash git clone https://git.trevorstocks.ca//.git /mnt/user/appdata/professor-oak-tracker cd /mnt/user/appdata/professor-oak-tracker docker compose up -d --build ``` To update later after pushing changes to Gitea: ```bash cd /mnt/user/appdata/professor-oak-tracker git pull docker compose up -d --build ``` ### Option B — Reverse Proxy / Subdomain Setup (Nginx Proxy Manager / SWAG) - **Default Compose port:** `28473` on Unraid → container port `28473` (avoids `80`, `443`, `8080`, `8088`) - **Nginx Proxy Manager / SWAG target:** - Scheme: `http` (Nginx Proxy Manager handles HTTPS/SSL termination for your subdomain) - Forward Hostname / IP: your Unraid IP (or `professor-oak-tracker` if both containers share a custom Docker bridge network like `proxynet`) - Forward Port: `28473` --- ## Automatic Updates on Unraid (Instead of Manual `git pull`) Unraid's Docker dashboard **"apply update"** badge only checks **remote Docker registries**—containers built locally with `docker compose up -d --build` will show updates as `not available`. Choose either approach below: ### Way 1 — Unraid Dashboard **"apply update"** Button (via Gitea Container Registry) 1. In Gitea (`git.trevorstocks.ca`), make sure **Packages** and **Actions** (with a Docker-capable runner) are enabled. 2. Generate a Personal Access Token (**Profile → Settings → Applications → Generate New Token**) with **`package` (`write:package`, `read:package`)** permission, then add it to your repository (**Settings → Actions → Secrets**) as **`REGISTRY_TOKEN`** *(Gitea's built-in `GITEA_TOKEN` usually lacks Container Registry write permission)*. 3. Push to `main`: [`.gitea/workflows/docker-publish.yml`](./.gitea/workflows/docker-publish.yml) runs `npm test` and pushes `git.trevorstocks.ca/faroegames/oaktracker:latest`. 3. In Gitea's **Packages** tab for `oaktracker`, set the container package visibility to **Public** (or run `docker login git.trevorstocks.ca` once in the Unraid terminal if keeping it private—note Unraid's automatic UI update checker works most reliably with public HTTPS packages; private custom registries may require clicking **Force Update** or using Watchtower). 4. On Unraid, add the container in **Docker → Add Container** (rather than Compose) with: - **Name:** `professor-oak-tracker` - **Repository:** `git.trevorstocks.ca/faroegames/oaktracker:latest` - **Port:** Container `28473` → Host `28473` - Now Unraid detects new pushes in its Docker tab (or Watchtower can auto-update it). ### Way 2 — Hands-Free Auto-Rebuild via Unraid **User Scripts** (Zero Gitea Runner Needed) If you don't run a Gitea Actions Runner, keep building locally with `docker compose` and add [`scripts/unraid-git-update.sh`](./scripts/unraid-git-update.sh) to Unraid's **User Scripts** plugin on a schedule (e.g., `*/15 * * * *`). It checks `git fetch origin main` and only rebuilds/restarts when a new commit is pushed to `git.trevorstocks.ca`.