Merge branch 'master' of github.com:flynx/proxmox-utils

This commit is contained in:
Alex A. Naanou 2025-02-04 22:49:11 +03:00
commit d62bf16831
3 changed files with 101 additions and 90 deletions

View File

@ -1,90 +1,94 @@
#!/usr/bin/bash
#----------------------------------------------------------------------
cd $(dirname $0)
PATH=$PATH:$(dirname "$(pwd)")
#----------------------------------------------------------------------
source ../.pct-helpers
#----------------------------------------------------------------------
readConfig
#----------------------------------------------------------------------
webAppConfig gitea
DFL_ID=${DFL_ID:=300}
DFL_CTHOSTNAME=${DFL_CTHOSTNAME:=gitea}
DFL_CORES=${DFL_CORES:=2}
DFL_RAM=${DFL_RAM:=1024}
DFL_SWAP=${DFL_SWAP:=${DFL_RAM}}
DFL_DRIVE=${DFL_DRIVE:=40}
WAN_IP=SKIP
WAN_GATE=SKIP
ADMIN_IP=SKIP
ADMIN_GATE=SKIP
LAN_IP=SKIP
LAN_GATE=SKIP
REBOOT=${REBOOT:=1}
readVars
#----------------------------------------------------------------------
INTERFACES=(
"name=lan,bridge=vmbr${LAN_BRIDGE},firewall=1,ip=dhcp,type=veth"
)
OPTS_STAGE_2="\
--onboot 1 \
"
#----------------------------------------------------------------------
echo "# Building config..."
buildAssets
echo "# Creating CT..."
pctCreateTurnkey 'gitea' $ID "$PASS"
echo "# Starting TKL UI..."
@ lxc-attach $ID -- bash -c "HUB_APIKEY=SKIP SEC_UPDATES=SKIP /usr/sbin/turnkey-init"
echo "# Copying assets..."
pctPushAssets $ID
echo "# Disabling fail2ban..."
# NOTE: we do not need this as we'll be running from behind a reverse proxy...
@ lxc-attach $ID systemctl stop fail2ban
@ lxc-attach $ID systemctl disable fail2ban
echo "# Updating system..."
pctUpdateTurnkey $ID
echo "# Post config..."
pctSet $ID "${OPTS_STAGE_2}" $REBOOT
pctSetNotes $ID
saveLastRunConfig
echo "# Traefik config..."
traefikPushConfig
showNotes
echo "# Done."
#----------------------------------------------------------------------
# vim:set ts=4 sw=4 :
#!/usr/bin/bash
#----------------------------------------------------------------------
cd $(dirname $0)
PATH=$PATH:$(dirname "$(pwd)")
#----------------------------------------------------------------------
source ../.pct-helpers
#----------------------------------------------------------------------
readConfig
#----------------------------------------------------------------------
webAppConfig gitea
DFL_ID=${DFL_ID:=300}
DFL_CTHOSTNAME=${DFL_CTHOSTNAME:=gitea}
DFL_CORES=${DFL_CORES:=2}
DFL_RAM=${DFL_RAM:=1024}
DFL_SWAP=${DFL_SWAP:=${DFL_RAM}}
DFL_DRIVE=${DFL_DRIVE:=40}
WAN_IP=SKIP
WAN_GATE=SKIP
ADMIN_IP=SKIP
ADMIN_GATE=SKIP
LAN_IP=SKIP
LAN_GATE=SKIP
REBOOT=${REBOOT:=1}
readVars
#----------------------------------------------------------------------
INTERFACES=(
"name=lan,bridge=vmbr${LAN_BRIDGE},firewall=1,ip=dhcp,type=veth"
)
OPTS_STAGE_2="\
--onboot 1 \
"
#----------------------------------------------------------------------
# XXX do a version using alpune...
# see:
# https://wiki.alpinelinux.org/wiki/Gitea
#
echo "# Building config..."
buildAssets
echo "# Creating CT..."
pctCreateTurnkey 'gitea' $ID "$PASS"
echo "# Starting TKL UI..."
@ lxc-attach $ID -- bash -c "HUB_APIKEY=SKIP SEC_UPDATES=SKIP /usr/sbin/turnkey-init"
echo "# Copying assets..."
pctPushAssets $ID
echo "# Disabling fail2ban..."
# NOTE: we do not need this as we'll be running from behind a reverse proxy...
@ lxc-attach $ID systemctl stop fail2ban
@ lxc-attach $ID systemctl disable fail2ban
echo "# Updating system..."
pctUpdateTurnkey $ID
echo "# Post config..."
pctSet $ID "${OPTS_STAGE_2}" $REBOOT
pctSetNotes $ID
saveLastRunConfig
echo "# Traefik config..."
traefikPushConfig
showNotes
echo "# Done."
#----------------------------------------------------------------------
# vim:set ts=4 sw=4 :

View File

@ -155,6 +155,8 @@ pctPushAssets $ID
# Colabora...
# XXX should this be a function/script, callable separately, usefull to
# update existing installations???
# XXX can we make the backup/restore/migrate scripts generic and simply adapt
# them for running in lxc, over ssh or locally???
if ! [ -z $COLLABORA_OFFICE ] ; then
echo "# Collabora office..."
# see:

View File

@ -49,6 +49,8 @@ fi
FROM=$1
TO=$2
SLEEP=${SLEEP:-}
# XXX should we build TO if it's not there???
@ -60,6 +62,9 @@ TO=$2
@ lxc-attach $TO -- turnkey-occ maintenance:mode --on
# XXX should we sleep here for a minute or 6 as is recommended in the docs???
[ -z "$SLEEP" ] \
|| [ $SLEEP <= 0 ] \
|| sleep $(( $SLEEP * 60 ))
# sql
@ lxc-attach $TO -- mysql -e "DROP DATABASE nextcloud"