mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-01-11 09:44:08 -05:00
booklore up and running
This commit is contained in:
parent
6ce540f5aa
commit
213cc8c10a
4 changed files with 89 additions and 34 deletions
|
|
@ -1,40 +1,88 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
services.caddy.virtualHosts."booklore.wanderingcrow.net".extraConfig = ''
|
||||
reverse_proxy http://10.88.0.4:6060
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
port = builtins.toString (lib.custom.autoport "booklore");
|
||||
volumePath = "/overseer/services";
|
||||
sopsFolder = inputs.nix-secrets + "/sops";
|
||||
in
|
||||
{
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${volumePath}/booklore"
|
||||
"d ${volumePath}/booklore/books"
|
||||
"d ${volumePath}/booklore/bookdrop"
|
||||
"d ${volumePath}/booklore/data"
|
||||
"d ${volumePath}/booklore/database"
|
||||
];
|
||||
|
||||
sops.secrets = {
|
||||
"booklore/db/root_pass" = {
|
||||
sopsFile = "${sopsFolder}/services.yaml";
|
||||
};
|
||||
"booklore/db/pass" = {
|
||||
sopsFile = "${sopsFolder}/services.yaml";
|
||||
};
|
||||
};
|
||||
|
||||
sops.templates."booklore-env".content = ''
|
||||
MYSQL_ROOT_PASSWORD = ${config.sops.placeholder."booklore/db/root_pass"}
|
||||
MYSQL_PASSWORD = ${config.sops.placeholder."booklore/db/pass"}
|
||||
DATABASE_PASSWORD = ${config.sops.placeholder."booklore/db/pass"}
|
||||
'';
|
||||
|
||||
services.caddy.virtualHosts."booklore.wanderingcrow.net".extraConfig = ''
|
||||
reverse_proxy localhost:${port}
|
||||
'';
|
||||
|
||||
virtualisation.quadlet = {
|
||||
containers = {
|
||||
booklore-web.containerConfig = {
|
||||
image = "ghcr.io/booklore-app/booklore:v1.14.1";
|
||||
environments = {
|
||||
USER_ID = "0";
|
||||
GROUP_ID = "0";
|
||||
TZ = "America/New_York";
|
||||
DATABASE_URL = "jdbc:mariadb://booklore-db:3306/booklore";
|
||||
DB_USER = "booklore";
|
||||
DB_PASSWORD = "changeme";
|
||||
BOOKLORE_PORT = "6060";
|
||||
};
|
||||
publishPorts = [
|
||||
""
|
||||
];
|
||||
pod = config.virtualisation.quadlet.pods.booklore.ref;
|
||||
environments = {
|
||||
DATABASE_URL = "jdbc:mariadb://localhost:3306/booklore";
|
||||
DATABASE_USERNAME = "booklore";
|
||||
BOOKLORE_PORT = "6060";
|
||||
# FIXME: convert to secrets
|
||||
DATABASE_PASSWORD = "changeme";
|
||||
};
|
||||
environmentFiles = [
|
||||
config.sops.templates."booklore-env".path
|
||||
];
|
||||
volumes = [
|
||||
"${volumePath}/booklore/books:/books"
|
||||
"${volumePath}/booklore/bookdrop:/bookdrop"
|
||||
"${volumePath}/booklore/data:/app/data"
|
||||
];
|
||||
};
|
||||
booklore-db.containerConfig = {
|
||||
image = "lscr.io/linuxserver/mariadb:11.4.5";
|
||||
image = "lscr.io/linuxserver/mariadb:11.4.8";
|
||||
pod = config.virtualisation.quadlet.pods.booklore.ref;
|
||||
environments = {
|
||||
PUID = "1000";
|
||||
PGID = "1000";
|
||||
TZ = "America/New_York";
|
||||
MYSQL_ROOT_PASSWORD = "changeme";
|
||||
MYSQL_DATABASE = "booklore";
|
||||
TZ = "Etc/UTC";
|
||||
PUID = "0";
|
||||
PGID = "0";
|
||||
MYSQL_USER = "booklore";
|
||||
MYSQL_DATABASE = "booklore";
|
||||
# FIXME: convert to secrets
|
||||
MYSQL_ROOT_PASSWORD = "changeme";
|
||||
MYSQL_PASSWORD = "changeme";
|
||||
};
|
||||
pod = config.virtualisation.quadlet.pods.booklore.ref;
|
||||
environmentFiles = [
|
||||
config.sops.templates."booklore-env".path
|
||||
];
|
||||
volumes = [
|
||||
"${volumePath}/booklore/database:/config"
|
||||
];
|
||||
};
|
||||
};
|
||||
pods.booklore = { };
|
||||
pods.booklore = {
|
||||
podConfig.publishPorts = [
|
||||
"${port}:6060"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue