From c4eabd0e4aae55a340a61734ea334b1687c29cee Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen.haas@lakedrops.com> Date: Wed, 6 Jul 2022 09:38:28 +0200 Subject: [PATCH] composer/library/docker-traefik#8 Changing ownership of new files and directories to the user --- Traefik.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Traefik.php b/Traefik.php index 8f72c44..4aadf38 100644 --- a/Traefik.php +++ b/Traefik.php @@ -104,19 +104,25 @@ class Traefik { $traefikConfigPath = $_SERVER['HOME'] . '/.traefik/configuration'; $traefikFile = $traefikPath . '/docker-compose.yml'; + $user = getenv('USER'); $fs = new Filesystem(); if (!$fs->exists($traefikPath)) { $fs->mkdir($traefikPath); + $fs->chown($traefikPath, $user, TRUE); } if (!$fs->exists($traefikCertPath)) { $fs->mkdir($traefikCertPath); + $fs->chown($traefikCertPath, $user, TRUE); } if (!$fs->exists($traefikConfigPath)) { $fs->mkdir($traefikConfigPath); + $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 . '/certifications.toml', $user, TRUE); + $fs->chown($traefikFile, $user, TRUE); $cwd = getcwd(); chdir($traefikPath); exec('docker network create traefik-public 2>/dev/null'); -- GitLab