This commit is contained in:
soraefir committed 2026-05-09 11:53:29 +02:00
1 parent eafafe876f
commit 1ca61b70d2
2 files changed
+98 -14

No files matched your search

+97 -13
View File
@@ -1,10 +1,93 @@
{ config, containerCfg, pkgs, lib, builder, name,... }: { config, containerCfg, pkgs, lib, builder, name,... }:
let let
serverCfg = config.syscfg.server; serverCfg = config.syscfg.server;
settings = pkgs.writeTextDir"etc/etherpad/settings.json" (builtins.toJSON {
title= "${TITLE:Etherpad}";
showRecentPads = "${SHOW_RECENT_PADS:true}";
favicon = "${FAVICON:null}";
publicURL = "${PUBLIC_URL:null}";
skinName = "${SKIN_NAME:colibris}";
skinVariants = "${SKIN_VARIANTS:super-light-toolbar super-light-editor light-background}";
ip = "${IP:0.0.0.0}";
port = "${PORT:9001}";
showSettingsInAdminPage = "${SHOW_SETTINGS_IN_ADMIN_PAGE:true}";
enableMetrics = "${ENABLE_METRICS:true}";
updates.tier = "off";
cleanup.enabled = false;
gdprAuthorErasure.enabled = "${GDPR_AUTHOR_ERASURE_ENABLED:false}";
authenticationMethod = "${AUTHENTICATION_METHOD:sso}";
enableDarkMode = "${ENABLE_DARK_MODE:true}";
enablePadWideSettings = "${ENABLE_PAD_WIDE_SETTINGS:true}";
dbType = "${DB_TYPE:dirty}";
dbSettings = {
host = "${DB_HOST:undefined}";
port = "${DB_PORT:undefined}";
database = "${DB_NAME:undefined}";
user = "${DB_USER:undefined}";
password = "${DB_PASS:undefined}";
charset = "${DB_CHARSET:undefined}";
filename = "${DB_FILENAME:var/dirty.db}";
collection = "${DB_COLLECTION:undefined}";
url = "${DB_URL:undefined}";
};
defaultPadText = "${DEFAULT_PAD_TEXT:Welcome to Etherpad!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nGet involved with Etherpad at https:\/\/etherpad.org\n}";
padOptions = {
noColors = "${PAD_OPTIONS_NO_COLORS:false}";
showControls = "${PAD_OPTIONS_SHOW_CONTROLS:true}";
showChat = "${PAD_OPTIONS_SHOW_CHAT:true}";
showLineNumbers = "${PAD_OPTIONS_SHOW_LINE_NUMBERS:true}";
useMonospaceFont = "${PAD_OPTIONS_USE_MONOSPACE_FONT:false}";
userName = "${PAD_OPTIONS_USER_NAME:null}";
userColor = "${PAD_OPTIONS_USER_COLOR:null}";
rtl = "${PAD_OPTIONS_RTL:false}";
alwaysShowChat = "${PAD_OPTIONS_ALWAYS_SHOW_CHAT:false}";
chatAndUsers = "${PAD_OPTIONS_CHAT_AND_USERS:false}";
lang = "${PAD_OPTIONS_LANG:null}";
fadeInactiveAuthorColors = "${PAD_OPTIONS_FADE_INACTIVE_AUTHOR_COLORS:true}";
enforceReadableAuthorColors = "${PAD_OPTIONS_ENFORCE_READABLE_AUTHOR_COLORS:true}";
};
requireSession = "${REQUIRE_SESSION:false}";
editOnly = "${EDIT_ONLY:false}";
minify = "${MINIFY:true}";
requireAuthentication = "${REQUIRE_AUTHENTICATION:true}";
requireAuthorization = "${REQUIRE_AUTHORIZATION:false}";
trustProxy = "${TRUST_PROXY:false}";
socketTransportProtocols = ["websocket", "polling"];
socketIo.maxHttpBufferSize = "${SOCKETIO_MAX_HTTP_BUFFER_SIZE:1000000}";
indentationOnNewLine = true;
exposeVersion = "${EXPOSE_VERSION:false}";
loglevel = "${LOGLEVEL:INFO}";
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 = pkgs.etherpad-lite.version;
contents = with pkgs;[ etherpad-lite bash coreutils cacert curl ]; contents = with pkgs;[cacert tzdata bash coreutils curl etherpadSettings ];
fakeRootCommands = '' fakeRootCommands = ''
mkdir -p ./var/lib/etherpad mkdir -p ./var/lib/etherpad
chown -R 1000:1000 ./var/lib/etherpad chown -R 1000:1000 ./var/lib/etherpad
@@ -12,7 +95,7 @@ let
chmod 1777 ./tmp chmod 1777 ./tmp
''; '';
config = { config = {
Cmd = [ "${pkgs.etherpad-lite}/bin/etherpad-lite" ]; Cmd = [ "${pkgs.etherpad-lite}/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" = {}; };
@@ -44,17 +127,18 @@ in {
ip = containerCfg.ip; ip = containerCfg.ip;
secret = name; secret = name;
extraEnv = { extraEnv = {
"TITLE" = "Pad"; TITLE = "Pad";
"PORT" = toString containerCfg.port; PORT = toString containerCfg.port;
"DB_TYPE" = "postgres"; DB_TYPE = "postgres";
"DB_HOST" = builder.host; DB_HOST = builder.host;
"DB_NAME" = "etherpad_db"; DB_NAME = "etherpad_db";
"DB_USER" = "etherpad_user"; DB_USER = "etherpad_user";
"TRUST_PROXY" = "true"; TRUST_PROXY = "true";
"DEFAULT_PAD_TEXT" = ""; DB_CHARSET = "utf8mb4";
"PAD_OPTIONS_SHOW_LINE_NUMBERS" = "true"; DEFAULT_PAD_TEXT = "";
"PAD_OPTIONS_USE_MONOSPACE_FONT" = "true"; PAD_OPTIONS_SHOW_LINE_NUMBERS = "true";
"SKIN_VARIANTS" = "super-dark-toolbar light-editor dark-background"; PAD_OPTIONS_USE_MONOSPACE_FONT = "true";
SKIN_VARIANTS = "super-dark-toolbar light-editor dark-background";
}; };
overrides = { overrides = {
volumes = [ volumes = [
+1 -1
View File
@@ -4,7 +4,7 @@ let
image = pkgs.dockerTools.streamLayeredImage { image = pkgs.dockerTools.streamLayeredImage {
name = "traefik"; name = "traefik";
tag = pkgs.traefik.version; tag = pkgs.traefik.version;
contents = with pkgs;[ traefik cacert tzdata ]; contents = with pkgs;[ cacert tzdata ];
config = { config = {
Entrypoint = [ "${pkgs.traefik}/bin/traefik" ]; Entrypoint = [ "${pkgs.traefik}/bin/traefik" ];
WorkingDir = "/"; WorkingDir = "/";