From 9e43a3adb8f7242e74fe3e8d43e5027a84ff8c51 Mon Sep 17 00:00:00 2001 From: Thomas Blarre Date: Fri, 10 May 2024 20:46:40 +0100 Subject: [PATCH] Nextcloud AIO working --- nexcloud-aio/.env.example | 4 ++ nexcloud-aio/docker-compose.yml | 61 +++++++++++++++++++ .../config/nextcloud-aio.json | 19 ++++++ .../ts-nextcloud/config/nextcloud.json | 19 ++++++ 4 files changed, 103 insertions(+) create mode 100644 nexcloud-aio/.env.example create mode 100644 nexcloud-aio/docker-compose.yml create mode 100644 nexcloud-aio/ts-nextcloud-aio/config/nextcloud-aio.json create mode 100644 nexcloud-aio/ts-nextcloud/config/nextcloud.json diff --git a/nexcloud-aio/.env.example b/nexcloud-aio/.env.example new file mode 100644 index 0000000..296a337 --- /dev/null +++ b/nexcloud-aio/.env.example @@ -0,0 +1,4 @@ +TAILSCALE_OAUTH_KEY_NC= +TAILSCALE_OAUTH_KEY_NCAIO= +TAILSCALE_TAGS_NC= +TAILSCALE_TAGS_NCAIO= \ No newline at end of file diff --git a/nexcloud-aio/docker-compose.yml b/nexcloud-aio/docker-compose.yml new file mode 100644 index 0000000..682c978 --- /dev/null +++ b/nexcloud-aio/docker-compose.yml @@ -0,0 +1,61 @@ +services: + ts-nextcloud-aio: + image: tailscale/tailscale:latest + hostname: nextcloud-aio + environment: + - TS_AUTHKEY=${TAILSCALE_OAUTH_KEY2} + - TS_EXTRA_ARGS=--advertise-tags=${TAILSCALE_TAGS} + - TS_SERVE_CONFIG=/config/nextcloud-aio.json + - TS_STATE_DIR=/var/lib/tailscale + volumes: + - ts-nextcloud-aio-state:/var/lib/tailscale + - ${PWD}/ts-nextcloud-aio/config:/config + - /dev/net/tun:/dev/net/tun + cap_add: + - net_admin + - sys_module + restart: unless-stopped + + ts-nextcloud: + image: tailscale/tailscale:latest + hostname: nextcloud + network_mode: host + environment: + - TS_AUTHKEY=${TAILSCALE_OAUTH_KEY} + - TS_EXTRA_ARGS=--advertise-tags=${TAILSCALE_TAGS} + - TS_SERVE_CONFIG=/config/nextcloud.json + - TS_STATE_DIR=/var/lib/tailscale + volumes: + - ts-nextcloud-state:/var/lib/tailscale + - ${PWD}/ts-nextcloud/config:/config + - /dev/net/tun:/dev/net/tun + cap_add: + - net_admin + - sys_module + restart: unless-stopped + + nextcloud-aio-mastercontainer: + image: nextcloud/all-in-one:latest + init: true + restart: always + container_name: nextcloud-aio-mastercontainer # This line is not allowed to be changed as otherwise AIO will not work correctly + volumes: + - nextcloud_aio_mastercontainer:/mnt/docker-aio-config # This line is not allowed to be changed as otherwise the built-in backup solution will not work + - /var/run/docker.sock:/var/run/docker.sock:ro # May be changed on macOS, Windows or docker rootless. See the applicable documentation. If adjusting, don't forget to also set 'WATCHTOWER_DOCKER_SOCKET_PATH'! + ports: + - 8080:8080 + environment: + APACHE_PORT: 11000 + NEXTCLOUD_DATADIR: /mnt/ncdata + +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: + name: nextcloud_aio_mastercontainer # This line is not allowed to be changed as otherwise the built-in backup solution will not work + ts-nextcloud-aio-state: + driver: local + ts-nextcloud-state: + driver: local + caddy_data: + driver: local + caddy_config: + driver: local \ No newline at end of file diff --git a/nexcloud-aio/ts-nextcloud-aio/config/nextcloud-aio.json b/nexcloud-aio/ts-nextcloud-aio/config/nextcloud-aio.json new file mode 100644 index 0000000..2d01238 --- /dev/null +++ b/nexcloud-aio/ts-nextcloud-aio/config/nextcloud-aio.json @@ -0,0 +1,19 @@ +{ + "TCP": { + "443": { + "HTTPS": true + } + }, + "Web": { + "${TS_CERT_DOMAIN}:443": { + "Handlers": { + "/": { + "Proxy": "https+insecure://nextcloud-aio-mastercontainer:8080" + } + } + } + }, + "AllowFunnel": { + "${TS_CERT_DOMAIN}:443": false + } + } \ No newline at end of file diff --git a/nexcloud-aio/ts-nextcloud/config/nextcloud.json b/nexcloud-aio/ts-nextcloud/config/nextcloud.json new file mode 100644 index 0000000..3018849 --- /dev/null +++ b/nexcloud-aio/ts-nextcloud/config/nextcloud.json @@ -0,0 +1,19 @@ +{ + "TCP": { + "443": { + "HTTPS": true + } + }, + "Web": { + "${TS_CERT_DOMAIN}:443": { + "Handlers": { + "/": { + "Proxy": "http://localhost:11000" + } + } + } + }, + "AllowFunnel": { + "${TS_CERT_DOMAIN}:443": true + } + } \ No newline at end of file