Added kanboard and reformated some files

This commit is contained in:
Jakub Kropáček 2024-01-13 14:36:17 +01:00
parent c468c81a00
commit 110b58921d
7 changed files with 538 additions and 532 deletions

View file

@ -15,14 +15,14 @@ apt.packages(
) )
apt.packages( apt.packages(
name="Install packages required by Docker", name="Install packages required by Docker",
packages=[ packages=[
"apt-transport-https", "apt-transport-https",
"ca-certificates", "ca-certificates",
"curl", "curl",
"gnupg-agent", "gnupg-agent",
"software-properties-common", "software-properties-common",
], ],
) )
setup_ssh() setup_ssh()

View file

@ -14,4 +14,4 @@ joplin_new = [
"web_server": True "web_server": True
} }
) )
] ]

1018
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,7 @@ license = "MIT"
readme = "README.md" readme = "README.md"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.11" python = "^3.12"
pyinfra = "^2.7" pyinfra = "^2.7"
pyinfra-docker = "^2.1" pyinfra-docker = "^2.1"

View file

@ -0,0 +1,2 @@
HOST=
PLUGIN_INSTALLER=true

View file

@ -0,0 +1,26 @@
volumes:
kanboard-data:
kanboard-plugins:
networks:
traefik-net:
external: true
services:
kanboard:
image: kanboard/kanboard:latest
volumes:
- kanboard-data:/var/www/app/data
- kanboard-plugins:/var/www/app/plugins
networks:
- traefik-net
environment:
- PLUGIN_INSTALLER=${PLUGIN_INSTALLER}
deploy:
labels:
- traefik.enable=true
- traefik.docker.network=traefik-net
- traefik.http.routers.kanboard.rule=Host(`${HOST}`)
- traefik.http.routers.kanboard.entrypoints=websecure
- traefik.http.routers.kanboard.tls.certresolver=le
- traefik.http.services.kanboard.loadbalancer.server.port=80

View file

@ -5,13 +5,13 @@ from pyinfra.operations import files, systemd
BASE_DIR = Path(__file__).parent.parent BASE_DIR = Path(__file__).parent.parent
def deploy_ssh_keys(): def deploy_ssh_keys():
files.file( files.file(
name="Create authorized_keys file", name="Create authorized_keys file",
path="/root/.ssh/authorized_keys" path="/root/.ssh/authorized_keys"
) )
for key_path in BASE_DIR.glob("pubkeys/*.pub"): for key_path in BASE_DIR.glob("pubkeys/*.pub"):
with open(key_path, "r") as f: with open(key_path, "r") as f:
key = f.read().strip() key = f.read().strip()
@ -21,6 +21,7 @@ def deploy_ssh_keys():
line=key line=key
) )
def reconfigure_ssh(): def reconfigure_ssh():
config_changed = files.line( config_changed = files.line(
name="Disable password login", name="Disable password login",
@ -35,6 +36,7 @@ def reconfigure_ssh():
restarted=config_changed restarted=config_changed
) )
@deploy @deploy
def setup_ssh(): def setup_ssh():
deploy_ssh_keys() deploy_ssh_keys()