From 817d09683b8d0e5351bbe7d07a6f6dc4f8e9c04b Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Mon, 6 May 2024 09:03:17 +0200 Subject: [PATCH] Add syncthing Signed-off-by: Bensuperpc --- Makefile | 2 +- README.md | 10 +++++++--- caddy/bensuperpc.org/Caddyfile | 6 ++++++ docker-compose.syncthing.yml | 25 +++++++++++++++++++++++++ env/syncthing.env | 2 ++ 5 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 docker-compose.syncthing.yml create mode 100644 env/syncthing.env diff --git a/Makefile b/Makefile index 0df3a7f..32b45f4 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ DOCKER := docker -PROFILES := webserver wordpress adminer uptime-kuma portainer qbittorrent gitea jellyfin watchtower backup openssh +PROFILES := webserver wordpress adminer uptime-kuma portainer qbittorrent gitea jellyfin watchtower backup syncthing openssh PROFILE_CMD := $(addprefix --profile ,$(PROFILES)) COMPOSE_FILES := $(shell find docker-compose*.yml | sed -e 's/^/--file /') diff --git a/README.md b/README.md index a7a676b..76cc300 100644 --- a/README.md +++ b/README.md @@ -70,10 +70,12 @@ And then, caddy will generate the certificate for you and renew it automatically | git.bensuperpc.org | Sub | Gitea for git | | link.bensuperpc.org | Sub | For link shortener | | jellyfin.bensuperpc.org | Sub | Jellyfin for media server | +| syncthing.bensuperpc.org | Sub | SyncThing for file synchronization | +| ssh.bensuperpc.org | Sub | Openssh for ssh | | bensuperpc.com | Main | Redirect to bensuperpc.org | -| bensuperpc.fr | Sub | Redirect to bensuperpc.org | -| bensuperpc.net | Sub | Redirect to bensuperpc.org | -| bensuperpc.ovh | Sub | Redirect to bensuperpc.org | +| bensuperpc.fr | Main | Redirect to bensuperpc.org | +| bensuperpc.net | Main | Redirect to bensuperpc.org | +| bensuperpc.ovh | Main | Redirect to bensuperpc.org | ### Configure the infrastructure @@ -163,6 +165,8 @@ You can find all services on the [docker-compose.yml](docker-compose.yml) file o | Torrent | Torrent server | [torrent.bensuperpc.org](https://torrent.bensuperpc.org) | | Gitea | Gitea for git | [git.bensuperpc.org](https://git.bensuperpc.org) | | Jellyfin | Jellyfin for media server | [jellyfin.bensuperpc.org](https://jellyfin.bensuperpc.org) | +| SyncThing | SyncThing for file synchronization | [syncthing.bensuperpc.org](https://syncthing.bensuperpc.org) | +| Openssh | Openssh for ssh | [ssh.bensuperpc.org](https://ssh.bensuperpc.org) | ## URL diff --git a/caddy/bensuperpc.org/Caddyfile b/caddy/bensuperpc.org/Caddyfile index bca661b..400fb6d 100644 --- a/caddy/bensuperpc.org/Caddyfile +++ b/caddy/bensuperpc.org/Caddyfile @@ -60,6 +60,12 @@ ssh.bensuperpc.org { reverse_proxy openssh:2222 } +syncthing.bensuperpc.org { + reverse_proxy syncthing:8384 { + header_up Host {upstream_hostport} + } +} + link.bensuperpc.org { redir /rickroll https://www.youtube.com/watch?v=dQw4w9WgXcQ permanent redir /babyshark https://www.youtube.com/watch?v=XqZsoesa55w permanent diff --git a/docker-compose.syncthing.yml b/docker-compose.syncthing.yml new file mode 100644 index 0000000..b4e241c --- /dev/null +++ b/docker-compose.syncthing.yml @@ -0,0 +1,25 @@ +version: '3.9' + +services: + # syncthing + syncthing: + image: linuxserver/syncthing:latest + container_name: syncthing + profiles: + - syncthing + restart: on-failure + env_file: + - env/syncthing.env + volumes: + - syncthing_config:/config + - syncthing_data:/data1 + networks: + - infra-network + security_opt: + - no-new-privileges:true + +volumes: + syncthing_config: + name: syncthing_config + syncthing_data: + name: syncthing_data diff --git a/env/syncthing.env b/env/syncthing.env new file mode 100644 index 0000000..54094c2 --- /dev/null +++ b/env/syncthing.env @@ -0,0 +1,2 @@ +PUID=1000 +PGID=1000