1 { php, env, ttrss, ttrss-plugins }:
6 varDir = "/var/lib/ttrss";
10 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
11 ${varDir}/lock ${varDir}/cache ${varDir}/feed-icons
12 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir}/cache/export/ \
13 ${varDir}/cache/feeds/ \
14 ${varDir}/cache/images/ \
16 ${varDir}/cache/simplepie/ \
17 ${varDir}/cache/upload/
18 touch ${varDir}/feed-icons/index.html
19 install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
23 dest = "webapps/tools-ttrss";
30 define('PHP_EXECUTABLE', '${php}/bin/php');
32 define('LOCK_DIRECTORY', 'lock');
33 define('CACHE_DIR', 'cache');
34 define('ICONS_DIR', 'feed-icons');
35 define('ICONS_URL', 'feed-icons');
36 define('SELF_URL_PATH', 'https://tools.immae.eu/ttrss/');
38 define('MYSQL_CHARSET', 'UTF8');
40 define('DB_TYPE', 'pgsql');
41 define('DB_HOST', '${env.postgresql.socket}');
42 define('DB_USER', '${env.postgresql.user}');
43 define('DB_NAME', '${env.postgresql.database}');
44 define('DB_PASS', '${env.postgresql.password}');
45 define('DB_PORT', '${env.postgresql.port}');
47 define('AUTH_AUTO_CREATE', true);
48 define('AUTH_AUTO_LOGIN', true);
50 define('SINGLE_USER_MODE', false);
52 define('SIMPLE_UPDATE_MODE', false);
53 define('CHECK_FOR_UPDATES', true);
55 define('FORCE_ARTICLE_PURGE', 0);
56 define('SESSION_COOKIE_LIFETIME', 60*60*24*120);
57 define('ENABLE_GZIP_OUTPUT', false);
59 define('PLUGINS', 'auth_ldap, note, instances');
61 define('LOG_DESTINATION', ''');
62 define('CONFIG_VERSION', 26);
65 define('SPHINX_SERVER', 'localhost:9312');
66 define('SPHINX_INDEX', 'ttrss, delta');
68 define('ENABLE_REGISTRATION', false);
69 define('REG_NOTIFY_ADDRESS', 'ttrss@tools.immae.eu');
70 define('REG_MAX_USERS', 10);
72 define('SMTP_FROM_NAME', 'Tiny Tiny RSS');
73 define('SMTP_FROM_ADDRESS', 'ttrss@tools.immae.eu');
74 define('DIGEST_SUBJECT', '[tt-rss] New headlines for last 24 hours');
76 define('LDAP_AUTH_SERVER_URI', 'ldap://${env.ldap.host}:389/');
77 define('LDAP_AUTH_USETLS', TRUE);
78 define('LDAP_AUTH_ALLOW_UNTRUSTED_CERT', TRUE);
79 define('LDAP_AUTH_BASEDN', '${env.ldap.base}');
80 define('LDAP_AUTH_ANONYMOUSBEFOREBIND', FALSE);
81 define('LDAP_AUTH_SEARCHFILTER', '${env.ldap.filter}');
83 define('LDAP_AUTH_BINDDN', '${env.ldap.dn}');
84 define('LDAP_AUTH_BINDPW', '${env.ldap.password}');
85 define('LDAP_AUTH_LOGIN_ATTRIB', 'immaeTtrssLogin');
87 define('LDAP_AUTH_LOG_ATTEMPTS', FALSE);
88 define('LDAP_AUTH_DEBUG', FALSE);
91 webRoot = (ttrss.override { ttrss_config = "/var/secrets/webapps/tools-ttrss"; }).withPlugins (builtins.attrValues ttrss-plugins);
95 modules = [ "proxy_fcgi" ];
96 webappName = "tools_ttrss";
97 root = "/run/current-system/webapps/${webappName}";
99 Alias /ttrss "${root}"
100 <Directory "${root}">
101 DirectoryIndex index.php
102 <FilesMatch "\.php$">
103 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
107 Options FollowSymlinks
113 serviceDeps = [ "postgresql.service" "openldap.service" ];
114 basedir = builtins.concatStringsSep ":" (
115 [ webRoot "/var/secrets/webapps/tools-ttrss" varDir ]
117 socket = "/var/run/phpfpm/ttrss.sock";
120 user = ${apache.user}
121 group = ${apache.group}
122 listen.owner = ${apache.user}
123 listen.group = ${apache.group}
126 pm.process_idle_timeout = 60
128 ; Needed to avoid clashes in browser cookies (same domain)
129 php_value[session.name] = TtrssPHPSESSID
130 php_admin_value[open_basedir] = "${basedir}:/tmp"
131 php_admin_value[session.save_path] = "${varDir}/phpSessions"