install wiki-js

This commit is contained in:
♥ Minnie ♥ 2024-10-16 04:59:02 +08:00
parent 2e7fefa7b9
commit 9b13797b9b
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
3 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,8 @@
age-encryption.org/v1
-> ssh-ed25519 KTkZog 7QJNbtDdO9LpwTDNgeaEtm4KTONs5Hgukenu2AL6dSY
l7Nz7xlPLUmYWxbL2tcUT/pgaoZUcGppKaUzoSDty7g
-> PLN-grease
KPAHJevjQIdgSu1kVhcefi2Y6aNgqaqhKXS0D3QWBFlSk7Kr8YQw2dDFpFW7fH/1
9tvZZz5hJe+sJA
--- ZiUHAguNDc75YzOTCuWOz3HEAyA6KrWZJvWB/bLDJw8
P|Öï†ì±Ç6(¢—"¥p3ålÛ"2½Ša¯Ñ¤TéïB:<3A>«üÜ6i4k¥Âb23`

View file

@ -0,0 +1,20 @@
{pkgs, ...}: {
services.postgresql = {
enable = true;
package = pkgs.postgresql_15;
settings = {
port = 5432;
};
dataDir = "/var/lib/postgresql/15";
};
environment.persistence."/persist" = {
directories = [
{
directory = "/var/lib/postgresql";
user = "postgres";
group = "postgres";
}
];
};
}

View file

@ -0,0 +1,48 @@
{config, ...}: {
systemd.services.wiki-js = {
requires = ["postgresql.service"];
after = ["postgresql.service"];
};
services.wiki-js = {
enable = true;
settings.db = {
db = "wiki-js";
host = "/run/postgresql";
type = "postgres";
user = "wiki-js";
};
};
services.postgresql = {
ensureDatabases = ["wiki-js"];
ensureUsers = [
{
name = "wiki-js";
ensureDBOwnership = true;
}
];
};
services.traefik.dynamicConfigOptions.http.routers = {
wiki-js = {
rule = "Host(`wiki.sajkbd.io`)";
entryPoints = [
"websecure"
];
middlewares = [
"crowdsec"
"geoblock"
];
service = "wiki-js";
};
};
services.traefik.dynamicConfigOptions.http.services = {
wiki-js.loadBalancer.servers = [
{url = "http://127.0.0.1:${toString config.services.wiki-js.settings.port}";}
];
};
environment.persistence."/persist".directories = ["/var/lib/wiki-js"];
}