build 2
This commit is contained in:
223
UNRAID.md
Normal file
223
UNRAID.md
Normal file
@@ -0,0 +1,223 @@
|
||||
# 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
|
||||
|
||||
- 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@<your-unraid-ip>
|
||||
```
|
||||
|
||||
### 2. Copy the project files
|
||||
|
||||
```bash
|
||||
mkdir -p /mnt/user/appdata/ui-tracker
|
||||
cd /mnt/user/appdata/ui-tracker
|
||||
git clone https://github.com/<your-username>/ui-tracker.git .
|
||||
```
|
||||
|
||||
> No git? Copy the folder via SMB (`\\<unraid-ip>\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://<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
|
||||
|
||||
### 1. Install Compose Manager
|
||||
|
||||
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 (`\\<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)
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Container Internals
|
||||
|
||||
| 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 |
|
||||
|
||||
---
|
||||
|
||||
## Port Reference
|
||||
|
||||
| Host Port | Purpose |
|
||||
|-----------|----------------------------------|
|
||||
| **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.
|
||||
|
||||
---
|
||||
|
||||
## Data Persistence
|
||||
|
||||
The SQLite database lives at:
|
||||
|
||||
```
|
||||
/mnt/user/appdata/ui-tracker/data/tracker.db
|
||||
```
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## First-Time Setup
|
||||
|
||||
Once the UI is open:
|
||||
|
||||
1. Click **Settings** (top right)
|
||||
2. Enter your **Bot Token**: `8769097441:AAFBqPlSTcTIi3I-F5ZIN9EEpwbNDzHg8hM`
|
||||
3. Enter your **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
|
||||
|
||||
```bash
|
||||
cd /mnt/user/appdata/ui-tracker
|
||||
git pull
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
The database and all your settings are preserved.
|
||||
Reference in New Issue
Block a user