diff --git a/.gitignore b/.gitignore index 9e028a2..fc4d8b1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ requirements.txt app/_version.py app/static/favicon.ico docker-compose.yml +dhparam/ +nginx-conf/ diff --git a/app/config.py b/app/config.py index 5769b2a..22bd2a8 100644 --- a/app/config.py +++ b/app/config.py @@ -91,6 +91,7 @@ class _BlockedServer(pydantic.BaseModel): class Config(pydantic.BaseModel): domain: str + domain_alias: str username: str admin_password: bytes name: str @@ -165,6 +166,7 @@ def verify_password(pwd: str) -> bool: CONFIG = load_config() DOMAIN = CONFIG.domain +DOMAIN_ALIAS = CONFIG.domain_alias _SCHEME = "https" if CONFIG.https else "http" ID = f"{_SCHEME}://{DOMAIN}" diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..937b77d --- /dev/null +++ b/run.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +cd /home/app/microblog +docker compose up -d + diff --git a/ssl_renew.sh b/ssl_renew.sh new file mode 100755 index 0000000..db7c4c7 --- /dev/null +++ b/ssl_renew.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +COMPOSE="docker compose --ansi never" +DOCKER="/usr/bin/docker" + +cd /home/app/microblog/ +$COMPOSE run certbot renew && $COMPOSE kill -s SIGHUP webserver +$DOCKER system prune -af