1 { lib, pkgs, config, ... }:
3 secrets = config.myEnv.websites.connexionswing.integration;
4 app = pkgs.webapps.connexionswing.override { environment = secrets.environment; };
5 cfg = config.myServices.websites.connexionswing.integration;
6 pcfg = config.services.phpApplication;
8 options.myServices.websites.connexionswing.integration.enable = lib.mkEnableOption "enable Connexionswing's website in integration";
10 config = lib.mkIf cfg.enable {
11 services.duplyBackup.profiles.connexionswing_dev.rootDir = app.varDir;
12 services.phpApplication.apps.connexionswing_dev = {
13 websiteEnv = "integration";
14 httpdUser = config.services.httpd.Inte.user;
15 httpdGroup = config.services.httpd.Inte.group;
16 inherit (app) webRoot varDir;
23 serviceDeps = [ "mysql.service" ];
25 "./bin/console --env=${app.environment} cache:clear --no-warmup"
27 phpOpenbasedir = [ "/tmp" "/run/wrappers/bin/sendmail" ];
29 php_admin_value[upload_max_filesize] = 20M
30 php_admin_value[post_max_size] = 20M
31 ;php_admin_flag[log_errors] = on
34 pm.process_idle_timeout = 60
35 env[SYMFONY_DEBUG_MODE] = "yes"
38 config.secrets.fullPaths."webapps/${app.environment}-connexionswing"
44 dest = "webapps/${app.environment}-connexionswing";
45 user = config.services.httpd.Inte.user;
46 group = config.services.httpd.Inte.group;
49 # This file is auto-generated during the composer install
51 database_host: ${secrets.mysql.host}
52 database_port: ${secrets.mysql.port}
53 database_name: ${secrets.mysql.database}
54 database_user: ${secrets.mysql.user}
55 database_password: ${secrets.mysql.password}
56 database_server_version: ${pkgs.mariadb.mysqlVersion}
57 mailer_transport: sendmail
61 subscription_email: ${secrets.email}
63 secret: ${secrets.secret}
68 services.websites.env.integration.vhostConfs.connexionswing_dev = {
71 hosts = ["connexionswing.immae.eu" "sandetludo.immae.eu" ];
72 root = pcfg.webappDirs.connexionswing_dev;
76 SetHandler "proxy:unix:${pcfg.phpListenPaths.connexionswing_dev}|fcgi://localhost"
79 <Directory ${app.varDir}/medias>
80 Options FollowSymLinks
85 <Directory ${app.varDir}/uploads>
86 Options FollowSymLinks
93 Require ldap-group cn=connexionswing.immae.eu,cn=httpd,ou=services,dc=immae,dc=eu
94 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://connexionswing.com\"></html>"
97 <Directory ${pcfg.webappDirs.connexionswing_dev}>
98 Options Indexes FollowSymLinks MultiViews Includes
102 DirectoryIndex app_dev.php
104 <IfModule mod_negotiation.c>
108 <IfModule mod_rewrite.c>
111 RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
112 RewriteRule ^(.*) - [E=BASE:%1]
115 RewriteCond %{DOCUMENT_ROOT}/maintenance.php -f
116 RewriteCond %{SCRIPT_FILENAME} !maintenance.php
117 RewriteRule ^.*$ %{ENV:BASE}/maintenance.php [R=503,L]
118 ErrorDocument 503 /maintenance.php
120 # Sets the HTTP_AUTHORIZATION header removed by Apache
121 RewriteCond %{HTTP:Authorization} .
122 RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
124 RewriteCond %{ENV:REDIRECT_STATUS} ^$
125 RewriteRule ^app_dev\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
127 # If the requested filename exists, simply serve it.
128 # We only want to let Apache serve files and not directories.
129 RewriteCond %{REQUEST_FILENAME} -f
132 # Rewrite all other queries to the front controller.
133 RewriteRule ^ %{ENV:BASE}/app_dev.php [L]