Skip to content
Snippets Groups Projects
Commit 513a9e8d authored by jurgenhaas's avatar jurgenhaas
Browse files

#8 Only change ownership if we have a user env variable

parent 2c04ce98
No related branches found
No related tags found
1 merge request!6Merging develop into main
Pipeline #550040 passed
......@@ -108,21 +108,29 @@ class Traefik {
$fs = new Filesystem();
if (!$fs->exists($traefikPath)) {
$fs->mkdir($traefikPath);
$fs->chown($traefikPath, $user, TRUE);
if ($user) {
$fs->chown($traefikPath, $user, TRUE);
}
}
if (!$fs->exists($traefikCertPath)) {
$fs->mkdir($traefikCertPath);
$fs->chown($traefikCertPath, $user, TRUE);
if ($user) {
$fs->chown($traefikCertPath, $user, TRUE);
}
}
if (!$fs->exists($traefikConfigPath)) {
$fs->mkdir($traefikConfigPath);
$fs->chown($traefikConfigPath, $user, TRUE);
if ($user) {
$fs->chown($traefikConfigPath, $user, TRUE);
}
}
$upd1 = $this->updateFile($traefikConfigPath . '/certificates.toml', $this->defaultCertificatesConfig());
$upd2 = $this->updateFile($traefikFile, Yaml::dump($this->defaultDockerCompose(), 9, 2));
if ($upd1 || $upd2) {
$fs->chown($traefikConfigPath . '/certificates.toml', $user, TRUE);
$fs->chown($traefikFile, $user, TRUE);
if ($user) {
$fs->chown($traefikConfigPath . '/certificates.toml', $user, TRUE);
$fs->chown($traefikFile, $user, TRUE);
}
$cwd = getcwd();
chdir($traefikPath);
exec('docker network create traefik-public 2>/dev/null');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment