diff --git a/bouncer/src/Bouncer.php b/bouncer/src/Bouncer.php index d90153b..1f21233 100644 --- a/bouncer/src/Bouncer.php +++ b/bouncer/src/Bouncer.php @@ -328,8 +328,8 @@ class Bouncer { foreach ($envs as $eKey => $eVal) { switch ($eKey) { - case 'BOUNCER_NAME': - $bouncerTarget->setName($eVal); + case 'BOUNCER_LABEL': + $bouncerTarget->setLabel($eVal); break; @@ -692,8 +692,7 @@ class Bouncer } if (count($changedTargets) <= $this->getMaximumNginxConfigCreationNotices()) { foreach ($changedTargets as $target) { - $this->logger->info('{emoji} Created {name}', ['emoji' => Emoji::pencil(), 'name' => $target->getName()]); - $this->logger->debug('{emoji} -> {certs_dir}/{file}', ['emoji' => Emoji::pencil(), 'certs_dir' => Bouncer::FILESYSTEM_CERTS_DIR, 'file' => $target->getFileName()]); + $this->logger->info('{emoji} Created {label}', ['emoji' => Emoji::pencil(), 'label' => $target->getLabel()]); $this->logger->debug('{emoji} -> {domain}', ['emoji' => Emoji::pencil(), 'domain' => $target->getPresentationDomain()]); } } else { diff --git a/bouncer/src/Target.php b/bouncer/src/Target.php index 1ce5b29..074addb 100644 --- a/bouncer/src/Target.php +++ b/bouncer/src/Target.php @@ -10,7 +10,7 @@ use Spatie\Emoji\Emoji; class Target { private string $id; - private ?string $name = null; + private ?string $label = null; private array $domains; private string $endpointHostnameOrIp; private ?int $port = null; @@ -37,6 +37,7 @@ class Target return [ 'id' => $this->getId(), 'name' => $this->getName(), + 'label' => $this->getLabel(), 'domains' => $this->getDomains(), 'letsEncrypt' => $this->isLetsEncrypt(), 'targetPath' => $this->getTargetPath(), @@ -275,13 +276,19 @@ class Target public function getName() { - return $this->name ?? reset($this->domains); + return reset($this->domains); } - public function setName(string $name): self + public function getLabel() { - $this->name = $name; + return $this->label ?? $this->getLabel(); + } + + public function setLabel(string $label): self + { + $this->label = $label; $this->updateLogger(); + $this->logger->debug('{emoji} Target label set to {label}', ['emoji' => Emoji::label(), 'label' => $label]); return $this; }