diff --git a/UNRAID.md b/UNRAID.md index f77d44c..b547dfd 100644 --- a/UNRAID.md +++ b/UNRAID.md @@ -1,223 +1,128 @@ # Unraid Installation Guide — UI Stock Tracker -UI Stock Tracker runs as a **single Docker container** — nginx serves the frontend and proxies API calls to the Node.js backend, both managed inside the container by supervisord. - -Two installation methods are covered: **CLI via SSH** (recommended) and **GUI via Compose Manager**. - --- -## Prerequisites +## Step 1 — CLI: Clone and Build the Image -- Unraid 6.10 or later -- Docker enabled: **Settings → Docker → Enable Docker → Yes** -- A share to store the persistent SQLite database (e.g. `/mnt/user/appdata/ui-tracker/data`) - ---- - -## Method 1 — CLI via SSH (Recommended) - -### 1. SSH into your Unraid server - -```bash -ssh root@ -``` - -### 2. Copy the project files +SSH into your Unraid server and run: ```bash mkdir -p /mnt/user/appdata/ui-tracker cd /mnt/user/appdata/ui-tracker git clone https://github.com//ui-tracker.git . +docker build -t ui-tracker . ``` -> No git? Copy the folder via SMB (`\\\appdata`) or SFTP instead. - -### 3. Build and start - -```bash -docker compose up -d --build -``` - -The first build takes a few minutes — it compiles both the React frontend and the Node.js backend, then installs Chromium. Subsequent starts are instant. - -### 4. Verify it's running - -```bash -docker compose ps -``` - -Expected: -``` -NAME STATUS -ui-tracker running -``` - -### 5. Open the web UI - -``` -http://:8080 -``` - -### Useful commands - -```bash -# Live logs (nginx + backend combined) -docker compose logs -f - -# Restart the container -docker compose restart - -# Stop -docker compose down - -# Rebuild after updating the code -docker compose up -d --build -``` +The first build takes a few minutes — it compiles the React frontend, compiles the Node.js backend, and installs Chromium inside the image. Once complete, the image is available locally as `ui-tracker`. --- -## Method 2 — GUI via Compose Manager Plugin +## Step 2 — GUI: Add the Container in Unraid -### 1. Install Compose Manager +In the Unraid web UI go to **Docker → Add Container**. -1. Go to **Apps** (Community Applications) -2. Search for **Compose Manager** and install it -3. It appears under **Docker → Compose** - -### 2. Upload the project files - -Copy the `ui-tracker` folder to your Unraid server at: - -``` -/mnt/user/appdata/ui-tracker/ -``` - -Use any of: SMB share (`\\\appdata`), SFTP (FileZilla / WinSCP), or the Unraid **Tools → File Manager**. - -### 3. Add the stack - -1. Go to **Docker → Compose → Add New Stack** -2. Name: `ui-tracker` -3. Compose file path: `/mnt/user/appdata/ui-tracker/docker-compose.yml` -4. Click **Save** - -### 4. Build and start - -1. Expand the `ui-tracker` stack row -2. Click **Build** (takes a few minutes on first run) -3. Click **Start** - -### 5. Open the web UI - -``` -http://:8080 -``` +Fill in each section as follows: --- -## Manual Docker Run (No Compose) +### Basic -If you prefer to run it without docker-compose: - -```bash -docker build -t ui-tracker /mnt/user/appdata/ui-tracker - -docker run -d \ - --name ui-tracker \ - --restart unless-stopped \ - -p 8080:8080 \ - -v /mnt/user/appdata/ui-tracker/data:/app/data \ - ui-tracker -``` +| Field | Value | +|---|---| +| Name | `ui-tracker` | +| Repository | `ui-tracker` | +| Icon URL | *(leave blank)* | --- -## Container Internals +### Network -| Process | Role | -|-----------|------------------------------------------------| -| supervisord | Process manager — keeps both services alive | -| nginx | Serves the React frontend on port 8080, proxies `/api/` to Node.js | -| node | Express API + Puppeteer scraper + scheduler | +| Field | Value | +|---|---| +| Network Type | `br0` | +| Fixed IP Address | Your chosen static LAN IP — e.g. `192.168.1.50` | + +> With br0, the container gets its own IP on your LAN. You will access the UI directly at `http://:8080` — no port conflict with the Unraid host. --- -## Port Reference +### Port -| Host Port | Purpose | -|-----------|----------------------------------| -| **8080** | Web UI (only port you need open) | +Click **Add another Path, Port, Variable, Label or Device** → select **Port**. -> To use a different port, change `"8080:8080"` to `":8080"` in `docker-compose.yml` before building. +| Field | Value | +|---|---| +| Name | `Web UI` | +| Container Port | `8080` | +| Host Port | `8080` | +| Protocol | `TCP` | --- -## Data Persistence +### Path (Persistent Data) -The SQLite database lives at: +Click **Add another Path, Port, Variable, Label or Device** → select **Path**. -``` -/mnt/user/appdata/ui-tracker/data/tracker.db -``` +| Field | Value | +|---|---| +| Name | `Data` | +| Container Path | `/app/data` | +| Host Path | `/mnt/user/appdata/ui-tracker/data` | +| Access Mode | `Read/Write` | -It is mounted into the container via the volume in `docker-compose.yml`. All tracked items and Telegram settings survive container restarts, rebuilds, and updates. - -**Backup:** -```bash -cp /mnt/user/appdata/ui-tracker/data/tracker.db ~/tracker-backup.db -``` +> This is where the SQLite database lives. All tracked items and Telegram settings persist here across restarts and rebuilds. --- -## First-Time Setup +### Variables -Once the UI is open: +No environment variables are required — all configuration is baked into the image. + +--- + +Click **Apply** to create and start the container. + +--- + +## Step 3 — First-Time Setup + +Open the UI at `http://:8080` and: 1. Click **Settings** (top right) -2. Enter your **Bot Token**: `8769097441:AAFBqPlSTcTIi3I-F5ZIN9EEpwbNDzHg8hM` -3. Enter your **Chat ID**: `8435449432` +2. Enter **Bot Token**: `8769097441:AAFBqPlSTcTIi3I-F5ZIN9EEpwbNDzHg8hM` +3. Enter **Chat ID**: `8435449432` 4. Click **Test Alert** — a Telegram message should arrive within seconds 5. Click **Save** 6. Click **Add Item**, paste a `store.ui.com` product URL, set your check interval, click **Start Tracking** --- -## Troubleshooting - -**UI shows "Cannot reach backend"** -```bash -docker logs ui-tracker -``` -Look for Node.js startup errors. The backend starts on port 3001 internally — nginx proxies to it. - -**Telegram test fails** -- Verify the bot token and chat ID in Settings -- Send `/start` to your bot in Telegram at least once to open the conversation -- Confirm Unraid has outbound HTTPS access (port 443) - -**Items stuck on "Unknown" status** -```bash -docker logs ui-tracker | grep Scheduler -``` -Puppeteer errors here usually mean Chromium failed to launch. Try restarting: -```bash -docker compose restart -``` - -**Port 8080 already in use** -```bash -netstat -tulnp | grep 8080 -``` -Change the host port in `docker-compose.yml` and rebuild. - ---- - -## Updating +## Rebuilding After an Update ```bash cd /mnt/user/appdata/ui-tracker git pull -docker compose up -d --build +docker stop ui-tracker +docker rm ui-tracker +docker build -t ui-tracker . ``` -The database and all your settings are preserved. +Then go back to **Docker → Add Container** and re-add it with the same settings, or start it from the Docker tab if Unraid retained the template. + +--- + +## Troubleshooting + +**UI not loading** +- Confirm the container is running in the Docker tab +- Check logs: click the container icon → **Logs** +- Make sure your fixed IP isn't already in use on the network + +**Telegram test fails** +- Verify the bot token and chat ID in Settings +- Send `/start` to your bot in Telegram at least once to open the conversation +- Confirm Unraid has outbound HTTPS (port 443) access + +**Items stuck on "Unknown" status** +- Open container logs and look for Puppeteer errors +- Restart the container from the Docker tab — Chromium occasionally needs a clean start