You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.1 KiB
Markdown

11 months ago
# Syncthing
###### guide-by-example
![logo](https://i.imgur.com/Vgtn1FM.png)
# Purpose & Overview
Synchronize folders between devices.<br>
* [Official](https://syncthing.net/)
* [Github](https://github.com/syncthing/syncthing)
11 months ago
Simple and elegant solution for Synchronizing folders.<br>
Clients are installed on devices, and paired with the Syncthing server.
There are Windows, MacOs, Linux, Android clients, and 3rd party Möbius Sync for iOS.
11 months ago
Written in Go.
# Files and directory structure
```
/home/
└── ~/
└── docker/
└── syncthing/
11 months ago
├── 🗋 .env
11 months ago
└── 🗋 docker-compose.yml
```
11 months ago
* `.env` - a file containing environment variables for docker compose
11 months ago
* `docker-compose.yml` - a docker compose file, telling docker how to run the container
# Compose
`docker-compose.yml`
```yml
services:
syncthing:
image: syncthing/syncthing
container_name: syncthing
hostname: syncthing
restart: unless-stopped
11 months ago
env_file: .env
11 months ago
volumes:
- /mnt/mirror/syncthing:/var/syncthing
ports:
- 8384:8384 # Web UI
- 22000:22000/tcp # TCP file transfers
- 22000:22000/udp # QUIC file transfers
- 21027:21027/udp # Receive local discovery broadcasts
11 months ago
11 months ago
networks:
default:
name: $DOCKER_MY_NETWORK
external: true
11 months ago
```
`.env`
```bash
# GENERAL
DOCKER_MY_NETWORK=caddy_net
TZ=Europe/Bratislava
# SYNCTHING
PUID=1000
PGID=1000
11 months ago
```
# Reverse proxy
Caddy v2 is used, details
[here](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/caddy_v2).
`Caddyfile`
```php
sync.{$MY_DOMAIN} {
11 months ago
reverse_proxy syncthing:8384
11 months ago
}
```
# First run
![webgui](https://i.imgur.com/ywdYeU2.png)
visit the webgui, setup username and password in settings > GUI.
* intall sync on other devices
* add folders, confirm them on webgui
sync should just start.
# Trouble shooting
# Update
Manual image update:
- `docker compose pull`</br>
- `docker compose up -d`</br>
- `docker image prune`