From a0633e94f8c59da72a6f25339add2544e1ed2ad2 Mon Sep 17 00:00:00 2001 From: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Date: Thu, 22 May 2025 07:02:21 +0200 Subject: [PATCH] start work on gitea-mirror script --- ct/gitea-mirror.sh | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 ct/gitea-mirror.sh diff --git a/ct/gitea-mirror.sh b/ct/gitea-mirror.sh new file mode 100644 index 0000000..d98b40b --- /dev/null +++ b/ct/gitea-mirror.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: CrazyWolf13 +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/arunavo4/gitea-mirror + +APP="gitea-mirror" +var_tags="${var_tags:-arr;dashboard}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-4096}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +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/homarr ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + RELEASE=$(curl -fsSL https://api.github.com/repos/homarr-labs/homarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + + msg_info "Stopping Services (Patience)" + systemctl stop homarr + msg_ok "Services Stopped" + + msg_info "Backup Data" + mkdir -p /opt/homarr-data-backup + cp /opt/homarr/.env /opt/homarr-data-backup/.env + msg_ok "Backup Data" + + msg_info "Updating and rebuilding ${APP} to v${RELEASE} (Patience)" + export BUN_INSTALL=/opt/bun + curl -fsSL https://bun.sh/install | bash + ln -sf /opt/bun/bin/bun /usr/local/bin/bun + ln -sf /opt/bun/bin/bun /usr/local/bin/bunx + bun --version + + apt install -y git + git clone https://github.com/arunavo4/gitea-mirror.git + cd /opt/gitea-mirror + bun install + bun run build + bun run manage-db init + + + install_node_and_modules + rm -rf /opt/homarr + fetch_and_deploy_gh_release "homarr-labs/homarr" + + else + msg_ok "No update required. ${APP} is already at v${RELEASE}" + 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}:7575${CL}"