mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-10-29 19:20:10 +00:00
testing...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
dfccbb0819
commit
7dda3a28e7
11
.pct-helpers
11
.pct-helpers
@ -205,27 +205,30 @@ xreadpass(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Wait for /etc/inithooks.conf to be generated then cleared
|
||||||
#
|
#
|
||||||
# tklWaitForSetup
|
# tklWaitForSetup
|
||||||
#
|
#
|
||||||
|
# for tkl inithooks doc see:
|
||||||
|
# https://www.turnkeylinux.org/docs/inithooks
|
||||||
tklWaitForSetup(){
|
tklWaitForSetup(){
|
||||||
printf "# TKL setup, this may take a while"
|
printf "# TKL setup, this may take a while"
|
||||||
if [ -z $DRY_RUN ] ; then
|
if [ -z $DRY_RUN ] ; then
|
||||||
while ! $(lxc-attach $ID -- test -e /etc/inithooks.conf) ; do
|
while ! $(lxc-attach $ID -- test -e /etc/inithooks.conf) ; do
|
||||||
printf '.'
|
printf '.'
|
||||||
sleep 5
|
sleep ${TIMEOUT:=5}
|
||||||
done
|
done
|
||||||
printf '+'
|
printf '+'
|
||||||
sleep 5
|
sleep ${TIMEOUT:=5}
|
||||||
while ! [[ $(lxc-attach $ID -- cat /etc/inithooks.conf | wc -c) < 2 ]] ; do
|
while ! [[ $(lxc-attach $ID -- cat /etc/inithooks.conf | wc -c) < 2 ]] ; do
|
||||||
printf '.'
|
printf '.'
|
||||||
sleep 5
|
sleep ${TIMEOUT:=5}
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
printf '.+..'
|
printf '.+..'
|
||||||
fi
|
fi
|
||||||
printf 'ready.\n'
|
printf 'ready.\n'
|
||||||
sleep 5
|
sleep ${TIMEOUT:=5}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -51,6 +51,7 @@ OPTS_STAGE_1="\
|
|||||||
--storage local-lvm \
|
--storage local-lvm \
|
||||||
--rootfs local-lvm:$DRIVE \
|
--rootfs local-lvm:$DRIVE \
|
||||||
--unprivileged 1 \
|
--unprivileged 1 \
|
||||||
|
--features nesting=1 \
|
||||||
${PCT_EXTRA} \
|
${PCT_EXTRA} \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ OPTS_STAGE_1="\
|
|||||||
--storage local-lvm \
|
--storage local-lvm \
|
||||||
--rootfs local-lvm:$DRIVE \
|
--rootfs local-lvm:$DRIVE \
|
||||||
--unprivileged 1 \
|
--unprivileged 1 \
|
||||||
--features nesting=1
|
--features nesting=1 \
|
||||||
${PCT_EXTRA} \
|
${PCT_EXTRA} \
|
||||||
"
|
"
|
||||||
|
|
||||||
@ -68,29 +68,6 @@ getLatestTemplate '.*-turnkey-nextcloud' TEMPLATE
|
|||||||
pctCreate $ID "$TEMPLATE" "$OPTS_STAGE_1" "$PASS"
|
pctCreate $ID "$TEMPLATE" "$OPTS_STAGE_1" "$PASS"
|
||||||
sleep ${TIMEOUT:=5}
|
sleep ${TIMEOUT:=5}
|
||||||
|
|
||||||
# hooking into tkl init process:
|
|
||||||
# - wait for /etc/inithooks.conf to be generated by:
|
|
||||||
# /usr/lib/inithooks/firstboot.d/29preseed
|
|
||||||
# this file existion would mean that the first stage of setup is
|
|
||||||
# done and we can do:
|
|
||||||
# lxc-attach $ID -- bash --login exit
|
|
||||||
# to launch interactive setup...
|
|
||||||
# XXX can we get console/log output while poling???
|
|
||||||
# - inject a script into the chain to do our stuff
|
|
||||||
# Q: can we reuse tkl's scripts???
|
|
||||||
#
|
|
||||||
# * another strategy would be generate our own inithooks.conf but
|
|
||||||
# this would require us to mount the ct volume before first boot...
|
|
||||||
# see:
|
|
||||||
# https://forum.proxmox.com/threads/pct-push-when-lxc-is-offline.116786/
|
|
||||||
# * might be usefull to do both to:
|
|
||||||
# - maximize compatibility / change tolerance (tkl ui) (???)
|
|
||||||
# - skip dialogs we do not use...
|
|
||||||
# ...i.e. poll-patch-ui
|
|
||||||
#
|
|
||||||
# for tkl inithooks doc see:
|
|
||||||
# https://www.turnkeylinux.org/docs/inithooks
|
|
||||||
|
|
||||||
tklWaitForSetup
|
tklWaitForSetup
|
||||||
|
|
||||||
echo "# Starting TKL UI..."
|
echo "# Starting TKL UI..."
|
||||||
@ -98,14 +75,16 @@ echo "# Starting TKL UI..."
|
|||||||
|
|
||||||
echo "# Updating config..."
|
echo "# Updating config..."
|
||||||
# add gate IP to trusted_proxies...
|
# add gate IP to trusted_proxies...
|
||||||
@ lxc-attach $ID -- sed -i \
|
@ lxc-attach $ID -- bash -c "\
|
||||||
-e "/trusted_domains/i\ 'trusted_proxies' =>\n array (\n '${GATE_LAN_IP}/32',\n )," \
|
sed -i \
|
||||||
/var/www/nextcloud/config/config.php
|
-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...
|
# add self IP to trusted_domains -- enable setup from local network...
|
||||||
IP=${DRY_RUN:=$(lxc-attach $ID -- hostname -I)}
|
IP=${DRY_RUN:=$(lxc-attach $ID -- hostname -I)}
|
||||||
@ lxc-attach $ID -- sed -z -i \
|
@ lxc-attach $ID -- bash -c "\
|
||||||
-e "s/\(trusted_domains[^)]*\)/\1 2 => '${IP/ *}',\n /" \
|
sed -z -i \
|
||||||
/var/www/nextcloud/config/config.php
|
-e \"s/\(trusted_domains[^)]*\)/\1 2 => '${IP/ *}',\n /\" \
|
||||||
|
/var/www/nextcloud/config/config.php"
|
||||||
|
|
||||||
echo "# Copying assets..."
|
echo "# Copying assets..."
|
||||||
@ pct-push-r $ID ./assets /
|
@ pct-push-r $ID ./assets /
|
||||||
|
|||||||
@ -50,6 +50,7 @@ OPTS_STAGE_1="\
|
|||||||
--storage local-lvm \
|
--storage local-lvm \
|
||||||
--rootfs local-lvm:$DRIVE \
|
--rootfs local-lvm:$DRIVE \
|
||||||
--unprivileged 1 \
|
--unprivileged 1 \
|
||||||
|
--features nesting=1 \
|
||||||
${PCT_EXTRA} \
|
${PCT_EXTRA} \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,7 @@ OPTS_STAGE_1="\
|
|||||||
--storage local-lvm \
|
--storage local-lvm \
|
||||||
--rootfs local-lvm:$DRIVE \
|
--rootfs local-lvm:$DRIVE \
|
||||||
--unprivileged 1 \
|
--unprivileged 1 \
|
||||||
|
--features nesting=1 \
|
||||||
${PCT_EXTRA} \
|
${PCT_EXTRA} \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|||||||
@ -49,6 +49,7 @@ OPTS_STAGE_1="\
|
|||||||
--storage local-lvm \
|
--storage local-lvm \
|
||||||
--rootfs local-lvm:$DRIVE \
|
--rootfs local-lvm:$DRIVE \
|
||||||
--unprivileged 1 \
|
--unprivileged 1 \
|
||||||
|
--features nesting=1 \
|
||||||
${PCT_EXTRA} \
|
${PCT_EXTRA} \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user