Merge pull request #1723 from JohnMcLear/feat/etherpad
feat: add Etherpad
This commit is contained in:
73
ct/etherpad.sh
Executable file
73
ct/etherpad.sh
Executable file
@@ -0,0 +1,73 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: John McLear (JohnMcLear)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://etherpad.org
|
||||
|
||||
APP="Etherpad"
|
||||
var_tags="${var_tags:-docs;collaboration;editor}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-8}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/etherpad-lite ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "etherpad-lite" "ether/etherpad"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop etherpad
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Backing up Configuration"
|
||||
[ -f /opt/etherpad-lite/settings.json ] && cp /opt/etherpad-lite/settings.json /opt/etherpad-settings.json.bak
|
||||
[ -d /opt/etherpad-lite/var ] && cp -a /opt/etherpad-lite/var /opt/etherpad-var.bak
|
||||
msg_ok "Backed up Configuration"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "etherpad-lite" "ether/etherpad" "tarball" "latest" "/opt/etherpad-lite"
|
||||
|
||||
msg_info "Rebuilding Etherpad"
|
||||
cd /opt/etherpad-lite
|
||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||
$STD corepack enable
|
||||
$STD pnpm install --frozen-lockfile
|
||||
$STD pnpm run build:etherpad
|
||||
msg_ok "Rebuilt Etherpad"
|
||||
|
||||
msg_info "Restoring Configuration"
|
||||
[ -f /opt/etherpad-settings.json.bak ] && mv /opt/etherpad-settings.json.bak /opt/etherpad-lite/settings.json
|
||||
[ -d /opt/etherpad-var.bak ] && rm -rf /opt/etherpad-lite/var && mv /opt/etherpad-var.bak /opt/etherpad-lite/var
|
||||
chown -R etherpad:etherpad /opt/etherpad-lite
|
||||
msg_ok "Restored Configuration"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start etherpad
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9001${CL}"
|
||||
87
install/etherpad-install.sh
Executable file
87
install/etherpad-install.sh
Executable file
@@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: John McLear (JohnMcLear)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://etherpad.org
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
build-essential \
|
||||
pkg-config \
|
||||
libsqlite3-dev
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
|
||||
msg_info "Enabling pnpm via corepack"
|
||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||
$STD corepack enable
|
||||
msg_ok "Enabled pnpm"
|
||||
|
||||
msg_info "Creating etherpad User"
|
||||
useradd --system --create-home --home-dir /var/lib/etherpad --shell /usr/sbin/nologin etherpad
|
||||
msg_ok "Created etherpad User"
|
||||
|
||||
fetch_and_deploy_gh_release "etherpad-lite" "ether/etherpad" "tarball" "latest" "/opt/etherpad-lite"
|
||||
|
||||
msg_info "Building Etherpad"
|
||||
cd /opt/etherpad-lite
|
||||
$STD pnpm install --frozen-lockfile
|
||||
$STD pnpm run build:etherpad
|
||||
msg_ok "Built Etherpad"
|
||||
|
||||
msg_info "Configuring Etherpad"
|
||||
cp /opt/etherpad-lite/settings.json.template /opt/etherpad-lite/settings.json
|
||||
# Switch dbType from the upstream template's dev-only "dirty" default to
|
||||
# sqlite (ACID, single-file) backed by a file in the etherpad user's
|
||||
# state directory. Matches the same default across our snap, .deb, and
|
||||
# Home Assistant add-on packagings. Admins who need postgres or mysql
|
||||
# can edit settings.json and switch dbType + dbSettings; ueberdb
|
||||
# supports both backends via the same code path.
|
||||
install -d -o etherpad -g etherpad -m 0750 /var/lib/etherpad
|
||||
sed -i \
|
||||
-e 's#"ip": *"127.0.0.1"#"ip": "0.0.0.0"#' \
|
||||
-e 's#"dbType" *: *"dirty"#"dbType": "sqlite"#' \
|
||||
-e 's#"filename" *: *"var/dirty.db"#"filename": "/var/lib/etherpad/etherpad.db"#' \
|
||||
/opt/etherpad-lite/settings.json
|
||||
chown -R etherpad:etherpad /opt/etherpad-lite
|
||||
msg_ok "Configured Etherpad"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/etherpad.service
|
||||
[Unit]
|
||||
Description=Etherpad Collaborative Editor
|
||||
Documentation=https://etherpad.org/doc
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=etherpad
|
||||
Group=etherpad
|
||||
WorkingDirectory=/opt/etherpad-lite
|
||||
Environment=NODE_ENV=production
|
||||
ExecStart=/usr/bin/env pnpm run prod
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
LimitNOFILE=65536
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now etherpad
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
48
json/etherpad.json
Normal file
48
json/etherpad.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "Etherpad",
|
||||
"slug": "etherpad",
|
||||
"categories": [
|
||||
12
|
||||
],
|
||||
"date_created": "2026-04-19",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 9001,
|
||||
"documentation": "https://etherpad.org/doc",
|
||||
"website": "https://etherpad.org",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/etherpad.webp",
|
||||
"description": "Etherpad is a highly customizable real-time collaborative document editor. It lets multiple people edit the same document simultaneously in the browser, with live changes, per-user colors, chat, and a rich plugin ecosystem.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/etherpad.sh",
|
||||
"config_path": "/opt/etherpad-lite/settings.json",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 8,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "The default install uses an embedded sqlite database at /var/lib/etherpad/etherpad.db — ACID, zero-config, suitable for single-instance homelab use. To use postgres or mysql instead, edit /opt/etherpad-lite/settings.json and switch 'dbType' + 'dbSettings' (Etherpad's ueberdb abstraction supports both).",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "View logs with: journalctl -u etherpad -f",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Etherpad listens on port 9001. Restart the service after editing settings.json: systemctl restart etherpad",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user