1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-27 18:17:44 +00:00

plausible: init

This commit is contained in:
RGBCube 2025-06-08 05:01:32 +03:00
parent b9c640dd78
commit e7cf9c7239
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M
4 changed files with 49 additions and 1 deletions

View 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;
};
};
}

View 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

View file

@ -16,7 +16,7 @@ in {
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;

View file

@ -20,6 +20,8 @@ in {
"hosts/best/nextcloud/password.age".publicKeys = [ best ] ++ admins;
"hosts/best/plausible/key.age".publicKeys = [ best ] ++ admins;
# disk
"hosts/disk/id.age".publicKeys = [ disk ] ++ admins;
"hosts/disk/password.age".publicKeys = [ disk ] ++ admins;