Skip to content

Commit 017dcaa

Browse files
authored
Set the Drupal install profile from an env var with a sensible default. Also set file permissions to 444 for security. (#12)
1 parent 3f1de63 commit 017dcaa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Handler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public function createSettingsFile()
139139
"\$settings['shepherd_site_id'] = getenv('SHEPHERD_SITE_ID');\n" .
140140
"\$settings['shepherd_url'] = getenv('SHEPHERD_URL');\n" .
141141
"\$settings['shepherd_token'] = getenv('SHEPHERD_TOKEN_FILE') ? file_get_contents(getenv('SHEPHERD_TOKEN_FILE')) : getenv('SHEPHERD_TOKEN');\n\n" .
142+
"\$settings['install_profile'] = getenv('SHEPHERD_INSTALL_PROFILE') ?: 'standard';\n" .
142143
"if (getenv('REDIS_ENABLED')) {\n" .
143144
" \$settings['redis.connection']['interface'] = 'PhpRedis';\n" .
144145
" \$settings['redis.connection']['host'] = getenv('REDIS_HOST') ?: 'redis';\n" .
@@ -168,6 +169,7 @@ public function createSettingsFile()
168169
$shepherdSettings,
169170
FILE_APPEND
170171
);
172+
$this->filesystem->chmod($root . '/sites/default/settings.php', 0444);
171173
}
172174
}
173175

@@ -180,7 +182,7 @@ public function createServicesFile()
180182

181183
if (!$this->filesystem->exists($root . '/sites/default/services.yml') && $this->filesystem->exists($root . '/sites/default/default.services.yml')) {
182184
$this->filesystem->copy($root . '/sites/default/default.services.yml', $root . '/sites/default/services.yml');
183-
$this->filesystem->chmod($root . '/sites/default/services.yml', 0666);
185+
$this->filesystem->chmod($root . '/sites/default/services.yml', 0444);
184186
}
185187
}
186188

0 commit comments

Comments
 (0)