Bug 447546 - Immutable unattended updates UX
Summary: Immutable unattended updates UX
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: Discover
Classification: Applications
Component: discover (other bugs)
Version First Reported In: 5.23.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dan Leinir Turthra Jensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-26 15:27 UTC by supgesu
Modified: 2021-12-29 15:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description supgesu 2021-12-26 15:27:41 UTC
SUMMARY

There is an option in system settings for automatic updates. However this option is only set for the current user (saved in `~/.config/PlasmaDiscoverUpdates`). I want to enable auto updates for the whole system. Users should not be able to disable auto updates by accident. I want to have this setting somewhere in for example `/etc/PlasmaDiscoverUpdates`, not writable for normal users.


STEPS TO REPRODUCE
1. Enable automatic updates for one user
2. Create a new user and see that automatic updates are disabled again

OBSERVED RESULT
Automatic updates do not work for new users and users can disable them by accident.

EXPECTED RESULT
Automatic updates should be a system wide setting that only administrators can change.

ADDITIONAL INFORMATION

A possible short solution would be (pseudo code):

if (file.exists("/etc/PlasmaDiscoverUpdates")) {
// load settings from /etc/PlasmaDiscoverUpdates
} else {
// load settings from ~/.config/PlasmaDiscoverUpdates`
}

And an alternative idea, would take longer to implement:
a whole new system wide service which runs as root and performs the updates, not depending on user sessions or user settings at all.
This would also make auto updates more reliable in general, for example if users are switched often (current idle timeout never runs out), multiple users are logged in (conflicting auto updates run multiple times), and would make it work even in cases where users do not have admin privileges to perform updates, like in case of ubuntu, auto updates currently don't work at all because of this:
https://bugs.launchpad.net/ubuntu/+source/packagekit/+bug/1955489
Comment 1 Aleix Pol 2021-12-28 17:07:07 UTC
This is something you can already do making the setting immutable:
https://api.kde.org/frameworks/kconfig/html/options.html

We could make sure that the UI still looks properly when the setting is immutable though. Please give it a try and get back to us.
Comment 2 supgesu 2021-12-28 19:06:39 UTC
Put it in /etc/xdg/PlasmaDiscoverUpdates.
This worked, thanks.
Comment 3 supgesu 2021-12-29 00:37:32 UTC
Noticed that this is not yet really a good solution. At least /etc/xdg.
Problem is that distributions already pack default kde settings into /etc/xdg and if I put in my custom ones (auto and offline updates) they will get overwritten by updates.
Would need another directory to load config files from which gets prioritized over /etc/xdg, so that I can safely overwrite distributions defaults without losing my settings after updates. How to add a path for kde configs between /home/.config and /etc/xdg?
Comment 4 supgesu 2021-12-29 15:21:51 UTC
Since I'm not able to get this working reliably, I also created this reddit post, in case someone has an idea over there:
https://www.reddit.com/r/kde/comments/rra0xe/need_help_setting_global_immutable_settings_kiosk/