104 Commits

Author SHA1 Message Date
Daniel unbrot Pätzold 6fe96f82fd 0060_ssh_key: relocate ~/.ssh into encrypted data dir, generate non-interactively
Symlinks ~/.ssh to ${DECRYPTEDDATADIR}/ssh_keys (migrating any existing
content once) so the key lives in the gocryptfs-encrypted area instead
of the plain home directory. Also passes -N "" to ssh-keygen so key
generation no longer prompts for a passphrase.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 13:49:33 +02:00
Daniel unbrot Pätzold a708e4fa6e 0060_ssh_key: add private key escrow via IPA vault and README
Provisions ~/.ssh/id_ed25519 once and stores it in the FreeIPA KRA
vault so the key persists across reinstalls/new machines instead of
being regenerated each time. Guards against silently overwriting an
existing vault key on transient failures (missing ~/.ssh, vault-add
errors, ssh-keygen failures) before archiving.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 13:13:30 +02:00
Daniel unbrot Pätzold 01b39e892f 0040_autostart_logon_script: remove executable bit from .desktop file
systemd-xdg-autostart-generator warns that .desktop files with
execute permissions set are invalid. .desktop files should not be
executable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 12:43:09 +02:00
Daniel unbrot Pätzold 5e0f268962 kwallet: remove ExecStop, stop old unit in user_run.sh instead
ExecStop on the user service caused an unmount race: it fired
asynchronously after logout while the next login's install.sh had
already remounted the wallet, then unmounted it again leaving
kwalletd6 without its wallet directory.

install.sh already handles umount/remount at login start, so no
ExecStop is needed. On gocryptfs systems the wallet becomes
inaccessible at logout naturally when ~/data is unmounted.

user_run.sh now explicitly stops any leftover kwalletd6-logon unit
from a previous session before creating a new one, avoiding the
systemd-run unit-name-conflict failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 12:29:20 +02:00
Daniel unbrot Pätzold b32cc96ca0 kwallet: stop kwalletd6-logon.service before remounting wallet
ExecStop (umount) fires asynchronously ~26s after logout, by which
time a second login's install.sh has already remounted the wallet.
ExecStop then unmounts the fresh mount, leaving kwalletd6 without
the wallet directory.

Fix: stop kwalletd6-logon.service at the top of install.sh so its
ExecStop fires and drains before the remount, eliminating the race.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 12:01:08 +02:00
Daniel unbrot Pätzold 5b13ea7372 kwallet: treat exit code 1 as success in kwalletd6-logon.service
kwalletd6 exits with code 1 when the Wayland compositor shuts down
during logout. Without SuccessExitStatus=1, the service is marked
failed and ExecStop (the bind mount umount) never runs. Treating
exit code 1 as success keeps the service in active-exited state so
systemd fires ExecStop cleanly on session end.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 11:49:12 +02:00
Daniel unbrot Pätzold 3429ffa48f kwallet: unmount bind mount cleanly on session logout
Switch kwalletd6-logon from --scope to a transient service with
RemainAfterExit=yes (kwalletd6 forks to background, so the service
must stay active after the main process exits). ExecStop runs
'sudo umount -l' to detach the wallet bind mount before gocryptfs
unmounts ~/data (Before=gocryptfs-home.service ordering).

install.sh adds a per-user sudoers drop-in so the user service
can call umount as root without a password.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 11:07:01 +02:00
Daniel unbrot Pätzold 84527d6384 client_software cosmetic changes 2026-05-08 12:07:54 +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 49a998fc12 Mozilla_pre: Make Firefox profile customizable 2026-05-07 18:05:19 +02:00
Daniel unbrot Pätzold 063011d404 0030_desktop_symbols does not need root for installing 2026-05-07 18:05:19 +02:00
Daniel unbrot Pätzold 6876c06ead nextcloud/user_run: centralise Flatpak app ID and data dir path
Introduce NC_FLATPAK_APP and NC_FLATPAK_DIR variables so the app ID
and ~/.var/app path are defined once and referenced everywhere, rather
than repeated as literals. Also fixes a stray leading '/' in the
nextcloud.cfg grep path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 08:50:21 +02:00
Daniel unbrot Pätzold b5462e4781 NC: remove autostart from installed Version 2026-05-05 08:35:00 +02:00
Daniel unbrot Pätzold 3b392c7862 nextcloud/user_run: block new setups when any folder is already configured
Set _nc_first=0 in the already-found branch so that a configured folder
prevents subsequent entries from wiping the Nextcloud config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 15:21:48 +02:00
Daniel unbrot Pätzold f04bbdf9f1 nextcloud/user_run: reactivate _nc_first single-folder guard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 14:12:41 +02:00
Daniel unbrot Pätzold fb726795db nextcloud/user_run: prompt to clean up leftover .bak folders before sync
Before the sync loop, find all *.bak directories in the parent dirs of
configured sync paths, list them with their size, and ask the user to
delete them with a y/N prompt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 14:11:39 +02:00
Daniel unbrot Pätzold 2bdee44e65 nextcloud/user_run: use timestamp suffix for renamed backup folders
Replace static _bak suffix with _YYYYMMDDhhmmss.bak so repeated runs
never fail trying to overwrite an existing backup directory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 14:07:11 +02:00
Daniel unbrot Pätzold e8c869f109 nextcloud/user_run: wipe config only once for first new sync folder
Config wipe now guarded by _nc_wipe_done flag so subsequent new entries
do not destroy the previous setup. _nc_first logic kept as comments for
later activation when multi-folder support is confirmed working.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 13:48:08 +02:00
Daniel unbrot Pätzold 2a1530f4f9 nextcloud/user_run: convert to POSIX sh, clean up loop and alignment
- Shebang changed to sh; replace all [[ ]] with [ ], == with = in [ ]
- Loop over CLIENT_DATA_SYNC[@] directly instead of counting to 100;
  replace index-based first-entry check with a _nc_first flag
- Fix missing fi before done, remove stray fi after KWallet block
- Dedent KWallet block to top level (was left indented from inside the loop)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 13:23:08 +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 b214880351 nextcloud: fix GTK module warning, Qt session error, skip KWallet on non-KDE
cinnamon_fullsetup.cfg: add xapps package so the xapp-gtk3-module GTK
module referenced in Cinnamon's GTK settings is present for Flatpak apps.

user_run.sh: pass --setenv=SESSION_MANAGER= to systemd-run so Qt does not
try to connect to an X11 session manager socket that may not exist (fixes
"Could not open network socket" on Wayland and non-KDE desktops).
Guard the KWallet D-Bus block behind a session-bus presence check
(qdbus | grep org.kde.kwalletd) so it is skipped entirely on Cinnamon and
other non-KDE desktops instead of producing D-Bus errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 20:56:34 +02:00
Daniel unbrot Pätzold 230b224ffc TB Mailaccount syntax error 2026-05-02 18:40:35 +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
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
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
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 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
unbrot 58b23b00e7 mozilla_pre: fixed server adress 2026-04-30 16:45:45 +02:00
unbrot 576363cdca Fix Nextcloud app password not stored in KWallet after autoprovisioning
The Flatpak autoprovisioning command does not reliably write credentials
to KWallet from inside the sandbox. After provisioning, directly write
both KWallet entries (user:url/:0 and user_app-password:url/:0) via
qdbus, creating the Nextcloud folder first if needed. kwallet-query was
tried but silently returns 0 without creating missing folders.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 17:30:49 +02:00
unbrot 7514b7cbe3 Talk: setsid won't work with Quotes 2026-04-25 14:48:09 +02:00
unbrot 7b6f7c8ea8 Talk: Set exitcode 2026-04-25 14:38:27 +02:00
unbrot 52aafd34dd Added exit code 0 to scripts 2026-04-25 14:34:31 +02:00
unbrot 72faa4d0f2 Talk: Add Background back again 2026-04-25 14:31:42 +02:00
unbrot 7ef83c5846 Talk: Fork in Background with bash 2026-04-25 14:27:46 +02:00
unbrot 4947599bb3 Talk: Stop before upgrade 2026-04-25 14:09:49 +02:00
unbrot c5e4cc1d12 talk: always fork new process 2026-04-25 13:52:46 +02:00
unbrot 398354028a Talk: call fixed in Background 2026-04-25 13:47:07 +02:00
unbrot a9fc6fda72 Wallet: New install wrote new rc at the second logon 2026-04-25 13:28:19 +02:00
unbrot 06f28d1064 moved gitignore from client software 2026-04-25 11:04:59 +02:00
Daniel Pätzold fd3ab78f92 Changed Order of Nextcloud and Mozilla_pre 2026-04-23 13:43:50 +02:00
Daniel Pätzold 5cd143d8f0 Kwallet: Fix setting up default walletrc 2026-04-23 12:32:55 +02:00
Daniel Pätzold e1dd5cc62a Kwallet: fixed copy kwalletrc 2026-04-23 12:09:15 +02:00
Daniel Pätzold cefb820ac2 Nc desktop client: no output for stopping service 2026-04-22 21:46:51 +02:00