1 { lib, pkgs, config, ... }:
3 secrets = config.myEnv.websites.isabelle.aten_integration;
4 webRoot = "/var/lib/ftp/immae/aten/public";
5 cfg = config.myServices.websites.isabelle.aten_integration;
6 pcfg = config.services.phpApplication;
8 options.myServices.websites.isabelle.aten_integration.enable = lib.mkEnableOption "enable Aten's website in integration";
10 config = lib.mkIf cfg.enable {
11 services.phpApplication.apps.isabelle_aten_integration = {
12 websiteEnv = "integration";
13 httpdUser = config.services.httpd.Inte.user;
14 httpdGroup = config.services.httpd.Inte.group;
16 config.secrets.fullPaths."websites/isabelle/aten_integration"
19 varDir = "/var/lib/ftp/immae/aten_var";
20 app = "/var/lib/ftp/immae/aten";
21 serviceDeps = [ "postgresql.service" ];
23 "APP_ENV=dev ./bin/console --env=dev 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";
31 "pm.max_children" = "5";
32 "pm.process_idle_timeout" = "60";
35 SYMFONY_DEBUG_MODE = "\"yes\"";
37 phpPackage = pkgs.php72;
40 secrets.keys."websites/isabelle/aten_integration" = {
41 user = config.services.httpd.Inte.user;
42 group = config.services.httpd.Inte.group;
46 # https://secure.php.net/manual/fr/function.parse-url.php
47 # vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php#parseDatabaseUrlQuery
48 psql_url = with secrets.postgresql; "pdo-pgsql://${user}:${password}@invalid:${port}/${database}?host=${socket}";
51 SetEnv APP_SECRET "${secrets.secret}"
52 SetEnv DATABASE_URL "${psql_url}"
55 services.websites.env.integration.vhostConfs.isabelle_aten_integration = {
56 certName = "integration";
58 hosts = [ "aten.ic.immae.dev" ];
63 SetHandler "proxy:unix:${pcfg.phpListenPaths.isabelle_aten_integration}|fcgi://localhost"
66 Include ${config.secrets.fullPaths."websites/isabelle/aten_integration"}
70 Require ldap-group cn=ic.immae.dev,cn=httpd,ou=services,dc=immae,dc=eu
71 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
76 Require ldap-group cn=ic.immae.dev,cn=httpd,ou=services,dc=immae,dc=eu
77 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
80 <Directory ${webRoot}>
81 Options Indexes FollowSymLinks MultiViews Includes
84 DirectoryIndex index.php
85 FallbackResource /index.php