]>
Commit | Line | Data |
---|---|---|
ab8f306d | 1 | { lib, pkgs, config, ... }: |
f759f52e | 2 | let |
f8026b6e | 3 | cfg = config.myServices.websites.immae.production; |
cb589b2e IB |
4 | varDir = "/var/lib/buildbot/outputs/immae/blog"; |
5 | coursDir = "/var/lib/buildbot/outputs/immae/cours"; | |
6 | rechercheDir = "/var/lib/buildbot/outputs/immae/recherche"; | |
7 | recettesDir = "/var/lib/buildbot/outputs/immae/recettes"; | |
b63d55f3 | 8 | jardinDir = "/var/lib/buildbot/outputs/immae/jardin"; |
577d00ee | 9 | historyDir = "/var/lib/buildbot/outputs/immae/history"; |
97f5a24b | 10 | docsDir = "/var/lib/buildbot/outputs/immae/docs/"; |
ab8f306d | 11 | env = config.myEnv.websites.immae; |
f759f52e | 12 | in { |
f8026b6e | 13 | options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website"; |
f759f52e | 14 | |
f8026b6e | 15 | config = lib.mkIf cfg.enable { |
120bcf4d | 16 | myServices.chatonsProperties.enable = true; |
9eae2b47 | 17 | services.webstats.sites = [ { name = "www.immae.eu"; } ]; |
f759f52e | 18 | |
d3452fc5 IB |
19 | services.websites.env.production.vhostConfs.immae_production = { |
20 | certName = "immae"; | |
21 | addToCerts = true; | |
22 | certMainHost = "www.immae.eu"; | |
23 | hosts = [ "www.immae.eu" "immae.eu" ]; | |
24 | root = varDir; | |
25 | extraConfig = [ | |
f759f52e IB |
26 | '' |
27 | Use Stats www.immae.eu | |
46c99b57 | 28 | Header always set Strict-Transport-Security "max-age=31536000" |
f759f52e | 29 | |
6da0830e IB |
30 | <LocationMatch /.well-known/(webfinger|host-meta)> |
31 | Header always set Referrer-Policy "strict-origin-when-cross-origin" | |
6da0830e IB |
32 | RequestHeader set X-Forwarded-Proto "https" |
33 | ||
34 | RewriteRule ^(.*)$ https://mastodon.immae.eu%{REQUEST_URI} [QSA,L] | |
35 | </LocationMatch> | |
36 | ||
37 | RewriteEngine On | |
38 | RewriteCond "%{REQUEST_URI}" "!^/.well-known/(webfinger|host-meta)" | |
39 | RewriteCond "%{HTTP_HOST}" "!^www\.immae\.eu$" [NC] | |
40 | RewriteRule ^(.+)$ https://www.immae.eu$1 [R=302,L] | |
41 | ||
f759f52e | 42 | <Directory ${varDir}> |
0012da0f IB |
43 | DirectoryIndex index.htm index.html |
44 | Options Indexes FollowSymLinks MultiViews Includes | |
45 | AllowOverride All | |
46 | Require all granted | |
47 | </Directory> | |
48 | ||
57a42113 IB |
49 | Alias /.well-known/matrix ${./matrix} |
50 | <Directory ${./matrix}> | |
51 | Options Indexes FollowSymLinks MultiViews Includes | |
52 | AllowOverride None | |
53 | Require all granted | |
54 | Header always set Access-Control-Allow-Origin "*" | |
55 | </Directory> | |
196c6e3c | 56 | |
0012da0f IB |
57 | Alias /cours ${coursDir} |
58 | <Directory ${coursDir}> | |
59 | DirectoryIndex index.htm index.html | |
60 | Options Indexes FollowSymLinks MultiViews Includes | |
61 | AllowOverride All | |
62 | Require all granted | |
63 | </Directory> | |
64 | ||
97f5a24b IB |
65 | Alias /docs ${docsDir} |
66 | <Directory ${docsDir}> | |
67 | DirectoryIndex index.htm index.html | |
68 | Options Indexes FollowSymLinks MultiViews Includes | |
69 | AllowOverride All | |
70 | Require all granted | |
71 | </Directory> | |
72 | ||
13f6fd65 IB |
73 | Alias /eurl ${./sarl} |
74 | Alias /eurl ${./sarl} | |
75 | <Directory ${./sarl}> | |
23f9fdf0 IB |
76 | DirectoryIndex index.htm index.html |
77 | Options Indexes FollowSymLinks MultiViews Includes | |
78 | AllowOverride None | |
79 | Require all granted | |
80 | </Directory> | |
81 | ||
0012da0f IB |
82 | Alias /recherche ${rechercheDir} |
83 | <Directory ${rechercheDir}> | |
84 | DirectoryIndex index.htm index.html | |
f759f52e IB |
85 | Options Indexes FollowSymLinks MultiViews Includes |
86 | AllowOverride All | |
87 | Require all granted | |
88 | </Directory> | |
f2a18fd6 IB |
89 | |
90 | Alias /recettes ${recettesDir} | |
91 | <Directory ${recettesDir}> | |
92 | DirectoryIndex index.htm index.html | |
93 | Options Indexes FollowSymLinks MultiViews Includes | |
94 | AllowOverride All | |
95 | Require all granted | |
96 | </Directory> | |
b63d55f3 IB |
97 | |
98 | Alias /jardin ${jardinDir} | |
99 | <Directory ${jardinDir}> | |
100 | DirectoryIndex index.htm index.html | |
101 | Options Indexes FollowSymLinks MultiViews Includes | |
102 | AllowOverride All | |
103 | Require all granted | |
104 | </Directory> | |
7130402c IB |
105 | |
106 | Alias /history ${historyDir} | |
107 | <Directory ${historyDir}> | |
108 | DirectoryIndex index.html | |
109 | AllowOverride None | |
110 | Require all granted | |
111 | </Directory> | |
f759f52e IB |
112 | '' |
113 | ]; | |
114 | }; | |
70606070 | 115 | |
d3452fc5 IB |
116 | services.websites.env.production.vhostConfs.immae_fr = { |
117 | certName = "immae"; | |
8cf37c75 IB |
118 | addToCerts = true; |
119 | hosts = [ "www.immae.fr" "immae.fr" ]; | |
120 | root = null; | |
121 | extraConfig = [ '' | |
122 | RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.immae.eu/chapeaux/ | |
123 | '' ]; | |
124 | }; | |
125 | ||
d3452fc5 IB |
126 | services.websites.env.production.vhostConfs.immae_bouya = { |
127 | certName = "immae"; | |
7df420c2 | 128 | addToCerts = true; |
70606070 | 129 | hosts = [ "bouya.org" "www.bouya.org" ]; |
c5f1602f | 130 | root = rechercheDir; |
70606070 | 131 | extraConfig = [ '' |
c5f1602f IB |
132 | <Directory ${rechercheDir}> |
133 | DirectoryIndex index.htm index.html | |
134 | Options Indexes FollowSymLinks MultiViews Includes | |
135 | AllowOverride All | |
136 | Require all granted | |
137 | </Directory> | |
70606070 IB |
138 | '' ]; |
139 | }; | |
f759f52e IB |
140 | }; |
141 | } |