Commit Graph

1781 Commits

Author SHA1 Message Date
Donal McBreen b3a6921118 Handle ssl: false in proxy config
Fixes: https://github.com/basecamp/kamal/issues/956
2024-09-26 06:17:45 -04:00
Donal McBreen 325bf9a797 Merge pull request #975 from basecamp/kamal-proxy-0.6.0
Bump to latest version of kamal-proxy
2024-09-25 23:03:25 +01:00
Donal McBreen 7bdf6cd2e8 Bump to latest version of kamal-proxy 2024-09-25 17:54:38 -04:00
Kohki Makimoto 92d82dd1a7 test: If the provenance is false, output "--provenance false". 2024-09-26 05:50:51 +09:00
Donal McBreen 7633fe0293 Merge pull request #974 from basecamp/proxy-boot-config
Proxy boot config
2024-09-25 20:28:24 +01:00
Donal McBreen f6851048a6 Proxy boot config
Add commands for managing proxy boot config. Since the proxy can be
shared by multiple applications, the configuration doesn't belong in
`config/deploy.yml`.

Instead you can set the config with:

```
Usage:
  kamal proxy boot_config <set|get|clear>

Options:
      [--publish], [--no-publish], [--skip-publish]   # Publish the proxy ports on the host
                                                      # Default: true
      [--http-port=N]                                 # HTTP port to publish on the host
                                                      # Default: 80
      [--https-port=N]                                # HTTPS port to publish on the host
                                                      # Default: 443
      [--docker-options=option=value option2=value2]  # Docker options to pass to the proxy container
```

By default we boot the proxy with `--publish 80:80 --publish 443:443`.

You can stop it from publishing ports, specify different ports and pass
other docker options.

The config is stored in `.kamal/proxy/options` as arguments to be passed
verbatim to docker run.

Where someone wants to set the options in their application they can do
that by calling `kamal proxy boot_config set` in a pre-deploy hook.

There's an example in the integration tests showing how to use this to
front kamal-proxy with Traefik, using an accessory.
2024-09-25 15:15:26 -04:00
Donal McBreen f0d7f786fa Traefik should be kamal-proxy in reboot hooks 2024-09-25 14:51:22 -04:00
Donal McBreen 4d8387b1c9 Merge pull request #973 from eroluysal/main
Fix adapter names
2024-09-25 19:48:40 +01:00
eroluysal 0258ac4297 Fix adapter names. 2024-09-25 21:22:59 +03:00
Kohki Makimoto c17bdba61c add tests 2024-09-25 23:50:05 +09:00
Kohki Makimoto 13328687d1 support the "provenance" option in the "builder" config 2024-09-25 23:24:52 +09:00
Igor Aleksandrov 2b0810d063 Update lib/kamal/cli/templates/deploy.yml
Co-authored-by: Nick Hammond <nick@nickhammond.com>
2024-09-25 17:19:20 +04:00
Igor Alexandrov 098f1855e2 Added back accidentially removed new line 2024-09-25 12:11:45 +04:00
Igor Alexandrov 88351312bf Added app_port example to the proxy section 2024-09-25 11:25:42 +04:00
David Heinemeier Hansson 4a13803119 Bump version for 2.0.0.rc3 v2.0.0.rc3 2024-09-23 16:48:07 -07:00
David Heinemeier Hansson bda252835b Merge pull request #966 from basecamp/cleanup-default-templates
Bring default templates up to par with what Rails generates
2024-09-24 01:46:09 +02:00
David Heinemeier Hansson 0f5dfa204f Rearrange one last time 2024-09-23 16:44:54 -07:00
David Heinemeier Hansson 9dde204480 Rearange 2024-09-23 16:30:16 -07:00
David Heinemeier Hansson b6cd4f8070 Bring default templates up to par with what Rails generates 2024-09-23 14:41:31 -07:00
David Heinemeier Hansson e71bfcbadd Bump version for 2.0.0.rc2 v2.0.0.rc2 2024-09-20 15:41:26 -07:00
David Heinemeier Hansson 567309596a Make the skip of timestamps a boolean 2024-09-20 12:50:46 -07:00
David Heinemeier Hansson b89ec2bf63 Bump version for 2.0.0.rc1 v2.0.0.rc1 2024-09-20 11:08:45 -07:00
David Heinemeier Hansson 3172adca30 Merge pull request #958 from basecamp/optional-timestamps
Add option to skip timestamps on logging output
2024-09-20 18:01:14 +02:00
David Heinemeier Hansson 04d21f45bb Fix test 2024-09-20 08:45:40 -07:00
David Heinemeier Hansson eabd57350c Fix tests 2024-09-20 08:33:14 -07:00
David Heinemeier Hansson 487f6f5f53 Fix excess spacing 2024-09-20 08:31:56 -07:00
David Heinemeier Hansson d98500982d Update tests 2024-09-20 08:19:38 -07:00
David Heinemeier Hansson 8693e968c1 Timestamps now default on for app logs too 2024-09-20 08:17:19 -07:00
David Heinemeier Hansson 6ab5fc9459 Allow timestamps on/off for app logging too 2024-09-20 08:04:28 -07:00
David Heinemeier Hansson 6fc2915884 Merge branch 'main' into optional-timestamps 2024-09-20 07:58:49 -07:00
David Heinemeier Hansson afa6898a82 Fix pipe 2024-09-20 07:58:38 -07:00
David Heinemeier Hansson 384b36d158 Add option to skip timestamps on logging output
So it is easier to follow live when you are doing debugging, especially
early days app setup when you are the only user.
2024-09-20 07:42:31 -07:00
Donal McBreen 6df169a4fb Doc updates 2024-09-20 15:27:10 +01:00
Donal McBreen ab109afc52 Merge pull request #957 from basecamp/numeric-timeouts
Response timeout should be a number
2024-09-20 09:50:05 +01:00
Donal McBreen a6a48c456c 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.
2024-09-20 09:26:06 +01:00
David Heinemeier Hansson a4e5dbe5d4 Bump version for 2.0.0.beta2 v2.0.0.beta2 2024-09-19 11:37:22 -07:00
Donal McBreen 56e90906b1 Merge pull request #954 from basecamp/two-app-integration-test
Integration test two apps
2024-09-19 16:36:45 +01:00
Donal McBreen 6e65968bdc Integration test two apps
Use localhost for app_with_roles and 127.0.0.1 for app. Confirm we can
deploy both and the respond to requests. Ensure the proxy is removed
once both have been removed.
2024-09-19 16:25:09 +01:00
Donal McBreen 85f1e14b97 Merge pull request #953 from basecamp/inherit-env-for-secrets
Avoid setting env via SSHKit
2024-09-19 15:18:31 +01:00
Donal McBreen 2c829a4824 Avoid setting env via SSHKit
SSHKit puts the env in the command, so leaks them in process listings.
2024-09-19 15:09:17 +01:00
Donal McBreen 45a58f7e15 Merge pull request #952 from basecamp/app-exec-in-kamal-network
Run app exec in the kamal network
2024-09-19 14:46:58 +01:00
Donal McBreen 834b343ded Run app exec in the kamal network
All other containers run in the kamal network, so let's add app exec-ed
containers as well.
2024-09-19 14:29:33 +01:00
Donal McBreen 9fe1821cae Merge pull request #951 from basecamp/proxy-config-ownership
Fix /home/kamal-proxy/.config/kamal-proxy ownership
2024-09-19 12:57:10 +01:00
Donal McBreen 1d7c9fec1d Fix /home/kamal-proxy/.config/kamal-proxy ownership
1. Update to kamal-proxy 0.4.0 which creates and chowns
/home/kamal-proxy/.config/kamal-proxy to kamal-proxy
2. Use a docker volume rather than mapping in a directory, so docker
keeps it owned by the correct user
2024-09-19 12:25:57 +01:00
David Heinemeier Hansson a6b983de06 Bump version for 2.0.0.beta1 v2.0.0.beta1 2024-09-18 15:33:21 -07:00
Donal McBreen 3ec4ad2ea5 Merge pull request #949 from basecamp/role-proxy-config
Allow role specific proxy config
2024-09-18 18:27:36 +01:00
Donal McBreen 63f854ea18 Add validations for host/ssl roles
Roles with SSL can only have one server.
Two roles with SSL can't use the same host.
2024-09-18 17:42:45 +01:00
Donal McBreen fd0cdc1ca1 All role specific proxy configuration
By default only the primary role runs the proxy. To disable the proxy
for that role, you can set `proxy: false` under it.

For other roles they default to not running the proxy, but you can
enable it by setting `proxy: true` for the role, or alternatively
setting a proxy configuration.

The proxy configuration will be merged into the root proxy configuration.
2024-09-18 17:25:35 +01:00
Donal McBreen d218264b69 Doc output fixes 2024-09-18 15:28:26 +01:00
Donal McBreen 684f7ac148 Merge pull request #948 from basecamp/deploy-drain-timeouts
Simplified deploy/drain timeouts
2024-09-18 15:18:00 +01:00