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