Commit Graph

214 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
1ee462dc3c docs: document nginx validate-config load_module override
The nginx deploy-time pre-validation runs `nginx -t` against a minimal wrapper that omits the global `load_module` directives, so a custom `nginx.conf.sigil` using a directive from a dynamically loaded module fails validation even though it is valid against the running server. Document overriding the `validate-config` template through the `nginx-app-template-source` trigger as the supported workaround.
2026-07-07 23:33:59 -04:00
Jose Diaz-Gonzalez
460d92e21c feat: expose certs-set and certs-remove plugin triggers
Adds `certs-set` and `certs-remove` plugin triggers so other plugins can install or remove an app's SSL cert/key pair without shelling out to the `dokku certs:add` / `dokku certs:remove` subcommands. Shared implementations live as `fn-certs-set` and `fn-certs-remove` in `plugins/certs/internal-functions`, with the subcommands and the new triggers calling `verify_app_name` before delegating.
2026-05-12 18:37:06 -04:00
Jose Diaz-Gonzalez
58042b9330 feat: delegate storage:exec to scheduler plugins, harden the flow
Moves the actual exec out of the storage plugin and into a new scheduler-storage-exec plugn trigger. scheduler-docker-local does docker run with TTY-aware -it/-i selection and --user derived from entry.Chown; scheduler-k3s creates a throwaway Pod via the kubernetes API, waits for it to reach Running with structured error reporting (ImagePullBackOff and friends are surfaced from the container status verbatim, no kubectl involvement), execs the user command via the existing SPDY plumbing in k8s.go, and deletes the Pod on the way out. (Entry).Validate now accepts either an absolute path or a docker named-volume token for docker-local entries so the migration synthesizer's named-volume legacy entries work cleanly. storage:exec gains --as-user for one-off uid overrides, propagates the underlying tool's exit code via os.Exit, and detects TTY/interactive mode from os.Stdin so non-interactive scripted use no longer trips over docker's input-device-is-not-a-tty error.
2026-04-29 23:29:30 -04:00
Jose Diaz-Gonzalez
d75228f165 fix: storage:list reads from attachments, deprecate storage-list trigger
storage:list was calling the storage-list plugn trigger which read -v lines from docker-options. After the install-time migration drains those lines into the attachment store, that source is empty for every migrated app and for any app that only ever used storage:create + storage:mount. The fix moves CommandList to call a new in-process ListAppMountEntries helper that reads attachments directly, surfaces the entry name in JSON output via a new entry_name field, and falls back to the entry name as the host token for k3s entries with no host path so the colon form remains well-formed. The storage-list plugn trigger is kept for back-compat with external callers but emits a deprecation warning and now reads from the same attachment-driven source.
2026-04-29 22:51:50 -04:00
Jose Diaz-Gonzalez
b601a626f5 docs: storage entries and migration guide for #6814
Updates persistent-storage.md to lead with the named storage entry workflow while keeping the legacy colon-form documentation intact, adds a Persistent storage section to the k3s scheduler doc, documents the storage-app-mounts, storage-create, storage-destroy, and storage-status triggers in plugin-triggers, and adds an entry to the 0.38.0 migration guide explaining the install-time migration of legacy mounts and the new DNS-1123 name validation. Bats coverage in tests/unit/storage.bats now exercises storage:create / list-entries / destroy, name validation rejections, multi-entry attachment, the destroy-while-mounted error, and the ensure-directory deprecation warning.
2026-04-29 14:54:15 -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
34c336c668 feat: add post-create support for env key in app.json
Closes #4498
2026-04-26 22:43:32 -04:00
Jose Diaz-Gonzalez
b8e8ea74ff feat: use certificates imported by certs plugin when deploying via scheduler-k3s
Closes #7257
2026-01-08 01:05:40 -05:00
Jose Diaz-Gonzalez
a6d65c821f feat: implement cron and one-off run task TTLs
Closes #7938
2025-11-18 16:46:31 -05:00
Jose Diaz-Gonzalez
3915d25d84 refactor: rename cron entry to cron task
This naming better suits what it is we are fetching.
2025-11-07 22:30:54 -05:00
Álvaro Justen (@turicas)
67311264d7 Implement domains:reset 2025-07-01 20:11:48 -04:00
Jose Diaz-Gonzalez
4ae9cca6f1 feat: implement app-json-is-valid plugin trigger 2025-06-19 02:20:02 -04:00
Jose Diaz-Gonzalez
398a78b2f6 refactor: move cron-write to scheduler-cron-write 2025-06-10 21:45:08 -04:00
Jose Diaz-Gonzalez
701b0cdb86 docs: use a cid-file in the plugin example 2025-04-14 14:10:22 -04:00
Jose Diaz-Gonzalez
611006af73 feat: add support for non-local nginx implementations
If the scheduler is not docker-local, we will assume that a separate plugin trigger will pull access/error logs on our behalf. For k3s, the naive implementation is to pull logs from a single container (multiple ingress-nginx pods will be supported in a future release).

Closes #7268
2024-10-17 00:18:24 -04:00
Jose Diaz-Gonzalez
1a07025e99 chore: deprecate the pre-deploy trigger in favor of the pre-release-builder trigger 2024-04-04 02:36:01 -04:00
crazehang
169d8a927e docs: fix some comments
Signed-off-by: crazehang <zhangrenzhong@outlook.com>
2024-04-03 17:28:12 +08:00
Jose Diaz-Gonzalez
c49322bd34 feat: manage vector container via compose
Using compose instead of manual docker calls allows folks to customize the vector container by using a custom compose.yml template file. This opens us up to more customizations while aligning container management with how we do other external containers (such as for the proxy plugins).

Refs #5784
2024-01-26 06:46:18 -05:00
Jose Diaz-Gonzalez
98d0a95ae6 feat: add a post-registry-login trigger
This allows other plugins to execute commands after a registry has been authenticated against.
2024-01-18 22:25:23 -05:00
Jose Diaz-Gonzalez
78d24ead09 feat: add the ability to specify the output format when listing ports 2024-01-18 22:00:53 -05:00
Pablo
7b209b01f0 docs: Fix app-exists plugin trigger description 2023-10-28 11:20:19 +02:00
Jose Diaz-Gonzalez
5e72bfabad Merge pull request #6283 from dokku/remove-deprecated-proxy-code
Remove deprecated proxy-ports functions and and plugin subcommands
2023-10-16 16:38:30 -04:00
Jose Diaz-Gonzalez
30b8a25ced feat: upgrade golang to 1.21 2023-10-16 01:10:02 -04:00
Jose Diaz-Gonzalez
126a3ed509 chore: remove deprecated proxy-ports functions and and plugin subcommands
These were deprecated in 0.31.0 in favor of the ports plugin.
2023-10-16 00:18:39 -04:00
Jose Diaz-Gonzalez
c23e878e7d feat: add the ability to specify a custom mailto for all cron output 2023-10-15 20:25:09 -04:00
Jose Diaz-Gonzalez
a433508fb1 chore: deprecate the builder-specific pre-build-* triggers in favor of a global pre-build trigger
The pre-build trigger takes a `BUILDER_TYPE` parameter, allowing folks to perform specific actions as needed.
2023-10-15 20:25:09 -04:00
Jose Diaz-Gonzalez
b19b409dd6 chore: deprecate the builder-specific post-build-* triggers in favor of a global post-build trigger
The pre-build trigger takes a `BUILDER_TYPE` parameter, allowing folks to perform specific actions as needed.
2023-10-15 20:25:09 -04:00
Jose Diaz-Gonzalez
cdd5698db9 chore: deprecate the builder-specific pre-release-* triggers in favor of a global pre-release-builder trigger
The pre-release-builder trigger takes a `BUILDER_TYPE` parameter, allowing folks to perform specific actions as needed.
2023-10-15 20:25:09 -04:00
Jose Diaz-Gonzalez
f433e008e9 Merge pull request #6129 from dokku/cleanup-markdown
Cleanup markdown and use Github Admonitions
2023-08-19 18:55:35 -04:00
Jose Diaz-Gonzalez
d61d91cf87 docs: use github admonitions
These still need to be properly parsed.
2023-08-19 14:24:12 -04:00
Jose Diaz-Gonzalez
5dd78e2b86 docs: update markdownlint rules for better formatting 2023-08-19 13:46:42 -04:00
Jose Diaz-Gonzalez
f58cf7f87c chore: add documentation for all events 2023-08-19 11:45:31 -04:00
Jose Diaz-Gonzalez
26e9cc9b8c feat: add support for non-web healthchecks via app.json
This change converts existing CHECKS files into a healthchecks key that is understood by 'docker-container-healthchecker'. This tool supports a number of different types of container healthchecks - command, http, uptime - and can perform healthchecks against non-web processes.

The use of the old CHECKS file is now deprecated, and will be removed in the next minor version. Users can use the 'docker-container-healthchecker' to convert existing CHECKS files to the new format automatically.

Closes #2760
2023-08-06 17:23:13 -04:00
Jose Diaz-Gonzalez
625ea14c8f feat: add openresty proxy implementation
This plugin is mostly compatible with the nginx plugin, but runs the proxy within a docker container. Users do not have direct access to add custom openresty configuration at this time, but instead receive the ability to setup automatic ssl on first request via letsencrypt integration.
2023-08-05 20:59:01 -04:00
Jose Diaz-Gonzalez
f8ccf52079 refactor: only use detected port mapping if override is not specified
Previously, we would always set the port mapping during a dockerfile build, making it difficult for users to override mappings. We also only _sometimes_ updated the detected port mapping, further confusing issues when users were migrating from Dockerfile to Buildpacks for builds.

Now, we always detect the port mapping during the build process, and only use that detected port mapping if an override is not specified. This greatly simplifies the experience around port mapping, as now a user can create an app, set a port mapping, and that first deploy will respect the port mapping without an additional deploy.

The builder always has the best context for what the app should be listening on, and thus we can always specify a "default" port mapping at this stage. Users can override this map as desired later.

This change also results in the removal of a ton of internal code that is now centralized in the ports plugin.

Closes #4067
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
4bc3de5540 feat: write auto-detected port mappings during a deploy
During an app build, we now auto-detect ports based on the source code. This is usually http:80:5000, with Dockerfile-based deploys having their ports extracted from the docker image or Dockerfile. Additionally, we add an https:443 mapping for any detected http:80 mapping when there is an ssl certificate, and all http port mappings are transformed to https mappings for Dockerfile-based deploys.

While the ports aren't currently consumed, a future refactor will provide the ability to fallback to the new detected ports when there is no user-specified port mapping.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
48d5820b8c refactor: deprecate proxy-configure-ports plugin trigger in favor of ports-configure
This also rewrites the logic to be in golang, which will make it easier to refactor portions of it to use the property system going forward.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
192f7cf768 refactor: move code for fetching an available port to the ports plugin
Also translate the code to golang.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
121e4737a8 refactor: move code that fetches raw tcp ports for dockerfile deploys to ports plugin 2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
87c4cb7230 docs: sort the plugin triggers 2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
1431724b85 feat: use ports-clear plugn trigger to manage clearing the port map
This removes any access to the underlying implementation for port map clearing, which will make it easier to refactor the actual clearing.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
b8680f7de7 fix: automatically clear the git source-image property when changing deployment methodologies
This ensures users don't have issues with cached state in regards to files pulled from the repo/image.

Also add missing docs for deploy-source-set trigger.

Closes #5963
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
914475f3e4 refactor: use ports-get plugn trigger for fetching port mappings
This removes use of ports internals from other plugins, which will make it easier to refactor the underlying property storage.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
eb6f85f083 feat: skip scaled processes that are missing in the Procfile
This allows folks to deploy apps that don't have a web process without needing to scale that process down before/after the first deploy. Note that the formations key in the app.json or a manual scale of other processes will be necessary to start anything non-web.

Closes #5700
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
64f0f2674d refactor: move all port management code to standalone ports plugin
This change makes interacting with port mappings more clear - folks might previously set the port mapping to the proxy type or vice-versa.

The existing proxy:ports* commands still exist but will show a deprecation warning for a single minor release.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
ef25a9b0d8 refactor: standardize on shorthand for redirecting all output to /dev/null
The shorthand is more prevalent in this codebase, and is something that bash supports, so we should just use the same thing everywhere.

Note that we do not use shorthand redirect in Makefile as shell parsing is a bit different in Make and the shorthand redirect doesn't seem to be properly supported, causing CI errors.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
87828515a1 fix: respect the build-dir in app-json extraction
Because the app-json extraction happens before the build-dir is set, it doesn't end up respecting the value, and thus the user might get the wrong app.json file.

This takes advantage of path.Join()'s default of ignoring empty paths.
2023-02-14 03:56:28 -05:00
Jose Diaz-Gonzalez
f84a650849 chore: remove deprecated nginx commands 2023-02-12 13:20:45 -05:00
Jose Diaz-Gonzalez
a5fa3725e6 chore: remove deprecated builder-specific post-release hooks
This option was deprecated in Dokku 0.25.0.
2023-01-16 01:25:41 -05:00
Jose Diaz-Gonzalez
852dfc6287 feat: add json output format support to storage:list
This will allow the command to be used in a programmatic fashion.
2022-12-26 16:33:40 -05:00