fix: repeating container

This commit is contained in:
2026-04-20 20:00:13 +02:00
parent 7f02abca1a
commit 90742e63f1
3 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -197,5 +197,5 @@ cp .env.example .env
$EDITOR .env # update HOST and TOKEN_SALT
docker compose up
# whenever you need a new token
docker compose run stapler token
docker compose run --rm stapler token
```
+1
View File
@@ -202,6 +202,7 @@ class CertManager:
cert_file = self.get_cert(default_host)
if cert_file.exists() and cert_file.stat().st_mtime != self.last_file_change:
self.logger.debug("Detected change: %s", cert_file)
self.last_file_change = cert_file.stat().st_mtime
return True
return False
+5 -1
View File
@@ -61,8 +61,12 @@ class TokenManager:
self.logger.warning("Please copy this secret value before it disappears")
def detect_file_change(self) -> bool:
if self.tokens_file.stat().st_mtime != self.last_file_change:
if (
self.tokens_file.exists()
and self.tokens_file.stat().st_mtime != self.last_file_change
):
self.logger.debug("Detected change: %s", self.tokens_file)
self.last_file_change = self.tokens_file.stat().st_mtime
return True
return False