Skip to content

Commit ed49627

Browse files
Add gogs (ct) (#13896)
Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
1 parent a2d94d6 commit ed49627

2 files changed

Lines changed: 115 additions & 0 deletions

File tree

ct/gogs.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://gogs.io/
7+
8+
APP="Gogs"
9+
var_tags="${var_tags:-git;code;devops}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-1024}"
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 [[ ! -f /opt/gogs/gogs ]]; then
28+
msg_error "No ${APP} Installation Found!"
29+
exit
30+
fi
31+
32+
if check_for_gh_release "gogs" "gogs/gogs"; then
33+
msg_info "Stopping Service"
34+
systemctl stop gogs
35+
msg_ok "Stopped Service"
36+
37+
msg_info "Backing up Data"
38+
cp -r /opt/gogs/custom /opt/gogs_custom_backup
39+
cp -r /opt/gogs/data /opt/gogs_data_backup
40+
msg_ok "Backed up Data"
41+
42+
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "gogs" "gogs/gogs" "prebuild" "latest" "/opt/gogs" "gogs_*_linux_amd64.tar.gz"
43+
44+
msg_info "Restoring Data"
45+
cp -r /opt/gogs_custom_backup/. /opt/gogs/custom
46+
cp -r /opt/gogs_data_backup/. /opt/gogs/data
47+
rm -rf /opt/gogs_custom_backup /opt/gogs_data_backup
48+
msg_ok "Restored Data"
49+
50+
msg_info "Starting Service"
51+
systemctl start gogs
52+
msg_ok "Started Service"
53+
msg_ok "Updated successfully!"
54+
fi
55+
exit
56+
}
57+
58+
start
59+
build_container
60+
description
61+
62+
msg_ok "Completed Successfully!\n"
63+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
64+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
65+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"

install/gogs-install.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://gogs.io/
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt install -y git
18+
msg_ok "Installed Dependencies"
19+
20+
fetch_and_deploy_gh_release "gogs" "gogs/gogs" "prebuild" "latest" "/opt/gogs" "gogs_*_linux_amd64.tar.gz"
21+
22+
msg_info "Setting up Gogs"
23+
mkdir -p /opt/gogs/{custom/conf,data,log}
24+
msg_ok "Set up Gogs"
25+
26+
msg_info "Creating Service"
27+
cat <<EOF >/etc/systemd/system/gogs.service
28+
[Unit]
29+
Description=Gogs Git Service
30+
After=network.target
31+
32+
[Service]
33+
Type=simple
34+
User=root
35+
WorkingDirectory=/opt/gogs
36+
ExecStart=/opt/gogs/gogs web
37+
Restart=on-failure
38+
RestartSec=5
39+
Environment=USER=root
40+
Environment=HOME=/root
41+
42+
[Install]
43+
WantedBy=multi-user.target
44+
EOF
45+
systemctl enable -q --now gogs
46+
msg_ok "Created Service"
47+
48+
motd_ssh
49+
customize
50+
cleanup_lxc

0 commit comments

Comments
 (0)