mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-12-25 21:02:04 +00:00
Compare commits
No commits in common. "bfb559aefd20390eb5957dd061ff9e293dccc87f" and "038d15049114db26f8126f3b5b91b9d71a5c85f4" have entirely different histories.
bfb559aefd
...
038d150491
18
.pct-helpers
18
.pct-helpers
@ -493,7 +493,6 @@ readVars(){
|
||||
# buildAssets [VAR ..]
|
||||
#
|
||||
# XXX revise: SKIP handling...
|
||||
NOTES=NOTES.md
|
||||
buildAssets(){
|
||||
local template_dir=${TEMPLATE_DIR:-templates}
|
||||
local assets_dir=${ASSETS_DIR:-assets}
|
||||
@ -565,12 +564,6 @@ buildAssets(){
|
||||
| eval "sed ${PATTERNS[@]}" \
|
||||
> "${assets_dir}/${file}"
|
||||
done
|
||||
# special case: NOTES.md...
|
||||
if [ -z "$DESCRIPTION" ] && [ -e "$NOTES" ] ; then
|
||||
DESCRIPTION="$(\
|
||||
cat ${NOTES} \
|
||||
| eval "sed ${PATTERNS[@]}")"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@ -660,20 +653,11 @@ pctUpdateTurnkey(){
|
||||
pctSet(){
|
||||
[ "$2" ] \
|
||||
&& @ pct set $1 \
|
||||
${2} \
|
||||
${2}
|
||||
[ "$3" ] \
|
||||
&& @ pct reboot $1
|
||||
}
|
||||
|
||||
#
|
||||
# pctSetNotes ID
|
||||
#
|
||||
# XXX BUG: this deos not work yet...
|
||||
pctSetNotes(){
|
||||
[ "$DESCRIPTION" ] \
|
||||
&& @ pct set $1 \
|
||||
"${DESCRIPTION:+--description \""${DESCRIPTION}"\"}"
|
||||
}
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
@ -93,7 +93,6 @@ echo "# Setup: iptables update script..."
|
||||
|
||||
echo "# Post config..."
|
||||
pctSet $ID "${OPTS_STAGE_2}" $REBOOT
|
||||
pctSetNotes $ID
|
||||
|
||||
saveLastRunConfig
|
||||
|
||||
|
||||
@ -84,7 +84,6 @@ pctUpdateTurnkey $ID
|
||||
|
||||
echo "# Post config..."
|
||||
pctSet $ID "${OPTS_STAGE_2}" $REBOOT
|
||||
pctSetNotes $ID
|
||||
|
||||
saveLastRunConfig
|
||||
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
# Nextcloud
|
||||
|
||||
Hostname: `${CTHOSTNAME}`
|
||||
|
||||
|
||||
@ -27,12 +27,13 @@ DFL_RAM=${DFL_RAM:=2048}
|
||||
DFL_SWAP=${DFL_SWAP:=${DFL_RAM}}
|
||||
DFL_DRIVE=${DFL_DRIVE:=40}
|
||||
|
||||
# XXX do we request these???
|
||||
GATE_LAN_IP=${GATE_LAN_IP:-${DFL_GATE_LAN_IP}}
|
||||
GATE_HOSTNAME=${GATE_HOSTNAME:-${DFL_GATE_HOSTNAME}}
|
||||
WAN_IP=${WAN_IP:-${DFL_WAN_IP}}
|
||||
# Nextcloud-specific configuration...
|
||||
#APP_DOMAIN=nc.$DOMAIN
|
||||
#DB_PASS=
|
||||
#APP_PASS=
|
||||
#SEC_ALERTS=SKIP
|
||||
|
||||
#WAN_IP=SKIP
|
||||
WAN_IP=SKIP
|
||||
WAN_GATE=SKIP
|
||||
ADMIN_IP=SKIP
|
||||
ADMIN_GATE=SKIP
|
||||
@ -45,9 +46,6 @@ readVars
|
||||
|
||||
# Nextcloud-specific configuration...
|
||||
APP_DOMAIN=$DOMAIN
|
||||
#DB_PASS=
|
||||
#APP_PASS=
|
||||
#SEC_ALERTS=SKIP
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
@ -94,26 +92,26 @@ echo "# Updating config..."
|
||||
# add gate IP to trusted_proxies...
|
||||
@ lxc-attach $ID -- bash -c "\
|
||||
sed -i \
|
||||
-e \"/trusted_domains/i\\ 'trusted_proxies' =>\\n array (\\n 0 => '${GATE_LAN_IP/\/*}\\/32',\\n ),\" \
|
||||
-e \"/trusted_domains/i\\ 'trusted_proxies' =>\\n array (\\n '${GATE_LAN_IP/\/*}\\/32',\\n ),\" \
|
||||
/var/www/nextcloud/config/config.php"
|
||||
|
||||
# add self IP to trusted_domains -- enable setup from local network...
|
||||
# XXX the gate stuff might not be needed...
|
||||
# XXX is the IP actually needed???
|
||||
IP=$([ -z $DRY_RUN ] && lxc-attach $ID -- hostname -I)
|
||||
# XXX the gate stuff might not be needed...
|
||||
TRUSTED_DOMAINS=(
|
||||
"${IP/ *}"
|
||||
"$CTHOSTNAME"
|
||||
"${CTHOSTNAME}.srv"
|
||||
"${GATE_LAN_IP/\/*}"
|
||||
"${GATE_LAN_IPn}"
|
||||
"${GATE_HOSTNAME}"
|
||||
"${GATE_HOSTNAME}.srv"
|
||||
"${WAN_IP/\/*}"
|
||||
"${WAN_IPn}"
|
||||
)
|
||||
ADDRS=
|
||||
i=2
|
||||
for addr in "${TRUSTED_DOMAINS[@]}" ; do
|
||||
if [ -z "$addr" ] || [[ "$addr" == ".srv" ]] ; then
|
||||
if [ -z "$addr" ] ; then
|
||||
continue
|
||||
fi
|
||||
ADDRS="${ADDRS}\ \ $i => '${addr//\//\\/}',\\n"
|
||||
@ -146,7 +144,6 @@ pctUpdateTurnkey $ID
|
||||
|
||||
echo "# Post config..."
|
||||
pctSet $ID "${OPTS_STAGE_2}" $REBOOT
|
||||
pctSetNotes $ID
|
||||
|
||||
saveLastRunConfig
|
||||
|
||||
|
||||
@ -83,7 +83,6 @@ echo "# Setup: dnsmasq..."
|
||||
|
||||
echo "# Post config..."
|
||||
pctSet $ID "${OPTS_STAGE_2}" $REBOOT
|
||||
pctSetNotes $ID
|
||||
|
||||
saveLastRunConfig
|
||||
|
||||
|
||||
@ -85,7 +85,6 @@ done
|
||||
|
||||
echo "# Post config..."
|
||||
pctSet $ID "${OPTS_STAGE_2}" $REBOOT
|
||||
pctSetNotes $ID
|
||||
|
||||
saveLastRunConfig
|
||||
|
||||
|
||||
@ -82,7 +82,6 @@ echo "# Setup: firewall..."
|
||||
|
||||
echo "# Post config..."
|
||||
pctSet $ID "${OPTS_STAGE_2}" $REBOOT
|
||||
pctSetNotes $ID
|
||||
|
||||
saveLastRunConfig
|
||||
|
||||
|
||||
@ -109,7 +109,6 @@ echo "# Setup: wireguard server and client profile..."
|
||||
|
||||
echo "# Post config..."
|
||||
pctSet $ID "${OPTS_STAGE_2}" $REBOOT
|
||||
pctSetNotes $ID
|
||||
|
||||
saveLastRunConfig
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user