1 { env, wallabag, mylibs, config }:
3 varDir = "/var/lib/wallabag";
4 keys."webapps/tools-wallabag" = {
9 # This file is auto-generated during the composer install
11 database_driver: pdo_pgsql
12 database_driver_class: Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver
13 database_host: ${env.postgresql.socket}
14 database_port: ${env.postgresql.port}
15 database_name: ${env.postgresql.database}
16 database_user: ${env.postgresql.user}
17 database_password: ${env.postgresql.password}
19 database_table_prefix: wallabag_
21 database_charset: utf8
22 domain_name: https://tools.immae.eu/wallabag
23 mailer_transport: sendmail
24 mailer_host: 127.0.0.1
30 twofactor_sender: wallabag@tools.immae.eu
31 fosuser_registration: false
32 fosuser_confirmation: true
33 from_email: wallabag@tools.immae.eu
35 rabbitmq_host: localhost
38 rabbitmq_password: guest
39 rabbitmq_prefetch_count: 10
43 redis_path: ${env.redis.socket}
45 sites_credentials: { }
47 ldap_host: ${env.ldap.host}
51 ldap_bind_requires_dn: true
52 ldap_base: '${env.ldap.base}'
53 ldap_manager_dn: '${env.ldap.dn}'
54 ldap_manager_pw: ${env.ldap.password}
55 ldap_filter: '${env.ldap.filter}'
56 ldap_admin_filter: '${env.ldap.admin_filter}'
57 ldap_username_attribute: uid
58 ldap_email_attribute: mail
59 ldap_name_attribute: cn
60 ldap_enabled_attribute: null
62 swiftmailer.mailer.default.transport:
63 class: Swift_SendmailTransport
64 arguments: ['/run/wrappers/bin/sendmail -bs']
68 file.datetime = "2022-08-21T22:50:00";
71 description = "wallabag is a self hostable application for saving web pages: Save and classify articles. Read them later. Freely.";
72 website = "https://tools.immae.eu/wallabag/";
73 logo = "https://tools.immae.eu/wallabag/wallassets/themes/_global/img/appicon/apple-touch-icon-120.png";
75 status.description = "OK";
76 registration."" = ["MEMBER" "CLIENT"];
77 registration.load = "OPEN";
78 install.type = "PACKAGE";
82 website = "https://wallabag.org/en";
83 license.url = "https://github.com/wallabag/wallabag/blob/master/COPYING.md";
84 license.name = "MIT License";
85 version = webappDir.version;
86 source.url = "https://github.com/wallabag/wallabag";
87 modules = "ldap-patch";
90 webappDir = wallabag.override { ldap = true; wallabag_config = config.secrets.fullPaths."webapps/tools-wallabag"; };
92 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
93 ${varDir}/var ${varDir}/data/db ${varDir}/assets/images
95 webRoot = "${webappDir}/web";
96 # Domain migration: Table wallabag_entry contains whole
97 # https://tools.immae.eu/wallabag domain name in preview_picture
101 modules = [ "proxy_fcgi" ];
103 vhostConf = socket: ''
104 Alias /wallabag "${root}"
105 <Directory "${root}">
111 <FilesMatch "\.php$">
112 SetHandler "proxy:unix:${socket}|fcgi://localhost"
115 <IfModule mod_rewrite.c>
118 RewriteCond %{REQUEST_FILENAME} !-f
119 RewriteRule ^(.*)$ app.php [QSA,L]
122 <Directory "${root}/bundles">
123 <IfModule mod_rewrite.c>
127 <Directory "${varDir}/assets">
135 if [ ! -f "${varDir}/currentWebappDir" -o \
136 ! -f "${varDir}/currentKey" -o \
137 "${webappDir}" != "$(cat ${varDir}/currentWebappDir 2>/dev/null)" ] \
138 || ! sha512sum -c --status ${varDir}/currentKey; then
139 pushd ${webappDir} > /dev/null
140 /run/wrappers/bin/sudo -u wwwrun ./bin/console --env=prod cache:clear
141 rm -rf /var/lib/wallabag/var/cache/pro_
142 /run/wrappers/bin/sudo -u wwwrun ./bin/console --env=prod doctrine:migrations:migrate --no-interaction
144 echo -n "${webappDir}" > ${varDir}/currentWebappDir
145 sha512sum ${config.secrets.fullPaths."webapps/tools-wallabag"} > ${varDir}/currentKey
148 serviceDeps = [ "postgresql.service" "openldap.service" ];
149 basedir = builtins.concatStringsSep ":" [ webappDir config.secrets.fullPaths."webapps/tools-wallabag" varDir ];
151 "listen.owner" = apache.user;
152 "listen.group" = apache.group;
154 "pm.max_children" = "60";
155 "pm.start_servers" = "2";
156 "pm.min_spare_servers" = "1";
157 "pm.max_spare_servers" = "10";
159 # Needed to avoid clashes in browser cookies (same domain)
160 "php_value[session.name]" = "WallabagPHPSESSID";
161 "php_admin_value[session.save_handler]" = "redis";
162 "php_admin_value[session.save_path]" = "'unix:///run/redis-php-sessions/redis.sock?persistent=1&prefix=Tools:Wallabag:'";
163 "php_admin_value[open_basedir]" = "/run/wrappers/bin/sendmail:${basedir}:/tmp";
164 "php_value[max_execution_time]" = "300";
167 monitoringPlugins = [ "http" ];
168 monitoringObjects.service = [
170 service_description = "wallabag website is running on tools.immae.eu";
171 host_name = config.hostEnv.fqdn;
172 use = "external-web-service";
173 check_command = ["check_https" "tools.immae.eu" "/wallabag/" "<title>Bienvenue sur wallabag"];
175 servicegroups = "webstatus-webapps";
176 _webstatus_name = "Wallabag";
177 _webstatus_url = "https://tools.immae.eu/wallabag/";