diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-12-13 21:25:24 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-24 01:40:13 +0200 |
commit | 252dd7d899b7a0deea1537cc5d2d48b825afffb0 (patch) | |
tree | f51c3c9cd7429b0b9553a840f26bee489be045bc /modules/private/websites/immae | |
download | NUR-252dd7d899b7a0deea1537cc5d2d48b825afffb0.tar.gz NUR-252dd7d899b7a0deea1537cc5d2d48b825afffb0.tar.zst NUR-252dd7d899b7a0deea1537cc5d2d48b825afffb0.zip |
Initial commit published for NURnur_root
Diffstat (limited to 'modules/private/websites/immae')
-rw-r--r-- | modules/private/websites/immae/production.nix | 64 | ||||
-rw-r--r-- | modules/private/websites/immae/release.nix | 39 | ||||
-rw-r--r-- | modules/private/websites/immae/temp.nix | 36 |
3 files changed, 139 insertions, 0 deletions
diff --git a/modules/private/websites/immae/production.nix b/modules/private/websites/immae/production.nix new file mode 100644 index 00000000..c3cabb6a --- /dev/null +++ b/modules/private/websites/immae/production.nix | |||
@@ -0,0 +1,64 @@ | |||
1 | { lib, pkgs, config, myconfig, ... }: | ||
2 | let | ||
3 | cfg = config.myServices.websites.immae.production; | ||
4 | varDir = "/var/lib/ftp/immae"; | ||
5 | env = myconfig.env.websites.immae; | ||
6 | in { | ||
7 | options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website"; | ||
8 | |||
9 | config = lib.mkIf cfg.enable { | ||
10 | services.webstats.sites = [ { name = "www.immae.eu"; } ]; | ||
11 | |||
12 | services.phpfpm.poolConfigs.immae = '' | ||
13 | listen = /run/phpfpm/immae.sock | ||
14 | user = wwwrun | ||
15 | group = wwwrun | ||
16 | listen.owner = wwwrun | ||
17 | listen.group = wwwrun | ||
18 | |||
19 | pm = ondemand | ||
20 | pm.max_children = 5 | ||
21 | pm.process_idle_timeout = 60 | ||
22 | |||
23 | php_admin_value[open_basedir] = "${varDir}:/tmp" | ||
24 | ''; | ||
25 | services.websites.production.modules = [ "proxy_fcgi" ]; | ||
26 | services.websites.production.vhostConfs.immae = { | ||
27 | certName = "eldiron"; | ||
28 | addToCerts = true; | ||
29 | hosts = [ "www.immae.eu" ]; | ||
30 | root = varDir; | ||
31 | extraConfig = [ | ||
32 | '' | ||
33 | Use Stats www.immae.eu | ||
34 | |||
35 | <FilesMatch "\.php$"> | ||
36 | SetHandler "proxy:unix:/run/phpfpm/immae.sock|fcgi://localhost" | ||
37 | </FilesMatch> | ||
38 | |||
39 | <Directory ${varDir}> | ||
40 | DirectoryIndex index.php index.htm index.html | ||
41 | Options Indexes FollowSymLinks MultiViews Includes | ||
42 | AllowOverride All | ||
43 | Require all granted | ||
44 | </Directory> | ||
45 | |||
46 | <Location /blog_old/> | ||
47 | Use LDAPConnect | ||
48 | Require ldap-group cn=blog,cn=immae.eu,ou=services,dc=immae,dc=eu | ||
49 | </Location> | ||
50 | '' | ||
51 | ]; | ||
52 | }; | ||
53 | |||
54 | services.websites.production.vhostConfs.bouya = { | ||
55 | certName = "eldiron"; | ||
56 | addToCerts = true; | ||
57 | hosts = [ "bouya.org" "www.bouya.org" ]; | ||
58 | root = null; | ||
59 | extraConfig = [ '' | ||
60 | RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.normalesup.org/~bouya/ | ||
61 | '' ]; | ||
62 | }; | ||
63 | }; | ||
64 | } | ||
diff --git a/modules/private/websites/immae/release.nix b/modules/private/websites/immae/release.nix new file mode 100644 index 00000000..68381a6a --- /dev/null +++ b/modules/private/websites/immae/release.nix | |||
@@ -0,0 +1,39 @@ | |||
1 | { lib, pkgs, config, myconfig, ... }: | ||
2 | let | ||
3 | cfg = config.myServices.websites.immae.release; | ||
4 | varDir = "/var/lib/ftp/release.immae.eu"; | ||
5 | env = myconfig.env.websites.release; | ||
6 | in { | ||
7 | options.myServices.websites.immae.release.enable = lib.mkEnableOption "enable Release' website"; | ||
8 | |||
9 | config = lib.mkIf cfg.enable { | ||
10 | services.webstats.sites = [ { name = "release.immae.eu"; } ]; | ||
11 | |||
12 | services.websites.production.vhostConfs.release = { | ||
13 | certName = "eldiron"; | ||
14 | addToCerts = true; | ||
15 | hosts = [ "release.immae.eu" ]; | ||
16 | root = varDir; | ||
17 | extraConfig = [ | ||
18 | '' | ||
19 | Use Stats release.immae.eu | ||
20 | |||
21 | Use Apaxy "${varDir}" "title .duplicity-ignore" | ||
22 | <Directory "${varDir}"> | ||
23 | Use LDAPConnect | ||
24 | Options Indexes | ||
25 | AllowOverride All | ||
26 | Require all granted | ||
27 | </Directory> | ||
28 | |||
29 | <Directory "${varDir}/packages"> | ||
30 | Use LDAPConnect | ||
31 | Options Indexes FollowSymlinks | ||
32 | AllowOverride None | ||
33 | Require all granted | ||
34 | </Directory> | ||
35 | '' | ||
36 | ]; | ||
37 | }; | ||
38 | }; | ||
39 | } | ||
diff --git a/modules/private/websites/immae/temp.nix b/modules/private/websites/immae/temp.nix new file mode 100644 index 00000000..0b2a3a3e --- /dev/null +++ b/modules/private/websites/immae/temp.nix | |||
@@ -0,0 +1,36 @@ | |||
1 | { lib, pkgs, config, myconfig, ... }: | ||
2 | let | ||
3 | cfg = config.myServices.websites.immae.temp; | ||
4 | varDir = "/var/lib/ftp/temp.immae.eu"; | ||
5 | env = myconfig.env.websites.temp; | ||
6 | in { | ||
7 | options.myServices.websites.immae.temp.enable = lib.mkEnableOption "enable Temp' website"; | ||
8 | |||
9 | config = lib.mkIf cfg.enable { | ||
10 | services.websites.production.modules = [ "headers" ]; | ||
11 | services.websites.production.vhostConfs.temp = { | ||
12 | certName = "eldiron"; | ||
13 | addToCerts = true; | ||
14 | hosts = [ "temp.immae.eu" ]; | ||
15 | root = varDir; | ||
16 | extraConfig = [ | ||
17 | '' | ||
18 | Use Apaxy "${varDir}" "title .duplicity-ignore" | ||
19 | <FilesMatch ".+"> | ||
20 | Header set Content-Disposition attachment | ||
21 | </FilesMatch> | ||
22 | <Directory "${varDir}"> | ||
23 | Options -Indexes | ||
24 | AllowOverride None | ||
25 | Require all granted | ||
26 | </Directory> | ||
27 | |||
28 | <DirectoryMatch "${varDir}/(.+)"> | ||
29 | Options Indexes | ||
30 | </DirectoryMatch> | ||
31 | '' | ||
32 | ]; | ||
33 | }; | ||
34 | }; | ||
35 | } | ||
36 | |||