Commit Graph

362 Commits

Author SHA1 Message Date
Donal McBreen
8a7260d1e9 Merge pull request #1531 from acidtib/feat/custom-ssl
feat: Add support for custom certificates
2025-06-17 09:25:15 +01:00
Donal McBreen
054a85d3c0 Merge pull request #916 from nickhammond/buildpacks
Add pack option to the builder options for cloud native buildpacks
2025-06-16 08:57:27 +01:00
Donal McBreen
a201a6ca68 Merge pull request #1544 from prullmann/kamal-exec-piping
Allow piping into kamal exec #1485
2025-06-16 07:52:03 +01:00
Nick Hammond
487aa306c9 Merge branch 'basecamp:main' into buildpacks 2025-05-23 10:59:05 -07:00
Donal McBreen
b387df0e4f KAMAL_HOST env var mop-up
- Ensure tests pass
- Switch from -e to --env everywhere
- Check KAMAL_HOST env var in integration tests
2025-05-20 14:10:50 +01:00
Dainel Vera
99f763d742 Merge branch 'main' into feat/custom-ssl 2025-05-19 15:38:33 -06:00
Peter Rullmann
d62c35e63e Add UT for new interactive behaviour
also adding helpers to simulate STDIN being tty or file
2025-05-08 20:24:50 +02:00
Nick Hammond
68404e2673 Merge branch 'basecamp:main' into buildpacks 2025-05-08 02:34:40 -07:00
Donal McBreen
1ea5d0bd86 Allow kamal-proxy run command options to be set
Allow --metrics_port and --debug options to be set via the boot config.

--metrics_port support will come in kamal-proxy v0.8.8, so this option
doesn't work right now.

This will be updated before the next Kamal release though and we can add
integration tests for the metrics at that point.
2025-05-06 12:11:48 +01:00
acidtib
9219b87630 remove chown for TLS certificates in proxy container 2025-04-29 19:57:41 -06:00
acidtib
045410368d add support for custom certificates 2025-04-26 01:03:15 -06:00
Donal McBreen
128294672d Extract Kamal::Configuration::Proxy::Boot
This is for boot time configuration for the kamal proxy. Config in here
doesn't not belong in Kamal::Configuration::Proxy which is for deploy
time configuration for the app itself.

Kamal apps don't contain boot time config, because multiple apps can
share a proxy and the config could conflict.
2025-04-23 16:16:12 +01:00
Donal McBreen
d26b3f1768 Create the .kamal/proxy/apps-config directory
Manually create it to avoid ownership issues when docker creates it
for you.
2025-04-22 15:18:54 +01:00
Donal McBreen
63f65d60c6 Escape the audit line
Makes it compatible with zsh.
2025-04-22 08:26:51 +01:00
Nick Hammond
045da87219 Merge branch 'basecamp:main' into buildpacks 2025-04-21 09:33:40 -07:00
Donal McBreen
93d1bd1369 Redirect buildx build output to stdout
Docker buildx build outputs the build logs to stderr by default.
SSHKit displays stderr logs in red, which can suggest that an error has
occurred.

Redirect the output to stdout, so it shows in green. If there is an
error, the output will be repeated in red anyway.

Fixes: https://github.com/basecamp/kamal/issues/1356
2025-04-21 10:19:36 +01:00
Nick Hammond
fc67cdea33 Merge branch 'basecamp:main' into buildpacks 2025-04-18 07:47:38 -07:00
Donal McBreen
354530f3b8 Maintenance mode
Adds support for maintenance mode to Kamal.

There are two new commands:
- `kamal app maintenance` - puts the app in maintenance mode
- `kamal app live` - puts the app back in live mode

In maintenance mode, the kamal proxy will respond to requests with a
503 status code. It will use an error page built into kamal proxy.

You can use your own error page by setting `error_pages_path` in the
configuration. This will copy any 4xx.html or 5xx.html files from that
page to a volume mounted into the proxy container.
2025-04-17 09:11:21 +01:00
Donal McBreen
26b6c072f3 Add a writable proxy volume
Maps in and external /home/kamal-proxy/.app-config volume that we can
use to map files to the proxy.

Can be used to store custom maintenance pages or SSL certificates.
2025-04-17 09:08:36 +01:00
Donal McBreen
85320dbc51 Custom proxy image registry, repo and version
Use the --registry, --repository and --image_version options of
`kamal proxy boot_config set` to change the kamal-proxy image used.

We'll still insist that the image version is at least as high as the
minimum.
2025-04-16 16:54:46 +01:00
Nick Hammond
38cfc4488b Merge branch 'basecamp:main' into buildpacks 2025-03-28 11:47:43 -07:00
Donal McBreen
7fa27faaca Use xargs to handle spaces in proxy options
We cat the options file, append the proxy image and then pass it
to xargs to ensure it handles spaces correctly.

Works better than using eval which can handle spaces but tries
to evaluate things like backticks.

Fixes: https://github.com/basecamp/kamal/issues/1448
2025-03-18 08:46:31 +00:00
Nick Hammond
f8f7c6ec57 Catch up with 2.5.1 2025-02-06 07:12:05 -07:00
Mike Dalessio
2127f1708a feat: Introduce a build dev command
which will build a "dirty" image using the working directory.

This command is different from `build push` in two important ways:

- the image tags will have a suffix of `-dirty`
- the export action is "docker", pushing to the local docker image store

The command also supports the `--output` option just added to `build
push` to override that default.

This command is intended to allow developers to quickly iterate on a
docker image built from their local working directory while avoiding
any confusion with a pristine image built from a git clone, and
keeping those images on the local dev system by default.
2025-01-20 18:52:21 -05:00
Mike Dalessio
24e4347c45 feat: Introduce a build push --output option
which controls where the build result is exported.

The default value is "registry" to reflect the current behavior of
`build push`.

Any value provided to this option will be passed to the `buildx build`
command as a `--output=type=<VALUE>` flag.

For example, the following command will push to the local docker image
store:

    kamal build push --output=docker

squash
2025-01-20 18:37:15 -05:00
Nick Hammond
95b606a427 Catch up with main 2025-01-20 09:53:16 -07:00
Donal McBreen
2c9bba3f88 Merge branch 'main' into feature/docker-build-cloud 2025-01-17 15:49:28 +00:00
Donal McBreen
5bd9bc8576 Merge pull request #1320 from ShPakvel/add_optional_accessory_registry
[Feature] Registry for accessory
2025-01-17 15:18:50 +00:00
Matthew Jones
b420b2613d Adds support for Docker Build Cloud 2025-01-17 07:14:31 -07:00
Donal McBreen
2cdca4596c Create but don't run the assets container
We don't need to run the assets container to copy the assets out,
instead we can just create, copy and remove.
2025-01-16 16:28:02 +00:00
Pavel Shpak
b5aee11a40 [Feature] Add optional accessory registry.
Add test cases to cover new option.
2024-12-22 02:50:53 +02:00
Donal McBreen
fbc4515888 Merge pull request #906 from aliismayilov/detached-run
Allow running detached app commands and follow logs by container ID
2024-12-02 10:22:45 +00:00
Donal McBreen
99829092b3 Merge pull request #1229 from matjack1/use-ssh-keys-when-executing-commands
[FIX] - Make kamal use ssh keys from config when performing commands
2024-12-02 09:59:03 +00:00
Nick Hammond
9f6660dfbf Catch up with main 2024-11-26 07:36:54 -07:00
Igor Alexandrov
f52826b2d6 Updated accessory proxy to support hosts option 2024-11-21 22:23:56 +04:00
Igor Alexandrov
4d8241ebab Fixed kamal-proxy remove command 2024-11-21 22:23:56 +04:00
Igor Alexandrov
86657b0172 Fixed kamal-proxy remove command 2024-11-21 22:23:56 +04:00
Igor Alexandrov
aa2906086a Added host to the expected accessory deploy command result 2024-11-21 22:23:56 +04:00
Igor Alexandrov
f4b7c886fb Added tests for accessory deploy and remove commands 2024-11-21 22:23:56 +04:00
Ali Ismayilov
75b44cd328 Capture logs for specific container_id 2024-11-21 18:54:34 +01:00
Ali Ismayilov
183fe9e06e Follow logs of a specific container 2024-11-21 18:05:56 +01:00
Ali Ismayilov
1da882bb01 Enable logging on app exec new containers 2024-11-21 18:05:55 +01:00
Ali Ismayilov
dbe0c3a7f8 Allow running detached app commands
this is useful for long running rake tasks or scripts
that can be run without having to keep open connection to the server.

Example:
```
kamal app exec 'bin/rails db:backfill_task' --detach
```
2024-11-21 18:05:55 +01:00
Federico
3fa9cd5a41 Make kamal use ssh keys from config when performing commands 2024-11-19 11:38:42 +01:00
Matthew Jones
c970ceebe3 Adds support for SBOM attestations 2024-11-18 13:01:53 -07:00
Donal McBreen
e9ba92386c Filter correctly for empty destinations
An empty destination should only filter container with empty
destination, not pick up all containers.

Fixes: https://github.com/basecamp/kamal/issues/1184
2024-11-04 11:05:24 +00:00
Nick Hammond
9ac3d57b29 Add default creation time to now for image 2024-10-30 06:25:12 -07:00
Nick Hammond
cde5c7abbf Catch up with main 2024-10-28 08:26:40 -07:00
Donal McBreen
57d582e3bc Merge pull request #972 from kohkimakimoto/dev-provenance-flag
Add provenance option
2024-10-23 14:07:19 +01:00
Donal McBreen
bd8c35b194 Merge pull request #1020 from igor-alexandrov/network-args
Allow to override network
2024-10-23 12:22:36 +01:00