From d846324fd5213d21cc4f485ea8616d2edba4062b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 25 Apr 2026 02:39:02 -0400 Subject: [PATCH] fix: correct global env path, migration join, and test app dirs - Use DOKKU_LIB_ROOT instead of DOKKU_ROOT in getGlobalFile() to match the intended new config path layout - Add missing comma in filepath.Join for old app ENV migration path - Revert common_test.go app dirs to DOKKU_ROOT since app detection still uses AppRoot() --- plugins/common/common_test.go | 4 ++-- plugins/config/environment.go | 2 +- plugins/config/triggers.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/common/common_test.go b/plugins/common/common_test.go index d6acadf66..e6f0faee5 100644 --- a/plugins/common/common_test.go +++ b/plugins/common/common_test.go @@ -10,11 +10,11 @@ import ( var ( testAppName = "test-app-1" - testAppDir = strings.Join([]string{"/var/lib/dokku/config/config/", testAppName}, "") + testAppDir = strings.Join([]string{"/home/dokku/", testAppName}, "") testEnvFile = strings.Join([]string{testAppDir, "/ENV"}, "") testEnvLine = "export testKey=TESTING" testAppName2 = "01-test-app-1" - testAppDir2 = strings.Join([]string{"/var/lib/dokku/config/config/", testAppName2}, "") + testAppDir2 = strings.Join([]string{"/home/dokku/", testAppName2}, "") testEnvFile2 = strings.Join([]string{testAppDir2, "/ENV"}, "") testEnvLine2 = "export testKey=TESTING" ) diff --git a/plugins/config/environment.go b/plugins/config/environment.go index 97a7fe8c6..3e9d5313d 100644 --- a/plugins/config/environment.go +++ b/plugins/config/environment.go @@ -396,5 +396,5 @@ func getAppFile(appName string) (string, error) { } func getGlobalFile() string { - return filepath.Join(common.MustGetEnv("DOKKU_ROOT"), "config", "--global", "ENV") + return filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "config", "--global", "ENV") } diff --git a/plugins/config/triggers.go b/plugins/config/triggers.go index 8fd1b6b9e..23b19c55d 100644 --- a/plugins/config/triggers.go +++ b/plugins/config/triggers.go @@ -114,7 +114,7 @@ func TriggerInstall() error { return fmt.Errorf("Unable to setup app environment: %s", err.Error()) } - oldEnvFile := filepath.Join(common.AppRoot(appName) + "ENV") + oldEnvFile := filepath.Join(common.AppRoot(appName), "ENV") isMigrated := common.PropertyGetDefault("config", appName, "env-migrated", "") // delete the old file on the next install if isMigrated == "true" {