|
| 1 | +#!/usr/bin/env bash |
| 2 | +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) |
| 3 | +# Copyright (c) 2021-2026 community-scripts ORG |
| 4 | +# Author: bzumhagen |
| 5 | +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE |
| 6 | +# Source: https://github.com/Wetzel402/Skylite-UX |
| 7 | + |
| 8 | +APP="Skylite-UX" |
| 9 | +var_tags="${var_tags:-family;productivity}" |
| 10 | +var_cpu="${var_cpu:-2}" |
| 11 | +var_ram="${var_ram:-4096}" |
| 12 | +var_disk="${var_disk:-8}" |
| 13 | +var_os="${var_os:-debian}" |
| 14 | +var_version="${var_version:-13}" |
| 15 | +var_unprivileged="${var_unprivileged:-1}" |
| 16 | + |
| 17 | +header_info "$APP" |
| 18 | +variables |
| 19 | +color |
| 20 | +catch_errors |
| 21 | + |
| 22 | +function update_script() { |
| 23 | + header_info |
| 24 | + check_container_storage |
| 25 | + check_container_resources |
| 26 | + |
| 27 | + if [[ ! -d /opt/skylite-ux ]]; then |
| 28 | + msg_error "No ${APP} Installation Found!" |
| 29 | + exit |
| 30 | + fi |
| 31 | + |
| 32 | + if check_for_gh_release "skylite-ux" "Wetzel402/Skylite-UX"; then |
| 33 | + msg_info "Stopping Service" |
| 34 | + systemctl stop skylite-ux |
| 35 | + msg_ok "Stopped Service" |
| 36 | + |
| 37 | + msg_info "Backing up Data" |
| 38 | + cp /opt/skylite-ux/.env /tmp/skylite-ux.env.backup |
| 39 | + msg_ok "Backed up Data" |
| 40 | + |
| 41 | + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "skylite-ux" "Wetzel402/Skylite-UX" "tarball" |
| 42 | + |
| 43 | + msg_info "Restoring Data" |
| 44 | + cp /tmp/skylite-ux.env.backup /opt/skylite-ux/.env |
| 45 | + rm -f /tmp/skylite-ux.env.backup |
| 46 | + msg_ok "Restored Data" |
| 47 | + |
| 48 | + msg_info "Building Skylite-UX" |
| 49 | + cd /opt/skylite-ux |
| 50 | + $STD npm ci |
| 51 | + $STD npx prisma generate |
| 52 | + $STD npm run build |
| 53 | + msg_ok "Built Skylite-UX" |
| 54 | + |
| 55 | + msg_info "Running Database Migrations" |
| 56 | + cd /opt/skylite-ux |
| 57 | + $STD npx prisma migrate deploy |
| 58 | + msg_ok "Ran Database Migrations" |
| 59 | + |
| 60 | + msg_info "Starting Service" |
| 61 | + systemctl start skylite-ux |
| 62 | + msg_ok "Started Service" |
| 63 | + msg_ok "Updated successfully!" |
| 64 | + fi |
| 65 | + exit |
| 66 | +} |
| 67 | + |
| 68 | +start |
| 69 | +build_container |
| 70 | +description |
| 71 | + |
| 72 | +msg_ok "Completed successfully!\n" |
| 73 | +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" |
| 74 | +echo -e "${INFO}${YW} Access it using the following URL:${CL}" |
| 75 | +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" |
0 commit comments