From 9d78037fe71b9750b7a4e2249da1443913e05746 Mon Sep 17 00:00:00 2001 From: CyberIce2077 Date: Tue, 23 Sep 2025 22:36:19 +0300 Subject: [PATCH 1/2] cloudflare tunnel --- .kamal/secrets | 1 + config/deploy.yml | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.kamal/secrets b/.kamal/secrets index 5c3f87a..3922202 100644 --- a/.kamal/secrets +++ b/.kamal/secrets @@ -18,3 +18,4 @@ KAMAL_REGISTRY_PASSWORD=$(cat .kamal/keys/kamal_registry_password.key) RAILS_MASTER_KEY=$(cat config/master.key) POSTGRES_PASSWORD=$(cat .kamal/keys/postgres_password.key) +TUNNEL_TOKEN=$(cat .kamal/keys/cloudflare_token.key) diff --git a/config/deploy.yml b/config/deploy.yml index ca932f1..02d20d8 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -17,10 +17,9 @@ servers: # Remove this section when using multiple web servers and ensure you terminate SSL at your load balancer. # # Note: If using Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption. -# proxy: -# ssl: true -# host: giftbrain.app -# app_port: 3000 +proxy: + ssl: false + host: giftbrain.app # Credentials for your image host. registry: @@ -92,10 +91,10 @@ accessories: image: cloudflare/cloudflared:latest roles: - web - files: - - ./.kamal/cloudflare/credentials.json:/etc/cloudflared/credentials.json - - ./.kamal/cloudflare/config.yml:/etc/cloudflared/config.yml - cmd: tunnel --config /etc/cloudflared/config.yml run + env: + secret: + - TUNNEL_TOKEN + cmd: tunnel run redis: image: redis:latest roles: From 5c1ad8c42342e3d044785a1541bf896b8bd98dca Mon Sep 17 00:00:00 2001 From: CyberIce2077 Date: Fri, 3 Oct 2025 14:42:12 +0300 Subject: [PATCH 2/2] kamal-proxy max loggin --- config/deploy.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/deploy.yml b/config/deploy.yml index 02d20d8..8b2b39b 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -74,6 +74,14 @@ builder: ssh: user: ice-server +# NOTE: To clear kamal-proxy logs if they grow too large +# sudo truncate -s 0 $(docker inspect --format='{{.LogPath}}' kamal-proxy) +logging: + driver: json-file + options: + max-size: 10m + max-file: 3 + accessories: # db: # image: postgres:16