mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
Refactors generate_buildtime_environment_variables() to use an associative array (dictionary) approach instead of sequential push() calls. This prevents duplicate variable declarations in the buildtime.env file. **Problem:** After adding nixpacks plan variables to buildtime.env, the same variable could appear twice in the file: - Once from nixpacks plan (e.g., NIXPACKS_NODE_VERSION='22') - Once from user-defined variables (e.g., NIXPACKS_NODE_VERSION="22") This caused shell errors and undefined behavior during Docker builds. **Root Cause:** The push() method adds items sequentially without checking for duplicate keys. When a variable existed in both nixpacks plan AND user-defined vars, both would be written to the file. **Solution:** - Use associative array ($envs_dict) for automatic deduplication - Establish clear override precedence: 1. Nixpacks plan variables (lowest priority) 2. COOLIFY_* variables (medium priority) 3. SERVICE_* variables (medium priority) 4. User-defined variables (highest priority - can override everything) - Convert to collection format at the end - Add debug logging when user variables override plan variables **Benefits:** - Automatic deduplication (array keys are unique by nature) - User variables properly override nixpacks plan values - Clear, explicit precedence order - No breaking changes to existing functionality Fixes #7114 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| ApplicationDeploymentJob.php | ||
| ApplicationPullRequestUpdateJob.php | ||
| CheckAndStartSentinelJob.php | ||
| CheckForUpdatesJob.php | ||
| CheckHelperImageJob.php | ||
| CheckTraefikVersionForServerJob.php | ||
| CheckTraefikVersionJob.php | ||
| CleanupHelperContainersJob.php | ||
| CleanupInstanceStuffsJob.php | ||
| CleanupStaleMultiplexedConnections.php | ||
| CoolifyTask.php | ||
| DatabaseBackupJob.php | ||
| DeleteResourceJob.php | ||
| DockerCleanupJob.php | ||
| GithubAppPermissionJob.php | ||
| PullChangelog.php | ||
| PullTemplatesFromCDN.php | ||
| PushServerUpdateJob.php | ||
| RegenerateSslCertJob.php | ||
| RestartProxyJob.php | ||
| ScheduledJobManager.php | ||
| ScheduledTaskJob.php | ||
| SendMessageToDiscordJob.php | ||
| SendMessageToPushoverJob.php | ||
| SendMessageToSlackJob.php | ||
| SendMessageToTelegramJob.php | ||
| SendWebhookJob.php | ||
| ServerCheckJob.php | ||
| ServerCleanupMux.php | ||
| ServerConnectionCheckJob.php | ||
| ServerFilesFromServerJob.php | ||
| ServerLimitCheckJob.php | ||
| ServerManagerJob.php | ||
| ServerPatchCheckJob.php | ||
| ServerStorageCheckJob.php | ||
| ServerStorageSaveJob.php | ||
| StripeProcessJob.php | ||
| SubscriptionInvoiceFailedJob.php | ||
| UpdateCoolifyJob.php | ||
| UpdateStripeCustomerEmailJob.php | ||
| ValidateAndInstallServerJob.php | ||
| VerifyStripeSubscriptionStatusJob.php | ||
| VolumeCloneJob.php | ||