Compare commits

..

5 Commits

Author SHA1 Message Date
tteckster
6ead7e1e5f Update CHANGELOG.md 2024-10-18 09:50:13 -04:00
tteckster
e705fb6805 Create archivebox-install.sh 2024-10-18 09:43:42 -04:00
tteckster
23b391b21d Create archivebox.sh 2024-10-18 09:42:23 -04:00
tteckster
e377e065a4 Revert "Add new LXC: Kibana (#3920)" (#3922)
This reverts commit 3237e6aced.
2024-10-18 08:30:12 -04:00
T. H.
3237e6aced Add new LXC: Kibana (#3920) 2024-10-18 07:06:17 -04:00
3 changed files with 201 additions and 0 deletions

View File

@@ -13,6 +13,13 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
> [!NOTE]
All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment.
## 2024-10-18
### Changed
- **ArchiveBox LXC** [(View Source)](https://github.com/tteck/Proxmox/blob/main/install/archivebox-install.sh)
- NEW Script
## 2024-10-15
### Changed

86
ct/archivebox.sh Normal file
View File

@@ -0,0 +1,86 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
# Copyright (c) 2021-2024 tteck
# Author: tteck
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
function header_info {
clear
cat <<"EOF"
___ __ _ ____
/ | __________/ /_ (_) _____ / __ )____ _ __
/ /| | / ___/ ___/ __ \/ / | / / _ \/ __ / __ \| |/_/
/ ___ |/ / / /__/ / / / /| |/ / __/ /_/ / /_/ /> <
/_/ |_/_/ \___/_/ /_/_/ |___/\___/_____/\____/_/|_|
EOF
}
header_info
echo -e "Loading..."
APP="ArchiveBox"
var_disk="8"
var_cpu="2"
var_ram="1024"
var_os="debian"
var_version="12"
variables
color
catch_errors
function default_settings() {
CT_TYPE="1"
PW=""
CT_ID=$NEXTID
HN=$NSAPP
DISK_SIZE="$var_disk"
CORE_COUNT="$var_cpu"
RAM_SIZE="$var_ram"
BRG="vmbr0"
NET="dhcp"
GATE=""
APT_CACHER=""
APT_CACHER_IP=""
DISABLEIP6="no"
MTU=""
SD=""
NS=""
MAC=""
VLAN=""
SSH="no"
VERB="no"
echo_default
}
function update_script() {
header_info
if [[ ! -d /opt/archivebox ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
fi
msg_info "Stopping ${APP}"
systemctl stop archivebox
msg_ok "Stopped ${APP}"
msg_info "Updating ${APP}"
cd /opt/archivebox/data
pip install --upgrade --ignore-installed archivebox
sudo -u archivebox archivebox init
msg_ok "Updated ${APP}"
msg_info "Starting ${APP}"
systemctl start archivebox
msg_ok "Started ${APP}"
msg_ok "Updated Successfully"
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8000/admin/login${CL} \n"

View File

@@ -0,0 +1,108 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2024 tteck
# Author: tteck
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
sudo \
mc \
git \
expect \
libssl-dev \
libldap2-dev \
libsasl2-dev \
procps \
dnsutils \
ripgrep
msg_ok "Installed Dependencies"
msg_info "Installing Python Dependencies"
$STD apt-get install -y \
python3-pip \
python3-ldap \
python3-msgpack \
python3-regex
msg_ok "Installed Python Dependencies"
msg_info "Setting up Node.js Repository"
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
msg_ok "Set up Node.js Repository"
msg_info "Installing Node.js"
$STD apt-get update
$STD apt-get install -y nodejs
msg_ok "Installed Node.js"
msg_info "Installing Playright/Chromium"
$STD pip install playwright
$STD playwright install --with-deps chromium
msg_ok "Installed Playright/Chromium"
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 archivebox
chown -R archivebox:archivebox /opt/archivebox/{data,.npm,.cache,.local}
chmod -R 755 /opt/archivebox/data
$STD pip install archivebox
cd /opt/archivebox/data
expect <<EOF
set timeout -1
log_user 0
spawn sudo -u archivebox archivebox setup
expect "Username"
send "\r"
expect "Email address"
send "\r"
expect "Password"
send "helper-scripts.com\r"
expect "Password (again)"
send "helper-scripts.com\r"
expect eof
EOF
msg_ok "Installed ArchiveBox"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/archivebox.service
[Unit]
Description=ArchiveBox Server
After=network.target
[Service]
User=archivebox
WorkingDirectory=/opt/archivebox/data
ExecStart=/usr/local/bin/archivebox server 0.0.0.0:8000
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now archivebox.service
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"