From a6a48c456c02f9e986efd244536e4514457436b0 Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Fri, 20 Sep 2024 09:26:06 +0100 Subject: [PATCH 1/2] Response timeout should be a number Kamal will append the `s` for the duration when talking to kamal-proxy so no need to have it in the config. --- lib/kamal/configuration/docs/proxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kamal/configuration/docs/proxy.yml b/lib/kamal/configuration/docs/proxy.yml index 332a2c28..1fdc39dd 100644 --- a/lib/kamal/configuration/docs/proxy.yml +++ b/lib/kamal/configuration/docs/proxy.yml @@ -47,7 +47,7 @@ proxy: # Response timeout # # How long to wait for requests to complete before timing out, defaults to 30 seconds - response_timeout: 10s + response_timeout: 10 # Healthcheck # From 6df169a4fb26a02e274c54be28f0558b81942e22 Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Fri, 20 Sep 2024 15:27:10 +0100 Subject: [PATCH 2/2] Doc updates --- lib/kamal/configuration/docs/builder.yml | 6 +----- .../configuration/docs/configuration.yml | 8 ++++++-- lib/kamal/configuration/docs/env.yml | 19 ++++++++++++++++--- lib/kamal/configuration/docs/proxy.yml | 2 +- lib/kamal/configuration/docs/role.yml | 8 ++++++-- 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/lib/kamal/configuration/docs/builder.yml b/lib/kamal/configuration/docs/builder.yml index 1c41a386..cdde194f 100644 --- a/lib/kamal/configuration/docs/builder.yml +++ b/lib/kamal/configuration/docs/builder.yml @@ -2,10 +2,6 @@ # # The builder configuration controls how the application is built with `docker build` # -# If no configuration is specified, Kamal will: -# 1. Create a buildx context called `kamal-local-docker-container`, using the docker-container driver -# 2. Use `docker build` to build a multiarch image for linux/amd64,linux/arm64 with that context -# # See https://kamal-deploy.org/docs/configuration/builder-examples/ for more information # Builder options @@ -78,7 +74,7 @@ builder: # Build secrets # - # Values are read from the .kamal/secrets. + # Values are read from .kamal/secrets. # secrets: - SECRET1 diff --git a/lib/kamal/configuration/docs/configuration.yml b/lib/kamal/configuration/docs/configuration.yml index 597a8bea..20530a3d 100644 --- a/lib/kamal/configuration/docs/configuration.yml +++ b/lib/kamal/configuration/docs/configuration.yml @@ -36,6 +36,8 @@ image: my-image labels: my-label: my-value +# Volumes +# # Additional volumes to mount into the container volumes: - /path/on/host:/path/in/container:ro @@ -58,7 +60,7 @@ servers: env: ... -# Asset Bridging +# Asset Path # # Used for asset bridging across deployments, default to `nil` # @@ -74,6 +76,8 @@ env: # To configure this, set the path to the assets: asset_path: /path/to/assets +# Hooks path +# # Path to hooks, defaults to `.kamal/hooks` # See https://kamal-deploy.org/docs/hooks for more information hooks_path: /user_home/kamal/hooks @@ -83,7 +87,7 @@ hooks_path: /user_home/kamal/hooks # Whether deployments require a destination to be specified, defaults to `false` require_destination: true -# The primary role +# Primary role # # This defaults to `web`, but if you have no web role, you can change this primary_role: workers diff --git a/lib/kamal/configuration/docs/env.yml b/lib/kamal/configuration/docs/env.yml index 513799d4..4c38442c 100644 --- a/lib/kamal/configuration/docs/env.yml +++ b/lib/kamal/configuration/docs/env.yml @@ -12,11 +12,16 @@ env: DATABASE_HOST: mysql-db1 DATABASE_PORT: 3306 -# Using .kamal/secrets file to load required environment variables +# Secrets # -# Kamal uses dotenv to automatically load environment variables set in the .kamal/secrets file. +# Kamal uses dotenv to automatically load environment variables set in the `.kamal/secrets` file. # -# This file can be used to set variables like KAMAL_REGISTRY_PASSWORD or database passwords. +# If you are using destinations, secrets will instead be read from `.kamal/secrets-` if +# it exists. +# +# Common secrets across all destinations can be set in `.kamal/secrets-common`. +# +# This file can be used to set variables like `KAMAL_REGISTRY_PASSWORD` or database passwords. # You can use variable or command substitution in the secrets file. # # ``` @@ -24,6 +29,14 @@ env: # RAILS_MASTER_KEY=$(cat config/master.key) # ``` # +# You can also use [secret helpers](../commands/secrets) for some common password managers. +# ``` +# SECRETS=$(kamal secrets fetch ...) +# +# REGISTRY_PASSWORD=$(kamal secrets extract REGISTRY_PASSWORD $SECRETS) +# DB_PASSWORD=$(kamal secrets extract DB_PASSWORD $SECRETS) +# ``` +# # If you store secrets directly in .kamal/secrets, ensure that it is not checked into version control. # # To pass the secrets you should list them under the `secret` key. When you do this the diff --git a/lib/kamal/configuration/docs/proxy.yml b/lib/kamal/configuration/docs/proxy.yml index 1fdc39dd..04eea4fc 100644 --- a/lib/kamal/configuration/docs/proxy.yml +++ b/lib/kamal/configuration/docs/proxy.yml @@ -91,7 +91,7 @@ proxy: # Forward headers # - # Whether to forward the X-Forwarded-For and X-Forwarded-Proto headers (defaults to false) + # Whether to forward the X-Forwarded-For and X-Forwarded-Proto headers. # # If you are behind a trusted proxy, you can set this to true to forward the headers. # diff --git a/lib/kamal/configuration/docs/role.yml b/lib/kamal/configuration/docs/role.yml index fbc8a813..dc27c69e 100644 --- a/lib/kamal/configuration/docs/role.yml +++ b/lib/kamal/configuration/docs/role.yml @@ -26,8 +26,12 @@ servers: # # When there are other options to set, the list of hosts goes under the `hosts` key # - # By default only the primary role uses a proxy, but you can set `proxy` to change - # it. + # By default only the primary role uses a proxy. + # + # For other roles, you can set it to `proxy: true` enable it and inherit the root proxy + # configuration or provide a map of options to override the root configuration. + # + # For the primary role, you can set `proxy: false` to disable the proxy. # # You can also set a custom cmd to run in the container, and overwrite other settings # from the root configuration.