1 { lib, pkgs, config, ... }:
3 adminer = pkgs.callPackage ../commons/adminer.nix { inherit config; };
4 secrets = config.myEnv.websites.tellesflorian.integration;
5 app = pkgs.webapps.tellesflorian.override { environment = secrets.environment; };
6 cfg = config.myServices.websites.florian.app;
7 pcfg = config.services.phpApplication;
9 options.myServices.websites.florian.app.enable = lib.mkEnableOption "enable Florian's app in integration";
11 config = lib.mkIf cfg.enable {
12 services.duplyBackup.profiles.tellesflorian_dev.rootDir = app.varDir;
13 services.phpApplication.apps.florian_dev = {
14 websiteEnv = "integration";
15 httpdUser = config.services.httpd.Inte.user;
16 httpdGroup = config.services.httpd.Inte.group;
17 inherit (app) webRoot varDir;
22 serviceDeps = [ "mysql.service" ];
24 "./bin/console --env=${app.environment} cache:clear --no-warmup"
26 phpOpenbasedir = [ "/tmp" ];
28 "php_admin_value[upload_max_filesize]" = "20M";
29 "php_admin_value[post_max_size]" = "20M";
30 #"php_admin_flag[log_errors]" = "on";
32 "pm.max_children" = "5";
33 "pm.process_idle_timeout" = "60";
36 SYMFONY_DEBUG_MODE = "yes";
39 config.secrets.fullPaths."webapps/${app.environment}-tellesflorian"
45 dest = "webapps/${app.environment}-tellesflorian-passwords";
46 user = config.services.httpd.Inte.user;
47 group = config.services.httpd.Inte.group;
50 invite:${secrets.invite_passwords}
54 dest = "webapps/${app.environment}-tellesflorian";
55 user = config.services.httpd.Inte.user;
56 group = config.services.httpd.Inte.group;
59 # This file is auto-generated during the composer install
61 database_host: ${secrets.mysql.host}
62 database_port: ${secrets.mysql.port}
63 database_name: ${secrets.mysql.database}
64 database_user: ${secrets.mysql.user}
65 database_password: ${secrets.mysql.password}
66 mailer_transport: smtp
67 mailer_host: 127.0.0.1
70 secret: ${secrets.secret}
75 services.websites.env.integration.modules = adminer.apache.modules;
76 services.websites.env.integration.vhostConfs.florian_dev = {
77 certName = "integration";
79 hosts = [ "app.tellesflorian.com" ];
80 root = pcfg.webappDirs.florian_dev;
84 SetHandler "proxy:unix:${pcfg.phpListenPaths.florian_dev}|fcgi://localhost"
88 AuthBasicProvider file ldap
90 Require ldap-group cn=app.tellesflorian.com,cn=httpd,ou=services,dc=immae,dc=eu
92 AuthUserFile "${config.secrets.fullPaths."webapps/${app.environment}-tellesflorian-passwords"}"
95 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://tellesflorian.com\"></html>"
98 <Directory ${pcfg.webappDirs.florian_dev}>
99 Options Indexes FollowSymLinks MultiViews Includes
103 DirectoryIndex app_dev.php
105 <IfModule mod_negotiation.c>
109 <IfModule mod_rewrite.c>
112 RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
113 RewriteRule ^(.*) - [E=BASE:%1]
116 RewriteCond %{DOCUMENT_ROOT}/maintenance.php -f
117 RewriteCond %{SCRIPT_FILENAME} !maintenance.php
118 RewriteRule ^.*$ %{ENV:BASE}/maintenance.php [R=503,L]
119 ErrorDocument 503 /maintenance.php
121 # Sets the HTTP_AUTHORIZATION header removed by Apache
122 RewriteCond %{HTTP:Authorization} .
123 RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
125 RewriteCond %{ENV:REDIRECT_STATUS} ^$
126 RewriteRule ^app_dev\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
128 # If the requested filename exists, simply serve it.
129 # We only want to let Apache serve files and not directories.
130 RewriteCond %{REQUEST_FILENAME} -f
133 # Rewrite all other queries to the front controller.
134 RewriteRule ^ %{ENV:BASE}/app_dev.php [L]
139 (adminer.apache.vhostConf null)