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.duplyBackup.profiles.isabelle_aten_integration.rootDir = app.varDir;
12 services.phpApplication.apps.isabelle_aten_integration = {
13 websiteEnv = "integration";
14 httpdUser = config.services.httpd.Inte.user;
15 httpdGroup = config.services.httpd.Inte.group;
17 config.secrets.fullPaths."websites/isabelle/aten_integration"
20 varDir = "/var/lib/ftp/immae/aten_var";
21 app = "/var/lib/ftp/immae/aten";
22 serviceDeps = [ "postgresql.service" ];
24 "APP_ENV=dev ./bin/console --env=dev 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\"";
38 phpPackage = pkgs.php72;
41 secrets.keys."websites/isabelle/aten_integration" = {
42 user = config.services.httpd.Inte.user;
43 group = config.services.httpd.Inte.group;
47 # https://secure.php.net/manual/fr/function.parse-url.php
48 # vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php#parseDatabaseUrlQuery
49 psql_url = with secrets.postgresql; "pdo-pgsql://${user}:${password}@invalid:${port}/${database}?host=${socket}";
52 SetEnv APP_SECRET "${secrets.secret}"
53 SetEnv DATABASE_URL "${psql_url}"
56 services.websites.env.integration.vhostConfs.isabelle_aten_integration = {
57 certName = "integration";
59 hosts = [ "dev.aten.pro" ];
64 SetHandler "proxy:unix:${pcfg.phpListenPaths.isabelle_aten_integration}|fcgi://localhost"
67 Include ${config.secrets.fullPaths."websites/isabelle/aten_integration"}
71 Require ldap-group cn=dev.aten.pro,cn=httpd,ou=services,dc=immae,dc=eu
72 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
77 Require ldap-group cn=dev.aten.pro,cn=httpd,ou=services,dc=immae,dc=eu
78 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
81 <Directory ${webRoot}>
82 Options Indexes FollowSymLinks MultiViews Includes
85 DirectoryIndex index.php
86 FallbackResource /index.php