X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Fisabelle%2Faten_integration.nix;h=288f20d04fa324564360458fbf12ccf80e014e6c;hb=41cce84a02652e22ad967c9f31669092eb3e7f0e;hp=c8ca03f142a3e76f9a4e8edf470d100ff11513ba;hpb=829ef7f1cb79f0171f9c5254278d93c48c44a7b5;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/isabelle/aten_integration.nix b/modules/private/websites/isabelle/aten_integration.nix index c8ca03f..288f20d 100644 --- a/modules/private/websites/isabelle/aten_integration.nix +++ b/modules/private/websites/isabelle/aten_integration.nix @@ -1,41 +1,44 @@ { lib, pkgs, config, ... }: let secrets = config.myEnv.websites.isabelle.aten_integration; - app = pkgs.webapps.aten.override { environment = secrets.environment; }; + webRoot = "/var/lib/ftp/immae/aten/public"; cfg = config.myServices.websites.isabelle.aten_integration; pcfg = config.services.phpApplication; in { options.myServices.websites.isabelle.aten_integration.enable = lib.mkEnableOption "enable Aten's website in integration"; config = lib.mkIf cfg.enable { - services.duplyBackup.profiles.aten_dev.rootDir = app.varDir; - services.phpApplication.apps.aten_dev = { + services.duplyBackup.profiles.isabelle_aten_integration.rootDir = app.varDir; + services.phpApplication.apps.isabelle_aten_integration = { websiteEnv = "integration"; httpdUser = config.services.httpd.Inte.user; httpdGroup = config.services.httpd.Inte.group; httpdWatchFiles = [ - config.secrets.fullPaths."webapps/${app.environment}-aten" + config.secrets.fullPaths."websites/isabelle/aten_integration" ]; - inherit (app) webRoot varDir; - inherit app; + inherit webRoot; + varDir = "/var/lib/ftp/immae/aten_var"; + app = "/var/lib/ftp/immae/aten"; serviceDeps = [ "postgresql.service" ]; preStartActions = [ - "APP_ENV=${app.environment} ./bin/console --env=${app.environment} cache:clear --no-warmup" + "APP_ENV=dev ./bin/console --env=dev cache:clear --no-warmup" ]; phpOpenbasedir = [ "/tmp" ]; - phpPool = '' - php_admin_value[upload_max_filesize] = 20M - php_admin_value[post_max_size] = 20M - ;php_admin_flag[log_errors] = on - pm = ondemand - pm.max_children = 5 - pm.process_idle_timeout = 60 - env[SYMFONY_DEBUG_MODE] = "yes" - ''; + phpPool = { + "php_admin_value[upload_max_filesize]" = "20M"; + "php_admin_value[post_max_size]" = "20M"; + #"php_admin_flag[log_errors]" = "on"; + "pm" = "ondemand"; + "pm.max_children" = "5"; + "pm.process_idle_timeout" = "60"; + }; + phpEnv = { + SYMFONY_DEBUG_MODE = "\"yes\""; + }; + phpPackage = pkgs.php72; }; - secrets.keys = [{ - dest = "webapps/${app.environment}-aten"; + secrets.keys."websites/isabelle/aten_integration" = { user = config.services.httpd.Inte.user; group = config.services.httpd.Inte.group; permissions = "0400"; @@ -45,23 +48,23 @@ in { # vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php#parseDatabaseUrlQuery psql_url = with secrets.postgresql; "pdo-pgsql://${user}:${password}@invalid:${port}/${database}?host=${socket}"; in '' - SetEnv APP_ENV "${app.environment}" + SetEnv APP_ENV "dev" SetEnv APP_SECRET "${secrets.secret}" SetEnv DATABASE_URL "${psql_url}" ''; - }]; - services.websites.env.integration.vhostConfs.aten_dev = { - certName = "eldiron"; + }; + services.websites.env.integration.vhostConfs.isabelle_aten_integration = { + certName = "integration"; addToCerts = true; hosts = [ "dev.aten.pro" ]; - root = pcfg.webappDirs.aten_dev; + root = webRoot; extraConfig = [ '' - SetHandler "proxy:unix:${pcfg.phpListenPaths.aten_dev}|fcgi://localhost" + SetHandler "proxy:unix:${pcfg.phpListenPaths.isabelle_aten_integration}|fcgi://localhost" - Include ${config.secrets.fullPaths."webapps/${app.environment}-aten"} + Include ${config.secrets.fullPaths."websites/isabelle/aten_integration"} Use LDAPConnect @@ -75,7 +78,7 @@ in { ErrorDocument 401 "" - + Options Indexes FollowSymLinks MultiViews Includes AllowOverride All Require all granted