2022-03-15 16:56:05 +01:00
|
|
|
{ config, custom, inputs, pkgs, ... }:
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
(import "${inputs.self}/systems/raspi4" {
|
|
|
|
hostname = "raspi-test";
|
|
|
|
ip = "10.7.89.99";
|
2022-03-15 17:18:44 +01:00
|
|
|
inherit inputs pkgs;
|
2022-03-15 16:56:05 +01:00
|
|
|
})
|
|
|
|
(import "${inputs.self}/modules/restic-server-client" {
|
|
|
|
time = "11:30"; inherit config custom inputs pkgs;
|
|
|
|
})
|
2022-05-18 21:17:15 +02:00
|
|
|
"${inputs.self}/modules/nginx-acme-base"
|
2022-03-15 16:56:05 +01:00
|
|
|
"${inputs.self}/modules/docker"
|
2022-05-18 20:57:00 +02:00
|
|
|
"${inputs.self}/modules/haproxy"
|
2022-06-20 21:06:55 +02:00
|
|
|
"${inputs.self}/modules/tmux"
|
2022-03-15 16:56:05 +01:00
|
|
|
];
|
2022-05-17 22:38:58 +02:00
|
|
|
|
|
|
|
services.nginx = {
|
2022-05-18 21:35:27 +02:00
|
|
|
commonHttpConfig = ''
|
|
|
|
# Add HSTS header with preloading to HTTPS requests.
|
|
|
|
# Adding this header to HTTP requests is discouraged
|
|
|
|
map $scheme $hsts_header {
|
|
|
|
https "max-age=63072000; includeSubdomains; preload";
|
|
|
|
}
|
|
|
|
add_header Strict-Transport-Security $hsts_header;
|
|
|
|
|
|
|
|
# Enable CSP for your services.
|
|
|
|
#add_header Content-Security-Policy "script-src 'self'; object-src 'none'; base-uri 'none';" always;
|
|
|
|
|
|
|
|
# Minimize information leaked to other domains
|
|
|
|
add_header 'Referrer-Policy' 'origin-when-cross-origin';
|
|
|
|
|
|
|
|
# Disable embedding as a frame
|
|
|
|
add_header X-Frame-Options DENY;
|
|
|
|
|
|
|
|
# Prevent injection of code in other mime types (XSS Attacks)
|
|
|
|
add_header X-Content-Type-Options nosniff;
|
|
|
|
|
|
|
|
# Enable XSS protection of the browser.
|
|
|
|
# May be unnecessary when CSP is configured properly (see above)
|
|
|
|
add_header X-XSS-Protection "1; mode=block";
|
|
|
|
|
|
|
|
# This might create errors
|
|
|
|
proxy_cookie_path / "/; secure; HttpOnly; SameSite=strict";
|
|
|
|
'';
|
2022-05-17 22:38:58 +02:00
|
|
|
virtualHosts = {
|
|
|
|
"2li.ch" = {
|
2022-05-17 23:03:26 +02:00
|
|
|
serverAliases = [ "www.2li.ch" ];
|
2022-05-17 22:38:58 +02:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
2022-05-17 23:03:26 +02:00
|
|
|
listen = [{ port = 4433; addr = "127.0.0.1"; ssl = true; }];
|
2022-05-17 22:38:58 +02:00
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:8080";
|
|
|
|
proxyWebsockets = true; # needed if you need to use WebSocket
|
|
|
|
};
|
|
|
|
};
|
|
|
|
"heimdall.2li.ch" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
2022-05-17 23:03:26 +02:00
|
|
|
listen = [{ port = 4433; addr = "127.0.0.1"; ssl = true; }];
|
2022-05-17 22:38:58 +02:00
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:8081";
|
|
|
|
proxyWebsockets = true; # needed if you need to use WebSocket
|
|
|
|
};
|
|
|
|
};
|
|
|
|
"rss-bridge.2li.ch" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
2022-05-17 23:03:26 +02:00
|
|
|
listen = [{ port = 4433; addr = "127.0.0.1"; ssl = true; }];
|
2022-05-17 22:38:58 +02:00
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:8082";
|
|
|
|
proxyWebsockets = true; # needed if you need to use WebSocket
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-03-15 16:56:05 +01:00
|
|
|
}
|