Summary

This PR adds two predefined server metadata environment variables for application deployments:

  • COOLIFY_SERVER_NAME
  • COOLIFY_SERVER_UUID

The injection is intentionally minimal and runtime-only, implemented in the existing ApplicationDeploymentJob::generate_coolify_env_variables() path.

Why

Issue #7738 asks for predefined server variables so an app can identify where it runs in multi-server deployments.

Behavior

  • Adds COOLIFY_SERVER_NAME and COOLIFY_SERVER_UUID for runtime env generation.
  • Keeps application-level precedence: if the app already defines either key, Coolify does not override it.
  • Does not inject these variables for build-time env generation (keeps build cache behavior stable and avoids build-server/runtime-server mismatch).

Scope

  • No schema changes
  • No UI changes
  • No API changes
  • No server-level custom variable CRUD

Tests

Added tests/Unit/ApplicationDeploymentServerEnvVariablesTest.php with coverage for:

  1. Runtime injection when keys are not overridden
  2. No injection when app env already defines those keys
  3. No injection in build-time env generation

Verification command used

docker run --rm -t --user root \
-v /var/www/html:/var/www/html \
-w /var/www/html docker.io/serversideup/php:8.4-fpm-nginx \
sh -lc "install-php-extensions sockets >/tmp/install-sockets.log 2>&1 && php artisan test --compact tests/Unit/ApplicationDeploymentServerEnvVariablesTest.php"

/claim #7738

Claim

Total prize pool $111
Total paid $0
Status Pending
Submitted March 06, 2026
Last updated March 06, 2026

Contributors

FR

Fraktal DeFi DAO

@FraktalDeFiDAO

100%

Sponsors

PR

Praveen Pendyala

@pkpio

$111