35 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
25a5bacde9 docs: note the preserved ENV file can be deleted
The preserved copy holds everything the legacy file was not allowed to import, which includes keys that had been `config:unset` on purpose, so a revoked secret can outlive its revocation in a file `dokku config:*` no longer reads. Nothing said the copy was the operator's to remove once reviewed.
2026-08-11 19:11:06 -04:00
Jose Diaz-Gonzalez
685f16e6b1 fix: do not import an already-migrated ENV file
Releases 0.38.0 through 0.38.25 recorded the ENV file migration and deliberately left the file at the old path, so 0.38.26 treating a leftover file as a hand-edit replayed the environment as it stood at that upgrade over every `config:set` and `config:unset` made since, reinstating variables and secrets that had been deliberately unset. A file found at the old path once its migration is on record is no longer imported: it is removed when it agrees with the current config, and is otherwise moved aside to `ENV.migrated` with the keys it disagrees on named in a warning. That warning now reaches the operator during an upgrade rather than being swallowed, which is why the overwrite went unreported.
2026-08-10 17:58:10 -04:00
Jose Diaz-Gonzalez
e24859bfe6 test: stage the migration marker through the trigger
The hand-written marker file was created as root, which the config-migrate-env
trigger could not overwrite when it ran under a different user. Draining once up
front records the migration through the same code path the assertion exercises.
2026-08-07 17:56:15 -04:00
Jose Diaz-Gonzalez
70dc921967 fix: migrate env files before reading deprecated vars
Install steps run in alphabetical order of the enabled plugin directory, so `apps`, `builder`, and `checks` read an app's environment before the `config` plugin had moved the `ENV` file to its new location. The read came back empty, so their deprecated `DOKKU_*` variables were never migrated to the matching plugin property and were never unset, with nothing reported either way: `dokku config:show` kept listing the variable while the plugin behaved as though it were unset. The relocation now runs before any deprecated variable is read, whatever the install order, and each old file is removed as soon as it has been drained rather than on a later install, which also covers the global file that was never removed at all. A file that reappears at the old path can only have been written by hand, so it is merged in with a warning naming its keys instead of being discarded.
2026-08-07 16:43:56 -04:00
Jose Diaz-Gonzalez
3c8cba08e5 chore: run shfmt 2026-05-24 16:06:02 -04:00
Jose Diaz-Gonzalez
748b66f669 docs: clarify byte-preserving behavior of config:set --encoded
The canonical encode pipeline `echo "value" | base64` silently appends `\n` to the value, which round-trips through base64 and ends up stored in the env. Document that decoded values are stored byte-for-byte, recommend `printf '%s'` or `echo -n` for short inline values, and show `cat | base64 -w 0` for files. Adds a bats test asserting all four encoding patterns produce the expected stored bytes.

Closes #8647.
2026-05-24 15:39:28 -04:00
Jose Diaz-Gonzalez
38c6b180af fix: reference env from config dir 2026-04-27 01:05:41 -04:00
Jose Diaz-Gonzalez
f5cbc51fec fix(tests): drop DOKKU_PROXY_PORT from config:show and config:export expectations now that it lives as a property rather than a config var 2026-04-26 08:53:27 -04:00
Jose Diaz-Gonzalez
ddf470282e fix(tests): update config and nginx tests for post-create side effects
The config:show and config:export tests now include DOKKU_PROXY_PORT
in expected output since ports-configure runs at app creation time.

Add sleep before HTTP assertion in nginx-vhosts_13 test to allow
nginx async reload to complete.
2026-04-24 05:02:49 -04:00
Jose Diaz-Gonzalez
9411c4ddc1 test: ensure the deploy succeeds and then check the output vs using grep 2025-11-16 01:10:53 -05:00
Jose Diaz-Gonzalez
770d150c7c fix: correct lint issue 2025-11-08 01:17:50 -05:00
Jose Diaz-Gonzalez
e134c314ea feat: implement config:import command
Closes #6846
2025-11-08 01:02:19 -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
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
798a413096 feat: re-add apps and config cli aliases
This better follows Heroku's output and is more useful to users. The subcommands will be treated as the primary, documented versions, while the aliases are there for convenience.

Closes #5362
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
9d332e9b2d chore: run shfmt against all test files 2022-07-21 14:57:42 -04:00
Jose Diaz-Gonzalez
cd33ec2f02 fix: remove trace mode 2021-11-03 14:40:21 -04:00
Jose Diaz-Gonzalez
a756786f93 fix: ensure we respect quotes and dollar signs in config vars
Due to various changes in how containers are started, these keys were set incorrectly for apps. Since we can use the short-hand --env=ENV format for setting env vars on docker containers, lets do so.

Closes #4895
Closes #4896
2021-11-03 12:13:52 -04:00
Jose Diaz-Gonzalez
7e45f1173f fix: update tests for new logging output 2020-11-28 19:14:17 -05:00
Michael Chen
e64f7b34ff Add unit test for config:clear 2020-08-31 18:48:36 +02:00
Jose Diaz-Gonzalez
5fd04001d8 feat: split out test files and execute them manually
This breaks the old grouping mechanism, but honestly that was a weird way of doing it.
2020-06-20 13:22:47 -04:00
Michael Hobbs
76ad65b715 don't run app deploy tests and spread out unit tests to 4 containers. closes #1787 2015-12-21 10:18:16 -08:00
Jose Diaz-Gonzalez
d71554e647 Add test for removal of config values with newlines 2015-09-18 16:18:38 -04:00
Arthur Schreiber
7a0161dd86 Add a testcase. 2015-09-18 15:34:46 +02:00
Michael Hobbs
d21caa4811 Merge branch 'master' into 1091_mh-switch-to-herokuish 2015-07-28 10:55:44 -07:00
Michael Hobbs
a84397895a initial pass at config plugin arguments refactor 2015-07-06 19:41:17 -07:00
Michael Hobbs
0840d8fd1f initial pass at switching to herokuish. closes #1091 2015-07-06 12:41:54 -07:00
Arthur Schreiber
b40a86a2fc Add a testcase 2015-06-24 11:22:48 +02:00
Michael Hobbs
4e472c39e3 uniform unit test labels 2015-04-01 17:44:34 -07:00
Michael Hobbs
fb8f08d280 remove quoting from dockerfile env. closes #1002 2015-02-24 11:56:54 -08:00
Michael Hobbs
7357df7c9d first pass at dockerfile support 2015-02-07 17:56:01 -08:00
Michael Hobbs
5fb30ab934 source global env prior to app env. closes #931 2015-02-03 13:47:20 -08:00
Michael Hobbs
c7bd7119b8 assert on intermediate steps 2015-01-16 14:59:01 -08:00
Michael Hobbs
67b7fa6263 handle config with spaces over ssh 2014-12-21 14:51:41 -08:00
Michael Hobbs
3706392e65 test with wercker 2014-12-21 14:51:40 -08:00