mirror of
https://github.com/RGBCube/ncc
synced 2025-07-28 02:27:44 +00:00
plausible: init
This commit is contained in:
parent
b9c640dd78
commit
e7cf9c7239
4 changed files with 49 additions and 1 deletions
39
hosts/best/plausible/default.nix
Normal file
39
hosts/best/plausible/default.nix
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{ config, self, lib, ... }: let
|
||||||
|
inherit (config.networking) domain;
|
||||||
|
inherit (lib) enabled merge;
|
||||||
|
|
||||||
|
fqdn = "shekels.${domain}";
|
||||||
|
port = 8007;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
(self + /modules/nginx.nix)
|
||||||
|
(self + /modules/postgresql.nix)
|
||||||
|
];
|
||||||
|
|
||||||
|
secrets.plausibleKey = {
|
||||||
|
file = ./key.age;
|
||||||
|
owner = "plausible";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.postgresql.ensure = [ "plausible" ];
|
||||||
|
|
||||||
|
services.plausible = enabled {
|
||||||
|
server = {
|
||||||
|
disableRegistration = true; # Setting it explicitly just in case.
|
||||||
|
|
||||||
|
secretKeybaseFile = config.secrets.plausibleKey.path;
|
||||||
|
|
||||||
|
baseUrl = "https://${fqdn}";
|
||||||
|
|
||||||
|
listenAddress = "::1";
|
||||||
|
inherit port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts.${fqdn} = merge config.services.nginx.sslTemplate {
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://[::1]:${toString port}";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
7
hosts/best/plausible/key.age
Normal file
7
hosts/best/plausible/key.age
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 8y3T6w 6z16kXAqAppYOMXQ7riHs+iP6SFMfJND1KlG0TI+Bgo
|
||||||
|
Gm99zghsZ69nBzs8I+Hs3fRM7+dGEaNC7mFwVJZbjO4
|
||||||
|
-> ssh-ed25519 CzqbPQ AYm8rfc18ftg7vvt6MVIYlaMcyL09VDoDBLGa0v6STo
|
||||||
|
uWmdITsGHXPZfMMBDdaYkbLCHntii4mupaWklLfOYa0
|
||||||
|
--- LFjB2mFBC6OkRoM7A9RVGjcXGbMQGKutBz44EDK3YJo
|
||||||
|
ーuL6lクレ6eユ燗z<E78797>月モE<EFBE93>'「Gコ殻逎、^xjノヤj椴!YEsDZモy2紙ヲ<E7B499>rF瀚Oソ<4F>K<EFBFBD><4B>剰%フ<>圦ネ^秉怖ホ<E68096>ュミ┐ィ∩ワY麩屍トyI
|
|
@ -16,7 +16,7 @@ in {
|
||||||
|
|
||||||
add_header Strict-Transport-Security $hsts_header always;
|
add_header Strict-Transport-Security $hsts_header always;
|
||||||
|
|
||||||
add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'self'; base-uri 'self';" always;
|
add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval' ${domain} *.${domain}; object-src 'self' ${domain} *.${domain}; base-uri 'self';" always;
|
||||||
|
|
||||||
add_header Referrer-Policy no-referrer always;
|
add_header Referrer-Policy no-referrer always;
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@ in {
|
||||||
|
|
||||||
"hosts/best/nextcloud/password.age".publicKeys = [ best ] ++ admins;
|
"hosts/best/nextcloud/password.age".publicKeys = [ best ] ++ admins;
|
||||||
|
|
||||||
|
"hosts/best/plausible/key.age".publicKeys = [ best ] ++ admins;
|
||||||
|
|
||||||
# disk
|
# disk
|
||||||
"hosts/disk/id.age".publicKeys = [ disk ] ++ admins;
|
"hosts/disk/id.age".publicKeys = [ disk ] ++ admins;
|
||||||
"hosts/disk/password.age".publicKeys = [ disk ] ++ admins;
|
"hosts/disk/password.age".publicKeys = [ disk ] ++ admins;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue