From 03d496ed0c8745614baae7a48f4026b21c8d3967 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 29 Oct 2025 09:55:11 -0700 Subject: [PATCH] Add Chromium and Node modules to ArchiveBox scripts (#8725) --- ct/archivebox.sh | 19 ++++++++++++------- install/archivebox-install.sh | 12 +++++++----- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ct/archivebox.sh b/ct/archivebox.sh index 7a792a7bb..651e6816b 100644 --- a/ct/archivebox.sh +++ b/ct/archivebox.sh @@ -28,12 +28,18 @@ function update_script() { exit fi - NODE_VERSION="22" setup_nodejs + NODE_VERSION="22" NODE_MODULE="@postlight/parser@latest,single-file-cli@latest" setup_nodejs PYTHON_VERSION="3.13" setup_uv - msg_info "Stopping ArchiveBox" + if ! dpkg -l | grep -q "^ii chromium "; then + msg_info "Installing System Dependencies" + $STD apt-get install -y chromium + msg_ok "Installed System Dependencies" + fi + + msg_info "Stopping Service" systemctl stop archivebox - msg_ok "Stopped ArchiveBox" + msg_ok "Stopped Service" msg_info "Upgrading Playwright" $STD uv pip install playwright --system @@ -46,11 +52,10 @@ function update_script() { sudo -u archivebox archivebox init msg_ok "Updated ArchiveBox" - msg_info "Starting ArchiveBox" + msg_info "Starting Service" systemctl start archivebox - msg_ok "Started ArchiveBox" - - msg_ok "Updated Successfully" + msg_ok "Started Service" + msg_ok "Updated Successfully!" exit } diff --git a/install/archivebox-install.sh b/install/archivebox-install.sh index a6943fa6a..8c9e13e74 100644 --- a/install/archivebox-install.sh +++ b/install/archivebox-install.sh @@ -22,7 +22,8 @@ $STD apt-get install -y \ libsasl2-dev \ procps \ dnsutils \ - ripgrep + ripgrep \ + chromium msg_ok "Installed Dependencies" msg_info "Installing Python Dependencies" @@ -32,7 +33,7 @@ $STD apt-get install -y \ python3-regex msg_ok "Installed Python Dependencies" -NODE_VERSION="22" setup_nodejs +NODE_VERSION="22" NODE_MODULE="@postlight/parser@latest,single-file-cli@latest" setup_nodejs PYTHON_VERSION="3.13" setup_uv msg_info "Installing Playwright" @@ -40,7 +41,7 @@ $STD uv pip install playwright --system $STD playwright install-deps chromium msg_ok "Installed Playwright" -msg_info "Installing Chromium and ArchiveBox" +msg_info "Installing ArchiveBox" mkdir -p /opt/archivebox/{data,.npm,.cache,.local} $STD adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled-password --home /home/archivebox archivebox chown -R archivebox:archivebox /opt/archivebox/{data,.npm,.cache,.local} @@ -92,6 +93,7 @@ motd_ssh customize msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean +$STD apt -y autoremove +$STD apt -y autoclean +$STD apt -y clean msg_ok "Cleaned"