2021-05-25 11:36:01 +02:00
|
|
|
# Syncthing
|
2021-05-17 11:55:03 +02:00
|
|
|
<div align="center">
|
|
|
|
<img src="https://syncthing.net/img/screenshot.png" />
|
|
|
|
</div>
|
|
|
|
|
2021-05-25 11:36:01 +02:00
|
|
|
## Descrizione
|
|
|
|
[Sito ufficiale](https://syncthing.net/) - [Repo (Github)](https://github.com/linuxserver/docker-syncthing) - [Docs](https://docs.linuxserver.io/images/docker-syncthing)
|
2021-05-17 11:55:03 +02:00
|
|
|
|
2021-05-25 11:36:01 +02:00
|
|
|
Syncthing è un dropbox ma decentralizzato e privato:
|
|
|
|
- Solo interfaccia web multilingua e compatibile anche con tablet/smartphone
|
|
|
|
- Basato su un [protocollo](https://docs.syncthing.net/specs/bep-v1.html#bep-v1) decentralizzato, crittografato e open source
|
|
|
|
- Esistono [client](https://syncthing.net/downloads/) sia ufficiali che di terze parti
|
2021-05-17 11:55:03 +02:00
|
|
|
|
2021-05-25 11:36:01 +02:00
|
|
|
## Struttura file e cartelle
|
2021-05-17 11:55:03 +02:00
|
|
|
```
|
|
|
|
/home/
|
2021-05-22 14:55:19 +02:00
|
|
|
└── docker/
|
|
|
|
└── syncthing/
|
|
|
|
├── config/
|
|
|
|
├── data/
|
|
|
|
├── .env
|
|
|
|
└── docker-compose.yml
|
2021-05-17 11:55:03 +02:00
|
|
|
```
|
|
|
|
|
2021-05-17 12:45:18 +02:00
|
|
|
* `config/` - cartella dove risiedono i dati che servono a syncthing
|
2021-05-25 11:36:01 +02:00
|
|
|
* `data/` - cartella dove risiedono e vengono condivisi i dati presenti
|
2021-06-06 11:32:56 +02:00
|
|
|
* `.env` - file contenenti le variabili environment per il docker-compose
|
2021-05-17 12:45:18 +02:00
|
|
|
* `docker-compose.yml` - file usato per creare il container
|
2021-05-17 11:55:03 +02:00
|
|
|
|
2021-05-25 11:36:01 +02:00
|
|
|
**N.B. Tutti i file e le cartelle devono essere creati a mano.**
|
2021-05-17 11:55:03 +02:00
|
|
|
|
2021-05-25 11:36:01 +02:00
|
|
|
## Esempi
|
|
|
|
Semplice esempio per iniziare ad usare subito il container
|
2021-05-17 11:55:03 +02:00
|
|
|
|
2021-05-25 11:36:01 +02:00
|
|
|
### docker-compose
|
2021-05-17 11:55:03 +02:00
|
|
|
`docker-compose.yml`
|
|
|
|
```yml
|
2021-06-03 09:54:35 +02:00
|
|
|
version: "3.5"
|
2021-05-17 11:55:03 +02:00
|
|
|
services:
|
|
|
|
syncthing:
|
|
|
|
container_name: linuxserver-syncthing
|
|
|
|
image: ghcr.io/linuxserver/syncthing
|
2021-06-03 09:54:35 +02:00
|
|
|
networks:
|
|
|
|
- custom-bridge
|
2021-05-17 11:55:03 +02:00
|
|
|
restart: unless-stopped
|
|
|
|
ports:
|
|
|
|
- ${SYNCTHING_WEBUI_PORT:-8384}:8384
|
2021-06-05 11:37:29 +02:00
|
|
|
- ${SYNCTHING_LST_TCP:-22000}:22000
|
2021-05-17 16:54:47 +02:00
|
|
|
- ${SYNCTHING_LST_UDP:-22000}/udp:22000/udp
|
|
|
|
- ${SYNCTHING_PORT_DSC:-21027}/udp:21027/udp
|
2021-05-17 11:55:03 +02:00
|
|
|
env_file: .env
|
|
|
|
sysctls:
|
|
|
|
- net.core.rmem_max=2097152
|
|
|
|
volumes:
|
|
|
|
- ${SYNCTHING_CONFIG:-/home/docker/syncthing/config}:/config
|
|
|
|
- ${SYNCTHING_DATA:-/home/docker/syncthing/data}:/data
|
2021-06-03 09:54:35 +02:00
|
|
|
|
|
|
|
networks:
|
|
|
|
custom-bridge:
|
|
|
|
name: custom-bridge
|
|
|
|
driver: bridge
|
2021-05-17 11:55:03 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
`.env`
|
|
|
|
```bash
|
|
|
|
# Generale
|
|
|
|
SYNCTHING_CONFIG=/home/docker/syncthing/config
|
|
|
|
SYNCTHING_DATA=/home/docker/syncthing/data
|
|
|
|
SYNCTHING_WEBUI_PORT=8384
|
2021-05-17 16:54:47 +02:00
|
|
|
SYNCTHING_LST_TCP=22000
|
|
|
|
SYNCTHING_LST_UDP=22000
|
|
|
|
SYNCTHING_PORT_DSC=21027
|
2021-05-17 11:55:03 +02:00
|
|
|
|
|
|
|
# Syncthing
|
|
|
|
TZ=Europe/Amsterdam
|
|
|
|
```
|
|
|
|
|
|
|
|
# Reverse proxy
|
2021-05-25 11:36:01 +02:00
|
|
|
Ancora non ho previsto l'uso di un reverse proxy (Vedi [Todo](#Todo))
|
2021-05-17 11:55:03 +02:00
|
|
|
|
2021-05-25 11:36:01 +02:00
|
|
|
# Aggiornamento
|
|
|
|
### Automatico
|
|
|
|
Usando [watchtower](../watchtower) il container si aggiorna automaticamente
|
2021-05-17 11:55:03 +02:00
|
|
|
|
2021-05-25 11:36:01 +02:00
|
|
|
### Manuale
|
|
|
|
1. `docker-compose pull`
|
|
|
|
2. `docker-compose up -d`
|
|
|
|
3. `docker image prune`
|
2021-05-17 11:55:03 +02:00
|
|
|
|
2021-05-25 11:36:01 +02:00
|
|
|
## Backup e ripristino
|
|
|
|
### Backup
|
|
|
|
Usate [borg](../borg_backup) per fare i backup giornalieri dell'intera cartella `syncthing`
|
2021-05-17 11:55:03 +02:00
|
|
|
|
2021-05-25 11:36:01 +02:00
|
|
|
### Ripristino
|
|
|
|
Per una maggiore spiegazione sui passaggi da fare, controllate [qua](../borg_backup#user-content-controllare-la-cartella-dei-backup)
|
|
|
|
* fermare il container `docker-compose down`
|
2021-05-22 14:27:29 +02:00
|
|
|
* cancellare l'intera cartella `syncthing`
|
|
|
|
* dal backup copiare la cartella `syncthing`
|
|
|
|
* far ripartire il container `docker-compose up -d`
|
2021-05-17 11:55:03 +02:00
|
|
|
|
2021-05-25 11:36:01 +02:00
|
|
|
## Todo
|
2021-05-17 11:55:03 +02:00
|
|
|
Implementare:
|
2021-05-25 11:36:01 +02:00
|
|
|
- reverse proxy: **[caddy](https://caddyserver.com/)** o **[traefik](https://doc.traefik.io/traefik/)**
|