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(
name="Install packages required by Docker",
packages=[
"apt-transport-https",
"ca-certificates",
"curl",
"gnupg-agent",
"software-properties-common",
],
name="Install packages required by Docker",
packages=[
"apt-transport-https",
"ca-certificates",
"curl",
"gnupg-agent",
"software-properties-common",
],
)
setup_ssh()

View file

@ -14,4 +14,4 @@ joplin_new = [
"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"
[tool.poetry.dependencies]
python = "^3.11"
python = "^3.12"
pyinfra = "^2.7"
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
def deploy_ssh_keys():
files.file(
name="Create authorized_keys file",
path="/root/.ssh/authorized_keys"
)
for key_path in BASE_DIR.glob("pubkeys/*.pub"):
with open(key_path, "r") as f:
key = f.read().strip()
@ -21,6 +21,7 @@ def deploy_ssh_keys():
line=key
)
def reconfigure_ssh():
config_changed = files.line(
name="Disable password login",
@ -35,6 +36,7 @@ def reconfigure_ssh():
restarted=config_changed
)
@deploy
def setup_ssh():
deploy_ssh_keys()