1 { lib, pkgs, config, myconfig, ... }:
3 secrets = myconfig.env.websites.piedsjaloux.integration;
4 app = pkgs.webapps.piedsjaloux.override { environment = secrets.environment; };
5 cfg = config.myServices.websites.piedsjaloux.integration;
6 pcfg = config.services.phpApplication;
8 options.myServices.websites.piedsjaloux.integration.enable = lib.mkEnableOption "enable PiedsJaloux's website in integration";
10 config = lib.mkIf cfg.enable {
11 services.phpApplication.apps.piedsjaloux_dev = {
12 websiteEnv = "integration";
13 httpdUser = config.services.httpd.Inte.user;
14 httpdGroup = config.services.httpd.Inte.group;
15 inherit (app) webRoot varDir;
20 serviceDeps = [ "mysql.service" ];
22 "./bin/console --env=${app.environment} cache:clear --no-warmup"
24 phpOpenbasedir = [ "/tmp" ];
26 php_admin_value[upload_max_filesize] = 20M
27 php_admin_value[post_max_size] = 20M
28 ;php_admin_flag[log_errors] = on
29 env[PATH] = ${lib.makeBinPath [ pkgs.apg pkgs.unzip ]}
32 pm.process_idle_timeout = 60
33 env[SYMFONY_DEBUG_MODE] = "yes"
36 config.secrets.fullPaths."webapps/${app.environment}-piedsjaloux"
42 dest = "webapps/${app.environment}-piedsjaloux";
43 user = config.services.httpd.Inte.user;
44 group = config.services.httpd.Inte.group;
47 # This file is auto-generated during the composer install
49 database_host: ${secrets.mysql.host}
50 database_port: ${secrets.mysql.port}
51 database_name: ${secrets.mysql.name}
52 database_user: ${secrets.mysql.user}
53 database_password: ${secrets.mysql.password}
54 database_server_version: ${pkgs.mariadb.mysqlVersion}
55 mailer_transport: smtp
56 mailer_host: 127.0.0.1
59 secret: ${secrets.secret}
60 pdflatex: "${pkgs.texlive.combine { inherit (pkgs.texlive) attachfile preprint scheme-small; }}/bin/pdflatex"
62 binary_path: ${pkgs.imagemagick}/bin
67 services.websites.env.integration.vhostConfs.piedsjaloux_dev = {
70 hosts = [ "piedsjaloux.immae.eu" ];
71 root = pcfg.webappDirs.piedsjaloux_dev;
75 SetHandler "proxy:unix:${pcfg.phpListenPaths.piedsjaloux_dev}|fcgi://localhost"
80 Require ldap-group cn=piedsjaloux.immae.eu,cn=httpd,ou=services,dc=immae,dc=eu
81 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://piedsjaloux.fr\"></html>"
84 <Directory ${pcfg.webappDirs.piedsjaloux_dev}>
85 Options Indexes FollowSymLinks MultiViews Includes
89 DirectoryIndex app_dev.php
91 <IfModule mod_negotiation.c>
95 <IfModule mod_rewrite.c>
98 RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
99 RewriteRule ^(.*) - [E=BASE:%1]
102 RewriteCond %{DOCUMENT_ROOT}/maintenance.php -f
103 RewriteCond %{SCRIPT_FILENAME} !maintenance.php
104 RewriteRule ^.*$ %{ENV:BASE}/maintenance.php [R=503,L]
105 ErrorDocument 503 /maintenance.php
107 # Sets the HTTP_AUTHORIZATION header removed by Apache
108 RewriteCond %{HTTP:Authorization} .
109 RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
111 RewriteCond %{ENV:REDIRECT_STATUS} ^$
112 RewriteRule ^app_dev\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
114 # If the requested filename exists, simply serve it.
115 # We only want to let Apache serve files and not directories.
116 RewriteCond %{REQUEST_FILENAME} -f
119 # Rewrite all other queries to the front controller.
120 RewriteRule ^ %{ENV:BASE}/app_dev.php [L]