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.duplyBackup.profiles.piedsjaloux_dev.rootDir = app.varDir;
12 services.phpApplication.apps.piedsjaloux_dev = {
13 websiteEnv = "integration";
14 httpdUser = config.services.httpd.Inte.user;
15 httpdGroup = config.services.httpd.Inte.group;
16 inherit (app) webRoot varDir;
21 serviceDeps = [ "mysql.service" ];
23 "./bin/console --env=${app.environment} cache:clear --no-warmup"
25 phpOpenbasedir = [ "/tmp" ];
27 php_admin_value[upload_max_filesize] = 20M
28 php_admin_value[post_max_size] = 20M
29 ;php_admin_flag[log_errors] = on
30 env[PATH] = ${lib.makeBinPath [ pkgs.apg pkgs.unzip ]}
33 pm.process_idle_timeout = 60
34 env[SYMFONY_DEBUG_MODE] = "yes"
37 config.secrets.fullPaths."webapps/${app.environment}-piedsjaloux"
43 dest = "webapps/${app.environment}-piedsjaloux";
44 user = config.services.httpd.Inte.user;
45 group = config.services.httpd.Inte.group;
48 # This file is auto-generated during the composer install
50 database_host: ${secrets.mysql.host}
51 database_port: ${secrets.mysql.port}
52 database_name: ${secrets.mysql.name}
53 database_user: ${secrets.mysql.user}
54 database_password: ${secrets.mysql.password}
55 database_server_version: ${pkgs.mariadb.mysqlVersion}
56 mailer_transport: smtp
57 mailer_host: 127.0.0.1
60 secret: ${secrets.secret}
61 pdflatex: "${pkgs.texlive.combine { inherit (pkgs.texlive) attachfile preprint scheme-small; }}/bin/pdflatex"
63 binary_path: ${pkgs.imagemagick}/bin
68 services.websites.env.integration.vhostConfs.piedsjaloux_dev = {
71 hosts = [ "piedsjaloux.immae.eu" ];
72 root = pcfg.webappDirs.piedsjaloux_dev;
76 SetHandler "proxy:unix:${pcfg.phpListenPaths.piedsjaloux_dev}|fcgi://localhost"
81 Require ldap-group cn=piedsjaloux.immae.eu,cn=httpd,ou=services,dc=immae,dc=eu
82 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://piedsjaloux.fr\"></html>"
85 <Directory ${pcfg.webappDirs.piedsjaloux_dev}>
86 Options Indexes FollowSymLinks MultiViews Includes
90 DirectoryIndex app_dev.php
92 <IfModule mod_negotiation.c>
96 <IfModule mod_rewrite.c>
99 RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
100 RewriteRule ^(.*) - [E=BASE:%1]
103 RewriteCond %{DOCUMENT_ROOT}/maintenance.php -f
104 RewriteCond %{SCRIPT_FILENAME} !maintenance.php
105 RewriteRule ^.*$ %{ENV:BASE}/maintenance.php [R=503,L]
106 ErrorDocument 503 /maintenance.php
108 # Sets the HTTP_AUTHORIZATION header removed by Apache
109 RewriteCond %{HTTP:Authorization} .
110 RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
112 RewriteCond %{ENV:REDIRECT_STATUS} ^$
113 RewriteRule ^app_dev\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
115 # If the requested filename exists, simply serve it.
116 # We only want to let Apache serve files and not directories.
117 RewriteCond %{REQUEST_FILENAME} -f
120 # Rewrite all other queries to the front controller.
121 RewriteRule ^ %{ENV:BASE}/app_dev.php [L]