refactor(etherpad): address review feedback
- Replace manual tag lookup + git clone/checkout with fetch_and_deploy_gh_release (tarball mode) for both install and update paths, matching repo convention (see ct/clickhouse.sh). - Drop git, curl, ca-certificates from apt deps — base image ships them and the helper no longer needs git. - Remove the id -u etherpad guard; fresh LXC will not have the user. - Bump Debian from 12 to 13 (trixie). - Switch logo to selfh.st/icons webp. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
|
|||||||
var_ram="${var_ram:-2048}"
|
var_ram="${var_ram:-2048}"
|
||||||
var_disk="${var_disk:-8}"
|
var_disk="${var_disk:-8}"
|
||||||
var_os="${var_os:-debian}"
|
var_os="${var_os:-debian}"
|
||||||
var_version="${var_version:-12}"
|
var_version="${var_version:-13}"
|
||||||
var_unprivileged="${var_unprivileged:-1}"
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
|
|
||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
@@ -39,16 +39,15 @@ function update_script() {
|
|||||||
[ -d /opt/etherpad-lite/var ] && cp -a /opt/etherpad-lite/var /opt/etherpad-var.bak
|
[ -d /opt/etherpad-lite/var ] && cp -a /opt/etherpad-lite/var /opt/etherpad-var.bak
|
||||||
msg_ok "Backed up Configuration"
|
msg_ok "Backed up Configuration"
|
||||||
|
|
||||||
LATEST_TAG=$(curl -fsSL https://api.github.com/repos/ether/etherpad-lite/releases/latest | grep -oP '"tag_name":\s*"\K[^"]+')
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "etherpad-lite" "ether/etherpad-lite" "tarball" "latest" "/opt/etherpad-lite"
|
||||||
msg_info "Updating to ${LATEST_TAG}"
|
|
||||||
|
msg_info "Rebuilding Etherpad"
|
||||||
cd /opt/etherpad-lite
|
cd /opt/etherpad-lite
|
||||||
$STD git fetch --tags --prune
|
|
||||||
$STD git checkout "${LATEST_TAG}"
|
|
||||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||||
$STD corepack enable
|
$STD corepack enable
|
||||||
$STD pnpm install --frozen-lockfile
|
$STD pnpm install --frozen-lockfile
|
||||||
$STD pnpm run build:etherpad
|
$STD pnpm run build:etherpad
|
||||||
msg_ok "Updated to ${LATEST_TAG}"
|
msg_ok "Rebuilt Etherpad"
|
||||||
|
|
||||||
msg_info "Restoring Configuration"
|
msg_info "Restoring Configuration"
|
||||||
[ -f /opt/etherpad-settings.json.bak ] && mv /opt/etherpad-settings.json.bak /opt/etherpad-lite/settings.json
|
[ -f /opt/etherpad-settings.json.bak ] && mv /opt/etherpad-settings.json.bak /opt/etherpad-lite/settings.json
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ update_os
|
|||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt install -y \
|
$STD apt install -y \
|
||||||
git \
|
|
||||||
curl \
|
|
||||||
ca-certificates \
|
|
||||||
build-essential \
|
build-essential \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
libsqlite3-dev
|
libsqlite3-dev
|
||||||
@@ -31,20 +28,10 @@ $STD corepack enable
|
|||||||
msg_ok "Enabled pnpm"
|
msg_ok "Enabled pnpm"
|
||||||
|
|
||||||
msg_info "Creating etherpad User"
|
msg_info "Creating etherpad User"
|
||||||
if ! id -u etherpad >/dev/null 2>&1; then
|
useradd --system --create-home --home-dir /var/lib/etherpad --shell /usr/sbin/nologin etherpad
|
||||||
useradd --system --create-home --home-dir /var/lib/etherpad --shell /usr/sbin/nologin etherpad
|
|
||||||
fi
|
|
||||||
msg_ok "Created etherpad User"
|
msg_ok "Created etherpad User"
|
||||||
|
|
||||||
msg_info "Cloning Etherpad"
|
fetch_and_deploy_gh_release "etherpad-lite" "ether/etherpad-lite" "tarball" "latest" "/opt/etherpad-lite"
|
||||||
LATEST_TAG=$(curl -fsSL https://api.github.com/repos/ether/etherpad-lite/releases/latest | grep -oP '"tag_name":\s*"\K[^"]+')
|
|
||||||
if [ -z "${LATEST_TAG}" ]; then
|
|
||||||
msg_error "Unable to determine latest Etherpad release"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
$STD git clone --depth 1 --branch "${LATEST_TAG}" https://github.com/ether/etherpad-lite.git /opt/etherpad-lite
|
|
||||||
echo "${LATEST_TAG}" >/opt/etherpad-lite/.version
|
|
||||||
msg_ok "Cloned Etherpad ${LATEST_TAG}"
|
|
||||||
|
|
||||||
msg_info "Building Etherpad"
|
msg_info "Building Etherpad"
|
||||||
cd /opt/etherpad-lite
|
cd /opt/etherpad-lite
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"interface_port": 9001,
|
"interface_port": 9001,
|
||||||
"documentation": "https://etherpad.org/doc",
|
"documentation": "https://etherpad.org/doc",
|
||||||
"website": "https://etherpad.org",
|
"website": "https://etherpad.org",
|
||||||
"logo": "https://raw.githubusercontent.com/ether/etherpad-lite/develop/src/static/favicon.ico",
|
"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.",
|
"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": [
|
"install_methods": [
|
||||||
{
|
{
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
"ram": 2048,
|
"ram": 2048,
|
||||||
"hdd": 8,
|
"hdd": 8,
|
||||||
"os": "Debian",
|
"os": "Debian",
|
||||||
"version": "12"
|
"version": "13"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user