feat(koi): docmost

This commit is contained in:
alina 🌸 2025-01-01 22:38:23 +03:00
parent 8b12efb8c9
commit a18a985d9b
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
4 changed files with 79 additions and 0 deletions

View file

@ -39,6 +39,7 @@
./containers/memos
./containers/wakapi
./containers/outline
./containers/docmost
./containers/teisu.nix
./containers/bots/pcre-sub-bot.nix
./containers/bots/channel-logger-bot.nix

View file

@ -0,0 +1,74 @@
{ pkgs, config, ... }:
let
UID = 1124;
context = pkgs.copyPathToStore ./image;
in {
desu.secrets.docmost-env.owner = "docmost";
users.users.docmost = {
isNormalUser = true;
uid = UID;
};
services.postgresql.ensureUsers = [
{ name = "docmost"; ensureDBOwnership = true; }
];
services.postgresql.ensureDatabases = [ "docmost" ];
desu.postgresql.ensurePasswords.docmost = "docmost";
virtualisation.oci-containers.containers.docmost-redis = {
image = "docker.io/redis:7.0-alpine";
user = builtins.toString UID;
extraOptions = [
"--mount=type=bind,source=/srv/docmost/redis,target=/data"
];
};
systemd.tmpfiles.rules = [
"d /srv/docmost/redis 0700 ${builtins.toString UID} ${builtins.toString UID} -"
];
systemd.services.docker-docmost.serviceConfig.ExecStartPre = [
(pkgs.writeShellScript "build-docmost" ''
docker build -t local/docmost ${context}
'')
];
virtualisation.oci-containers.containers.docmost = {
dependsOn = [ "docmost-redis" ];
image = "local/docmost";
environment = {
APP_URL = "https://docmost.stupid.fish";
PORT = "80";
DATABASE_URL = "postgres://docmost:docmost@172.17.0.1:5432/docmost?sslmode=disable";
REDIS_URL = "redis://docmost-redis.docker:6379";
STORAGE_DRIVER = "local";
FILE_UPLOAD_SIZE_LIMIT = "100mb";
MAIL_DRIVER = "smtp";
};
environmentFiles = [
# oidc related config + SECRET_KEY, UTILS_SECRET
config.desu.secrets.docmost-env.path
];
user = builtins.toString UID;
extraOptions = [
"--group-add=${builtins.toString config.users.groups.geesefs.gid}"
"--mount=type=bind,source=/mnt/s3-desu-priv-encrypted/docmost,target=/app/data/storage"
];
};
systemd.services.docker-docmost.requires = [ "postgresql.service" "gocryptfs.service" ];
services.nginx.virtualHosts."docmost.stupid.fish" = {
forceSSL = true;
useACMEHost = "stupid.fish";
locations."/" = {
proxyPass = "http://docmost.docker$request_uri";
proxyWebsockets = true;
extraConfig = ''
proxy_buffering off;
'';
};
};
}

View file

@ -0,0 +1,4 @@
FROM docmost/docmost:0.6.2
# for whatever reason docmost needs to be able to write to this dir at runtime
RUN chmod -R 777 /app/apps/client/dist

BIN
secrets/docmost-env.age Normal file

Binary file not shown.