Skip to content

Commit c0495b1

Browse files
rubysclaude
andcommitted
Fix environment variable precedence for tenant configuration
Tenant-specific environment variables now properly override application.env template variables. Previously, the application.env templates were applied after tenant env vars, causing them to overwrite tenant-specific settings. This ensures tenants can override default database paths and other settings as needed. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e7312fb commit c0495b1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

cmd/navigator/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,11 +1678,6 @@ func ParseYAML(content []byte) (*Config, error) {
16781678
Hooks: tenant.Hooks, // Copy tenant-specific hooks
16791679
}
16801680

1681-
// Copy tenant environment variables
1682-
for k, v := range tenant.Env {
1683-
location.EnvVars[k] = v
1684-
}
1685-
16861681
// Add variables from applications.env that need substitution (unless it's a special tenant)
16871682
if !tenant.Special {
16881683
for varName, template := range yamlConfig.Applications.Env {
@@ -1694,6 +1689,11 @@ func ParseYAML(content []byte) (*Config, error) {
16941689
}
16951690
}
16961691

1692+
// Copy tenant environment variables (these should override application env)
1693+
for k, v := range tenant.Env {
1694+
location.EnvVars[k] = v
1695+
}
1696+
16971697
if tenant.Root != "" {
16981698
location.Root = tenant.Root
16991699
} else if yamlConfig.Server.PublicDir != "" {

0 commit comments

Comments
 (0)