This commit is contained in:
2026-03-27 23:47:39 -05:00
parent 1c8d6787b6
commit 219ab15273

243
UNRAID.md
View File

@@ -1,223 +1,128 @@
# Unraid Installation Guide — UI Stock Tracker # 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 SSH into your Unraid server and run:
- 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@<your-unraid-ip>
```
### 2. Copy the project files
```bash ```bash
mkdir -p /mnt/user/appdata/ui-tracker mkdir -p /mnt/user/appdata/ui-tracker
cd /mnt/user/appdata/ui-tracker cd /mnt/user/appdata/ui-tracker
git clone https://github.com/<your-username>/ui-tracker.git . git clone https://github.com/<your-username>/ui-tracker.git .
docker build -t ui-tracker .
``` ```
> No git? Copy the folder via SMB (`\\<unraid-ip>\appdata`) or SFTP instead. 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`.
### 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://<your-unraid-ip>: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
```
--- ---
## 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) Fill in each section as follows:
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 (`\\<unraid-ip>\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://<your-unraid-ip>:8080
```
--- ---
## Manual Docker Run (No Compose) ### Basic
If you prefer to run it without docker-compose: | Field | Value |
|---|---|
```bash | Name | `ui-tracker` |
docker build -t ui-tracker /mnt/user/appdata/ui-tracker | Repository | `ui-tracker` |
| Icon URL | *(leave blank)* |
docker run -d \
--name ui-tracker \
--restart unless-stopped \
-p 8080:8080 \
-v /mnt/user/appdata/ui-tracker/data:/app/data \
ui-tracker
```
--- ---
## Container Internals ### Network
| Process | Role | | Field | Value |
|-----------|------------------------------------------------| |---|---|
| supervisord | Process manager — keeps both services alive | | Network Type | `br0` |
| nginx | Serves the React frontend on port 8080, proxies `/api/` to Node.js | | Fixed IP Address | Your chosen static LAN IP — e.g. `192.168.1.50` |
| node | Express API + Puppeteer scraper + scheduler |
> With br0, the container gets its own IP on your LAN. You will access the UI directly at `http://<fixed-ip>:8080` — no port conflict with the Unraid host.
--- ---
## Port Reference ### Port
| Host Port | Purpose | Click **Add another Path, Port, Variable, Label or Device** → select **Port**.
|-----------|----------------------------------|
| **8080** | Web UI (only port you need open) |
> To use a different port, change `"8080:8080"` to `"<port>: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**.
``` | Field | Value |
/mnt/user/appdata/ui-tracker/data/tracker.db |---|---|
``` | 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. > This is where the SQLite database lives. All tracked items and Telegram settings persist here across restarts and rebuilds.
**Backup:**
```bash
cp /mnt/user/appdata/ui-tracker/data/tracker.db ~/tracker-backup.db
```
--- ---
## 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://<fixed-ip>:8080` and:
1. Click **Settings** (top right) 1. Click **Settings** (top right)
2. Enter your **Bot Token**: `8769097441:AAFBqPlSTcTIi3I-F5ZIN9EEpwbNDzHg8hM` 2. Enter **Bot Token**: `8769097441:AAFBqPlSTcTIi3I-F5ZIN9EEpwbNDzHg8hM`
3. Enter your **Chat ID**: `8435449432` 3. Enter **Chat ID**: `8435449432`
4. Click **Test Alert** — a Telegram message should arrive within seconds 4. Click **Test Alert** — a Telegram message should arrive within seconds
5. Click **Save** 5. Click **Save**
6. Click **Add Item**, paste a `store.ui.com` product URL, set your check interval, click **Start Tracking** 6. Click **Add Item**, paste a `store.ui.com` product URL, set your check interval, click **Start Tracking**
--- ---
## Troubleshooting ## Rebuilding After an Update
**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
```bash ```bash
cd /mnt/user/appdata/ui-tracker cd /mnt/user/appdata/ui-tracker
git pull 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