Updates
CI / test (push) Successful in 1m3s
Release rolling / release (push) Has been cancelled

This commit is contained in:
Raven Scott
2026-07-18 23:32:56 -04:00
parent 6ef3afe821
commit 4633210eea
13 changed files with 64 additions and 25 deletions
+27
View File
@@ -321,9 +321,33 @@ install_server() {
fi
id peardata >/dev/null 2>&1 || die "peardata user was not created"
# Host journal access for Logs tab (journalctl as peardata)
if getent group systemd-journal >/dev/null 2>&1; then
log "Adding peardata to systemd-journal for host log access…"
if command -v usermod >/dev/null 2>&1; then
run_root usermod -aG systemd-journal peardata || warn "usermod -aG systemd-journal peardata failed"
elif command -v gpasswd >/dev/null 2>&1; then
run_root gpasswd -a peardata systemd-journal || warn "gpasswd -a peardata systemd-journal failed"
else
warn "Could not add peardata to systemd-journal (no usermod/gpasswd)"
fi
else
warn "Group systemd-journal not found — host Journal in Logs may be unavailable"
fi
# Ensure journal is enabled in .env (default on; operators may set PEARDATA_JOURNAL=0)
if ! run_root grep -qE '^PEARDATA_JOURNAL=' "${SERVER_DIR}/.env" 2>/dev/null; then
log "Enabling PEARDATA_JOURNAL=1 in ${SERVER_DIR}/.env"
run_root sh -c "printf '\\n# Host journal for Logs tab (set to 0 to disable)\\nPEARDATA_JOURNAL=1\\n' >> '${SERVER_DIR}/.env'"
fi
run_root chown -R peardata:peardata "$SERVER_DIR" 2>/dev/null || run_root chown -R peardata "$SERVER_DIR"
unit_path="/etc/systemd/system/peardata.service"
local journal_group_line=""
if getent group systemd-journal >/dev/null 2>&1; then
journal_group_line="SupplementaryGroups=systemd-journal"
fi
log "Writing ${unit_path}"
run_root tee "$unit_path" >/dev/null <<EOF
[Unit]
@@ -342,9 +366,11 @@ TimeoutStartSec=30
TimeoutStopSec=30
User=peardata
Group=peardata
${journal_group_line}
NoNewPrivileges=true
PrivateTmp=true
Environment=NODE_ENV=production
Environment=PEARDATA_JOURNAL=1
EnvironmentFile=-${SERVER_DIR}/.env
# Identity + HyperDB / ring buffers
ReadWritePaths=${SERVER_DIR}
@@ -380,6 +406,7 @@ ${C_BOLD}Server installed${C_RESET}
Config: ${SERVER_DIR}/.env ${C_BOLD}← check this file for your keys${C_RESET}
Data: ${SERVER_DIR}/data
Service: peardata.service
Journal: peardata ∈ systemd-journal · PEARDATA_JOURNAL=1 (Logs tab)
REST: http://127.0.0.1:19999/api/v3/info (localhost by default)
${C_BOLD}Keys (written on first successful start)${C_RESET}