-
Notifications
You must be signed in to change notification settings - Fork 50
Add sanitization script for XFCE settings in prod #475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @eloquence took a first pass
The icon size changes work well, and the full text is visible:
However, had some issues with the power management changes:
- Errors while running
disable-unsafe-power-management
andreset-power-management
(see inline for error message) - update-xfce-settings is not cleaned by the
clean-salt
makefile target. We should either prefix the file by sd or securedrop, or add it to the target, see:securedrop-workstation/Makefile
Line 79 in c54d5dd
clean-salt: assert-dom0 ## Purges SD Salt configuration from dom0
dom0/update-xfce-settings
Outdated
# Hide hibernate button in logout menu | ||
xfconf-query -c xfce4-session -np '/shutdown/ShowHibernate' -t 'bool' -s 'false' | ||
# Trim action button menu to the essentials | ||
xfconf-query -c xfce4-panel -p '/plugins/plugin-2/items' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting some errors here:
Property "/plugins/plugin-2/items" does not exist on channel "xfce4-panel". If a new property should be created, use the --create option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, now I'm worried that the plugin number is not consistent from install to install. Let me do some digging on this one, thanks for flagging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Should be resolved now.)
xfconf-query -c xfce4-session -p '/shutdown/ShowSuspend' -r | ||
xfconf-query -c xfce4-session -p '/shutdown/ShowHibernate' -r | ||
# Does not retain its default config, so resetting to Qubes default values | ||
xfconf-query -c xfce4-panel -p '/plugins/plugin-2/items' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same error as above, maybe resolved by resolving the disable action:
Property "/plugins/plugin-2/items" does not exist on channel "xfce4-panel". If a new property should be created, use the --create option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Should be resolved now.)
TASK=${1:-none} | ||
ICONSIZE=64 | ||
|
||
if ! [ -x "$(command -v xfconf-query)" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 xfconf-query is present by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added this check for future-proofing and in case folks try to run it outside of Qubes
I believe the root cause is that the items are not initialized until the user modifies the default. I never ran into this during testing because I had modified the setting already. This should now be resolved; please let me know if you still see errors.
This should also be resolved. |
ec4cfcd
to
f2a4eda
Compare
I'm currently noticing that the settings changes never seem to take effect when run via Salt. The |
|
I've added a test plan; I believe this is ready for a formal review now. I've not added a test plan for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @eloquence for the changes, this now works as expected for me.
One request: can we remove the "log off" option as well? the reason i ask is that it's very similar to sleep (without the sleep) where it's implied that the session is ended. In reality, it's similar to just locking the screen: The option Save session for future logins
is enabled by default, and VMs are always powered on during that time.
I will be running a couple more times through the test plan on a clean install to ensure this logic is reliable, because this logic has no test coverage, due to it being limited to staging and production environments.
That's a great flag @emkll , it should be easy to remove, will poke while Qubes is doing something slow :) |
Well, it would be easy, if XFCE exposed that property like it does for "Suspend" and "Hibernate", but it does not. Internet wisdom suggests altering the logout script to force a shutdown on logout. It sounds like the behavior you describe may be captured by the "save on exit" preference in the session manager, which we can programmatically alter, but it is not checked for my user account, and I don't recall changing it. Will test with a fresh account to examine default behavior. |
To recap, altering what appears on the "Log out" dialog beyond removing removing the suspend and hibernate buttons is difficult, but I think we can just remove the "Log out" dialog altogether (which may have been what you were suggesting). In that case we don't have to update the preferences for the dialog either, simplifying the code somewhat. I'll do some testing to see if that works and if so, will make those changes. The user will then just get the "Shut down" and "Restart" options in the user menu (the "action buttons" plugin). |
I've now removed it from the user actions. There's still a "Log out" action in the application menu, which will bring up the dialog (which is why I kept the code to remove "suspend" and "hibernate" from that dialog); I think that's reasonable for this iteration, and perhaps in a future release we can investigate updating that menu, as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @eloquence, looks good to merge from my perspective. Before merging, would you mind squashing your commits?
Tested as follows:
Testing production config
From a make clean
state or a previously provisioned dev environment:
- Verify that your desktop icon size is set to the default value (right-click on desktop, "Desktop Settings", "Icons" - should be set to 32px). Cancel out of the dialog.
- Click the user menu in the top right and verify that it uses Qubes OS defaults. You should have the following options: Lock Screen, Switch User, Suspend, Shut Down, Log Out. The logout dialog should give you the option to suspend or hibernate.
I built/used an RPM insteadmake clone
this branch into dom0- Ensure you have a valid
config.json
. Runscripts/configure-environment --environment prod
to switch it to production. (Note: That script currently messes up JSON formatting, make sure you have a copy if you care about that.) - Run
make prep-dom0
. -
- Observe that the desktop icon is now larger with readable text, and that the icon size has been increased to 64 px.
-
- Observe that the user menu now has the options Lock Screen, Restart, Shut down, and that you are no longer able to suspend or hibernate form the logout menu.
Testing cleanup
- Run
make clean
-
- Observe that the desktop icon size (via settings), menu, and logout dialog have been resest to their original values.
Testing that only the icon size is modified in development environment
- Set your
config.json
todev
using the same method as before. - Rebuild your environment with
make all
-
- Observe that the icon size is increased, and that the user menu and logout dialog are not modified from the default.
before :
after make all:
after make clean:
I realize now that I unfortunately hid the icon on the second screenshot, but the icon size is correctly changed.
Removes suspend/hibernate options and hides logout in user menu (due to session save behavior); adjusts icon size for usability and accessibility.
9deed56
to
16656d3
Compare
Done. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @eloquence !
Add sanitization script for XFCE settings in prod
Ensures that the "Suspend" and "Hibernate" options are not available in the user menu (provided by the "Action Buttons" plugin in XFCE) or the logout dialog, in staging or production. Adjusts the icon size so desktop icon caption is readable.
This is done via a new
dom0
Salt scriptupdate-xfce-settings
, so we have a single place we can update if XFCE/Qubes behavior changes. I've added it to the RPM but not bumped the RPM version.Status
Ready for review
Test plan
Testing production config
From a
make clean
state or a previously provisioned dev environment:make clone
this branch into dom0config.json
. Runscripts/configure-environment --environment prod
to switch it to production. (Note: That script currently messes up JSON formatting, make sure you have a copy if you care about that.)make prep-dom0
.Testing cleanup
make clean
Testing that only the icon size is modified in development environment
config.json
todev
using the same method as before.make all
Checklist
make test
run in dom0