1 { lib, pkgs, config, ... }:
3 secrets = config.myEnv.websites.isabelle.aten_integration;
4 app = pkgs.callPackage ./aten_app {
5 composerEnv = pkgs.composerEnv.override { php = pkgs.php72; };
6 environment = secrets.environment;
7 varDir = "/var/lib/isabelle_aten_integration";
9 cfg = config.myServices.websites.isabelle.aten_integration;
10 pcfg = config.services.phpApplication;
12 options.myServices.websites.isabelle.aten_integration.enable = lib.mkEnableOption "enable Aten's website in integration";
14 config = lib.mkIf cfg.enable {
15 services.duplyBackup.profiles.isabelle_aten_integration.rootDir = app.varDir;
16 services.phpApplication.apps.isabelle_aten_integration = {
17 websiteEnv = "integration";
18 httpdUser = config.services.httpd.Inte.user;
19 httpdGroup = config.services.httpd.Inte.group;
21 config.secrets.fullPaths."websites/isabelle/aten_integration"
23 inherit (app) webRoot varDir;
25 serviceDeps = [ "postgresql.service" ];
27 "APP_ENV=${app.environment} ./bin/console --env=${app.environment} cache:clear --no-warmup"
29 phpOpenbasedir = [ "/tmp" ];
31 "php_admin_value[upload_max_filesize]" = "20M";
32 "php_admin_value[post_max_size]" = "20M";
33 #"php_admin_flag[log_errors]" = "on";
35 "pm.max_children" = "5";
36 "pm.process_idle_timeout" = "60";
39 SYMFONY_DEBUG_MODE = "\"yes\"";
41 phpPackage = pkgs.php72;
44 secrets.keys."websites/isabelle/aten_integration" = {
45 user = config.services.httpd.Inte.user;
46 group = config.services.httpd.Inte.group;
50 # https://secure.php.net/manual/fr/function.parse-url.php
51 # vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php#parseDatabaseUrlQuery
52 psql_url = with secrets.postgresql; "pdo-pgsql://${user}:${password}@invalid:${port}/${database}?host=${socket}";
54 SetEnv APP_ENV "${app.environment}"
55 SetEnv APP_SECRET "${secrets.secret}"
56 SetEnv DATABASE_URL "${psql_url}"
59 services.websites.env.integration.vhostConfs.isabelle_aten_integration = {
60 certName = "integration";
62 hosts = [ "dev.aten.pro" ];
63 root = pcfg.webappDirs.isabelle_aten_integration;
67 SetHandler "proxy:unix:${pcfg.phpListenPaths.isabelle_aten_integration}|fcgi://localhost"
70 Include ${config.secrets.fullPaths."websites/isabelle/aten_integration"}
74 Require ldap-group cn=dev.aten.pro,cn=httpd,ou=services,dc=immae,dc=eu
75 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
80 Require ldap-group cn=dev.aten.pro,cn=httpd,ou=services,dc=immae,dc=eu
81 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
84 <Directory ${pcfg.webappDirs.isabelle_aten_integration}>
85 Options Indexes FollowSymLinks MultiViews Includes
88 DirectoryIndex index.php
89 FallbackResource /index.php