Set up Wallabag

This commit is contained in:
coolneng 2019-11-17 18:58:31 +01:00
parent 58b29c0f7a
commit efa53dc335
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 45 additions and 3 deletions

View File

@ -7,7 +7,8 @@
php
postgresql_11
libressl
wallabag
gnumake
php73Packages.composer
];
services.nginx = {
@ -65,6 +66,23 @@
locations."/gitea/" = {
proxyPass = "http://localhost:3000/";
};
locations."/wallabag/" = {
root = "/var/lib/wallabag/web";
tryFiles = "try_files $uri /app.php$is_args$args";
extraConfig = ''
location ~ ^/app\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
location ~ \.php$ {
return 404;
}
'';
};
};
};
};
@ -83,16 +101,20 @@
params = { nginx.bits = 2048; };
};
# Enable PostgreSQL with daily backup
# PostgreSQL databases configuration
services.postgresql = {
enable = true;
package = pkgs.postgresql_11;
ensureDatabases = [ "gitea" ];
ensureDatabases = [ "gitea" "wallabag" ];
ensureUsers = [
{
name = "gitea";
ensurePermissions = {"DATABASE gitea" = "ALL PRIVILEGES";};
}
{
name = "wallabag";
ensurePermissions = {"DATABASE wallabag" = "ALL PRIVILEGES";};
}
];
authentication = lib.mkForce ''
# Generated file; do not edit!
@ -106,6 +128,7 @@
'';
};
# PostgreSQL daily backups
services.postgresqlBackup = {
enable = true;
backupAll = true;
@ -113,4 +136,23 @@
startAt = "*-*-* 05:15:00";
};
# PHP-fpm configuration
services.phpfpm = {
pools = {
mypool = {
user = "php";
group = "php";
phpPackage = pkgs.php;
settings = {
"pm" = "static";
"pm.max_children" = 4;
"pm.start_servers" = 2;
"pm.min_spare_servers" = 2;
"pm.max_spare_servers" = 4;
"pm.max_requests" = 500;
};
};
};
};
}