mirror of https://github.com/tteck/Proxmox
parent
22e7ff1f17
commit
a9a442dc67
2 changed files with 176 additions and 0 deletions
@ -0,0 +1,87 @@ |
|||||||
|
#!/usr/bin/env bash |
||||||
|
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) |
||||||
|
# Copyright (c) 2021-2024 tteck |
||||||
|
# Author: tteck |
||||||
|
# Co-Author: MickLesk (Canbiz) |
||||||
|
# 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="5" |
||||||
|
var_cpu="1" |
||||||
|
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 |
||||||
|
sudo -u archivebox archivebox setup &>/dev/null |
||||||
|
sudo -u archivebox archivebox init &>/dev/null |
||||||
|
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${CL} \n" |
@ -0,0 +1,89 @@ |
|||||||
|
#!/usr/bin/env bash |
||||||
|
|
||||||
|
# Copyright (c) 2021-2024 tteck |
||||||
|
# Author: tteck |
||||||
|
# Co-Author: MickLesk (Canbiz) |
||||||
|
# License: MIT |
||||||
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE |
||||||
|
# Source: https://github.com/ArchiveBox/ArchiveBox |
||||||
|
|
||||||
|
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 \ |
||||||
|
build-essential \ |
||||||
|
curl \ |
||||||
|
sudo \ |
||||||
|
python3-{pip,minimal,distutils,ldap,msgpack,mutagen,regex,pycryptodome} \ |
||||||
|
libatomic1 \ |
||||||
|
zlib1g-dev \ |
||||||
|
libssl-dev \ |
||||||
|
libldap2-dev \ |
||||||
|
libsasl2-dev \ |
||||||
|
procps \ |
||||||
|
dnsutils \ |
||||||
|
yt-dlp \ |
||||||
|
ffmpeg \ |
||||||
|
ripgrep \ |
||||||
|
mc |
||||||
|
|
||||||
|
msg_ok "Installed Dependencies" |
||||||
|
|
||||||
|
msg_info "Installing Playright" |
||||||
|
$STD pip install --upgrade playwright |
||||||
|
$STD playwright install --with-deps chromium |
||||||
|
msg_ok "Installed Playright" |
||||||
|
|
||||||
|
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 ArchiveBox" |
||||||
|
$STD pip install --upgrade --ignore-installed archivebox[ldap,sonic] |
||||||
|
$STD sudo adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled-password --home /opt/archivebox archivebox |
||||||
|
mkdir -p /opt/archivebox/data |
||||||
|
cd /opt/archivebox/data |
||||||
|
sudo chown -R archivebox:archivebox /opt/archivebox/data |
||||||
|
sudo chown -R archivebox:archivebox /root |
||||||
|
sudo chmod -R 755 /opt/archivebox/data |
||||||
|
$STD sudo -u archivebox archivebox init |
||||||
|
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" |
Loading…
Reference in new issue