diff --git a/ct/etherpad.sh b/ct/etherpad.sh index 0ad29ad0..3f7cbab9 100755 --- a/ct/etherpad.sh +++ b/ct/etherpad.sh @@ -29,7 +29,7 @@ function update_script() { exit fi - if check_for_gh_release "etherpad-lite" "ether/etherpad-lite"; then + if check_for_gh_release "etherpad-lite" "ether/etherpad"; then msg_info "Stopping Service" systemctl stop etherpad msg_ok "Stopped Service" @@ -39,7 +39,7 @@ function update_script() { [ -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-lite" "tarball" "latest" "/opt/etherpad-lite" + 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 diff --git a/install/etherpad-install.sh b/install/etherpad-install.sh index 7bc32163..3eee69d8 100755 --- a/install/etherpad-install.sh +++ b/install/etherpad-install.sh @@ -31,7 +31,7 @@ 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-lite" "tarball" "latest" "/opt/etherpad-lite" +fetch_and_deploy_gh_release "etherpad-lite" "ether/etherpad" "tarball" "latest" "/opt/etherpad-lite" msg_info "Building Etherpad" cd /opt/etherpad-lite @@ -41,7 +41,18 @@ msg_ok "Built Etherpad" msg_info "Configuring Etherpad" cp /opt/etherpad-lite/settings.json.template /opt/etherpad-lite/settings.json -sed -i 's#"ip": *"127.0.0.1"#"ip": "0.0.0.0"#' /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" diff --git a/json/etherpad.json b/json/etherpad.json index 7b14ca99..e3a73321 100644 --- a/json/etherpad.json +++ b/json/etherpad.json @@ -33,7 +33,7 @@ }, "notes": [ { - "text": "The default install uses the built-in DirtyDB store, intended for evaluation only. For production, edit /opt/etherpad-lite/settings.json and switch the 'dbType' to mysql or postgres.", + "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" }, {