Skip to content

Commit

Permalink
[2.x] Overrides existing variables when loading encrypted environment…
Browse files Browse the repository at this point in the history
… files (#144)

* create mutable variables

* Do not pass secrets to fpm
  • Loading branch information
joedixon authored Nov 28, 2022
1 parent 45efd88 commit 887890d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Runtime/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function loadEnvironment()
{
fwrite(STDERR, 'Loading decrypted environment variables.'.PHP_EOL);

Dotenv::createImmutable($this->writePath, $this->environmentFile)->load();
Dotenv::createMutable($this->writePath, $this->environmentFile)->load();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions stubs/fpmRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

fwrite(STDERR, 'Preparing to add secrets to runtime'.PHP_EOL);

$secrets = Secrets::addToEnvironment(
Secrets::addToEnvironment(
$_ENV['VAPOR_SSM_PATH'],
json_decode($_ENV['VAPOR_SSM_VARIABLES'] ?? '[]', true),
__DIR__.'/vaporSecrets.php'
Expand Down Expand Up @@ -76,7 +76,7 @@
fwrite(STDERR, 'Preparing to boot FPM'.PHP_EOL);

$fpm = Fpm::boot(
__DIR__.'/httpHandler.php', $secrets
__DIR__.'/httpHandler.php'
);

/*
Expand Down
2 changes: 1 addition & 1 deletion stubs/octaneRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

fwrite(STDERR, 'Preparing to add secrets to runtime'.PHP_EOL);

$secrets = Secrets::addToEnvironment(
Secrets::addToEnvironment(
$_ENV['VAPOR_SSM_PATH'],
json_decode($_ENV['VAPOR_SSM_VARIABLES'] ?? '[]', true),
__DIR__.'/vaporSecrets.php'
Expand Down

0 comments on commit 887890d

Please sign in to comment.