Commit Graph

13432 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
b28e4e552b test: align git:report --global assertion with rendered key 2026-04-29 10:31:01 -04:00
Jose Diaz-Gonzalez
8282981361 feat: accept --global on :report subcommands
Every `:report` subcommand now recognizes `--global` as a scope selector that limits the report to globally-configured properties, including in JSON form via `--global --format json`. Previously this combination was rejected because `--global` was treated as an info flag, conflicting with `--format`. The shared `common.ParseReportArgs` helper now returns a `ReportArgs` struct exposing the parsed scope; each Go and bash report selects a global-only flag map when scope is global, and skips per-app verification.
2026-04-29 10:30:59 -04:00
Jose Diaz-Gonzalez
ec70e10c5d Merge pull request #8528 from dokku/6998-dokku-ps-retire-or-cron-job-trying-to-retire-running-app
Skip retiring images still in use by app containers
2026-04-29 10:28:18 -04:00
Jose Diaz-Gonzalez
63958b99ef Merge pull request #8537 from dokku/dependabot/go_modules/plugins/scheduler-k3s/github.com/traefik/traefik/v2-2.11.44
chore(deps): bump github.com/traefik/traefik/v2 from 2.11.43 to 2.11.44 in /plugins/scheduler-k3s
2026-04-29 10:26:16 -04:00
dependabot[bot]
3267cb2ac8 chore(deps): bump github.com/traefik/traefik/v2
Bumps [github.com/traefik/traefik/v2](https://github.com/traefik/traefik) from 2.11.43 to 2.11.44.
- [Release notes](https://github.com/traefik/traefik/releases)
- [Changelog](https://github.com/traefik/traefik/blob/v2.11.44/CHANGELOG.md)
- [Commits](https://github.com/traefik/traefik/compare/v2.11.43...v2.11.44)

---
updated-dependencies:
- dependency-name: github.com/traefik/traefik/v2
  dependency-version: 2.11.44
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-29 14:24:21 +00:00
Jose Diaz-Gonzalez
cf5807c157 Merge pull request #8529 from dokku/fix-netrc-bug
chore: bump dokku/netrc to v0.11.0
2026-04-29 09:02:22 -04:00
Jose Diaz-Gonzalez
73238b7c97 Merge pull request #8524 from dokku/7827-pre-validate-the-nginx-conf-prior-to-starting-a-deploy
Pre-validate custom nginx.conf.sigil during core-post-extract
2026-04-29 08:47:56 -04:00
Jose Diaz-Gonzalez
ab804c678a test: assert dead-images grep result instead of count
The previous assertion piped grep -c through `|| echo 0`, which printed an extra `0` when the file existed without matches because grep -c emits the count of `0` and exits 1, triggering the fallback.
2026-04-29 08:19:54 -04:00
Jose Diaz-Gonzalez
40b8b25ad4 Merge pull request #8525 from dokku/8242-cron-run-and-dokku-run-fail-on-cnb-pack-images-since-0-37-fix
Add launcher entrypoint for CNB images on dokku run and cron:run
2026-04-29 08:15:24 -04:00
Jose Diaz-Gonzalez
f4a1559edc chore: bump dokku/netrc to v0.11.0
The `git:auth` test in `tests/unit/git_3.bats` verifies the written entry with `netrc get --netrc-file ${DOKKU_ROOT}/.netrc github.com`, but the `--netrc-file` flag was added in netrc v0.11.0 and CI was still pinned to v0.10.3, so the assertion ran against root's `~/.netrc` and exited 1.
2026-04-29 06:09:07 -04:00
Jose Diaz-Gonzalez
3a7d74cdaa fix: ensure leading space when injecting --entrypoint launcher
The trigger output started with `--entrypoint` and relied on the caller
to provide a trailing space. `scheduler-deploy-process-container` does
that, but `scheduler-run` does not when `DOKKU_TRACE` is unset, so the
flag concatenated onto the previous arg as `--env=KEY--entrypoint`,
leaving `launcher` as the image positional argument and causing
`docker container create` to fail with `Unable to find image 'launcher:latest'`.
Match the leading-space convention used by the other docker-args triggers
(`config/docker-args-run`, `builder-herokuish/docker-args-run`).
2026-04-29 05:48:43 -04:00
Jose Diaz-Gonzalez
effa9d37cf fix: add launcher entrypoint for CNB images on dokku run and cron:run
The scheduler-run script classified CNB-based images as `herokuish` because
`is_image_herokuish_based` returns true for them, which caused the
`docker-args-process-run` trigger for builder-pack to skip injecting
`--entrypoint launcher`. Without that flag the container fell back to the
image entrypoint (`/cnb/process/web`) and dropped the user-supplied
arguments. Mirror the deploy-side detection so CNB images set
`IMAGE_SOURCE_TYPE=pack`, allowing the launcher entrypoint to be added.
2026-04-29 05:39:56 -04:00
Jose Diaz-Gonzalez
d88e8f137f fix: skip retiring images still in use by app containers
When ps:rebuild runs against an image-based deploy via git:from-image, the resulting image often shares the same SHA as the previous deployment, so retiring the old container's image would target the live image of the new container. The retirement is now skipped when another running container of the same app still references the image, and the cron retire loop self-heals previously stuck entries the next time it encounters them.
2026-04-29 05:36:04 -04:00
Jose Diaz-Gonzalez
ec7841a07b fix: inject placeholder listener for pre-validation upstream blocks
When pre-validating a custom nginx.conf.sigil before the build phase, no app listeners exist yet on first deploys. Templates that emit `proxy_pass http://app-port` while gating the matching upstream block on `DOKKU_APP_WEB_LISTENERS` render an undefined upstream, causing `nginx -t` to fail with "host not found in upstream". Pre-validation now passes a `127.0.0.1:5000` placeholder for `DOKKU_APP_WEB_LISTENERS` so the upstream block emits a static server entry and the template can be validated for syntax without depending on live listeners.
2026-04-29 05:12:05 -04:00
Jose Diaz-Gonzalez
63b809f64c feat: pre-validate custom nginx.conf.sigil during core-post-extract
Renders the user-supplied nginx.conf.sigil via sigil into a tmp file and runs `nginx -t` against a wrapped copy as soon as the template is extracted from the source tree, so syntactically invalid templates abort the deploy before the build phase runs. Skipped when `proxy-type` is not `nginx`, when `disable-custom-config=true`, or when no custom template was extracted. Closes #7827.
2026-04-29 05:01:25 -04:00
Jose Diaz-Gonzalez
9b6c32f39c Merge pull request #8516 from dokku/2441-process-scoped-docker-options
Scope docker-options to specific procfile processes
2026-04-29 04:45:23 -04:00
Jose Diaz-Gonzalez
9a795fcf91 test: cover migration via go unit test
The bats test for migration idempotency invoked the install binary directly via sudo, which kept hitting fresh missing env vars on each iteration (DOKKU_LIB_ROOT, then PLUGIN_PATH, etc). The dokku launcher script exports a chain of vars that the install path reads via common.MustGetEnv, and mirroring that chain in a bats test is fragile. Migration is pure file IO plus a property marker - perfect for a Go unit test that isolates itself with t.TempDir and t.Setenv. The new test covers parsing comments and blank lines, the marker-based no-op on re-run, and the rule that a manually re-created legacy file is left untouched after the marker is set.
2026-04-29 03:14:17 -04:00
Jose Diaz-Gonzalez
d1213c14a8 test: relax default-scope assertions and pass env to install
The ps plugin auto-adds --restart=on-failure:10 to the default deploy scope on app create, so docker-options:list --phase deploy is never empty for a freshly-created app. Switch the default-scope assertions from exact-match to contains/not-contains so the auto-injected restart line stops causing false failures. The migration test invoked the install binary directly via sudo, but DOKKU_LIB_ROOT is normally exported by the dokku launcher script and isn't set in that subprocess; pass it (and DOKKU_ROOT) explicitly.
2026-04-29 02:34:30 -04:00
Jose Diaz-Gonzalez
d51726b7cb Merge pull request #8522 from dokku/fix-keda-scaling
Only emit keda fallback when a non-cpu/memory trigger exists
2026-04-29 02:27:03 -04:00
Jose Diaz-Gonzalez
177eac4ef1 Merge pull request #8517 from dokku/6833-send-sigterm-immediately-to-old-containers-when-deploying-via-docker-local
Send SIGTERM to old containers immediately on deploy
2026-04-29 01:50:35 -04:00
Jose Diaz-Gonzalez
f728fc8cd7 fix: only emit keda fallback when a non-cpu/memory trigger exists
Keda 2.17+ rejects ScaledObjects whose spec.fallback is set unless at least one trigger is not a cpu or memory scaler, so unconditionally emitting fallback broke deploys for apps autoscaled on cpu or memory alone. The chart now skips the fallback block when every configured trigger is cpu or memory and keeps the existing behavior otherwise.
2026-04-29 01:10:34 -04:00
Jose Diaz-Gonzalez
8a6c853ccd Merge pull request #8515 from dokku/fix-vector-data-dir
Fix vector mount directory config
2026-04-29 00:36:40 -04:00
Jose Diaz-Gonzalez
97b86707e7 fix: docker-options:list flag parsing and ci test fixes
The :list subcommand had `SetInterspersed(false)` which forced flags to come before positional arguments; in practice users invoke it as `docker-options:list <app> --process X --phase Y`. Drop the non-interspersed setting so flags can appear after the app name. Two existing buildpacks/dockerfile tests appended directly to the legacy `DOCKER_OPTIONS_DEPLOY` file - that path is no longer the source of truth, so switch them to `docker-options:add`. The new migration test invoked `dokku plugin:trigger install` which fans out to every plugin and trips on unrelated permission errors; call the docker-options install binary directly instead. Tighten the report and JSON assertions to match the actual output format (`.` becomes a space in the display key, and JSON values may concatenate options).
2026-04-29 00:35:26 -04:00
Jose Diaz-Gonzalez
c424cb06c2 Merge pull request #8520 from dokku/dependabot/pip/docs/_build/packaging-26.2
chore(deps): bump packaging from 26.1 to 26.2 in /docs/_build
2026-04-29 00:28:22 -04:00
dependabot[bot]
32c997e4a7 chore(deps): bump packaging from 26.1 to 26.2 in /docs/_build
Bumps [packaging](https://github.com/pypa/packaging) from 26.1 to 26.2.
- [Release notes](https://github.com/pypa/packaging/releases)
- [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pypa/packaging/compare/26.1...26.2)

---
updated-dependencies:
- dependency-name: packaging
  dependency-version: '26.2'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-28 13:54:14 +00:00
Jose Diaz-Gonzalez
1161dda05e feat: send SIGTERM to old containers immediately on deploy
The docker-local scheduler now sends `SIGTERM` to old containers immediately after a successful deploy via `docker container kill --signal=SIGTERM`, rather than waiting `wait-to-retire` seconds before signaling. This matches Heroku's graceful-shutdown contract and lets applications begin draining in-flight work as soon as proxy traffic switches. The existing `wait-to-retire` grace period and `stop-timeout-seconds` hard-stop continue to apply unchanged as the authoritative cleanup path.
2026-04-27 18:18:39 -04:00
Jose Diaz-Gonzalez
9c8d5f54fb feat: scope docker-options to specific procfile processes
Adds a `--process` flag (repeatable) to docker-options:add/remove/clear/list and the new docker-options:list subcommand for querying a single process+phase pair. Process scoping is supported only for the deploy phase since build runs once per app and run covers ad-hoc commands and cron tasks where no Procfile process type is available. Storage moves from `$DOKKU_ROOT/$APP/DOCKER_OPTIONS_*` files to property lists under `/var/lib/dokku/config/docker-options/$APP/{processType}.{phase}`, with `_default_` as the sentinel for app-wide options. The install trigger migrates pre-existing DOCKER_OPTIONS_* files into property lists once and renames them to `.migrated`; a global marker makes re-runs strictly no-op. The legacy docker-args-{build,deploy,run} bash triggers are reimplemented in Go alongside a new docker-args-process-deploy trigger that surfaces per-process options to the scheduler. The :report command exposes one dynamic flag per configured `process.deploy` pair (e.g. `--docker-options-deploy.web`) and supports `--format json`. There is no `--global` flag; omitting `--process` keeps the historical default behaviour, since `--global` elsewhere in dokku means "across all apps". Closes #2441.
2026-04-27 18:12:52 -04:00
Jose Diaz-Gonzalez
c0f23528af fix: just use an emptyDir
Let vector decide how to handle the directory.
2026-04-27 17:53:23 -04:00
Jose Diaz-Gonzalez
f19227dcd9 Merge pull request #8514 from dokku/migrate-docker-options-to-go
Migrate docker-options subcommands to go
2026-04-27 17:29:22 -04:00
Jose Diaz-Gonzalez
9767f996c6 Merge pull request #8509 from dokku/7309-nginx-default-site-038
Ship default catch-all site on fresh apt install
2026-04-27 17:11:57 -04:00
Jose Diaz-Gonzalez
acf841606c Merge pull request #8510 from dokku/dependabot/pip/docs/_build/packaging-26.2
chore(deps): bump packaging from 26.1 to 26.2 in /docs/_build
2026-04-27 16:09:24 -04:00
Jose Diaz-Gonzalez
8e7d158ac2 chore: revert transforms changes 2026-04-27 16:06:45 -04:00
Jose Diaz-Gonzalez
5dcefe7ffa fix: use extraVolumeMount just for the vector state 2026-04-27 16:06:07 -04:00
Jose Diaz-Gonzalez
87dd39e0b3 refactor: collect docker-options file helpers in functions.go
Moves `copyPhaseFile` and `removePhaseFile` next to the other phase-file helpers so the package keeps a single home for filesystem plumbing.
2026-04-27 15:58:40 -04:00
Jose Diaz-Gonzalez
b397cf1bd7 test: pass deploy phase to docker-options:add in udp test
The single-udp network test was calling `docker-options:add $TEST_APP -p 1194:1194` without a phase argument. The bash subcommand silently no-op'd because `-p` is not a recognized phase, so the test happened to pass even though it was not actually setting the option. The go port surfaces the validation error correctly, so the test now needs the proper `deploy` phase to keep working.
2026-04-27 15:58:35 -04:00
Jose Diaz-Gonzalez
eaaf0e41c2 fix: clear auto-detected port maps when re-enabling vhost
Re-enabling vhost on an app that was previously deployed with no global VHOST left the auto-assigned random high port behind in the ports plugin's `map-detected` property, so nginx kept listening on that port and the new catch-all default vhost rejected requests for the app's own domain on port 80.
2026-04-27 15:43:33 -04:00
Jose Diaz-Gonzalez
af6267f3b5 fix: restore default domains and reset proxy ports on vhost enable
Re-enabling vhost (via `proxy:enable`, `domains:enable`, or `domains:add` with no global VHOST) was leaving the app pinned to the random high port and the empty VHOST file from the previous disabled state, so the new catch-all vhost intercepted requests for the app's domain. The `domains-enable` trigger now restores default vhosts via `domains_enable`, and `pre-enable-vhost` clears any stored proxy ports so they can be recomputed to 80/443. Also fixes the netrc lookup in the `git:auth` test to read dokku's netrc file directly.
2026-04-27 14:43:20 -04:00
Jose Diaz-Gonzalez
b2ea5406fe fix: remove sites-enabled default instead of renaming
Renaming `/etc/nginx/sites-enabled/default` to `.dokku-disabled` left a broken symlink that nginx's `include /etc/nginx/sites-enabled/*;` glob still picked up, breaking config validation. Files inside `sites-enabled/` are now removed; the real config in `sites-available/default` is still preserved via rename.
2026-04-27 14:43:20 -04:00
Jose Diaz-Gonzalez
d7c88ae298 feat: ship default catch-all site on fresh apt install
Fresh apt installs now drop a catch-all server block at `/etc/nginx/conf.d/00-default-vhost.conf` that uses `ssl_reject_handshake on` and `return 444` to drop requests with unknown Host headers. Conflicting upstream nginx default vhosts are renamed to `*.dokku-disabled` rather than deleted, preserving any local edits. The new `dokku/install_default_site` debconf flag opts out of the install. Upgrades leave existing nginx config untouched.
2026-04-27 14:43:20 -04:00
Jose Diaz-Gonzalez
a4f26a356a feat: add nginx:reload command
Reloads the nginx server config after validating it with `nginx -t`. Useful for picking up changes to globally managed nginx configs without restarting the running process.
2026-04-27 14:43:20 -04:00
Jose Diaz-Gonzalez
099c358a1e fix: set the defaultVolumeMounts instead of using extraVolumeMounts
Without this, the daemonset will inject customConfig.data_dir as a default mount, which will collide with extraVolumeMounts.
2026-04-27 14:27:05 -04:00
Jose Diaz-Gonzalez
e4a8cfc74f Merge pull request #8402 from dokku/upgrade-keda
Upgrade keda to 2.19.0 and keda-add-ons-http to 0.12.2
2026-04-27 14:12:37 -04:00
Jose Diaz-Gonzalez
4eb42f1b82 refactor: migrate docker-options subcommands to go
Ports the user-facing CLI subcommands and lifecycle triggers from bash to go, mirroring the layout used by the ports plugin. The on-disk format (`DOCKER_OPTIONS_BUILD/DEPLOY/RUN` files), the `docker-args-build/deploy/run` triggers, and every exported helper consumed by other plugins are unchanged. Reserves the `--process` and `--global` flags on add, remove, and clear so usage today exits with a not-yet-implemented error and the surface is locked in ahead of the process-scoping work tracked in #2441.
2026-04-27 14:11:37 -04:00
dependabot[bot]
d356ee6847 chore(deps): bump packaging from 26.1 to 26.2 in /docs/_build
Bumps [packaging](https://github.com/pypa/packaging) from 26.1 to 26.2.
- [Release notes](https://github.com/pypa/packaging/releases)
- [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pypa/packaging/compare/26.1...26.2)

---
updated-dependencies:
- dependency-name: packaging
  dependency-version: '26.2'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-27 17:15:21 +00:00
Jose Diaz-Gonzalez
da13367ca8 feat: add version-aware helm chart upgrade callbacks
Some helm chart upgrades require side-effects that a plain `helm upgrade` cannot perform, such as deleting deployments whose immutable selectors changed. Charts may now register pre and post upgrade hooks against a target version; applicable hooks fire in ascending semver order, each bracketed around an upgrade to its version, with a final upgrade to the chart's configured version when needed. The new `keda-add-ons-http` 0.12.2 hook deletes the chart-managed deployments before the upgrade so the new selectors take effect cleanly.
2026-04-27 07:57:38 -04:00
Jose Diaz-Gonzalez
db1308a2ab feat: upgrade keda to 2.19.0 and keda-add-ons-http to 0.12.2
While there are breaking changes in the addon, none of these impact how Dokku exposes the addon.
2026-04-27 07:32:38 -04:00
Jose Diaz-Gonzalez
b92310c4c8 Merge pull request #8508 from dokku/8230-renaming-app-clears-the-set-domain
Preserve all domains when renaming an app
2026-04-27 07:19:48 -04:00
Jose Diaz-Gonzalez
b17eaedbec Merge pull request #8507 from dokku/fix-8497-orphaned-containers-on-scale-down
Retire orphaned containers when scaling down
2026-04-27 07:19:36 -04:00
Jose Diaz-Gonzalez
bc603d7b9c test: drain dead-containers before scale-up assertion
The intermediate container count check raced with the existing
zero-downtime retire of the previous container, so docker ps still
saw the renamed-but-pending container until wait-to-retire elapsed.
2026-04-27 03:29:06 -04:00
Jose Diaz-Gonzalez
4927ca092d fix: retire orphaned containers when scaling down
When scaling a process type to a smaller count, the indices above the
new count had their `CONTAINER.<proctype>.<idx>` state files deleted but
the underlying Docker containers were never registered for retirement,
so they remained running indefinitely. The cleanup block now reads each
orphaned state file and registers its container id with the existing
`scheduler-register-retired` trigger before the file is removed.
2026-04-27 03:23:15 -04:00