Compare commits

...

4 Commits

  1. 3
      .gitignore
  2. 41
      README.md
  3. 23
      conftest.py
  4. 0
      cookbooks/Makefile
  5. 5
      cookbooks/base/Makefile
  6. 0
      cookbooks/base/README.md
  7. 0
      cookbooks/base/config/examples/fastfetch.env
  8. 0
      cookbooks/base/config/fastfetch.jsonc
  9. 0
      cookbooks/base/config/install-fastfetch.sh
  10. 0
      cookbooks/base/install-fastfetch.service
  11. 0
      cookbooks/base/overlay.bu
  12. 0
      cookbooks/base/profile.d/fastfetch.sh
  13. 0
      cookbooks/base/rpm-ostree-install-qemu-guest-agent.service
  14. 0
      cookbooks/base/tmpfiles.d/base.conf
  15. 0
      cookbooks/base/var-lib-virtiofs-data.mount
  16. 4
      cookbooks/gitea/Makefile
  17. 0
      cookbooks/gitea/README.md
  18. 0
      cookbooks/gitea/config/examples/app.ini
  19. 0
      cookbooks/gitea/config/examples/config.env
  20. 0
      cookbooks/gitea/gitea.container
  21. 0
      cookbooks/gitea/gitea.target
  22. 0
      cookbooks/gitea/other/postgresql/gitea.sql
  23. 0
      cookbooks/gitea/other/traefik/gitea.yaml
  24. 0
      cookbooks/gitea/overlay.bu
  25. 0
      cookbooks/gitea/tmpfiles.d/gitea.conf
  26. 5
      cookbooks/keycloak/Makefile
  27. 0
      cookbooks/keycloak/README.md
  28. 0
      cookbooks/keycloak/config/container/Containerfile
  29. 0
      cookbooks/keycloak/config/examples/config.env
  30. 0
      cookbooks/keycloak/keycloak-build.timer
  31. 0
      cookbooks/keycloak/keycloak.build
  32. 0
      cookbooks/keycloak/keycloak.container
  33. 0
      cookbooks/keycloak/keycloak.target
  34. 0
      cookbooks/keycloak/other/postgresql/keycloak.sql
  35. 0
      cookbooks/keycloak/other/traefik/keycloak.yaml
  36. 0
      cookbooks/keycloak/overlay.bu
  37. 4
      cookbooks/lego/Makefile
  38. 0
      cookbooks/lego/README.md
  39. 0
      cookbooks/lego/config/examples/config.env
  40. 0
      cookbooks/lego/config/hooks/flag-as-renewed.sh
  41. 0
      cookbooks/lego/lego-renew.container
  42. 0
      cookbooks/lego/lego-renew.timer
  43. 0
      cookbooks/lego/lego-run.container
  44. 0
      cookbooks/lego/lego.target
  45. 0
      cookbooks/lego/overlay.bu
  46. 5
      cookbooks/miniflux/Makefile
  47. 0
      cookbooks/miniflux/README.md
  48. 0
      cookbooks/miniflux/config/examples/miniflux.conf
  49. 0
      cookbooks/miniflux/miniflux.container
  50. 0
      cookbooks/miniflux/miniflux.target
  51. 0
      cookbooks/miniflux/other/postgresql/miniflux.sql
  52. 0
      cookbooks/miniflux/other/traefik/miniflux.yaml
  53. 0
      cookbooks/miniflux/overlay.bu
  54. 4
      cookbooks/nextcloud/Makefile
  55. 0
      cookbooks/nextcloud/README.md
  56. 0
      cookbooks/nextcloud/config/custom-noinit.sh
  57. 0
      cookbooks/nextcloud/config/custom-post.sh
  58. 0
      cookbooks/nextcloud/config/custom-pre.sh
  59. 0
      cookbooks/nextcloud/config/examples/collabora.env
  60. 0
      cookbooks/nextcloud/config/examples/config.env
  61. 0
      cookbooks/nextcloud/config/nginx.conf
  62. 0
      cookbooks/nextcloud/config/redis.conf
  63. 0
      cookbooks/nextcloud/config/www.conf
  64. 0
      cookbooks/nextcloud/nextcloud-app.container
  65. 0
      cookbooks/nextcloud/nextcloud-collabora.container
  66. 0
      cookbooks/nextcloud/nextcloud-cron.container
  67. 0
      cookbooks/nextcloud/nextcloud-cron.timer
  68. 0
      cookbooks/nextcloud/nextcloud-init.container
  69. 0
      cookbooks/nextcloud/nextcloud-nginx.container
  70. 0
      cookbooks/nextcloud/nextcloud-redis.container
  71. 0
      cookbooks/nextcloud/nextcloud-upgrade.container
  72. 0
      cookbooks/nextcloud/nextcloud.target
  73. 0
      cookbooks/nextcloud/other/postgresql/nextcloud.sql
  74. 0
      cookbooks/nextcloud/other/traefik/collabora.yaml
  75. 0
      cookbooks/nextcloud/other/traefik/nextcloud.yaml
  76. 0
      cookbooks/nextcloud/overlay.bu
  77. 0
      cookbooks/nextcloud/sysctl.d/examples/nextcloud.conf
  78. 0
      cookbooks/nextcloud/tests/witness.txt
  79. 0
      cookbooks/nextcloud/tmpfiles.d/nextcloud.conf
  80. 4
      cookbooks/nginx/Makefile
  81. 0
      cookbooks/nginx/README.md
  82. 0
      cookbooks/nginx/config/examples/config.env
  83. 0
      cookbooks/nginx/nginx-init.container
  84. 0
      cookbooks/nginx/nginx-server.container
  85. 0
      cookbooks/nginx/nginx-update.container
  86. 0
      cookbooks/nginx/nginx-update.timer
  87. 0
      cookbooks/nginx/nginx.target
  88. 0
      cookbooks/nginx/website/index.html
  89. 3
      cookbooks/postgresql/Makefile
  90. 0
      cookbooks/postgresql/README.md
  91. 0
      cookbooks/postgresql/config/backup.sh
  92. 0
      cookbooks/postgresql/config/examples/config.env
  93. 0
      cookbooks/postgresql/config/init.sh
  94. 0
      cookbooks/postgresql/config/upgrade.sh
  95. 0
      cookbooks/postgresql/hooks.mk
  96. 0
      cookbooks/postgresql/overlay.bu
  97. 2
      cookbooks/postgresql/postgresql-backup.container
  98. 0
      cookbooks/postgresql/postgresql-backup.timer
  99. 2
      cookbooks/postgresql/postgresql-init.container
  100. 13
      cookbooks/postgresql/postgresql-pgautoupgrade.image

3
.gitignore

@ -2,4 +2,5 @@
*.ign
!fcos.bu
!overlay.bu
*/butane.blocklist
__pycache__/
.pytest_cache/

41
README.md

@ -14,22 +14,22 @@ This repository gathers all the recipes (hence the name "Cookbook") to deploy Op
## Available Cookbooks
- [base](base/): base configuration for Fedora CoreOS with fastfetch, tmpfiles setup, and QEMU guest agent.
- [gitea](gitea/): self-hosted Git service, a lightweight GitHub/GitLab alternative.
- [keycloak](keycloak/): open source identity and access management server with PostgreSQL backend.
- [lego](lego/): Let's Encrypt/ACME client for automatic SSL/TLS certificate management and renewal.
- [miniflux](miniflux/): minimalist RSS/Atom feed reader with PostgreSQL backend.
- [nextcloud](nextcloud/): self-hosted file sync and share platform with all its dependencies, handles automated upgrades.
- [nginx](nginx/): Nginx web server with content initialized and updated from a GIT repository.
- [postgresql](postgresql/): PostgreSQL database server with automated major upgrades, periodic backup and restore capabilities.
- [qemu-user-static](qemu-user-static/): multi-architecture container support using QEMU user-mode emulation.
- [restic-server](restic-server/): REST server backend for restic backups with append-only mode and Prometheus metrics.
- [samba](samba/): SMB/CIFS file sharing server for network storage access.
- [seedbox](seedbox/): complete media server stack with Radarr, Sonarr, Lidarr, Prowlarr, qBittorrent, Jellyfin, and FlareSolverr.
- [traefik](traefik/): modern HTTP reverse proxy and load balancer with automatic service discovery.
- [vaultwarden](vaultwarden/): Bitwarden-compatible password manager server with PostgreSQL backend.
- [vmagent](vmagent/): Victoria Metrics agent for collecting and forwarding metrics.
- [vsftpd](vsftpd/): secure FTP server with TLS support and Let's Encrypt certificate integration.
- [base](cookbooks/base/): base configuration for Fedora CoreOS with fastfetch, tmpfiles setup, and QEMU guest agent.
- [gitea](cookbooks/gitea/): self-hosted Git service, a lightweight GitHub/GitLab alternative.
- [keycloak](cookbooks/keycloak/): open source identity and access management server with PostgreSQL backend.
- [lego](cookbooks/lego/): Let's Encrypt/ACME client for automatic SSL/TLS certificate management and renewal.
- [miniflux](cookbooks/miniflux/): minimalist RSS/Atom feed reader with PostgreSQL backend.
- [nextcloud](cookbooks/nextcloud/): self-hosted file sync and share platform with all its dependencies, handles automated upgrades.
- [nginx](cookbooks/nginx/): Nginx web server with content initialized and updated from a GIT repository.
- [postgresql](cookbooks/postgresql/): PostgreSQL database server with automated major upgrades, periodic backup and restore capabilities.
- [qemu-user-static](cookbooks/qemu-user-static/): multi-architecture container support using QEMU user-mode emulation.
- [restic-server](cookbooks/restic-server/): REST server backend for restic backups with append-only mode and Prometheus metrics.
- [samba](cookbooks/samba/): SMB/CIFS file sharing server for network storage access.
- [seedbox](cookbooks/seedbox/): complete media server stack with Radarr, Sonarr, Lidarr, Prowlarr, qBittorrent, Jellyfin, and FlareSolverr.
- [traefik](cookbooks/traefik/): modern HTTP reverse proxy and load balancer with automatic service discovery.
- [vaultwarden](cookbooks/vaultwarden/): Bitwarden-compatible password manager server with PostgreSQL backend.
- [vmagent](cookbooks/vmagent/): Victoria Metrics agent for collecting and forwarding metrics.
- [vsftpd](cookbooks/vsftpd/): secure FTP server with TLS support and Let's Encrypt certificate integration.
## Cookbook layout
@ -53,6 +53,13 @@ This repository gathers all the recipes (hence the name "Cookbook") to deploy Op
- Fedora / CentOS Stream / RHEL or derivative operating system.
- Systemd
## End-to-end testing
```
pip install -e .
pytest cookbooks/postgresql/tests/
```
## Development
To develop Podman Quadlets, it is advised to create a Fedora Virtual Machine dedicated to this task.
@ -60,7 +67,7 @@ To develop Podman Quadlets, it is advised to create a Fedora Virtual Machine ded
You can create a Fedora Virtual Machine with the following command:
```sh
sudo ./create-dev-vm.sh
sudo ./scripts/create-dev-vm.sh
```
Then, retrieve the IP address of your VM with the following command:

23
conftest.py

@ -0,0 +1,23 @@
import subprocess
from pathlib import Path
import pytest
@pytest.fixture(scope="session")
def test_ssh_key(tmp_path_factory: pytest.TempPathFactory) -> Path:
"""Generate a temporary SSH key pair (no passphrase) for VM access."""
key_dir = tmp_path_factory.mktemp("ssh-key")
key_path = key_dir / "id_ed25519"
subprocess.run(
["ssh-keygen", "-t", "ed25519", "-N", "", "-f", str(key_path)],
check=True,
capture_output=True,
)
return key_path
@pytest.fixture(scope="session")
def test_ssh_pubkey(test_ssh_key: Path) -> str:
"""Public key string corresponding to test_ssh_key."""
return test_ssh_key.with_suffix(".pub").read_text().strip()

0
Makefile → cookbooks/Makefile

5
base/Makefile → cookbooks/base/Makefile

@ -1,5 +1,6 @@
TOP_LEVEL_DIR := ..
include $(TOP_LEVEL_DIR)/common.mk
# Include common Makefile
include ../../scripts/common.mk
SYSTEMD_MAIN_UNIT_NAMES += var-lib-virtiofs-data.mount
SYSTEMD_MAIN_UNIT_NAMES += rpm-ostree-install-qemu-guest-agent.service
SYSTEMD_MAIN_UNIT_NAMES += install-fastfetch.service

0
base/README.md → cookbooks/base/README.md

0
base/config/examples/fastfetch.env → cookbooks/base/config/examples/fastfetch.env

0
base/config/fastfetch.jsonc → cookbooks/base/config/fastfetch.jsonc

0
base/config/install-fastfetch.sh → cookbooks/base/config/install-fastfetch.sh

0
base/install-fastfetch.service → cookbooks/base/install-fastfetch.service

0
base/overlay.bu → cookbooks/base/overlay.bu

0
base/profile.d/fastfetch.sh → cookbooks/base/profile.d/fastfetch.sh

0
base/rpm-ostree-install-qemu-guest-agent.service → cookbooks/base/rpm-ostree-install-qemu-guest-agent.service

0
base/tmpfiles.d/base.conf → cookbooks/base/tmpfiles.d/base.conf

0
base/var-lib-virtiofs-data.mount → cookbooks/base/var-lib-virtiofs-data.mount

4
gitea/Makefile → cookbooks/gitea/Makefile

@ -8,5 +8,5 @@ DEPENDENCIES = postgresql traefik
PROJECT_UID = 10009
PROJECT_GID = 10000
TOP_LEVEL_DIR := ..
include $(TOP_LEVEL_DIR)/common.mk
# Include common Makefile
include ../../scripts/common.mk

0
gitea/README.md → cookbooks/gitea/README.md

0
gitea/config/examples/app.ini → cookbooks/gitea/config/examples/app.ini

0
gitea/config/examples/config.env → cookbooks/gitea/config/examples/config.env

0
gitea/gitea.container → cookbooks/gitea/gitea.container

0
gitea/gitea.target → cookbooks/gitea/gitea.target

0
gitea/other/postgresql/gitea.sql → cookbooks/gitea/other/postgresql/gitea.sql

0
gitea/other/traefik/gitea.yaml → cookbooks/gitea/other/traefik/gitea.yaml

0
gitea/overlay.bu → cookbooks/gitea/overlay.bu

0
gitea/tmpfiles.d/gitea.conf → cookbooks/gitea/tmpfiles.d/gitea.conf

5
keycloak/Makefile → cookbooks/keycloak/Makefile

@ -8,6 +8,5 @@ DEPENDENCIES = postgresql traefik
PROJECT_UID = 10007
PROJECT_GID = 10000
TOP_LEVEL_DIR := ..
include $(TOP_LEVEL_DIR)/common.mk
# Include common Makefile
include ../../scripts/common.mk

0
keycloak/README.md → cookbooks/keycloak/README.md

0
keycloak/config/container/Containerfile → cookbooks/keycloak/config/container/Containerfile

0
keycloak/config/examples/config.env → cookbooks/keycloak/config/examples/config.env

0
keycloak/keycloak-build.timer → cookbooks/keycloak/keycloak-build.timer

0
keycloak/keycloak.build → cookbooks/keycloak/keycloak.build

0
keycloak/keycloak.container → cookbooks/keycloak/keycloak.container

0
keycloak/keycloak.target → cookbooks/keycloak/keycloak.target

0
keycloak/other/postgresql/keycloak.sql → cookbooks/keycloak/other/postgresql/keycloak.sql

0
keycloak/other/traefik/keycloak.yaml → cookbooks/keycloak/other/traefik/keycloak.yaml

0
keycloak/overlay.bu → cookbooks/keycloak/overlay.bu

4
lego/Makefile → cookbooks/lego/Makefile

@ -7,7 +7,5 @@ PROJECT_UID = 10023
PROJECT_GID = 10000
# Include common Makefile
TOP_LEVEL_DIR := ..
include $(TOP_LEVEL_DIR)/common.mk
include ../../scripts/common.mk

0
lego/README.md → cookbooks/lego/README.md

0
lego/config/examples/config.env → cookbooks/lego/config/examples/config.env

0
lego/config/hooks/flag-as-renewed.sh → cookbooks/lego/config/hooks/flag-as-renewed.sh

0
lego/lego-renew.container → cookbooks/lego/lego-renew.container

0
lego/lego-renew.timer → cookbooks/lego/lego-renew.timer

0
lego/lego-run.container → cookbooks/lego/lego-run.container

0
lego/lego.target → cookbooks/lego/lego.target

0
lego/overlay.bu → cookbooks/lego/overlay.bu

5
miniflux/Makefile → cookbooks/miniflux/Makefile

@ -8,6 +8,5 @@ DEPENDENCIES = postgresql traefik
PROJECT_UID = 10010
PROJECT_GID = 10000
TOP_LEVEL_DIR := ..
include $(TOP_LEVEL_DIR)/common.mk
# Include common Makefile
include ../../scripts/common.mk

0
miniflux/README.md → cookbooks/miniflux/README.md

0
miniflux/config/examples/miniflux.conf → cookbooks/miniflux/config/examples/miniflux.conf

0
miniflux/miniflux.container → cookbooks/miniflux/miniflux.container

0
miniflux/miniflux.target → cookbooks/miniflux/miniflux.target

0
miniflux/other/postgresql/miniflux.sql → cookbooks/miniflux/other/postgresql/miniflux.sql

0
miniflux/other/traefik/miniflux.yaml → cookbooks/miniflux/other/traefik/miniflux.yaml

0
miniflux/overlay.bu → cookbooks/miniflux/overlay.bu

4
nextcloud/Makefile → cookbooks/nextcloud/Makefile

@ -8,8 +8,8 @@ DEPENDENCIES = postgresql traefik
PROJECT_UID = 10008
PROJECT_GID = 10000
TOP_LEVEL_DIR := ..
include $(TOP_LEVEL_DIR)/common.mk
# Include common Makefile
include ../../scripts/common.mk
# Additional Nextcloud directories and files
TARGET_FILES += $(TARGET_CHROOT)/etc/quadlets/nextcloud/collabora-seccomp-profile.json

0
nextcloud/README.md → cookbooks/nextcloud/README.md

0
nextcloud/config/custom-noinit.sh → cookbooks/nextcloud/config/custom-noinit.sh

0
nextcloud/config/custom-post.sh → cookbooks/nextcloud/config/custom-post.sh

0
nextcloud/config/custom-pre.sh → cookbooks/nextcloud/config/custom-pre.sh

0
nextcloud/config/examples/collabora.env → cookbooks/nextcloud/config/examples/collabora.env

0
nextcloud/config/examples/config.env → cookbooks/nextcloud/config/examples/config.env

0
nextcloud/config/nginx.conf → cookbooks/nextcloud/config/nginx.conf

0
nextcloud/config/redis.conf → cookbooks/nextcloud/config/redis.conf

0
nextcloud/config/www.conf → cookbooks/nextcloud/config/www.conf

0
nextcloud/nextcloud-app.container → cookbooks/nextcloud/nextcloud-app.container

0
nextcloud/nextcloud-collabora.container → cookbooks/nextcloud/nextcloud-collabora.container

0
nextcloud/nextcloud-cron.container → cookbooks/nextcloud/nextcloud-cron.container

0
nextcloud/nextcloud-cron.timer → cookbooks/nextcloud/nextcloud-cron.timer

0
nextcloud/nextcloud-init.container → cookbooks/nextcloud/nextcloud-init.container

0
nextcloud/nextcloud-nginx.container → cookbooks/nextcloud/nextcloud-nginx.container

0
nextcloud/nextcloud-redis.container → cookbooks/nextcloud/nextcloud-redis.container

0
nextcloud/nextcloud-upgrade.container → cookbooks/nextcloud/nextcloud-upgrade.container

0
nextcloud/nextcloud.target → cookbooks/nextcloud/nextcloud.target

0
nextcloud/other/postgresql/nextcloud.sql → cookbooks/nextcloud/other/postgresql/nextcloud.sql

0
nextcloud/other/traefik/collabora.yaml → cookbooks/nextcloud/other/traefik/collabora.yaml

0
nextcloud/other/traefik/nextcloud.yaml → cookbooks/nextcloud/other/traefik/nextcloud.yaml

0
nextcloud/overlay.bu → cookbooks/nextcloud/overlay.bu

0
nextcloud/sysctl.d/examples/nextcloud.conf → cookbooks/nextcloud/sysctl.d/examples/nextcloud.conf

0
nextcloud/tests/witness.txt → cookbooks/nextcloud/tests/witness.txt

0
nextcloud/tmpfiles.d/nextcloud.conf → cookbooks/nextcloud/tmpfiles.d/nextcloud.conf

4
nginx/Makefile → cookbooks/nginx/Makefile

@ -1,5 +1,5 @@
TOP_LEVEL_DIR := ..
include $(TOP_LEVEL_DIR)/common.mk
# Include common Makefile
include ../../scripts/common.mk
.PHONY: test

0
nginx/README.md → cookbooks/nginx/README.md

0
nginx/config/examples/config.env → cookbooks/nginx/config/examples/config.env

0
nginx/nginx-init.container → cookbooks/nginx/nginx-init.container

0
nginx/nginx-server.container → cookbooks/nginx/nginx-server.container

0
nginx/nginx-update.container → cookbooks/nginx/nginx-update.container

0
nginx/nginx-update.timer → cookbooks/nginx/nginx-update.timer

0
nginx/nginx.target → cookbooks/nginx/nginx.target

0
nginx/website/index.html → cookbooks/nginx/website/index.html

3
postgresql/Makefile → cookbooks/postgresql/Makefile

@ -11,8 +11,7 @@ $(TARGET_CHROOT)/etc/quadlets/postgresql/init.d:
install -m 0755 -o $(PROJECT_UID) -g $(PROJECT_GID) -D -d $@
# Include common Makefile
TOP_LEVEL_DIR := ..
include $(TOP_LEVEL_DIR)/common.mk
include ../../scripts/common.mk
.PHONY: test test-set-pgmajor install-config

0
postgresql/README.md → cookbooks/postgresql/README.md

0
postgresql/config/backup.sh → cookbooks/postgresql/config/backup.sh

0
postgresql/config/examples/config.env → cookbooks/postgresql/config/examples/config.env

0
postgresql/config/init.sh → cookbooks/postgresql/config/init.sh

0
postgresql/config/upgrade.sh → cookbooks/postgresql/config/upgrade.sh

0
postgresql/hooks.mk → cookbooks/postgresql/hooks.mk

0
postgresql/overlay.bu → cookbooks/postgresql/overlay.bu

2
postgresql/postgresql-backup.container → cookbooks/postgresql/postgresql-backup.container

@ -9,7 +9,7 @@ PartOf=postgresql.target
[Container]
ContainerName=postgresql-backup-job
Image=docker.io/library/postgres:${PG_MAJOR}-alpine
Image=postgresql.image
# Network configuration
Network=host

0
postgresql/postgresql-backup.timer → cookbooks/postgresql/postgresql-backup.timer

2
postgresql/postgresql-init.container → cookbooks/postgresql/postgresql-init.container

@ -15,7 +15,7 @@ PartOf=postgresql.target
[Container]
ContainerName=postgresql-init-job
Image=docker.io/library/postgres:${PG_MAJOR}-alpine
Image=postgresql.image
# Network configuration
Network=host

13
cookbooks/postgresql/postgresql-pgautoupgrade.image

@ -0,0 +1,13 @@
[Unit]
Description=podman pull docker.io/pgautoupgrade/pgautoupgrade
Documentation=https://hub.docker.com/_/postgres/
# Only start if PostgreSQL has been configured
ConditionPathExists=/etc/quadlets/postgresql/config.env
[Image]
Image=docker.io/pgautoupgrade/pgautoupgrade:${PG_MAJOR}-alpine
[Service]
# These environment variables are sourced to be used by systemd in the Exec* commands
EnvironmentFile=/etc/quadlets/postgresql/config.env

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save