Migrate Wallabag to container deployment
This commit is contained in:
@@ -44,9 +44,31 @@
|
||||
ports = [ "127.0.0.1:9090:8080" ];
|
||||
volumes = [ "/vault/opodsync:/var/www/server/data" ];
|
||||
};
|
||||
# Wallabag
|
||||
wallabag = {
|
||||
image = "wallabag/wallabag@sha256:a87160e4445e11f9bcec0f4b201c31e1eb0d201d7bcd1aac421e8f3c2b8f553c";
|
||||
environmentFiles = [ config.age.secrets.wallabag.path ];
|
||||
dependsOn = [ "postgresql" ];
|
||||
extraOptions = [ "--pod=wallabag-pod" ];
|
||||
};
|
||||
# Wallabag database
|
||||
postgresql = {
|
||||
image = "postgres:16.8@sha256:e95b0cb95f719e0ce156c2bc5545c89fbd98a1a692845a5331ddc79ea61f1b1e";
|
||||
environmentFiles = [ config.age.secrets.wallabag-postgres.path ];
|
||||
extraOptions = [ "--pod=wallabag-pod" ];
|
||||
volumes = [ "/var/lib/postgresql-wallabag:/var/lib/postgresql/data" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
# Allow networking between Wallabag and Postgresql
|
||||
systemd.services.create-wallabag-pod = {
|
||||
serviceConfig.Type = "oneshot";
|
||||
wantedBy = [ "podman-postgresql.service" ];
|
||||
script = with pkgs; ''
|
||||
${podman}/bin/podman pod exists wallabag-pod || ${podman}/bin/podman pod create -n wallabag-pod -p '127.0.0.1:8090:80'
|
||||
'';
|
||||
};
|
||||
|
||||
# Start services after ZFS mount
|
||||
systemd.services.podman-mqtt2prometheus.unitConfig.RequiresMountsFor = [ /vault/mqtt2prometheus ];
|
||||
|
||||
@@ -12,23 +12,8 @@
|
||||
adminCredentialsFile = config.age.secrets.miniflux.path;
|
||||
};
|
||||
|
||||
# Php-fpm pool for Wallabag
|
||||
services.phpfpm.pools.wallabag = {
|
||||
user = "nginx";
|
||||
group = "nginx";
|
||||
settings = {
|
||||
"listen.owner" = config.services.nginx.user;
|
||||
"listen.group" = config.services.nginx.group;
|
||||
"listen.mode" = 600;
|
||||
"pm" = "ondemand";
|
||||
"pm.max_children " = 4;
|
||||
"pm.max_requests" = 32;
|
||||
"env[WALLABAG_DATA]" = config.environment.variables.WALLABAG_DATA;
|
||||
};
|
||||
phpEnv."PATH" = lib.makeBinPath [ pkgs.php ];
|
||||
};
|
||||
|
||||
# Set environment variable pointing to wallabag configuration directory
|
||||
environment.variables.WALLABAG_DATA = "/var/lib/wallabag";
|
||||
|
||||
}
|
||||
|
||||
@@ -137,22 +137,13 @@
|
||||
"wallabag.psydnd.org" = {
|
||||
useACMEHost = "psydnd.org";
|
||||
forceSSL = true;
|
||||
root = "${pkgs.wallabag}/web";
|
||||
locations = {
|
||||
"/".tryFiles = "$uri /app.php$is_args$args";
|
||||
"/assets".root = "${config.environment.variables.WALLABAG_DATA}/web";
|
||||
"~ ^/app.php(/|$)" = {
|
||||
fastcgiParams = {
|
||||
SCRIPT_FILENAME = "${pkgs.wallabag}/web/$fastcgi_script_name";
|
||||
DOCUMENT_ROOT = "${pkgs.wallabag}/web";
|
||||
};
|
||||
extraConfig = ''
|
||||
fastcgi_pass unix:${config.services.phpfpm.pools.wallabag.socket};
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
include ${pkgs.nginx}/conf/fastcgi_params;
|
||||
internal;
|
||||
'';
|
||||
};
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:8090/";
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Forwarded-Host $server_name;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
'';
|
||||
};
|
||||
};
|
||||
"books.psydnd.org" = {
|
||||
@@ -236,7 +227,6 @@
|
||||
"miniflux.service"
|
||||
"radicale.service"
|
||||
"dendrite.service"
|
||||
"phpfpm-wallabag.service"
|
||||
"grafana.service"
|
||||
"podman-openbooks.service"
|
||||
"podman-mqtt2prometheus.service"
|
||||
|
||||
Reference in New Issue
Block a user