Commit Graph

271 Commits

Author SHA1 Message Date
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
obel1x a269a7e5ef Merge pull request 'TB Mailaccount: use USER instead of WEBDAV user for imap user' (#23) from unbrot/fedora-OEMDRV:main into main
Reviewed-on: obel1x/fedora-OEMDRV#23
2026-05-02 21:31:04 +02:00
Daniel unbrot Pätzold 230b224ffc TB Mailaccount syntax error 2026-05-02 18:40:35 +02:00
Daniel unbrot Pätzold fa571be379 Merge branch 'main' of ssh://gitea.dtext.online:2222/unbrot/fedora-OEMDRV 2026-05-02 18:37:22 +02:00
Daniel unbrot Pätzold 99c2e464a5 TB Mailaccount: user user instead of WEBDAV user for imap user 2026-05-02 17:05:08 +02:00
obel1x 80e844f56c Merge pull request 'TB Mailaccount: user right userid when NC User differs from IPA User' (#22) from unbrot/fedora-OEMDRV:main into main
Reviewed-on: obel1x/fedora-OEMDRV#22
2026-05-02 14:26:42 +02:00
unbrot ace97187d1 merge upstream 2026-05-02 14:25:20 +02:00
Daniel unbrot Pätzold b91008368d TB Mailaccount: user right userid when NC User differs from IPA User 2026-05-02 14:23:02 +02:00
obel1x 5827c5b0b6 Merge pull request 'TB Mailaccount autoprovisioning, Talk with dbus access' (#21) from unbrot/fedora-OEMDRV:main into main
Reviewed-on: obel1x/fedora-OEMDRV#21
2026-05-02 14:02:44 +02:00
unbrot b233601e16 undo pycache in gitignore 2026-05-02 13:57:59 +02:00
Daniel unbrot Pätzold b37bd8fadd Add pycache to gitignore 2026-05-02 13:50:47 +02:00
Daniel unbrot Pätzold c4448caa5f mozilla pre: renamed test_api to test_ipaapi 2026-05-02 13:43:32 +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 d95136459c 0020_nextcloud_mozilla_pre: auto-provision Thunderbird IMAP account at logon
Adds SERVERFQDN_IMAP and TB_MAIL_FULLNAME to setup_system.conf.dist.
On each logon the script checks if an IMAP account for DAVTOKEN_USER@TLDOMAIN
already exists in prefs.js; if not it writes the server, identity, and account
entries and registers it with accountmanager. Idempotent — skipped when the
account is already present.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 10:59:53 +02:00
Daniel unbrot Pätzold 87ac49ce41 0110_nextcloud_talk_app: restore D-Bus and KWallet access via flatpak override
Ensures session bus socket and kwalletd5/6 talk permissions are set at
logon, so Flatseal or a missing manifest entry cannot silently break
Talk's credential storage and Plasma integration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 10:59:53 +02:00
obel1x 0ad82ac4e9 Merge pull request 'install.sh bug fixes, autostart cgroup detachment, vault key security' (#20) from unbrot/fedora-OEMDRV:main into main
Reviewed-on: obel1x/fedora-OEMDRV#20
2026-05-01 17:59:24 +02:00
Daniel unbrot Pätzold 1a8260afff setup system: add compression to mount 2026-05-01 17:53:08 +02:00
Brot der Bot 0c50f7825d 0110_nextcloud_talk_app: fix Electron GPU crash on service exit
--scope ... & had two problems:
1. systemd-run stayed alive in the autostart service cgroup;
   KillMode=control-group sent it SIGTERM when logon_script.sh exited,
   tearing down the scope and killing Talk mid-initialization.
2. The scope lacked Delegate=yes, preventing Electron's zygote from
   creating sub-cgroups for the GPU/renderer processes.

The previous commit added Delegate=yes but kept --scope, so problem 1
remained: the scope was still torn down on service exit, causing the
GPU/network service crash visible in talk.log.

Switch to a transient service unit identical to the Nextcloud Desktop
Client fix: --no-block returns immediately so systemd-run is gone from
the cgroup before the service ends; --property=Delegate=yes is retained
for Electron's zygote. Tested: service active, zygote and network
service running, no GPU crash.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 17:23:49 +02:00
Brot der Bot c454110793 0050_nextcloud_desktopclient: fix Nextcloud client killed on service exit
systemd-run --scope ... & left the systemd-run binary running as a
background process inside the autostart service's cgroup. When
logon_script.sh exited, systemd's KillMode=control-group sent SIGTERM
to all remaining cgroup processes, including systemd-run. systemd-run,
on receiving SIGTERM while monitoring a scope, stopped the scope and
killed the Nextcloud client -- at exactly the same moment the autostart
service ended.

--no-block with --scope is not supported. Switch to a transient service
unit (drop --scope, add --no-block). systemd-run registers the unit and
returns immediately, leaving the cgroup before logon_script.sh ends.
The Nextcloud process then runs as an independent systemd user service,
unaffected by the autostart service lifecycle. Tested: Nextcloud keeps
running after systemd-run exits.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 17:13:41 +02:00
Brot der Bot 93418748d7 0110_nextcloud_talk_app: add Delegate=yes to fix Electron GPU crash
Nextcloud Talk is an Electron app. Electron uses a zygote process to
fork sandboxed child processes (GPU, renderer, network service) into
their own sub-cgroups. systemd-run --scope without Delegate=yes locks
down the cgroup — sub-cgroups cannot be created — so the zygote fails,
causing the GPU process to crash immediately on startup.

Adding --property=Delegate=yes hands cgroup management to the scope,
allowing flatpak/bubblewrap and Electron's zygote to create the
sub-cgroups they need. Tested: no GPU crash with this flag set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 16:57:03 +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 e246c1f875 0110_nextcloud_talk_app: detach Talk from autostart service cgroup
setsid -f forks the process into a new session but leaves it in the
calling service's cgroup. systemd-run --user --scope moves it into its
own transient scope cgroup so the autostart service can finish normally.

Added & to background the launch, replacing the fork that setsid -f
was providing. Tested: scope is created and Talk starts correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 16:33:17 +02:00
Brot der Bot 3964f8b081 0010_kwallet: detach kwalletd6 from autostart service cgroup
Same root cause as the gocryptfs and Nextcloud fixes: kwalletd6 is a
long-running daemon that stays alive for the entire KDE session.
Launching it with setsid keeps it in the autostart service cgroup,
preventing app-logon_script.sh@autostart from reaching finished state.

Replace setsid with systemd-run --user --scope so kwalletd6 runs in
its own transient scope cgroup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 15:05:20 +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
obel1x e8c88c35d7 Merge pull request 'configure.sh wizard, install improvements, encryption fixes, branch support' (#19) from devel into main
Reviewed-on: obel1x/fedora-OEMDRV#19
2026-04-30 18:36:59 +02:00
obel1x 9f71728512 Merge branch 'main' into devel 2026-04-30 18:36:46 +02:00
obel1x 9ce4686a2b Merge pull request 'configure.sh wizard, install improvements, encryption fixes, branch support' (#18) from unbrot/fedora-OEMDRV:main into devel
Reviewed-on: obel1x/fedora-OEMDRV#18
2026-04-30 18:34:01 +02:00
obel1x fdbd4e44f5 Merge branch 'devel' into main 2026-04-30 18:33: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
unbrot 58b23b00e7 mozilla_pre: fixed server adress 2026-04-30 16:45:45 +02:00
unbrot 554ef23c7e Encryption: Add user_allow_other to /etc/fuse.conf 2026-04-30 16:43:46 +02:00
unbrot b586de545e check crypt setup file 2026-04-30 16:36:34 +02:00
unbrot 7a3f610740 Crypt: Better check for configured 2026-04-30 16:34:01 +02:00
unbrot ee2ae055e9 Crypt: Add Passfile 2026-04-30 16:23:56 +02:00
unbrot fe9f6841f3 Cryptfilesystem: Allow root to access encrypted directory 2026-04-30 16:19:01 +02:00
unbrot 0d86bc3d1a Div visual updates 2026-04-30 15:37:19 +02:00
unbrot 4a7ee59559 configure: CLIENT_SOFTWARE_SRC not needed 2026-04-30 15:19:58 +02:00
unbrot d0932a2fda Configure: Make IPAVAULTNAME again possible 2026-04-30 15:15:20 +02:00
unbrot 29c87be593 Replace instable HOSTNM determination by file for installation. 2026-04-30 15:06:47 +02:00
unbrot f89d0f36f1 Write DMI UUID to machine_uuid.sys for user-accessible machine ID
install.sh writes the last 12 chars of the DMI system UUID to
config.d/machine_uuid.sys (0444) after git clone, so non-root scripts
can derive the hardware-bound hostname without needing dmidecode.

conf.dist reads machine_uuid.sys first; falls back to dmidecode (root)
or hostname -s (user) if the file is absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 14:55:33 +02:00
unbrot bcbcc3392d install.sh: offer to install missing tools via dnf
Instead of dying immediately, check_tools now lists missing packages,
asks the user to install them with dnf, and re-verifies after install.
Decline still aborts as before.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 13:06:49 +02:00
unbrot d316a7b605 Refactor configure.sh: per-variable validation loop with DNS domain check
Each variable is now prompted in a retry loop so a failed test re-prompts
that specific variable instead of restarting the whole wizard. Adds DNS-based
IPA domain validation (_ldap._tcp SRV + _kerberos TXT + _kerberos._udp SRV),
matching what ipa-client-install --domain performs. Fixes syntax errors
(bare `do` → `while true; do`, `continue` → `break`). Expands VARS to include
IPAVAULTNAME, CLIENT_SOFTWARE_SRC, DISTCONFIGPATH_SRC.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 12:52:41 +02:00
unbrot 2032bde99d IPA-register use Terminal 8 for better logging 2026-04-30 12:51:59 +02:00
unbrot 0b1ade5771 Anaconda ks.cfg: use also nvme drives 2026-04-30 12:36:05 +02:00