From 1a5e606a9337ce2842c14b7f937c0a2912b4610b Mon Sep 17 00:00:00 2001 From: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Date: Thu, 22 May 2025 16:31:22 +0200 Subject: [PATCH] Create gitea-mirror-install.sh --- install/gitea-mirror-install.sh | 69 +++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 install/gitea-mirror-install.sh diff --git a/install/gitea-mirror-install.sh b/install/gitea-mirror-install.sh new file mode 100644 index 0000000..b61c4c3 --- /dev/null +++ b/install/gitea-mirror-install.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash + +# 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 + +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 \ + openssl \ + sqlite3 \ + unzip +msg_ok "Installed Dependencies" + +msg_info "Installing Bun" +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 +msg_ok "Installed Bun" + +fetch_and_deploy_gh_release "arunavo4/gitea-mirror" + +msg_info "Installing Gite-Mirror" +cd /opt/gitea-mirror +bun install +bun run build +mkdir -p /opt/gitea-mirror-data/ +bun run manage-db init +msg_ok "Installed Gitea-Mirror" + +msg_info "Creating Services" +cat </etc/systemd/system/homarr.service +[Unit] +Description=Gitea Mirror +After=network.target +[Service] +Type=simple +WorkingDirectory=/opt/gitea-mirror +ExecStart=/usr/local/bin/bun dist/server/entry.mjs +Restart=on-failure +RestartSec=10 +Environment=NODE_ENV=production +Environment=HOST=0.0.0.0 +Environment=PORT=4321 +Environment=DATABASE_URL=file:/opt/gitea-mirror-data/gitea-mirror.db +Environment=JWT_SECRET=${JWT_SECRET} +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now gite-mirror +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned"