1 { lib, pkgs, config, ... }:
3 cfg = config.myServices.websites.immae.production;
4 varDir = "/var/lib/buildbot/outputs/immae/blog";
5 historyDir = "/var/lib/buildbot/outputs/immae/history";
6 docsDir = "/var/lib/buildbot/outputs/immae/docs/";
8 options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website";
10 config = lib.mkIf cfg.enable {
11 myServices.dns.zones."immae.eu".subdomains = with config.myServices.dns.helpers;
13 www = ips servers.eldiron.ips.production;
14 matrix.CNAME = [ "immae.element.io." ];
16 services.webstats.sites = [ { name = "www.immae.eu"; } ];
18 security.acme.certs.immae.domain = "www.immae.eu";
19 security.acme.certs.immae.extraDomainNames = [ "immae.eu" ];
20 services.websites.env.production.bindMounts."${varDir}" = {};
21 services.websites.env.production.bindMounts."${docsDir}" = {};
22 services.websites.env.production.bindMounts."${historyDir}" = {};
23 services.websites.env.production.vhostConfs.immae_production = {
25 hosts = [ "www.immae.eu" "immae.eu" ];
29 Use Stats www.immae.eu
30 Header always set Strict-Transport-Security "max-age=31536000"
32 <LocationMatch /.well-known/(webfinger|host-meta)>
33 Header always set Referrer-Policy "strict-origin-when-cross-origin"
34 RequestHeader set X-Forwarded-Proto "https"
36 RewriteRule ^(.*)$ https://mastodon.immae.eu%{REQUEST_URI} [QSA,L]
40 RewriteCond "%{REQUEST_URI}" "!^/.well-known/(webfinger|host-meta)"
41 RewriteCond "%{HTTP_HOST}" "!^www\.immae\.eu$" [NC]
42 RewriteRule ^(.+)$ https://www.immae.eu$1 [R=302,L]
45 DirectoryIndex index.htm index.html
46 Options Indexes FollowSymLinks MultiViews Includes
51 Alias /.well-known/matrix ${./matrix}
52 <Directory ${./matrix}>
53 Options Indexes FollowSymLinks MultiViews Includes
56 Header always set Access-Control-Allow-Origin "*"
59 Alias /docs ${docsDir}
60 <Directory ${docsDir}>
61 DirectoryIndex index.htm index.html
62 Options Indexes FollowSymLinks MultiViews Includes
70 DirectoryIndex index.htm index.html
71 Options Indexes FollowSymLinks MultiViews Includes
76 Alias /history ${historyDir}
77 <Directory ${historyDir}>
78 DirectoryIndex index.html
83 Alias /.well-known/chatonsinfos ${config.myServices.chatonsProperties.propertiesPath}
84 <Directory ${config.myServices.chatonsProperties.propertiesPath}>
85 Options Indexes FollowSymLinks MultiViews Includes
93 myServices.monitoring.fromMasterActivatedPlugins = [ "http" ];
94 myServices.monitoring.fromMasterObjects.service = [
96 service_description = "blog website is running on immae.eu";
97 host_name = config.hostEnv.fqdn;
98 use = "external-web-service";
99 check_command = ["check_https" "www.immae.eu" "/blog/" "egrep -ri TODO /etc"];
101 servicegroups = "webstatus-websites";
102 _webstatus_name = "Immae’s Blog";
103 _webstatus_url = "https://www.immae.eu/blog";