diff options
-rw-r--r-- | modules/private/default.nix | 1 | ||||
-rw-r--r-- | modules/private/websites/default.nix | 5 | ||||
-rw-r--r-- | modules/private/websites/emilia/atelierfringant.nix | 65 | ||||
m--------- | nixops/secrets | 0 |
4 files changed, 70 insertions, 1 deletions
diff --git a/modules/private/default.nix b/modules/private/default.nix index 6b64e60..5bb6507 100644 --- a/modules/private/default.nix +++ b/modules/private/default.nix | |||
@@ -40,6 +40,7 @@ set = { | |||
40 | deniseProduction = ./websites/denise/production.nix; | 40 | deniseProduction = ./websites/denise/production.nix; |
41 | 41 | ||
42 | emiliaMoodle = ./websites/emilia/moodle.nix; | 42 | emiliaMoodle = ./websites/emilia/moodle.nix; |
43 | emiliaAtelierFringant = ./websites/emilia/atelierfringant.nix; | ||
43 | 44 | ||
44 | florianApp = ./websites/florian/app.nix; | 45 | florianApp = ./websites/florian/app.nix; |
45 | florianInte = ./websites/florian/integration.nix; | 46 | florianInte = ./websites/florian/integration.nix; |
diff --git a/modules/private/websites/default.nix b/modules/private/websites/default.nix index ba2dde0..809f615 100644 --- a/modules/private/websites/default.nix +++ b/modules/private/websites/default.nix | |||
@@ -248,7 +248,10 @@ in | |||
248 | production.enable = true; | 248 | production.enable = true; |
249 | }; | 249 | }; |
250 | 250 | ||
251 | emilia.moodle.enable = false; | 251 | emilia = { |
252 | moodle.enable = false; | ||
253 | atelierfringant.enable = true; | ||
254 | }; | ||
252 | 255 | ||
253 | florian = { | 256 | florian = { |
254 | app.enable = true; | 257 | app.enable = true; |
diff --git a/modules/private/websites/emilia/atelierfringant.nix b/modules/private/websites/emilia/atelierfringant.nix new file mode 100644 index 0000000..b47452f --- /dev/null +++ b/modules/private/websites/emilia/atelierfringant.nix | |||
@@ -0,0 +1,65 @@ | |||
1 | { lib, pkgs, config, ... }: | ||
2 | let | ||
3 | cfg = config.myServices.websites.emilia.atelierfringant; | ||
4 | varDir = "/var/lib/ftp/emilia/atelierfringant"; | ||
5 | apacheUser = config.services.httpd.Prod.user; | ||
6 | apacheGroup = config.services.httpd.Prod.group; | ||
7 | in { | ||
8 | options.myServices.websites.emilia.atelierfringant.enable = lib.mkEnableOption "enable Émilia's website"; | ||
9 | |||
10 | config = lib.mkIf cfg.enable { | ||
11 | system.activationScripts.emilia_atelierfringant = { | ||
12 | deps = [ "httpd" ]; | ||
13 | text = '' | ||
14 | install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/ftp/emilia/atelierfringant | ||
15 | install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d /var/lib/php/sessions/emilia | ||
16 | ''; | ||
17 | }; | ||
18 | systemd.services.phpfpm-emilia_atelierfringant.after = lib.mkAfter [ "mysql.service" ]; | ||
19 | systemd.services.phpfpm-emilia_atelierfringant.wants = [ "mysql.service" ]; | ||
20 | services.phpfpm.pools.emilia_atelierfringant = { | ||
21 | user = apacheUser; | ||
22 | group = apacheGroup; | ||
23 | settings = { | ||
24 | "listen.owner" = apacheUser; | ||
25 | "listen.group" = apacheGroup; | ||
26 | |||
27 | "pm" = "ondemand"; | ||
28 | "pm.max_children" = "5"; | ||
29 | "pm.process_idle_timeout" = "60"; | ||
30 | |||
31 | "php_admin_value[open_basedir]" = "/var/lib/php/sessions/emilia:${varDir}:/tmp"; | ||
32 | "php_admin_value[session.save_path]" = "/var/lib/php/sessions/emilia"; | ||
33 | }; | ||
34 | phpOptions = config.services.phpfpm.phpOptions + '' | ||
35 | disable_functions = "mail" | ||
36 | ''; | ||
37 | phpPackage = pkgs.php72; | ||
38 | }; | ||
39 | services.websites.env.production.modules = [ "proxy_fcgi" ]; | ||
40 | services.websites.env.production.vhostConfs.emilia_atelierfringant = { | ||
41 | certName = "emilia"; | ||
42 | certMainHost = "atelierfringant.org"; | ||
43 | hosts = ["atelierfringant.org" "www.atelierfringant.org" ]; | ||
44 | root = varDir; | ||
45 | extraConfig = [ | ||
46 | '' | ||
47 | <FilesMatch "\.php$"> | ||
48 | SetHandler "proxy:unix:${config.services.phpfpm.pools.emilia_atelierfringant.socket}|fcgi://localhost" | ||
49 | </FilesMatch> | ||
50 | |||
51 | <Location /xmlrpc.php> | ||
52 | AllowOverride None | ||
53 | Require all denied | ||
54 | </Location> | ||
55 | <Directory ${varDir}> | ||
56 | DirectoryIndex index.php index.htm index.html | ||
57 | Options Indexes FollowSymLinks MultiViews Includes | ||
58 | AllowOverride all | ||
59 | Require all granted | ||
60 | </Directory> | ||
61 | '' | ||
62 | ]; | ||
63 | }; | ||
64 | }; | ||
65 | } | ||
diff --git a/nixops/secrets b/nixops/secrets | |||
Subproject e241d6ee177132dc1847b37b900d0897a984a2e | Subproject d5068b2f6e4a8aa7e6e487b34eef0d90e7f547c | ||