aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/connexionswing/integration.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-18 16:10:56 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-04-20 01:51:48 +0200
commitd3452fc59b9839846225fd254926c64a9c71f071 (patch)
treea98a0958b826ac4b2ab137720edf0195c65dd958 /modules/private/websites/connexionswing/integration.nix
parent514f9ec3beec470c4445be690673a0ceab9115b4 (diff)
downloadNix-d3452fc59b9839846225fd254926c64a9c71f071.tar.gz
Nix-d3452fc59b9839846225fd254926c64a9c71f071.tar.zst
Nix-d3452fc59b9839846225fd254926c64a9c71f071.zip
Refactor websites
Diffstat (limited to 'modules/private/websites/connexionswing/integration.nix')
-rw-r--r--modules/private/websites/connexionswing/integration.nix26
1 files changed, 15 insertions, 11 deletions
diff --git a/modules/private/websites/connexionswing/integration.nix b/modules/private/websites/connexionswing/integration.nix
index 4f7b72d..b4de4e1 100644
--- a/modules/private/websites/connexionswing/integration.nix
+++ b/modules/private/websites/connexionswing/integration.nix
@@ -1,15 +1,19 @@
1{ lib, pkgs, config, ... }: 1{ lib, pkgs, config, ... }:
2let 2let
3 secrets = config.myEnv.websites.connexionswing.integration; 3 secrets = config.myEnv.websites.connexionswing.integration;
4 app = pkgs.webapps.connexionswing.override { environment = secrets.environment; }; 4 app = pkgs.callPackage ./app {
5 environment = secrets.environment;
6 varDir = "/var/lib/connexionswing_integration";
7 secretsPath = config.secrets.fullPaths."websites/connexionswing/integration";
8 };
5 cfg = config.myServices.websites.connexionswing.integration; 9 cfg = config.myServices.websites.connexionswing.integration;
6 pcfg = config.services.phpApplication; 10 pcfg = config.services.phpApplication;
7in { 11in {
8 options.myServices.websites.connexionswing.integration.enable = lib.mkEnableOption "enable Connexionswing's website in integration"; 12 options.myServices.websites.connexionswing.integration.enable = lib.mkEnableOption "enable Connexionswing's website in integration";
9 13
10 config = lib.mkIf cfg.enable { 14 config = lib.mkIf cfg.enable {
11 services.duplyBackup.profiles.connexionswing_dev.rootDir = app.varDir; 15 services.duplyBackup.profiles.connexionswing_integration.rootDir = app.varDir;
12 services.phpApplication.apps.connexionswing_dev = { 16 services.phpApplication.apps.connexionswing_integration = {
13 websiteEnv = "integration"; 17 websiteEnv = "integration";
14 httpdUser = config.services.httpd.Inte.user; 18 httpdUser = config.services.httpd.Inte.user;
15 httpdGroup = config.services.httpd.Inte.group; 19 httpdGroup = config.services.httpd.Inte.group;
@@ -34,16 +38,16 @@ in {
34 "pm.process_idle_timeout" = "60"; 38 "pm.process_idle_timeout" = "60";
35 }; 39 };
36 phpEnv = { 40 phpEnv = {
37 SYMFONY_DEBUG_MODE = "yes"; 41 SYMFONY_DEBUG_MODE = "\"yes\"";
38 }; 42 };
39 phpWatchFiles = [ 43 phpWatchFiles = [
40 config.secrets.fullPaths."webapps/${app.environment}-connexionswing" 44 config.secrets.fullPaths."websites/connexionswing/integration"
41 ]; 45 ];
42 }; 46 };
43 47
44 secrets.keys = [ 48 secrets.keys = [
45 { 49 {
46 dest = "webapps/${app.environment}-connexionswing"; 50 dest = "websites/connexionswing/integration";
47 user = config.services.httpd.Inte.user; 51 user = config.services.httpd.Inte.user;
48 group = config.services.httpd.Inte.group; 52 group = config.services.httpd.Inte.group;
49 permissions = "0400"; 53 permissions = "0400";
@@ -67,15 +71,15 @@ in {
67 } 71 }
68 ]; 72 ];
69 73
70 services.websites.env.integration.vhostConfs.connexionswing_dev = { 74 services.websites.env.integration.vhostConfs.connexionswing_integration = {
71 certName = "integration"; 75 certName = "integration";
72 addToCerts = true; 76 addToCerts = true;
73 hosts = ["connexionswing.immae.eu" "sandetludo.immae.eu" ]; 77 hosts = ["connexionswing.immae.eu" "sandetludo.immae.eu" ];
74 root = pcfg.webappDirs.connexionswing_dev; 78 root = pcfg.webappDirs.connexionswing_integration;
75 extraConfig = [ 79 extraConfig = [
76 '' 80 ''
77 <FilesMatch "\.php$"> 81 <FilesMatch "\.php$">
78 SetHandler "proxy:unix:${pcfg.phpListenPaths.connexionswing_dev}|fcgi://localhost" 82 SetHandler "proxy:unix:${pcfg.phpListenPaths.connexionswing_integration}|fcgi://localhost"
79 </FilesMatch> 83 </FilesMatch>
80 84
81 <Directory ${app.varDir}/medias> 85 <Directory ${app.varDir}/medias>
@@ -96,7 +100,7 @@ in {
96 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://connexionswing.com\"></html>" 100 ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://connexionswing.com\"></html>"
97 </Location> 101 </Location>
98 102
99 <Directory ${pcfg.webappDirs.connexionswing_dev}> 103 <Directory ${pcfg.webappDirs.connexionswing_integration}>
100 Options Indexes FollowSymLinks MultiViews Includes 104 Options Indexes FollowSymLinks MultiViews Includes
101 AllowOverride None 105 AllowOverride None
102 Require all granted 106 Require all granted