small setup

main
Dominik Madarász 2023-08-03 17:01:37 +00:00
parent 20140f6f31
commit 0205038f0d
4 changed files with 17 additions and 0 deletions

2
.gitignore vendored
View File

@ -7,3 +7,5 @@ requirements.txt
app/_version.py
app/static/favicon.ico
docker-compose.yml
dhparam/
nginx-conf/

View File

@ -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}"

5
run.sh 100755
View File

@ -0,0 +1,5 @@
#!/bin/bash
cd /home/app/microblog
docker compose up -d

8
ssl_renew.sh 100755
View File

@ -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