1 { lib, pkgs, config, ... }:
3 secrets = config.myEnv.websites.isabelle.aten_integration;
4 app = pkgs.callPackage ./aten_app {
5 environment = secrets.environment;
6 varDir = "/var/lib/isabelle_aten_integration";
8 cfg = config.myServices.websites.isabelle.aten_integration;
9 pcfg = config.services.phpApplication;
11 options.myServices.websites.isabelle.aten_integration.enable = lib.mkEnableOption "enable Aten's website in integration";
13 config = lib.mkIf cfg.enable {
14 services.duplyBackup.profiles.isabelle_aten_integration.rootDir = app.varDir;
15 services.phpApplication.apps.isabelle_aten_integration = {
16 websiteEnv = "integration";
17 httpdUser = config.services.httpd.Inte.user;
18 httpdGroup = config.services.httpd.Inte.group;
20 config.secrets.fullPaths."websites/isabelle/aten_integration"
22 inherit (app) webRoot varDir;
24 serviceDeps = [ "postgresql.service" ];
26 "APP_ENV=${app.environment} ./bin/console --env=${app.environment} cache:clear --no-warmup"
28 phpOpenbasedir = [ "/tmp" ];
30 "php_admin_value[upload_max_filesize]" = "20M";
31 "php_admin_value[post_max_size]" = "20M";
32 #"php_admin_flag[log_errors]" = "on";
34 "pm.max_children" = "5";
35 "pm.process_idle_timeout" = "60";
38 SYMFONY_DEBUG_MODE = "\"yes\"";
43 dest = "websites/isabelle/aten_integration";
44 user = config.services.httpd.Inte.user;
45 group = config.services.httpd.Inte.group;
49 # https://secure.php.net/manual/fr/function.parse-url.php
50 # vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php#parseDatabaseUrlQuery
51 psql_url = with secrets.postgresql; "pdo-pgsql://${user}:${password}@invalid:${port}/${database}?host=${socket}";
53 SetEnv APP_ENV "${app.environment}"
54 SetEnv APP_SECRET "${secrets.secret}"
55 SetEnv DATABASE_URL "${psql_url}"
58 services.websites.env.integration.vhostConfs.isabelle_aten_integration = {
59 certName = "integration";
61 hosts = [ "dev.aten.pro" ];
62 root = pcfg.webappDirs.isabelle_aten_integration;
66 SetHandler "proxy:unix:${pcfg.phpListenPaths.isabelle_aten_integration}|fcgi://localhost"
69 Include ${config.secrets.fullPaths."websites/isabelle/aten_integration"}
73 Require ldap-group cn=dev.aten.pro,cn=httpd,ou=services,dc=immae,dc=eu
74 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
79 Require ldap-group cn=dev.aten.pro,cn=httpd,ou=services,dc=immae,dc=eu
80 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
83 <Directory ${pcfg.webappDirs.isabelle_aten_integration}>
84 Options Indexes FollowSymLinks MultiViews Includes
87 DirectoryIndex index.php
88 FallbackResource /index.php