etherpad api

This commit is contained in:
soraefir
2026-05-11 00:15:54 +02:00
parent 46f4b5288b
commit bbbb5831a8
2 changed files with 15 additions and 22 deletions

View File

@@ -1,9 +1,7 @@
{ config, containerCfg, pkgs, lib, builder, name,... }:
let
serverCfg = config.syscfg.server;
etherpad_exe = pkgs.etherpad-lite;/*.override {
plugins = [ pkgs.nodePackages.ep_proxy_auth ]; # Ensure this is in your nixpkgs
};*/
etherpad_exe = pkgs.etherpad-lite;
settings = pkgs.writeTextDir"etc/etherpad/settings.json" (builtins.toJSON {
title= "\${TITLE:Etherpad}";
showRecentPads = "\${SHOW_RECENT_PADS:true}";
@@ -83,25 +81,12 @@ let
User = "1000:1000";
WorkingDir = "/var/lib/etherpad";
ExposedPorts = { "${toString containerCfg.port}/tcp" = {}; };
Env = [
"NODE_ENV=production"
"HOME=/opt/etherpad-lite/var"
"DB_FILENAME=/opt/etherpad-lite/var/dirty.db"
];
Env = [];
};
};
in {
paths = [{
path="${serverCfg.configPath}/etherpad/data";
owner = "1000:1000";
mode = "0755";
}{
path="${serverCfg.configPath}/etherpad/APIKEY.txt";
owner = "1000:1000";
mode = "0755";
backup = true;
}];
paths = [];
containers = {
server = builder.mkContainer {
@@ -129,10 +114,18 @@ in {
};
overrides = {
volumes = [
"${serverCfg.configPath}/etherpad/data:/opt/etherpad-lite/var"
"${serverCfg.configPath}/etherpad/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt"
];
};
};
};
setup = {
trigger = "server";
script = pkgs.writeShellScript "setup" ''
export $(sops -d ${config.sops.secrets."ETHERPAD".path} | xargs)
echo "The API key is $APIKEY" > output.txt
'';
};
}