add plausible

This commit is contained in:
Kopatz
2024-06-09 14:15:55 +02:00
parent cb05d6aa18
commit 73858519c6
7 changed files with 55 additions and 1 deletions

View File

@@ -14,5 +14,6 @@
./kop-monitor.nix
./kop-fileshare.nix
./adam-site.nix
./plausible.nix
];
}

View File

@@ -0,0 +1,37 @@
{ config, pkgs, lib, inputs, ... }:
let cfg = config.custom.services.plausible;
in {
options.custom.services.plausible = {
enable = lib.mkEnableOption "Enables plausible";
};
config = lib.mkIf cfg.enable {
age.secrets.plausible-admin = {
file = ../../secrets/plausible-admin.age;
};
age.secrets.plausible-keybase = {
file = ../../secrets/plausible-keybase.age;
};
services.plausible = {
enable = true;
adminUser = {
# activate is used to skip the email verification of the admin-user that's
# automatically created by plausible. This is only supported if
# postgresql is configured by the module. This is done by default, but
# can be turned off with services.plausible.database.postgres.setup.
activate = true;
email = "admin@localhost";
passwordFile = config.age.secrets.plausible-admin.path;
};
server = {
baseUrl = "https://plausible.imbissaggsbachdorf.at";
#baseUrl = "http://localhost";
# secretKeybaseFile is a path to the file which contains the secret generated
# with openssl as described above.
secretKeybaseFile = config.age.secrets.plausible-keybase.path;
};
};
};
}

View File

@@ -6,7 +6,7 @@ buildNpmPackage rec {
src = fetchGit {
url = "git@github.com:oberprofis/adams.git";
ref = "main";
rev = "b5af7fe2acf2fcf3b7b115f39c9401d0bf40456d";
rev = "68fa8392335a462634d4bb886344762592c8d566";
};
npmDepsHash="sha256-ULxOaEpa2+YS45kh+2xCZMqXQs5bMYhy7J08DsFYE+s=";
installPhase = ''

View File

@@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 bqM3xA Wrj1qtU09AyFSgxzqH0eCYWwlGhZEgIZJBrjywU/bSg
mMwRqlAGXFCUr+Nj/6JMbjjJHLbwHm4/mrOjwaxBlDM
-> ssh-ed25519 DCzi1A hgOetbh8HzZeDfHccR5LG7V8ImLyY7Hil+LvcIAO5RQ
xfLj0NwDZ0jUzCjxs3DUHGxu3tQc7uShMduyl9hoqe8
--- uaqIvyCHbDxezDYBgIYAlBYD+Dtw+jIFknYl8DQVRnM
Ñï!«ø9~:_!ÍàAã†p]¡ êh9Ê{ °HÀŒKùM¡vL¢ =TO¹üòA%Á8 ±u[<12>Î2¢-Ì‚§ÖÙ,2Ü*jƒ[šºôVñ<>8s0@¸g

Binary file not shown.

View File

@@ -3,6 +3,7 @@ let
server = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAUA7uVKXAF2UcwaIDSJP2Te8Fi++2zkKzSPoRx1vQrI root@server";
laptop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDqcphdDEJhnSBkAZzQXZJDCzsyb/Tqpcf0pUADFpbd1 root@nix-laptop";
mini-pc = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKla9+Gj2i9Ax7cIdnTM6zsmze3g1N/qCPqhga0P+toU root@mini-pc";
adam-site = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfaIaKoNStnbfjB9cSJ9+PW0BVO3Uhh1uIbZA2CszDE root@nixos";
users = [ kop ];
systems = [ mini-pc server laptop ];
in
@@ -28,4 +29,6 @@ in
"fileshelter-conf.age".publicKeys = [ mini-pc server kop ];
"webhook.age".publicKeys = [ mini-pc server kop ];
"stash-auth.age".publicKeys = [ mini-pc server kop ];
"plausible-admin.age".publicKeys = [ adam-site kop ];
"plausible-keybase.age".publicKeys = [ adam-site kop ];
}

View File

@@ -12,6 +12,7 @@
services = {
acme.enable = true;
adam-site.enable = true;
plausible.enable = true;
};
nftables.enable = true;
nix = { settings.enable = true; };
@@ -34,6 +35,11 @@
enableACME = true;
locations."/".proxyPass = "http://127.0.0.1:4000";
};
"plausible.imbissaggsbachdorf.at" = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://127.0.0.1:8000";
};
};
};