Commit Graph
24 Commits
Author SHA1 Message Date
Jose Diaz-Gonzalez 9df45f6a6e fix: serialize concurrent property updates
Concurrent commands for the same app could each read a setting, change it, and write it back, so all of them exited successfully while silently dropping changes made by the others. Updates to app settings are now serialized so every change is kept, and readers never see a partially written value.
2026-10-21 21:21:57 -04:00
Jose Diaz-Gonzalez d5b2e699f2 Merge pull request #9062 from dokku/explicit-datastore-destroy-force
Pass force to the datastore command that owns it
2026-09-20 04:09:03 -04:00
Jose Diaz-Gonzalez 11b09fb375 fix: pass force to the datastore command that owns it
The datastore destroys were written with dokku's global `--force`, which works only because dokku translates it into `DOKKU_APPS_FORCE_DELETE` and the plugin reads that environment variable back. The flag belongs to the subcommand, which declares it, so it is passed there instead.

Only the datastore calls move. `network:destroy` and `storage:destroy` are dokku's own commands and keep dokku's own convention.
2026-09-20 02:58:02 -04:00
Jose Diaz-Gonzalez 57bbe917b0 fix: call the datastore create command the way it is documented
The ports and app-json tests passed the app name to `postgres:create` and `redis:create` a second time, as a positional the command has never taken. The bash datastore plugins parsed their arguments with getopts and simply stopped at it; those plugins now dispatch to a binary that reports the count instead, so every dokku pull request fails on `This command requires 2 arguments, 3 arguments given`.

The documented form takes the service alone, as `docs/deployment/application-deployment.md` shows. The `:link` and `:unlink` calls beside these are unchanged, since those do take two.
2026-09-20 02:53:32 -04:00
Jose Diaz-Gonzalez 9c61031f3e docs: add docs and tests for this feature 2026-07-22 03:45:32 -04:00
Jose Diaz-Gonzalez 3bf6c72451 fix: align Go-plugin :report JSON keys with bash-strip convention
Every Go-implemented plugin's `:report --format json` now emits keys without the redundant `<plugin>-` head segment, matching the shape bash plugins have always emitted. The CLI flag names and `:set` semantics are unchanged. For backwards compatibility during the 0.38.x patch series, the legacy `<plugin>-<property>` keys are emitted side-by-side with the new keys, and a future major release will drop the legacy keys. `common.ReportSingleApp` is refactored to accept a `ReportSingleAppInput` struct with a `Validate()` method so the input is checked before any work runs, which also catches the latent `"docker options"` reportType bug at the API boundary.
2026-05-27 07:17:00 -04:00
Jose Diaz-Gonzalez a2d399c104 fix: do not reset manually set port mappings when upgrading dokku
Closes #8067
2025-11-20 00:21:40 -05:00
Jose Diaz-Gonzalez 03c25dae55 fix: ensure the code is copied over to the new app on clone or rebase
Closes #7706
2025-09-08 00:19:55 -04:00
Jose Diaz-Gonzalez a2209eeee7 fix: ensure we raise errors when setting ports 2024-02-25 12:13:06 -05:00
Jose Diaz-Gonzalez ba3ad4a9ab fix: do not allow reusing the same scheme:host-port mappings when setting ports
This doesn't make sense as a port can't be listened to twice on the same domain, so instead we should just fail immediately if someone attempts to perform this action.

Refs dokku/dokku-letsencrypt#269
2024-02-25 11:11:23 -05:00
Jose Diaz-Gonzalez 5846301a48 tests: make it possible to specify an alternative base domain for tests
When developing Dokku, it is useful to use a real domain to test actual functionality. This is impossible if the domain is hardcoded to dokku.me in testing.
2023-08-05 20:58:26 -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 622548057c tests: add assertions to various bats tests
Missing these assertions didn't necessarily break tests but they are more correct and having them should help suss out bugs.
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez d6468f4713 tests: use assert_output_not_exists instead of asserting output is empty string 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 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
Michael Hobbs 4e472c39e3 uniform unit test labels 2015-04-01 17:44:34 -07:00
Michael Hobbs c83fbad205 xip.io style vhosts with tests. closes #1005 2015-03-19 11:23:00 -07:00
Michael Hobbs 2834ce1f1a extract first port from Dockerfile and set config variable for use in deploy phase. closes #993 2015-03-19 07:54:45 -07:00
Michael Hobbs 80d13c0005 allow users to add a domain to an app if there is no global vhost 2015-01-11 14:35:02 -08:00
Michael Hobbs da465a61dd disable VHOST deployment if global VHOST file is missing 2015-01-08 15:58:08 -08:00
Michael Hobbs 896ce50c93 support pre deployment usage of domains plugin. fixes interface binding issue 2015-01-06 12:42:21 -08:00
Michael Hobbs 441d212ef2 add ipv6 detection for external port binding 2015-01-05 10:47:20 -08:00
Michael Hobbs 948d7902f2 bind docker container to internal port if using vhosts 2015-01-02 16:27:19 -08:00