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