Compare commits

...
Author SHA1 Message Date
push-app-to-main[bot] 70099c20bc Add bugsink (ct) 2026-11-13 07:41:24 +00:00
2 changed files with 156 additions and 0 deletions

No files matched your search

+70
View File
@@ -0,0 +1,70 @@
#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/bugsink/bugsink
APP="Bugsink"
var_tags="${var_tags:-monitoring;error-tracking;sentry}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
export var_admin_email="${var_admin_email:-}"
export var_admin_pass="${var_admin_pass:-}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/bugsink ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "bugsink" "bugsink/bugsink"; then
msg_info "Stopping Bugsink"
systemctl stop bugsink bugsink-snappea
msg_ok "Stopped Bugsink"
PYTHON_VERSION="3.12" setup_uv
msg_info "Updating Bugsink"
$STD uv pip install --upgrade --python /opt/bugsink/.venv/bin/python "bugsink==${CHECK_UPDATE_RELEASE}"
cd /opt/bugsink_data
$STD /opt/bugsink/.venv/bin/bugsink-manage migrate
$STD /opt/bugsink/.venv/bin/bugsink-manage migrate snappea --database=snappea
cat <<EOF >~/.bugsink
${CHECK_UPDATE_RELEASE}
EOF
msg_ok "Updated Bugsink"
msg_info "Starting Bugsink"
systemctl start bugsink bugsink-snappea
msg_ok "Started Bugsink"
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 "${GATEWAY}${BGN}http://${IP}:8000${CL}"
echo -e "${INFO}${YW}Admin login: /opt/bugsink_data/.env (inside the container)${CL}"
+86
View File
@@ -0,0 +1,86 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/bugsink/bugsink
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
PYTHON_VERSION="3.12" setup_uv
msg_info "Installing Bugsink"
BUGSINK_VERSION="${var_appversion:-$(get_latest_github_release "bugsink/bugsink")}"
$STD uv venv --python 3.12 /opt/bugsink/.venv
$STD uv pip install --python /opt/bugsink/.venv/bin/python "bugsink==${BUGSINK_VERSION}"
cat <<EOF >~/.bugsink
${BUGSINK_VERSION}
EOF
msg_ok "Installed Bugsink"
msg_info "Configuring Bugsink"
ADMIN_EMAIL="${var_admin_email:-admin@localhost}"
ADMIN_PASS="${var_admin_pass:-$(random_password)}"
mkdir -p /opt/bugsink_data
cd /opt/bugsink_data
$STD /opt/bugsink/.venv/bin/bugsink-create-conf --template=singleserver --host="${LOCAL_IP}" --base-dir=/opt/bugsink_data
sed -i \
-e "s|\"BASE_URL\": \"https://${LOCAL_IP}\"|\"BASE_URL\": \"http://${LOCAL_IP}:8000\"|" \
-e 's|^SESSION_COOKIE_SECURE = True|SESSION_COOKIE_SECURE = False|' \
-e 's|^CSRF_COOKIE_SECURE = True|CSRF_COOKIE_SECURE = False|' \
-e 's|^USE_X_REAL_IP = True|USE_X_REAL_IP = False|' \
/opt/bugsink_data/bugsink_conf.py
$STD /opt/bugsink/.venv/bin/bugsink-manage migrate
$STD /opt/bugsink/.venv/bin/bugsink-manage migrate snappea --database=snappea
DJANGO_SUPERUSER_PASSWORD="$ADMIN_PASS" $STD /opt/bugsink/.venv/bin/bugsink-manage createsuperuser --noinput --username "$ADMIN_EMAIL" --email "$ADMIN_EMAIL"
cat <<EOF >/opt/bugsink_data/.env
BUGSINK_ADMIN_EMAIL=${ADMIN_EMAIL}
BUGSINK_ADMIN_PASSWORD=${ADMIN_PASS}
EOF
chmod 600 /opt/bugsink_data/.env /opt/bugsink_data/bugsink_conf.py
msg_ok "Configured Bugsink"
msg_info "Creating Services"
cat <<EOF >/etc/systemd/system/bugsink.service
[Unit]
Description=Bugsink
After=network.target
[Service]
Type=notify
WorkingDirectory=/opt/bugsink_data
Environment=PYTHONUNBUFFERED=1
ExecStart=/opt/bugsink/.venv/bin/gunicorn --bind=0.0.0.0:8000 --workers=4 --max-requests=1000 --max-requests-jitter=100 --access-logfile - bugsink.wsgi
Restart=always
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/bugsink-snappea.service
[Unit]
Description=Bugsink Snappea
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/bugsink_data
Environment=PYTHONUNBUFFERED=1
ExecStart=/opt/bugsink/.venv/bin/bugsink-runsnappea
Restart=always
RuntimeMaxSec=1d
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now bugsink bugsink-snappea
msg_ok "Created Services"
motd_ssh
customize
cleanup_lxc