ProxmoxVED/ct/zerobyte.sh
CanbiZ (MickLesk) f45b5b461f Add Zerobyte installer, CT script, and docs
Introduce Zerobyte support: add LXC container installer (install/zerobyte-install.sh), container template/update script (ct/zerobyte.sh), and frontend metadata (frontend/public/json/zerobyte.json). Update docs (docs/AI.md) to require explicit "tarball" mode for fetch_and_deploy_gh_release, add helper notes and best-practices, and include a new get_latest_github_release usage. Also switch the shellscript formatter in .vscode/settings.json to foxundermoon.shell-format. The installer fetches required binaries (restic, rclone, shoutrrr), installs Bun, builds Zerobyte, configures a systemd service, and prepares runtime directories and env config.
2026-02-18 10:24:58 +01:00

72 lines
1.9 KiB
Bash

#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
# Author: community-scripts
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://github.com/nicotsx/zerobyte
APP="Zerobyte"
var_tags="${var_tags:-backup;encryption;restic}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-10}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/zerobyte ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "zerobyte" "nicotsx/zerobyte"; then
msg_info "Stopping Service"
systemctl stop zerobyte
msg_ok "Stopped Service"
msg_info "Backing up Configuration"
cp /opt/zerobyte/.env /opt/zerobyte.env.bak
msg_ok "Backed up Configuration"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "zerobyte" "nicotsx/zerobyte" "tarball"
msg_info "Building Zerobyte"
cd /opt/zerobyte
$STD bun install
$STD bun run build
mkdir -p /opt/zerobyte/assets
cp -r /opt/zerobyte/app/drizzle /opt/zerobyte/assets/migrations
msg_ok "Built Zerobyte"
msg_info "Restoring Configuration"
cp /opt/zerobyte.env.bak /opt/zerobyte/.env
rm -f /opt/zerobyte.env.bak
msg_ok "Restored Configuration"
msg_info "Starting Service"
systemctl start zerobyte
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:4096${CL}"