2016-06-19 07:15:34 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
{
|
|
|
|
containers.ttrss = {
|
|
|
|
config = {
|
|
|
|
users.extraUsers.ttrss = {};
|
|
|
|
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.postgresql95;
|
|
|
|
initialScript = pkgs.writeText "ttrss-init.sql" ''
|
|
|
|
create database ttrss;
|
|
|
|
create user ttrss with password 'ttrss';
|
|
|
|
grant all privileges on database ttrss to ttrss;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
services.tt-rss = {
|
|
|
|
enable = true;
|
|
|
|
user = "ttrss";
|
|
|
|
|
2016-07-30 05:14:53 +00:00
|
|
|
pool = "ttrss";
|
2018-04-17 09:50:16 +00:00
|
|
|
virtualHost = null;
|
2016-07-30 05:14:53 +00:00
|
|
|
|
2016-06-19 07:15:34 +00:00
|
|
|
database = {
|
|
|
|
type = "pgsql";
|
|
|
|
host = "localhost";
|
|
|
|
name = "ttrss";
|
|
|
|
user = "ttrss";
|
|
|
|
password = "ttrss";
|
|
|
|
};
|
|
|
|
|
|
|
|
selfUrlPath = "https://reader.gebner.org/";
|
|
|
|
};
|
|
|
|
|
|
|
|
services.phpfpm = {
|
|
|
|
extraConfig = ''
|
|
|
|
error_log = /var/log/phpfpm.log
|
|
|
|
log_level = notice
|
|
|
|
'';
|
|
|
|
|
2016-07-30 05:14:53 +00:00
|
|
|
poolConfigs = {
|
|
|
|
ttrss = ''
|
|
|
|
listen = 9000
|
2016-07-23 09:18:05 +00:00
|
|
|
user = ttrss
|
|
|
|
pm = dynamic
|
|
|
|
pm.max_children = 75
|
|
|
|
pm.start_servers = 10
|
|
|
|
pm.min_spare_servers = 5
|
|
|
|
pm.max_spare_servers = 20
|
|
|
|
pm.max_requests = 500
|
|
|
|
catch_workers_output = 1
|
2016-07-30 05:14:53 +00:00
|
|
|
'';
|
2016-06-19 07:15:34 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [ 9000 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
autoStart = true;
|
|
|
|
hostAddress = "192.168.100.10";
|
|
|
|
localAddress = "192.168.100.11";
|
|
|
|
privateNetwork = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
networking.nat.enable = true;
|
|
|
|
networking.nat.internalInterfaces = ["ve-+"];
|
2018-03-10 15:40:04 +00:00
|
|
|
networking.nat.externalInterface = "ens3";
|
2016-06-19 07:15:34 +00:00
|
|
|
|
|
|
|
security.acme.certs."gebner.org".extraDomains."reader.gebner.org" = null;
|
|
|
|
|
2019-08-25 16:04:33 +00:00
|
|
|
services.nginx = {
|
|
|
|
virtualHosts."reader.gebner.org" = {
|
|
|
|
forceSSL = true;
|
|
|
|
useACMEHost = "gebner.org";
|
|
|
|
locations."/" = {
|
|
|
|
root = "/var/lib/containers/ttrss/var/lib/tt-rss";
|
|
|
|
index = "index.php";
|
|
|
|
};
|
|
|
|
locations."/cache".extraConfig = "deny all;";
|
|
|
|
locations."= /config.php".extraConfig = "deny all;";
|
|
|
|
locations."~ \\.php$".extraConfig = ''
|
2016-06-19 07:15:34 +00:00
|
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
|
|
fastcgi_pass 192.168.100.11:9000;
|
|
|
|
fastcgi_index index.php;
|
|
|
|
fastcgi_param SCRIPT_FILENAME /var/lib/tt-rss/$fastcgi_script_name;
|
|
|
|
include ${pkgs.nginx}/conf/fastcgi_params;
|
2019-08-25 16:04:33 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-06-19 07:15:34 +00:00
|
|
|
}
|