1 { lib, pkgs, config, myconfig, ... }:
3 secrets = myconfig.env.websites.aten.integration;
4 app = pkgs.webapps.aten.override { environment = secrets.environment; };
5 cfg = config.myServices.websites.aten.integration;
6 pcfg = config.services.phpApplication;
8 options.myServices.websites.aten.integration.enable = lib.mkEnableOption "enable Aten's website in integration";
10 config = lib.mkIf cfg.enable {
11 services.phpApplication.apps.aten_dev = {
12 websiteEnv = "integration";
13 httpdUser = config.services.httpd.Inte.user;
14 httpdGroup = config.services.httpd.Inte.group;
16 config.secrets.fullPaths."webapps/${app.environment}-aten"
18 inherit (app) webRoot varDir;
20 serviceDeps = [ "postgresql.service" ];
22 "APP_ENV=${app.environment} ./bin/console --env=${app.environment} cache:clear --no-warmup"
24 phpOpenbasedir = [ "/tmp" ];
26 php_admin_value[upload_max_filesize] = 20M
27 php_admin_value[post_max_size] = 20M
28 ;php_admin_flag[log_errors] = on
31 pm.process_idle_timeout = 60
32 env[SYMFONY_DEBUG_MODE] = "yes"
37 dest = "webapps/${app.environment}-aten";
38 user = config.services.httpd.Inte.user;
39 group = config.services.httpd.Inte.group;
42 SetEnv APP_ENV "${app.environment}"
43 SetEnv APP_SECRET "${secrets.secret}"
44 SetEnv DATABASE_URL "${secrets.psql_url}"
47 services.websites.env.integration.vhostConfs.aten_dev = {
50 hosts = [ "dev.aten.pro" ];
51 root = pcfg.webappDirs.aten_dev;
55 SetHandler "proxy:unix:${pcfg.phpListenPaths.aten_dev}|fcgi://localhost"
58 Include ${config.secrets.fullPaths."webapps/${app.environment}-aten"}
62 Require ldap-group cn=dev.aten.pro,cn=httpd,ou=services,dc=immae,dc=eu
63 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://aten.pro\"></html>"
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>"
72 <Directory ${pcfg.webappDirs.aten_dev}>
73 Options Indexes FollowSymLinks MultiViews Includes
76 DirectoryIndex index.php
77 FallbackResource /index.php