1 { apacheUser, apacheGroup, tellesflorian, config }:
3 app = tellesflorian.override { inherit (config) environment; };
6 dest = "webapps/${app.environment}-tellesflorian-passwords";
11 invite:${config.invite_passwords}
15 dest = "webapps/${app.environment}-tellesflorian";
20 # This file is auto-generated during the composer install
22 database_host: ${config.mysql.host}
23 database_port: ${config.mysql.port}
24 database_name: ${config.mysql.name}
25 database_user: ${config.mysql.user}
26 database_password: ${config.mysql.password}
27 mailer_transport: smtp
28 mailer_host: 127.0.0.1
31 secret: ${config.secret}
37 if [ ! -f "${app.varDir}/currentWebappDir" -o \
38 ! -f "${app.varDir}/currentKey" -o \
39 "${app}" != "$(cat ${app.varDir}/currentWebappDir 2>/dev/null)" ] \
40 || ! sha512sum -c --status ${app.varDir}/currentKey; then
41 pushd ${app} > /dev/null
42 /run/wrappers/bin/sudo -u wwwrun ./bin/console --env=${app.environment} cache:clear --no-warmup
44 echo -n "${app}" > ${app.varDir}/currentWebappDir
45 sha512sum /var/secrets/webapps/${app.environment}-tellesflorian > ${app.varDir}/currentKey
48 serviceDeps = [ "mysql.service" ];
49 socket = "/var/run/phpfpm/floriantelles-${app.environment}.sock";
53 group = ${apacheGroup}
54 listen.owner = ${apacheUser}
55 listen.group = ${apacheGroup}
56 php_admin_value[upload_max_filesize] = 20M
57 php_admin_value[post_max_size] = 20M
58 ;php_admin_flag[log_errors] = on
59 php_admin_value[open_basedir] = "/var/secrets/webapps/${app.environment}-tellesflorian:${app}:${app.varDir}:/tmp"
60 php_admin_value[session.save_path] = "${app.varDir}/phpSessions"
61 ${if app.environment == "dev" then ''
64 pm.process_idle_timeout = 60
65 env[SYMFONY_DEBUG_MODE] = "yes"
70 pm.min_spare_servers = 1
71 pm.max_spare_servers = 3
75 modules = [ "proxy_fcgi" ];
76 webappName = "florian_${app.environment}";
77 root = "/run/current-system/webapps/${webappName}";
80 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
83 ${if app.environment == "dev" then ''
85 AuthBasicProvider file ldap
87 Require ldap-group cn=app.tellesflorian.com,cn=httpd,ou=services,dc=immae,dc=eu
89 AuthUserFile "/var/secrets/webapps/${app.environment}-tellesflorian-passwords"
92 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://tellesflorian.com\"></html>"
96 Options Indexes FollowSymLinks MultiViews Includes
100 DirectoryIndex app_dev.php
102 <IfModule mod_negotiation.c>
106 <IfModule mod_rewrite.c>
109 RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
110 RewriteRule ^(.*) - [E=BASE:%1]
113 RewriteCond %{DOCUMENT_ROOT}/maintenance.php -f
114 RewriteCond %{SCRIPT_FILENAME} !maintenance.php
115 RewriteRule ^.*$ %{ENV:BASE}/maintenance.php [R=503,L]
116 ErrorDocument 503 /maintenance.php
118 # Sets the HTTP_AUTHORIZATION header removed by Apache
119 RewriteCond %{HTTP:Authorization} .
120 RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
122 RewriteCond %{ENV:REDIRECT_STATUS} ^$
123 RewriteRule ^app_dev\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
125 # If the requested filename exists, simply serve it.
126 # We only want to let Apache serve files and not directories.
127 RewriteCond %{REQUEST_FILENAME} -f
130 # Rewrite all other queries to the front controller.
131 RewriteRule ^ %{ENV:BASE}/app_dev.php [L]
137 Options Indexes FollowSymLinks MultiViews Includes
145 deps = [ "wrappers" ];
147 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir} \
149 install -m 0750 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir}/phpSessions