nextcloud/install: session-bus override, KWallet existence check, pass REPO vars

- sync_client_software.sh: add system-wide flatpak session-bus override for
  Nextcloud so KWallet D-Bus access works for all users; fix broken compound
  test ([ a || b ] → [ a ] || [ b ])
- user_run.sh: check KWallet entries with hasEntry before writing — skip write
  and print info message when both passwords are already present; remove stale
  commented-out code
- install.sh: forward REPO_URL and REPO_BRANCH into configure.sh environment
  for both the su- and direct-bash invocation paths
- configure.sh: simplify do_configure (user cleanup)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel unbrot Pätzold
2026-05-04 12:24:24 +02:00
parent 9a2d8ca6be
commit 5eacd55153
4 changed files with 23 additions and 39 deletions
+1 -6
View File
@@ -40,12 +40,7 @@ override_conf_var() {
do_configure() {
mkdir -p "$(dirname "$CONF_FILE")"
cp "$CONF_DIST" "$CONF_FILE"
# Source the dist defaults (unset computed vars first so they are re-evaluated).
unset TLDOMAIN DOMAIN SERVERFQDN_IPA SERVERFQDN_NC CLIENTADMINGROUP \
DECRYPTEDDATADIR ENCRYPTEDDATADIR IPAVAULTUSE IPAVAULTNAME HOSTNM FQDN
# shellcheck disable=SC1090
cp "$CONF_DIST" "$CONF_FILE" # Either setup_system.conf or setup_system.conf.dist to config.d/configure.conf
echo ""
echo "=== System Configuration ==="
+2 -2
View File
@@ -49,10 +49,10 @@ finish_install() {
if [[ "${RUN_CONF,,}" == "y" ]]; then
if [[ -n "$SUDO_USER" && "$SUDO_USER" != "root" ]]; then
info "Running configure.sh as user '$SUDO_USER'..."
su - "$SUDO_USER" -c "DISPLAY='${DISPLAY}' WAYLAND_DISPLAY='${WAYLAND_DISPLAY}' bash '$CONF_SCRIPT'"
su - "$SUDO_USER" -c "DISPLAY='${DISPLAY}' WAYLAND_DISPLAY='${WAYLAND_DISPLAY}' REPO_URL='${REPO_URL}' REPO_BRANCH='${REPO_BRANCH}' bash '$CONF_SCRIPT'"
else
info "Running configure.sh as root..."
bash "$CONF_SCRIPT"
REPO_URL="$REPO_URL" REPO_BRANCH="$REPO_BRANCH" bash "$CONF_SCRIPT"
fi
else
echo
+4 -1
View File
@@ -31,6 +31,9 @@ if [[ $? -ne 0 ]]; then
fi
echo ""
# Ensure session bus access for Nextcloud (may be blocked by Flatseal or missing from manifest)
/usr/bin/flatpak override --system --socket=session-bus com.nextcloud.desktopclient.nextcloud
#Do an upgrade of the Base package if its configured and if there are changes
chown root:${CLIENTADMINGROUP} -R ${SYSCONFIGPATH}
chmod ug+rwX,o=rX -R ${SYSCONFIGPATH}
@@ -92,7 +95,7 @@ if [[ ! -z "${DISTCONFIGPATH_SRC}" ]]; then
OLD_REPO_BRANCH="$REPO_BRANCH"
source $(dirname "$0")/setup_system.inc.sh
#Compare the Repository URLS after that
if [ "$REPO_URL" != "$OLD_REPO_URL" || "$REPO_BRANCH" != "$OLD_REPO_BRANCH" ]; then
if [ "$REPO_URL" != "$OLD_REPO_URL" ] || [ "$REPO_BRANCH" != "$OLD_REPO_BRANCH" ]; then
echo "The Repository for installation was"
echo "$OLD_REPO_URL Branch $OLD_REPO_BRANCH"
echo "After reading the config, the Repository has changed to"