From daeb06e4ae5c2fa1d91a19146f59a291e6c8c7b3 Mon Sep 17 00:00:00 2001 From: Natalie Rose Date: Thu, 21 Aug 2025 23:44:43 +1000 Subject: [PATCH] Say hello to my little friend (tailscale) --- .gitignore | 1 + .gitmodules | 4 ++-- app | 2 +- docker-compose.yml | 37 +++++++++++++++++++++++++++----- etc-docker/lacuna.conf | 4 ++-- etc-docker/tailscale/lacuna.json | 19 ++++++++++++++++ 6 files changed, 57 insertions(+), 10 deletions(-) create mode 100644 etc-docker/tailscale/lacuna.json diff --git a/.gitignore b/.gitignore index e0795b8d..ff6ba3e7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ var/www/public/starmap.json var/www/public/api var/www/public/captcha data/ +data-tailscale/ etc-docker/logs/ tmp/ log/ diff --git a/.gitmodules b/.gitmodules index d09d3e5b..861948a9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "assets"] path = assets - url = git@github.com:tlecommunity/assets.git + url = https://gitea.allosaurus-chromatic.ts.net/tlecommunity/assets.git [submodule "app"] path = app - url = git@github.com:tlecommunity/app.git + url = https://gitea.allosaurus-chromatic.ts.net/tlecommunity/app.git diff --git a/app b/app index fc139fc7..b7aef0c5 160000 --- a/app +++ b/app @@ -1 +1 @@ -Subproject commit fc139fc723b5e7ff3f8af3b245b80b7fd17a98cc +Subproject commit b7aef0c52e83341b475b856f9dfc8ee2b7ab0025 diff --git a/docker-compose.yml b/docker-compose.yml index 99c4a9f5..b3c985e5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -74,15 +74,42 @@ services: ## NGINX ## ########### + lacuna-tailscale: + image: tailscale/tailscale:latest + container_name: lacuna-tailscale + hostname: lacuna + environment: + - TS_AUTHKEY=tskey-auth-kax68gMHyj11CNTRL-zJ8g8qwsq4D5PyQKafPK5DLrPTqEZYih + - TS_EXTRA_ARGS=--advertise-tags=tag:container + - TS_SERVE_CONFIG=/config/lacuna.json + - TS_STATE_DIR=/var/lib/tailscale + - TS_USERSPACE=false + - TS_ENABLE_HEALTH_CHECK=true + healthcheck: + test: ['CMD', 'wget', '--spider', '-q', 'http://127.0.0.1:9002/healthz'] + interval: 10s + timeout: 3s + volumes: + - ./data-tailscale:/var/lib/tailscale + - ./etc-docker/tailscale:/config + devices: + - /dev/net/tun:/dev/net/tun + cap_add: + - net_admin + - sys_module + restart: unless-stopped + lacuna-nginx: build: context: . dockerfile: ./docker/build-nginx/Dockerfile container_name: 'lacuna-nginx' + network_mode: service:lacuna-tailscale depends_on: - - 'lacuna-server' - ports: - - '8080:80' + lacuna-server: + condition: service_started + lacuna-tailscale: + condition: service_healthy volumes: - ./etc-docker/nginx.conf:/etc/nginx/nginx.conf - ./etc-docker:/home/lacuna/server/etc @@ -122,8 +149,8 @@ services: - app-node_modules:/usr/src/app/node_modules - ./app:/usr/src/app environment: - - 'LACUNA_ASSETS_URL=https://lacuna.ocean74.net/assets/' - - 'LACUNA_SERVER_URL=https://lacuna.ocean74.net' + - 'LACUNA_ASSETS_URL=https://lacuna.allosaurus-chromatic.ts.net/assets/' + - 'LACUNA_SERVER_URL=https://lacuna.allosaurus-chromatic.ts.net' - 'LACUNA_API_KEY=anonymous' ############ diff --git a/etc-docker/lacuna.conf b/etc-docker/lacuna.conf index 3216b528..f9f75525 100644 --- a/etc-docker/lacuna.conf +++ b/etc-docker/lacuna.conf @@ -119,8 +119,8 @@ "server_keys" : [ "XXXX" ], - "server_url" : "https://lacuna.ocean74.net/", - "assets_url": "https://lacuna.ocean74.net/assets/", + "server_url" : "https://lacuna.allosaurus-chromatic.ts.net/", + "assets_url": "https://lacuna.allosaurus-chromatic.ts.net/assets/", "starter_zone" : { # If zone is set to a valid zone, x & y are confined to within that zone. # Coord set to 1 will further narrow area. diff --git a/etc-docker/tailscale/lacuna.json b/etc-docker/tailscale/lacuna.json new file mode 100644 index 00000000..088f152f --- /dev/null +++ b/etc-docker/tailscale/lacuna.json @@ -0,0 +1,19 @@ +{ + "TCP": { + "443": { + "HTTPS": true + } + }, + "Web": { + "${TS_CERT_DOMAIN}:443": { + "Handlers": { + "/": { + "Proxy": "http://127.0.0.1:80" + } + } + } + }, + "AllowFunnel": { + "${TS_CERT_DOMAIN}:443": false + } +} -- 2.51.2