fix: allow enabling nginx-vhosts when skipped at install

Installing with the `dokku/nginx_enable` debconf option set to `false` left the nginx-vhosts plugin disabled with no way to turn it back on, as `dokku plugin:enable nginx-vhosts` reported that the plugin does not exist. The plugin can now be enabled after installation, and the debconf documentation explains the option's effect and how to reverse it.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-09-29 12:11:17 -04:00
1 parent b61a5784e6
commit 46776fa87c
5 files changed
+61 -5

No files matched your search

+37
View File
@@ -9,9 +9,16 @@ setup() {
teardown() {
remove_test_plugin || true
restore_enter_plugin
global_teardown
}
restore_enter_plugin() {
declare desc="re-enables the enter core plugin if a test left it disabled"
[[ -e "$PLUGIN_CORE_PATH/enabled/enter" ]] || PLUGIN_PATH="$PLUGIN_CORE_PATH" plugn enable enter || true
[[ -e "$PLUGIN_ENABLED_PATH/enter" ]] || PLUGIN_PATH="$PLUGIN_PATH" plugn enable enter || true
}
@test "(plugin) plugin:help" {
run /bin/bash -c "dokku plugin"
echo "output: $output"
@@ -379,3 +386,33 @@ teardown() {
echo "status: $status"
assert_success
}
@test "(plugin:enable) core plugin skipped at install" {
run /bin/bash -c "rm $PLUGIN_ENABLED_PATH/enter $PLUGIN_CORE_PATH/enabled/enter"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku plugin:list --format json | jq -r '.[] | select(.name == \"enter\") | .enabled'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "false"
run /bin/bash -c "dokku plugin:enable enter"
echo "output: $output"
echo "status: $status"
assert_success
assert_output_contains "Plugin enter enabled"
run /bin/bash -c "dokku plugin:list --format json | jq -r '.[] | select(.name == \"enter\") | .enabled'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "true"
run /bin/bash -c "test -L $PLUGIN_CORE_PATH/enabled/enter"
echo "output: $output"
echo "status: $status"
assert_success
}