1 { apacheUser, apacheGroup, aten, lib, mylibs, config }: rec {
2 app = aten.override { inherit (config) environment; };
4 preStart = mylibs.phpFpmPreStart {
8 "/var/secrets/webapps/${app.environment}-aten"
11 "/run/wrappers/bin/sudo -u ${apacheUser} APP_ENV=${app.environment} ./bin/console --env=${app.environment} cache:clear --no-warmup"
14 serviceDeps = [ "postgresql.service" ];
15 socket = "/var/run/phpfpm/aten-${app.environment}.sock";
19 group = ${apacheGroup}
20 listen.owner = ${apacheUser}
21 listen.group = ${apacheGroup}
22 php_admin_value[upload_max_filesize] = 20M
23 php_admin_value[post_max_size] = 20M
24 ;php_admin_flag[log_errors] = on
25 php_admin_value[open_basedir] = "${app}:${app.varDir}:/tmp"
26 php_admin_value[session.save_path] = "${app.varDir}/phpSessions"
27 ${if app.environment == "dev" then ''
30 pm.process_idle_timeout = 60
31 env[SYMFONY_DEBUG_MODE] = "yes"
36 pm.min_spare_servers = 1
37 pm.max_spare_servers = 3
41 dest = "webapps/${app.environment}-aten";
46 SetEnv APP_ENV "${app.environment}"
47 SetEnv APP_SECRET "${config.secret}"
48 SetEnv DATABASE_URL "${config.psql_url}"
52 modules = [ "proxy_fcgi" ];
53 webappName = "aten_${app.environment}";
54 root = "/run/current-system/webapps/${webappName}";
57 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
60 Include /var/secrets/webapps/${app.environment}-aten
62 ${if app.environment == "dev" then ''
65 Require ldap-group cn=dev.aten.pro,cn=httpd,ou=services,dc=immae,dc=eu
66 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
71 Require ldap-group cn=dev.aten.pro,cn=httpd,ou=services,dc=immae,dc=eu
72 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
79 Require ldap-group cn=aten.pro,cn=httpd,ou=services,dc=immae,dc=eu
80 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
85 Options Indexes FollowSymLinks MultiViews Includes
88 DirectoryIndex index.php
89 FallbackResource /index.php
94 deps = [ "wrappers" ];
96 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir}
97 install -m 0750 -o ${apacheUser} -g ${apacheGroup} -d ${app.varDir}/phpSessions