add plugin

This commit is contained in:
soraefir
2026-05-09 12:38:04 +02:00
parent b58da2b2e1
commit f3dfe561ad

View File

@@ -1,6 +1,9 @@
{ config, containerCfg, pkgs, lib, builder, name,... }: { config, containerCfg, pkgs, lib, builder, name,... }:
let let
serverCfg = config.syscfg.server; serverCfg = config.syscfg.server;
etherpad_exe = pkgs.etherpad-lite.override {
plugins = [ pkgs.nodePackages.ep_proxy_auth ]; # Ensure this is in your nixpkgs
};
settings = pkgs.writeTextDir"etc/etherpad/settings.json" (builtins.toJSON { settings = pkgs.writeTextDir"etc/etherpad/settings.json" (builtins.toJSON {
title= "\${TITLE:Etherpad}"; title= "\${TITLE:Etherpad}";
showRecentPads = "\${SHOW_RECENT_PADS:true}"; showRecentPads = "\${SHOW_RECENT_PADS:true}";
@@ -53,40 +56,18 @@ let
minify = "\${MINIFY:true}"; minify = "\${MINIFY:true}";
requireAuthentication = "\${REQUIRE_AUTHENTICATION:true}"; requireAuthentication = "\${REQUIRE_AUTHENTICATION:true}";
requireAuthorization = "\${REQUIRE_AUTHORIZATION:false}"; requireAuthorization = "\${REQUIRE_AUTHORIZATION:false}";
trustProxy = "\${TRUST_PROXY:false}"; trustProxy = "\${TRUST_PROXY:true}";
ep_headerauth.username_header = "X-authentik-username";
socketTransportProtocols = ["websocket" "polling"]; socketTransportProtocols = ["websocket" "polling"];
socketIo.maxHttpBufferSize = "\${SOCKETIO_MAX_HTTP_BUFFER_SIZE:1000000}"; socketIo.maxHttpBufferSize = "\${SOCKETIO_MAX_HTTP_BUFFER_SIZE:1000000}";
indentationOnNewLine = true; indentationOnNewLine = true;
exposeVersion = "\${EXPOSE_VERSION:false}";
loglevel = "\${LOGLEVEL:INFO}"; loglevel = "\${LOGLEVEL:INFO}";
lowerCasePadIds = "\${LOWER_CASE_PAD_IDS:true}"; lowerCasePadIds = "\${LOWER_CASE_PAD_IDS:true}";
sso = {
issuer = "\${SSO_ISSUER:http://localhost:9001}";
clients = [
{
client_id = "\${ADMIN_CLIENT:admin_client}";
client_secret = "\${ADMIN_SECRET:admin}";
grant_types = ["authorization_code"];
response_types = ["code"];
redirect_uris = ["\${ADMIN_REDIRECT:http://localhost:9001/admin/}"];
}
{
client_id = "\${USER_CLIENT:user_client}";
client_secret = "\${USER_SECRET:user}";
grant_types = ["authorization_code"];
response_types = ["code"];
redirect_uris = ["\${USER_REDIRECT:http://localhost:9001/}"];
}
];
};
}); });
image = pkgs.dockerTools.streamLayeredImage { image = pkgs.dockerTools.streamLayeredImage {
name = "etherpad"; name = "etherpad";
tag = pkgs.etherpad-lite.version; tag = etherpad_exe.version;
contents = with pkgs;[cacert tzdata bash coreutils curl settings ]; contents = with pkgs;[cacert tzdata bash coreutils curl settings ];
fakeRootCommands = '' fakeRootCommands = ''
mkdir -p ./var/lib/etherpad mkdir -p ./var/lib/etherpad
@@ -95,7 +76,7 @@ let
chmod 1777 ./tmp chmod 1777 ./tmp
''; '';
config = { config = {
Cmd = [ "${pkgs.etherpad-lite}/bin/etherpad-lite" "--settings" "/etc/etherpad/settings.json" ]; Cmd = [ "${etherpad_exe}/bin/etherpad-lite" "--settings" "/etc/etherpad/settings.json" ];
User = "1000:1000"; User = "1000:1000";
WorkingDir = "/var/lib/etherpad"; WorkingDir = "/var/lib/etherpad";
ExposedPorts = { "${toString containerCfg.port}/tcp" = {}; }; ExposedPorts = { "${toString containerCfg.port}/tcp" = {}; };
@@ -140,6 +121,9 @@ in {
PAD_OPTIONS_USE_MONOSPACE_FONT = "true"; PAD_OPTIONS_USE_MONOSPACE_FONT = "true";
SKIN_VARIANTS = "super-dark-toolbar light-editor dark-background"; SKIN_VARIANTS = "super-dark-toolbar light-editor dark-background";
}; };
extraLabels = {
"traefik.http.routers.${containerCfg.subdomain}.middlewares" = "authentik";
};
overrides = { overrides = {
volumes = [ volumes = [
"${serverCfg.configPath}/etherpad/data:/opt/etherpad-lite/var" "${serverCfg.configPath}/etherpad/data:/opt/etherpad-lite/var"