1 { lib, pkgs, config, ... }:
3 secrets = config.myEnv.websites.isabelle.aten_integration;
4 app = pkgs.webapps.aten.override { environment = secrets.environment; };
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.aten_dev.rootDir = app.varDir;
12 services.phpApplication.apps.aten_dev = {
13 websiteEnv = "integration";
14 httpdUser = config.services.httpd.Inte.user;
15 httpdGroup = config.services.httpd.Inte.group;
17 config.secrets.fullPaths."webapps/${app.environment}-aten"
19 inherit (app) webRoot varDir;
21 serviceDeps = [ "postgresql.service" ];
23 "APP_ENV=${app.environment} ./bin/console --env=${app.environment} 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
32 pm.process_idle_timeout = 60
33 env[SYMFONY_DEBUG_MODE] = "yes"
38 dest = "webapps/${app.environment}-aten";
39 user = config.services.httpd.Inte.user;
40 group = config.services.httpd.Inte.group;
44 # https://secure.php.net/manual/fr/function.parse-url.php
45 # vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php#parseDatabaseUrlQuery
46 psql_url = with secrets.postgresql; "pdo-pgsql://${user}:${password}@invalid:${port}/${database}?host=${socket}";
48 SetEnv APP_ENV "${app.environment}"
49 SetEnv APP_SECRET "${secrets.secret}"
50 SetEnv DATABASE_URL "${psql_url}"
53 services.websites.env.integration.vhostConfs.aten_dev = {
56 hosts = [ "dev.aten.pro" ];
57 root = pcfg.webappDirs.aten_dev;
61 SetHandler "proxy:unix:${pcfg.phpListenPaths.aten_dev}|fcgi://localhost"
64 Include ${config.secrets.fullPaths."webapps/${app.environment}-aten"}
68 Require ldap-group cn=dev.aten.pro,cn=httpd,ou=services,dc=immae,dc=eu
69 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
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>"
78 <Directory ${pcfg.webappDirs.aten_dev}>
79 Options Indexes FollowSymLinks MultiViews Includes
82 DirectoryIndex index.php
83 FallbackResource /index.php