Merge pull request 'Add configure.sh wizard, server checks, KS profile selection, and install improvements' (#16) #17

Merged
obel1x merged 16 commits from devel into main 2026-04-29 22:16:53 +02:00
Showing only changes of commit d363a806c0 - Show all commits
+30 -24
View File
@@ -52,7 +52,7 @@ do_configure() {
echo "" echo ""
source "$CONF_FILE" source "$CONF_FILE"
VARS=("TLDOMAIN" "DOMAIN" "SERVERFQDN_IPA" "SERVERFQDN_NC" "CLIENTADMINGROUP" ) VARS=("TLDOMAIN" "DOMAIN" "SERVERFQDN_IPA" "SERVERFQDN_NC" "CLIENTADMINGROUP" "IPAVAULTUSE" )
for ELE in "${VARS[@]}" for ELE in "${VARS[@]}"
do do
new_ELE=$(prompt_value "${ELE}" "${!ELE}") new_ELE=$(prompt_value "${ELE}" "${!ELE}")
@@ -67,35 +67,41 @@ do_configure() {
while true; do while true; do
do_configure do_configure
# Load setup_system.inc.sh (which re-sources configure.conf and defines all functions).
# shellcheck disable=SC1090
source "${SCRIPTDIR}/setup_system.inc.sh"
echo "" echo ""
echo "=== Testing: obtaining Nextcloud WebDAV token ===" echo "=== Testing: Nextcloud server ==="
while true; do NC_STATUS=$(curl -fsSL "https://${SERVERFQDN_NC}/status.php" 2>/dev/null)
# This makes the Token only available for this session, not written to disk if echo "$NC_STATUS" | grep -q '"installed":true'; then
unset DAVTOKENFILENAME NC_VERSION=$(echo "$NC_STATUS" | grep -oP '(?<="versionstring":")[^"]+')
#Sets a temporay Hostname for the Token echo "Nextcloud confirmed at ${SERVERFQDN_NC} (version ${NC_VERSION})."
export HOSTNM="OEMDRV_TEST_TOKEN" else
get_nc_token
current_user="$(id -un)"
if [[ "${DAVTOKEN_USER}" == "${current_user}" ]]; then
echo "Token obtained successfully for user '${DAVTOKEN_USER}'."
break
fi
echo "" echo ""
if [[ -z "${DAVTOKEN_USER}" ]]; then echo "WARNING: '${SERVERFQDN_NC}' does not appear to be a valid Nextcloud server."
echo "Token could not be obtained (DAVTOKEN_USER is empty)." echo " Could not reach https://${SERVERFQDN_NC}/status.php or response was unexpected."
else read -rp "Start configuration again (a) or quit (q)? [a/q]: " ans
echo "Token user '${DAVTOKEN_USER}' does not match current user '${current_user}'."
fi
read -rp "Retry get_nc_token (r) or quit (q)? [r/q]: " ans
if [[ "${ans,,}" == "q" ]]; then if [[ "${ans,,}" == "q" ]]; then
echo "Quitting." echo "Quitting."
exit 1 exit 1
fi fi
done continue
fi
echo ""
echo "=== Testing: FreeIPA server ==="
IPA_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
"https://${SERVERFQDN_IPA}/ipa/session/json" 2>/dev/null)
if [[ "$IPA_CODE" == "200" || "$IPA_CODE" == "401" ]]; then
echo "FreeIPA server confirmed at ${SERVERFQDN_IPA}."
else
echo ""
echo "WARNING: '${SERVERFQDN_IPA}' does not appear to be a valid FreeIPA server."
echo " https://${SERVERFQDN_IPA}/ipa/session/json returned: ${IPA_CODE:-no response}"
read -rp "Start configuration again (a) or quit (q)? [a/q]: " ans
if [[ "${ans,,}" == "q" ]]; then
echo "Quitting."
exit 1
fi
continue
fi
echo "" echo ""
echo "=== Configuration complete ===" echo "=== Configuration complete ==="