- Riorganizzato README.md con badge versione, changelog, guida rapida e istruzioni semplificate per Docker/Unraid - Creato CHANGELOG.md secondo standard Keep a Changelog/SemVer - Aggiunto script bump-version.ps1 per gestione automatica versioni e tagging Git - Aggiornate guide deployment: PUBLISHING_GUIDE.md, UNRAID_INSTALL.md e README.md in /deployment - Modificato unraid-template.xml: porta WebUI configurabile (default 8888), volumi e variabili ambiente semplificati - Aggiornata PROJECT_STRUCTURE.md con nuova struttura e best practices - Migliorata chiarezza, professionalità e automazione del workflow di rilascio
394 lines
9.2 KiB
Markdown
394 lines
9.2 KiB
Markdown
# ?? TradingBot - Installazione su Unraid (Senza Portainer)
|
|
|
|
## ? Installazione Diretta da Gitea Registry
|
|
|
|
Puoi installare TradingBot direttamente dall'Unraid Docker Manager usando il tuo Gitea Registry!
|
|
|
|
---
|
|
|
|
## ?? PREREQUISITI
|
|
|
|
### 1. Login Gitea Registry su Unraid
|
|
|
|
SSH su Unraid:
|
|
|
|
```bash
|
|
ssh root@192.168.30.23 # O IP Tailscale
|
|
|
|
# Login al Gitea Registry
|
|
docker login gitea.encke-hake.ts.net
|
|
|
|
# Username: Alby96
|
|
# Password: [Personal Access Token Gitea]
|
|
```
|
|
|
|
**Output atteso**:
|
|
```
|
|
Login Succeeded ?
|
|
```
|
|
|
|
---
|
|
|
|
## ?? METODO 1: Template XML (Consigliato)
|
|
|
|
### Step 1: Copia Template su Unraid
|
|
|
|
```bash
|
|
# Su Unraid
|
|
mkdir -p /boot/config/plugins/dockerMan/templates-user
|
|
|
|
# Scarica template
|
|
wget -O /boot/config/plugins/dockerMan/templates-user/TradingBot.xml \
|
|
https://gitea.encke-hake.ts.net/Alby96/Encelado/raw/branch/main/TradingBot/deployment/unraid-template.xml
|
|
```
|
|
|
|
### Step 2: Installa Container
|
|
|
|
1. Unraid WebUI ? **Docker** tab
|
|
2. Click **Add Container** (in fondo)
|
|
3. **Template**: Dropdown ? Seleziona **TradingBot**
|
|
4. Configura parametri:
|
|
|
|
**Parametri Base**:
|
|
- **Name**: `TradingBot` (già impostato)
|
|
- **Repository**: `gitea.encke-hake.ts.net/alby96/encelado/tradingbot:latest` (già impostato)
|
|
|
|
**Porta WebUI** (Visibile e Configurabile!):
|
|
- **WebUI HTTP Port**: `8888` (porta default - cambia se occupata)
|
|
- Questa è la porta HOST per accedere all'interfaccia web
|
|
- La porta CONTAINER rimane sempre 8080 (non modificare)
|
|
- Alternative comuni se 8888 occupata: `8881`, `9999`, `7777`
|
|
|
|
**Volume Dati**:
|
|
- **AppData**: `/mnt/user/appdata/tradingbot` (già impostato)
|
|
- Puoi cambiare se preferisci altra directory
|
|
|
|
**Variabili Ambiente** (Avanzate - espandi se necessario):
|
|
- **ASPNETCORE_ENVIRONMENT**: `Production` (non modificare)
|
|
- **ASPNETCORE_URLS**: `http://+:8080` (non modificare - porta interna container)
|
|
- **TZ**: `Europe/Rome` (cambia per altro timezone)
|
|
|
|
5. Click **Apply**
|
|
|
|
Unraid farà:
|
|
- ? Pull immagine da Gitea Registry
|
|
- ? Crea container con nome "TradingBot"
|
|
- ? Configura porta WebUI (default 8888 ? host, 8080 ? container)
|
|
- ? Crea volume per persistenza dati
|
|
- ? Start automatico
|
|
|
|
### Step 3: Accedi WebUI
|
|
|
|
**Metodo A: Click su WebUI Icon** ??
|
|
|
|
1. **Docker tab** ? Trova container **TradingBot**
|
|
2. Nella riga del container, a destra, vedrai l'**icona globe** ??
|
|
3. Click sull'icona ? Si apre automaticamente `http://192.168.30.23:8888`
|
|
|
|
**Metodo B: URL Manuale**
|
|
|
|
```
|
|
http://192.168.30.23:8888
|
|
```
|
|
|
|
(Sostituisci `8888` con la porta HOST che hai configurato)
|
|
|
|
?? **IMPORTANTE**: La porta nel browser deve essere quella HOST (8888 default), NON la porta container (8080)
|
|
|
|
Dovresti vedere la **Dashboard TradingBot**! ??
|
|
|
|
---
|
|
|
|
## ?? METODO 2: Installazione Manuale
|
|
|
|
Se preferisci non usare template:
|
|
|
|
### Step 1: Unraid Docker Tab
|
|
|
|
1. **Docker** ? **Add Container**
|
|
2. **Name**: `TradingBot`
|
|
|
|
### Step 2: Configurazione Base
|
|
|
|
**Repository**:
|
|
```
|
|
gitea.encke-hake.ts.net/alby96/encelado/tradingbot:latest
|
|
```
|
|
|
|
**Network Type**: `Bridge`
|
|
|
|
**Console shell command**: `Shell`
|
|
|
|
### Step 3: Port Mapping
|
|
|
|
Click **Add another Path, Port, Variable, Label or Device**
|
|
|
|
**Config Type**: `Port`
|
|
- **Name**: `WebUI`
|
|
- **Container Port**: `8080`
|
|
- **Host Port**: `8080` ? **Cambia questa se occupata!**
|
|
- **Connection Type**: `TCP`
|
|
|
|
### Step 4: Volume Mapping
|
|
|
|
Click **Add another Path, Port, Variable, Label or Device**
|
|
|
|
**Config Type**: `Path`
|
|
- **Name**: `AppData`
|
|
- **Container Path**: `/app/data`
|
|
- **Host Path**: `/mnt/user/appdata/tradingbot`
|
|
- **Access Mode**: `Read/Write`
|
|
|
|
### Step 5: Environment Variables
|
|
|
|
**ASPNETCORE_ENVIRONMENT**:
|
|
- **Name**: `ASPNETCORE_ENVIRONMENT`
|
|
- **Value**: `Production`
|
|
|
|
**ASPNETCORE_URLS**:
|
|
- **Name**: `ASPNETCORE_URLS`
|
|
- **Value**: `http://+:8080`
|
|
|
|
**TZ** (Opzionale):
|
|
- **Name**: `TZ`
|
|
- **Value**: `Europe/Rome` (o tuo timezone)
|
|
|
|
### Step 6: Health Check (Opzionale ma Consigliato)
|
|
|
|
**Extra Parameters**:
|
|
```
|
|
--health-cmd="wget --no-verbose --tries=1 --spider http://localhost:8080/ || exit 1" --health-interval=30s --health-timeout=3s --health-retries=3 --health-start-period=40s
|
|
```
|
|
|
|
### Step 7: Apply
|
|
|
|
Click **Apply** in fondo alla pagina.
|
|
|
|
---
|
|
|
|
## ?? AGGIORNAMENTO CONTAINER
|
|
|
|
### Via Unraid Docker Tab
|
|
|
|
1. **Docker** ? Trova **TradingBot**
|
|
2. Click **icona Stop** (ferma container)
|
|
3. Click **Force Update** (icona update con freccia circolare)
|
|
4. Attendi pull dell'immagine aggiornata
|
|
5. Click **icona Start** (avvia container)
|
|
|
|
Unraid farà:
|
|
- ? Pull ultima immagine da Gitea
|
|
- ? Ricrea container con nuova immagine
|
|
- ? Mantiene dati persistenti (volume non viene toccato)
|
|
- ? Mantiene configurazione (porta, variabili, etc.)
|
|
|
|
### Automatico con User Scripts Plugin
|
|
|
|
Installa **User Scripts** plugin:
|
|
|
|
1. **Apps** ? Cerca "User Scripts"
|
|
2. Installa
|
|
|
|
Crea script update:
|
|
|
|
```bash
|
|
#!/bin/bash
|
|
# Nome: Update TradingBot
|
|
# Schedula: Weekly (ogni domenica alle 3:00 AM)
|
|
|
|
# Stop container
|
|
docker stop TradingBot
|
|
|
|
# Pull latest image
|
|
docker pull gitea.encke-hake.ts.net/alby96/encelado/tradingbot:latest
|
|
|
|
# Start container (Unraid ricrea automaticamente)
|
|
docker start TradingBot
|
|
|
|
# Notifica
|
|
/usr/local/emhttp/webGui/scripts/notify -s "TradingBot Update" -d "Container aggiornato con successo!" -i "normal"
|
|
|
|
echo "Update completato alle $(date)"
|
|
```
|
|
|
|
Schedula: Settimanale o manualmente quando serve.
|
|
|
|
---
|
|
|
|
## ??? CONFIGURAZIONE PORTA
|
|
|
|
### Cambiare Porta WebUI
|
|
|
|
La porta **default è 8888** (host) ? **8080** (container).
|
|
|
|
Se la porta 8888 è occupata o vuoi usarne un'altra:
|
|
|
|
#### **Via Template (Prima Installazione)**
|
|
|
|
Durante Step 2 dell'installazione:
|
|
- **WebUI HTTP Port**: Cambia da `8888` a porta desiderata (es. `8881`, `9999`, `7777`)
|
|
- ?? Modifica SOLO la porta HOST (a sinistra)
|
|
- NON modificare la porta Container (deve restare 8080)
|
|
|
|
#### **Via Edit (Container Esistente)**
|
|
|
|
1. **Docker tab** ? Container **TradingBot**
|
|
2. Click **Edit** (icona matita/wrench)
|
|
3. Trova sezione **Port Mappings**
|
|
4. Vedrai: **Host Port** `8888` ? **Container Port** `8080`
|
|
5. Modifica **Host Port** (es. da `8888` a `8881`)
|
|
6. **IMPORTANTE**: NON modificare **Container Port** (deve restare `8080`)
|
|
7. Click **Apply** in fondo
|
|
8. Container si riavvierà automaticamente
|
|
|
|
#### **Accesso con Nuova Porta**
|
|
|
|
```
|
|
http://192.168.30.23:NUOVA_PORTA_HOST
|
|
```
|
|
|
|
Esempio con porta `8881`:
|
|
```
|
|
http://192.168.30.23:8881
|
|
```
|
|
|
|
### Porte Comuni Disponibili
|
|
|
|
Se `8888` è occupata, prova queste alternative:
|
|
|
|
| Porta | Uso Comune | Probabilità Libera |
|
|
|-------|------------|-------------------|
|
|
| `8881` | Alternative port | ????? Alta |
|
|
| `9999` | Generic services | ???? Alta |
|
|
| `7777` | Custom apps | ???? Alta |
|
|
| `8889` | Next to 8888 | ??? Media |
|
|
| `3000` | Dev servers | ?? Bassa (spesso occupata) |
|
|
| `8080` | ? NON usare | Troppo comune, quasi sempre occupata |
|
|
|
|
**Check porta disponibile**:
|
|
```bash
|
|
# Su Unraid via SSH
|
|
netstat -tulpn | grep :8888
|
|
# Se restituisce risultato ? porta occupata
|
|
# Se vuoto ? porta libera ?
|
|
```
|
|
|
|
### Differenza HOST vs CONTAINER Port
|
|
|
|
?? **IMPORTANTE da capire**:
|
|
|
|
```
|
|
HOST Port (8888) ? CONTAINER Port (8080)
|
|
?? Porta su Unraid ?? Porta interna Docker
|
|
?? Quella nel BROWSER ?? Fissa, NON modificare
|
|
?? Configurabile ?? Hardcoded nell'app
|
|
?? Esempio: 8888 ?? Sempre 8080
|
|
```
|
|
|
|
**Esempio configurazione corretta**:
|
|
```
|
|
Browser: http://192.168.30.23:8888
|
|
?? Usa porta HOST
|
|
|
|
Docker: 8888 (host) ? 8080 (container)
|
|
?? Mapping ?? App interna
|
|
```
|
|
|
|
**Cosa NON fare**:
|
|
- ? Cambiare porta Container da 8080 a altro
|
|
- ? Modificare `ASPNETCORE_URLS` (deve restare `http://+:8080`)
|
|
- ? Usare porta Host 8080 (conflitto con container)
|
|
|
|
**Cosa puoi fare**:
|
|
- ? Cambiare porta Host da 8888 a qualsiasi altra libera
|
|
- ? Usare porta Host diversa per ogni app
|
|
- ? Accedere con `http://IP:PORTA_HOST`
|
|
|
|
---
|
|
|
|
## ?? QUICK START COMPLETO
|
|
|
|
**Setup in 3 minuti**:
|
|
|
|
```bash
|
|
# 1. Login (una volta)
|
|
docker login gitea.encke-hake.ts.net
|
|
|
|
# 2. Download template
|
|
wget -O /boot/config/plugins/dockerMan/templates-user/TradingBot.xml \
|
|
https://gitea.encke-hake.ts.net/Alby96/Encelado/raw/branch/main/TradingBot/deployment/unraid-template.xml
|
|
|
|
# 3. Install via UI
|
|
# Docker tab ? Add Container ? TradingBot template ? Apply
|
|
|
|
# 4. Access WebUI
|
|
# Metodo A: Click icona ?? nella Docker tab
|
|
# Metodo B: http://192.168.30.23:8888
|
|
```
|
|
|
|
**?? TradingBot pronto su Unraid!**
|
|
|
|
---
|
|
|
|
## ?? Nota sulla Porta
|
|
|
|
**Default**: Porta HOST `8888` (invece di 8080)
|
|
|
|
**Perché 8888?**
|
|
- Porta 8080 è troppo comune e spesso occupata
|
|
- 8888 è quasi sempre libera su Unraid
|
|
- Facile da ricordare (quattro 8)
|
|
- WebUI icon funziona automaticamente
|
|
|
|
**Se 8888 è occupata**: Cambia in fase di installazione o dopo via Edit
|
|
|
|
---
|
|
|
|
## ?? ACCESSO WEBUI
|
|
|
|
### Locale (Unraid LAN)
|
|
|
|
```
|
|
http://192.168.30.23:8888
|
|
```
|
|
|
|
Sostituisci:
|
|
- `192.168.30.23` con IP del tuo Unraid
|
|
- `8888` con porta HOST configurata (se diversa)
|
|
|
|
### Via Tailscale
|
|
|
|
Se hai configurato Tailscale su Unraid:
|
|
|
|
```
|
|
http://unraid.encke-hake.ts.net:8888
|
|
```
|
|
|
|
### Via Hostname Unraid
|
|
|
|
Se hai configurato hostname:
|
|
|
|
```
|
|
http://tower:8888
|
|
```
|
|
|
|
(Sostituisci `tower` con hostname del tuo Unraid e `8888` con porta configurata)
|
|
|
|
### Reverse Proxy (Accesso HTTPS)
|
|
|
|
Se usi **Nginx Proxy Manager** o **Swag**:
|
|
|
|
```nginx
|
|
# Nginx Proxy Manager
|
|
Upstream: http://192.168.30.23:8888
|
|
Domain: tradingbot.tuo-dominio.com
|
|
SSL: Let's Encrypt
|
|
```
|
|
|
|
Poi accedi via:
|
|
```
|
|
https://tradingbot.tuo-dominio.com
|
|
```
|
|
|
|
?? **Nota**: Il reverse proxy si connette alla porta HOST (8888), non container (8080)
|