Commit Graph

136 Commits

Author SHA1 Message Date
Daniel unbrot Pätzold 536bf095d4 Cosmetic changes 2026-05-08 13:20:37 +02:00
Daniel unbrot Pätzold 08a0a6d2f0 logon_script: skip parts when parameters are wrong 2026-05-08 13:04:40 +02:00
Daniel unbrot Pätzold 01e5a3ba85 logon_script: Add Check for right config values
sync_client_software move check to better place
2026-05-08 12:59:59 +02:00
Daniel unbrot Pätzold 198f17157d sync_client_software: type in paths 2026-05-08 12:51:38 +02:00
Daniel unbrot Pätzold 8dc8cca48c sync_client_software: fix location of checks 2026-05-08 12:48:57 +02:00
Daniel unbrot Pätzold aaa7b73d53 sync_client_software: fix permissions and parameter check 2026-05-08 12:40:08 +02:00
Daniel unbrot Pätzold a237f58813 Introduce client_software_cust
For customer setups, the software repository was split into client_software and client_software_cust.

Obsoleted sync for client_software.
2026-05-08 12:10:19 +02:00
Daniel unbrot Pätzold 10517de84e Obsolete client_software/install.sh 2026-05-08 10:48:48 +02:00
Daniel unbrot Pätzold 1495c57a99 Obsoleted client_software/install.sh and user_run.sh
To make structure of client_software more clear for
following introduction of client_software.2nd
2026-05-08 10:42:34 +02:00
Daniel unbrot Pätzold 0b13f19f84 logon_script: Only Snc Mozilla if the Options are set in config. 2026-05-08 09:43:40 +02:00
Daniel unbrot Pätzold b9d13e821d mount_ecrypt_home: run gocryptfs in foreground to fix premature ExecStop
Without -fg, gocryptfs forks to background and the parent exits,
causing systemd to consider the service done and immediately call
ExecStop (fusermount -u). With -fg, gocryptfs stays as the tracked
service process so ExecStop only fires on explicit service stop at
logout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 18:05:19 +02:00
Daniel unbrot Pätzold 815fa46daa mount_ecrypt_home: wait for FUSE mount before removing passfile
systemd-run service mode returns as soon as the start request is
accepted, before gocryptfs has read the passfile. Poll /proc/mounts
for up to 10 seconds so the passfile is only removed after the mount
is confirmed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 18:05:19 +02:00
Daniel unbrot Pätzold 588f669a60 logon_script: gate KDE-specific settings on XDG_CURRENT_DESKTOP
Wrap kwriteconfig5 calls in a KDE check so they are skipped on
Cinnamon and other desktops. Also add empty-session setting so
previous apps are not restored on login.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 18:05:19 +02:00
Daniel unbrot Pätzold 4da2a3fa69 mount_ecrypt_home: unmount gocryptfs cleanly on session logout
Switch from --scope to a transient service so systemd can run
fusermount -u via ExecStop before terminating the process.
With KillMode=none, gocryptfs exits on its own once the FUSE
filesystem is detached.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 18:05:19 +02:00
Daniel unbrot Pätzold fdc2a44582 install: given repo url will be used intead of already existing ones 2026-05-07 18:05:19 +02:00
Daniel unbrot Pätzold 49a998fc12 Mozilla_pre: Make Firefox profile customizable 2026-05-07 18:05:19 +02:00
Daniel unbrot Pätzold 253030228f logon_script: check DNS resolution before proceeding
If the IPA server FQDN cannot be resolved at startup (e.g. due to a
DNSSEC outage or network not yet ready), the logon script would silently
fail later. The new check prompts the user to retry, continue anyway, or
quit, so the problem is immediately visible.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 12:26:07 +02:00
Daniel unbrot Pätzold f59ba70bb9 sync_client_software: patch sssd.conf to add krb5_validate = False
SSSD >= 2.10.1 no longer raises CAP_DAC_READ_SEARCH to effective in
offline mode, so validate_tgt fails with EACCES reading /etc/krb5.keytab
before the cached-credential fallback is reached. Adding krb5_validate =
False disables the keytab validation step and restores reliable offline
authentication for FreeIPA domain users.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 12:26:07 +02:00
Daniel unbrot Pätzold b978771206 confige: source dists defaults to for robustnes
and docs
2026-05-06 09:06:30 +02:00
Daniel unbrot Pätzold ab7dc208ad configure: Better detection and choice between predefined configs 2026-05-06 08:42:53 +02:00
Daniel unbrot Pätzold 559e913c0f install: if config was found with other repourl as the user specified, use users repourl for configure call 2026-05-06 08:07:31 +02:00
Daniel unbrot Pätzold 9fed049222 configure: comment if existing config was found 2026-05-05 21:33:25 +02:00
Daniel unbrot Pätzold 0dadf36230 Baseprofilenames and configure checks for existing preconfigure 2026-05-05 21:07:48 +02:00
Daniel unbrot Pätzold a3c95ab146 sync_client_software: run git clean from repo root
git clean -fd scopes to the current directory and below, so running it
from the system_setup/ subdirectory missed untracked files in sibling
dirs like config/. Use -C "${SYSCONFIGPATH}" to always clean from the
repo root regardless of invocation directory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 19:29:08 +02:00
Daniel unbrot Pätzold 1ac952c094 sync_client_software: fetch depth=1 and clean untracked files on upgrade
Replace the broken `git rebase HEAD^` with a proper shallow fetch:
- `git fetch --depth=1` limits local history to one commit, regardless of server history
- `git reset --hard FETCH_HEAD` syncs the working tree to the fetched tip
- `git clean -fd` removes untracked non-ignored files left by old versions
- `git gc --prune=now` immediately purges unreachable history objects

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 19:29:08 +02:00
Daniel unbrot Pätzold 4143925ff7 configure: some usable output 2026-05-04 12:40:00 +02:00
Daniel unbrot Pätzold 5eacd55153 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>
2026-05-04 12:24:24 +02:00
Daniel unbrot Pätzold 48803d89a4 Configure: Take given REPO_URL and BRANCH to new installation 2026-05-03 21:48:52 +02:00
Daniel unbrot Pätzold 73de38efe6 small changes in output 2026-05-03 20:39:56 +02:00
Daniel unbrot Pätzold 7d109111c1 Logon: Don't need KDE 2026-05-03 20:18:54 +02:00
Daniel unbrot Pätzold 8e0faed130 Install: Fix permissions 2026-05-03 19:11:19 +02:00
Daniel unbrot Pätzold 0f7dc9c043 configure: use setup_system.inc.sh to get machineid for configuration 2026-05-03 19:01:02 +02:00
Daniel unbrot Pätzold 527a124bb1 Install: Add missingconfok for broken existing installs without config 2026-05-03 18:47:53 +02:00
Daniel unbrot Pätzold 8652131882 inc.sh: use BASH_SOURCE for path resolution; add --missingconfok; fix install.sh sourcing and git pull logic
setup_system.inc.sh: replace $(dirname "$0") with $(dirname "${BASH_SOURCE[0]:-$0}") so
paths resolve correctly whether the file is sourced or executed directly. Add --missingconfok
flag to warn-and-continue instead of prompting+aborting when config is missing. Fix machine_uuid
path (missing ../). Move `source config` into the else branch so it is not reached when
missingconfok skips the exit.

install.sh: source inc.sh instead of executing it as a subprocess so exported variables
(REPO_URL etc.) propagate back to the caller. Fix git-origin conflict handling: when reusing
an existing OEMDRV partition the user has already confirmed they want to keep it, so remove
the "fresh clone / wipe" option entirely. Now always pulls (fetch+checkout) when a git repo
is present; clears and fresh-clones only when no git repo exists on the partition.

basic_pre_script.inc: dot-source inc.sh so INSTALLDOCS and other config vars are available.

config.dist, sync_client_software.sh: rename UPGRADEURL/UPGRADEBRANCH to REPO_URL/REPO_BRANCH
to match the variable names already used in install.sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 18:42:12 +02:00
Daniel unbrot Pätzold cfae3ac1f6 install: Fixed directory for reading config after git 2026-05-03 15:36:54 +02:00
Daniel unbrot Pätzold 2e329a3807 Install: Don't source setup_system.inc.sh, because it would not find the rigth settings 2026-05-03 15:32:07 +02:00
Daniel unbrot Pätzold 1d5c72129f isnatll: fixed config check before sourcing 2026-05-03 15:21:53 +02:00
Daniel unbrot Pätzold 3e78a77623 configure.sh: seed wizard from setup_system.conf when it exists
Use config/setup_system.conf as the template for configure.conf when
present, so existing values appear as defaults. Falls back to the dist
file on a fresh install.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 13:51:39 +02:00
Daniel unbrot Pätzold 94e857f340 configure.sh: allow root and non-root execution
- install.sh: pre-create ks.cfg with o+w after permission setup so
  non-root users can overwrite it (OEMDRV root itself stays o=rX)
- install.sh: restore su drop to $SUDO_USER when it is set and not
  root; fall back to direct root execution otherwise
- configure.sh: remove the hard root check so both cases work
- configure.md: update docs to reflect root/non-root support

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 13:43:09 +02:00
Daniel unbrot Pätzold 9264ca8e92 Relocate dist files, fix path references, and misc script improvements
- Move setup_system.conf.dist to system_setup/config.dist/ and
  skel.tar.zst.dist + pack_skel.sh to system_setup/skel/; config/ now
  holds only gitignored local files
- Fix configure.sh CONF_DIST path (was pointing at non-existent
  config/setup_system.conf.dist)
- Fix skel/pack_skel.sh: remove vestigial source line whose path was
  wrong in both old and new location
- Update error messages in setup_system.inc.sh and
  sync_client_software.sh to reference new dist file location
- Move machine_uuid reading/writing into setup_system.inc.sh so all
  scripts have MACHINEID available; setup_system.conf.dist now uses
  MACHINEID conditionally with a hostname fallback
- sync_client_software.sh: fix && / typo (should be && \) that broke
  the flatpak remote-add → install chain; add network error handling
  after flatpak install; cleanup upgrade logic and chown placement
- Update CLAUDE.md and install.md to reflect new dist file locations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 13:28:44 +02:00
Daniel unbrot Pätzold 97c034e31b install.sh: add existing OEMDRV reuse, git origin conflict handling, refined permissions
- Detect existing OEMDRV partition at startup; offer to reuse it
  instead of creating a new one (mounts if needed, sources existing
  setup_system.inc.sh before cloning)
- When existing repo origin/branch differs from REPO_URL/REPO_BRANCH,
  offer to pull from existing origin, migrate to new origin (preserving
  gitignored local files), or fall through to fresh clone
- Extract finish_install() and do_clone_and_done() helpers to share
  clone, permissions, and configure.sh prompt across all paths
- Replace generic chmod with chown root:root + chmod ug=rwX,o=rX
  recursively, plus o+w on config/ and config.d/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 13:08:07 +02:00
Daniel unbrot Pätzold 51ee27f514 0020_nextcloud_mozilla_pre: auto-provision Thunderbird IMAP account at logon
Fetches user_full_name (givenname + sn) and user_email from FreeIPA via
ipalib and writes them into the Thunderbird IMAP account prefs. Adds
ipalib availability check to logon_script.sh. Drops TB_MAIL_FULLNAME
config variable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 12:21:13 +02:00
Daniel unbrot Pätzold 1a8260afff setup system: add compression to mount 2026-05-01 17:53:08 +02:00
Brot der Bot d1ff9e348a mount_ecrypt_home.sh: store vault key in XDG_RUNTIME_DIR instead of /var/tmp
/var/tmp is persistent on-disk storage. The encryption key must never
be written to disk, even temporarily. Replaced all occurrences of
/var/tmp/IPAVAULTKEY.txt with ${XDG_RUNTIME_DIR}/IPAVAULTKEY, which
is a per-user tmpfs directory (/run/user/<UID>) created by
systemd-logind: guaranteed memory-only, mode 0700, wiped on logout.

Also removed the TODO comment that tracked this exact issue.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 16:38:24 +02:00
Brot der Bot 1abf7879cd detach long-running background processes from autostart service cgroup
KDE Plasma runs each autostart .desktop entry as a systemd user unit.
systemd tracks service liveness by cgroup membership, not just the
main PID. Any process forked inside the service — even via setsid or &
— stays in the service's cgroup and keeps app-logon_script.sh@autostart
in active (running) state indefinitely after logon_script.sh exits.

mount_ecrypt_home.sh: wrap the gocryptfs mount call with
  systemd-run --user --scope --unit=gocryptfs-home
The FUSE daemon that gocryptfs forks now lives in its own transient
scope cgroup. Exit-code propagation is unchanged because systemd-run
--scope returns the main process's exit code.

0050_nextcloud_desktopclient/user_run.sh: replace
  /usr/bin/setsid ... &
with
  systemd-run --user --scope --unit=nextcloud-client ... &
setsid creates a new session but does not move the process out of the
cgroup; systemd-run --scope does.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 15:02:39 +02:00
Brot der Bot 92b5e9c4a6 install.sh: fix four bugs found during live testing
Free-space start alignment
  parted reports free space starting at 0,02 MiB (before the GPT
  alignment boundary). The collect_free_space awk now rounds the start
  up to the next whole MiB (ceiling) and enforces a minimum of 1 MiB,
  then recomputes the usable size from the adjusted start. This prevents
  parted from being asked to create a partition at 0 MiB, which it
  cannot do.

Locale-independent partition creation
  The previous `printf 'Yes\n' | parted mkpart` relied on parted
  accepting an English answer to its alignment-confirmation prompt.
  On a German-locale system parted asks "Ist dies noch akzeptabel?"
  and ignores "Yes", causing mkpart to fail. Replaced with `parted -s`
  (script/non-interactive mode), consistent with every other parted
  call in the script.

Correct new-partition detection on disks with gaps
  The old heuristic took the highest partition number after partprobe.
  On a disk where existing partitions are numbered 2/3/4, a new
  partition in the gap before them receives number 1 — making the
  old heuristic point at partition 4 (the existing btrfs volume) and
  subsequently run mkfs.btrfs on it. The new awk matches by start
  position (OEMDRV_START ± 1 MiB) instead, which is unambiguous
  regardless of how numbers are assigned.

Infinite loop on EOF stdin
  When the selection while-loop's `read` hits EOF (e.g. stdin exhausted
  after sudo consumed a piped password), it returns exit code 1 with an
  empty INPUT, which falls through to "Invalid input." and spins
  forever. Added `|| { echo; echo "Aborted."; exit 0; }` to all three
  read calls in the loop.

install.md: drop stale install_from_repo.sh reference from title;
clarify that REPO_URL/REPO_BRANCH overrides are optional.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 13:56:34 +02:00
unbrot a960c084b7 Undo test install.sh 2026-04-30 18:09:09 +02:00
unbrot 1ffa1adafa Test install.sh 2026-04-30 18:06:24 +02:00
unbrot b088a03f88 Describe how to install with testenvironment 2026-04-30 18:01:48 +02:00
unbrot 8263d92b5b Add install_from_repo.sh 2026-04-30 17:16:26 +02:00