From 33b5c5e8c814b549c0ad720865dfee2cd2004451 Mon Sep 17 00:00:00 2001 From: Thomas Blarre Date: Thu, 6 Jun 2024 19:12:27 +0100 Subject: [PATCH] Add syncthing to nextcloud aio --- nexcloud-aio/.env.example | 4 ++- nexcloud-aio/docker-compose.yml | 30 ++++++++++++++++++- .../config/syncthing-ncaio.json | 19 ++++++++++++ 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 nexcloud-aio/ts-syncthing-ncaio/config/syncthing-ncaio.json diff --git a/nexcloud-aio/.env.example b/nexcloud-aio/.env.example index 296a337..e670f23 100644 --- a/nexcloud-aio/.env.example +++ b/nexcloud-aio/.env.example @@ -1,4 +1,6 @@ TAILSCALE_OAUTH_KEY_NC= TAILSCALE_OAUTH_KEY_NCAIO= +TAILSCALE_OAUTH_KEY_SYNCTNCAIO= TAILSCALE_TAGS_NC= -TAILSCALE_TAGS_NCAIO= \ No newline at end of file +TAILSCALE_TAGS_NCAIO= +TAILSCALE_TAGS_SYNCTNCAIO= \ No newline at end of file diff --git a/nexcloud-aio/docker-compose.yml b/nexcloud-aio/docker-compose.yml index a76f246..6f8ae8d 100644 --- a/nexcloud-aio/docker-compose.yml +++ b/nexcloud-aio/docker-compose.yml @@ -46,7 +46,33 @@ services: - 8080:8080 environment: APACHE_PORT: 11000 - NEXTCLOUD_DATADIR: /mnt/ncdata + NEXTCLOUD_DATADIR: /mnt/ncdata + NEXTCLOUD_MOUNT: /mnt/external_data + + ts-syncthing: + image: tailscale/tailscale:latest + hostname: syncthing-ncaio + environment: + - TS_AUTHKEY=${TAILSCALE_OAUTH_KEY_SYNCTNCAIO} + - TS_EXTRA_ARGS=--advertise-tags=${TAILSCALE_TAGS_SYNCTNCAIO} + - TS_SERVE_CONFIG=/config/syncthing-ncaio.json + - TS_STATE_DIR=/var/lib/tailscale + volumes: + - ts-syncthing-ncaio-state:/var/lib/tailscale + - ${PWD}/ts-syncthing-ncaio/config:/config + - /dev/net/tun:/dev/net/tun + cap_add: + - net_admin + - sys_module + restart: unless-stopped + + syncthing: + image: syncthing/syncthing + container_name: syncthing + hostname: syncthing + volumes: + - /mnt/external_data/syncthing:/var/syncthing + restart: unless-stopped volumes: # If you want to store the data on a different drive, see https://github.com/nextcloud/all-in-one#how-to-store-the-filesinstallation-on-a-separate-drive nextcloud_aio_mastercontainer: @@ -55,6 +81,8 @@ volumes: # If you want to store the data on a different drive, see https://githu driver: local ts-nextcloud-state: driver: local + ts-syncthing-ncaio-state: + driver: local caddy_data: driver: local caddy_config: diff --git a/nexcloud-aio/ts-syncthing-ncaio/config/syncthing-ncaio.json b/nexcloud-aio/ts-syncthing-ncaio/config/syncthing-ncaio.json new file mode 100644 index 0000000..7fbc819 --- /dev/null +++ b/nexcloud-aio/ts-syncthing-ncaio/config/syncthing-ncaio.json @@ -0,0 +1,19 @@ +{ + "TCP": { + "443": { + "HTTPS": true + } + }, + "Web": { + "${TS_CERT_DOMAIN}:443": { + "Handlers": { + "/": { + "Proxy": "http://syncthing:8384" + } + } + } + }, + "AllowFunnel": { + "${TS_CERT_DOMAIN}:443": true + } + } \ No newline at end of file