Skip to content

Monday, 18 December 2023

In this post, I will detail how to replace sudo (a setuid binary) by using SSH over a local UNIX socket.

I am of the opinion that setuid/setgid binaries are a UNIX legacy that should be deprecated. I will explain the security reasons behind that statement in a future post.

This is related to the work of the Confined Users SIG in Fedora.

Why bother?

The main benefit of this approach is that it enables root access to the host from any unprivileged toolbox / distrobox container. This is particularly useful on Fedora Atomic desktops (Silverblue, Kinoite, Sericea, Onyx) or Universal Blue (Bluefin, Bazzite) for example.

As a side effect of this setup, we also get the following security advantages:

  • No longer rely on sudo as a setuid binary for privileged operations.
  • Access control via a physical hardware token (here a Yubikey) for each privileged operation.

Setting up the server

Create the following systemd units:

/etc/systemd/system/sshd-unix.socket:

[Unit]
Description=OpenSSH Server Unix Socket
Documentation=man:sshd(8) man:sshd_config(5)

[Socket]
ListenStream=/run/sshd.sock
Accept=yes

[Install]
WantedBy=sockets.target

/etc/systemd/system/sshd-unix@.service:

[Unit]
Description=OpenSSH per-connection server daemon (Unix socket)
Documentation=man:sshd(8) man:sshd_config(5)
Wants=sshd-keygen.target
After=sshd-keygen.target

[Service]
ExecStart=-/usr/sbin/sshd -i -f /etc/ssh/sshd_config_unix
StandardInput=socket

Create a dedicated configuration file /etc/ssh/sshd_config_unix:

# Deny all non key based authentication methods
PermitRootLogin prohibit-password
PasswordAuthentication no
PermitEmptyPasswords no
GSSAPIAuthentication no

# Only allow access for specific users
AllowUsers root tim

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys

# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server

Enable and start the new socket unit:

$ sudo systemctl daemon-reload
$ sudo systemctl enable --now sshd-unix.socket

Add your SSH Key to /root/.ssh/authorized_keys.

Setting up the client

Install socat and use the following snippet in /.ssh/config:

Host host.local
    User root
    # We use `run/host/run` instead of `/run` to transparently work in and out of containers
    ProxyCommand socat - UNIX-CLIENT:/run/host/run/sshd.sock
    # Path to your SSH key. See: https://tim.siosm.fr/blog/2023/01/13/openssh-key-management/
    IdentityFile ~/.ssh/keys/localroot
    # Force TTY allocation to always get an interactive shell
    RequestTTY yes
    # Minimize log output
    LogLevel QUIET

Test your setup:

$ ssh host.local
[root@phoenix ~]#

Shell alias

Let’s create a sudohost shell “alias” (function) that you can add to your Bash or ZSH config to make using this command easier:

# Get an interactive root shell or run a command as root on the host
sudohost() {
    if [[ ${#} -eq 0 ]]; then
        cmd="$(printf "exec \"%s\" --login" "${SHELL}")"
        ssh host.local "${cmd}"
    else
        cmd="$(printf "cd \"%s\"; exec %s" "${PWD}" "$*")"
        ssh host.local "${cmd}"
    fi
}

2024-01-12 update: Fix quoting and array expansion (thanks to o11c).

Test the alias:

$ sudohost id
uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
$ sudohost pwd
/var/home/tim
$ sudohost ls
Desktop Downloads ...

We’ll keep a distinct alias for now as we’ll still have a need for the “real” sudo in our toolbox containers.

Security?

As-is, this setup is basically a free local root for anything running under your current user that has access to your SSH private key. This is however likely already the case on most developer’s workstations if you are part of the wheel, sudo or docker groups, as any code running under your user can edit your shell config and set a backdoored alias for sudo or run arbitrary privileged containers via Docker. sudo itself is not a security boundary as commonly configured by default.

To truly increase our security posture, we would instead need to remove sudo (and all other setuid binaries) and run our session under a fully unprivileged, confined user, but that’s for a future post.

Setting up U2F authentication with an sk-based SSH key-pair

To make it more obvious when commands are run as root, we can setup SSH authentication using U2F with a Yubikey as an example. While this, by itself, does not, strictly speaking, increase the security of this setup, this makes it harder to run commands without you being somewhat aware of it.

First, we need to figure out which algorithm are supported by our Yubikey:

$ lsusb -v 2>/dev/null | grep -A2 Yubico | grep "bcdDevice" | awk '{print $2}'

If the value is 5.2.3 or higher, then we can use ed25519-sk, otherwise we’ll have to use ecdsa-sk to generate the SSH key-pair:

$ ssh-keygen -t ed25519-sk
# or
$ ssh-keygen -t ecdsa-sk

Add the new sk-based SSH public key to /root/.ssh/authorized_keys.

Update the server configuration to only accept sk-based SSH key-pairs:

/etc/ssh/sshd_config_unix:

# Only allow sk-based SSH key-pairs authentication methods
PubkeyAcceptedKeyTypes sk-ecdsa-sha2-nistp256@openssh.com,sk-ssh-ed25519@openssh.com

...

Restricting access to a subset of users

You can also further restrict the access to the UNIX socket by configuring classic user/group UNIX permissions:

/etc/systemd/system/sshd-unix.socket:

1
2
3
4
5
6
7
8
...

[Socket]
...
SocketUser=tim
SocketGroup=tim
SocketMode=0660
...

Then reload systemd’s configuration and restart the socket unit.

Next steps: Disabling sudo

Now that we have a working alias to run privileged commands, we can disable sudo access for our user.

Important backup / pre-requisite step

Make sure that you have a backup and are able to boot from a LiveISO in case something goes wrong.

Set a strong password for the root account. Make sure that can locally log into the system via a TTY console.

If you have the classic sshd server enabled and listening on the network, make sure to disable remote login as root or password logins.

Removing yourself from the wheel / sudo groups

Open a terminal running as root (i.e. don’t use sudo for those commands) and remove you users from the wheel or sudo groups using:

$ usermod -dG wheel tim

You can also update the sudo config to remove access for users that are part of the wheel group:

# Comment / delete this line
%wheel  ALL=(ALL)       ALL

Removing the setuid binaries

To fully benefit from the security advantage of this setup, we need to remove the setuid binaries (sudo and su).

If you can, uninstall sudo and su from your system. This is usually not possible due to package dependencies (su is part of util-linux on Fedora).

Another option is to remove the setuid bit from the sudo and su binaries:

$ chmod u-s $(which sudo)
$ chmod u-s $(which su)

You will have to re-run those commands after each update on classic systems.

Setting this up for Fedora Atomic desktops is a little bit different as /usr is read only. This will be the subject of an upcoming blog post.

Conclusion

Like most of the time with security, this is not a silver bullet solution that will make your system “more secure” (TM). I have been working on this setup as part of my investigation to reduce our reliance on setuid binaries and trying to figure out alternatives for common use cases.

Let me know if you found this interesting as that will likely motivate me to write the next part!

References

An updated stable release of XWayland Video Bridge is out now for packaging.

https://download.kde.org/stable/xwaylandvideobridge/

sha256 ea72ac7b2a67578e9994dcb0619602ead3097a46fb9336661da200e63927ebe6

Signed by E0A3EB202F8E57528E13E72FD7574483BB57B18D Jonathan Esk-Riddell <jr@jriddell.org>
https://jriddell.org/esk-riddell.gpg

Changes

  • Also skip the switcher
  • Do not start in an X11 session and opt out of session management

Sunday, 17 December 2023

In my last post about HDR and color management I explained roughly how color management works, what we’re doing to make it work on Wayland and how far along we were with that in Plasma. That’s more than half a year ago now, so let’s take a look at what changed since then!

Color management with ICC profiles

KWin now supports ICC profiles: In display settings you can set one for each screen, and KWin will use that to adjust the colors accordingly.

Applications are still limited to sRGB for now. For Wayland native applications, a color management protocol is required to change that, so that apps can know about the colorspaces they can use, and so that KWin can know which colorspace their windows are actually using, and the upstream color management protocol for that is still not done yet. It’s getting close though! For example I have an implementation for it in a KWin branch, and Victoria Brekenfeld from System76 implemented a Vulkan layer using the protocol to allow applications to use the VK_EXT_swapchain_colorspace and VK_EXT_hdr_metadata Vulkan extensions, which can be used to run some applications and games with non-sRGB colorspaces.

Apps running through Xwayland are strictly limited to sRGB too, even if they have the ability to work with ICC profiles, as they have the same problem as Wayland native apps: Outside of manual overrides with application settings there’s now way to tell them to use a specific ICC profile or colorspace, and there’s also no way for KWin to know which profile or colorspace the application is using. Even if you set an ICC profile with an application setting, KWin still doesn’t know about that, so the colors will be wrong.1

It would be possible to introduce an “API” using X11 atoms to make at least the basic arbitrary primaries + sRGB EOTF case work though, so if any developers of apps that are still stuck with X11 for the foreseeable future would be interested in that, please contact me about it!

HDR

In Plasma 6 you can enable HDR in the display settings, which enables static HDR metadata signalling for the display, with the PQ EOTF and the display’s preferred brightness values, and sets the colorspace to rec.2020.

With that enabled, you get two additional settings:

  • “SDR Brightness” is, as the name suggests, the brightness KWin renders non-HDR stuff at, and effectively replaces the brightness setting that most displays disable when they’re in HDR mode
  • “SDR Color Intensity” is inspired by the color slider on the Steam Deck. For sRGB applications it scales the color gamut up to (at 100%) rec.2020, or more simply put, it makes the colors of non-HDR apps more intense, to counteract the bad gamut mapping many HDR displays do and make colors of SDR apps look more like when HDR is disabled

HDR settings page

There’s some additional hidden settings to override bad brightness metadata from displays too. A GUI for that is still planned, but until that’s done you can use kscreen-doctor to override the brightness values your screen provides.

KWin now also uses gamma 2.2 instead of the sRGB piece-wise transfer function for sRGB applications, as that more closely matches what displays actually do in SDR mode. This means that in the dark regions of sRGB content things will now look like they do with HDR disabled, instead of things being a little bit brighter and looking kind of washed out.23


My last post ended at this point, with me saying that looking at boring sRGB apps in HDR mode would be all you could do for now… well, not anymore! While I already mentioned that Xwayland apps are restricted to sRGB, gamescope uses a Vulkan layer together with a custom Wayland protocol to bypass Xwayland almost entirely. This is how HDR is done on the Steam Deck OLED and it works well, so all that was still missing is a way for gamescope to pass the buffers and HDR metadata on to KWin.

To make that happen, Joshua Ashton from Valve and I put together a small Wayland protocol for doing HDR until the upstream protocol is done. I implemented it in KWin, forked Victoria’s Vulkan layer to make my own using that protocol and Joshua implemented HDR support for gamescope nested with the Vulkan extensions implemented by the layer.

The Plasma 6 beta is already shipping with that implementation in KWin, and with a few additional steps you can play most HDR capable games in the Wayland session:

  1. install the Vulkan layer
  2. install gamescope git master, or at least a version that’s new enough to have this commit
  3. run Steam with the following command:
    ENABLE_HDR_WSI=1 gamescope --hdr-enabled --hdr-debug-force-output --steam -- env ENABLE_GAMESCOPE_WSI=1 DXVK_HDR=1 DISABLE_HDR_WSI=1 steam
    

To explain a bit what that does, ENABLE_HDR_WSI=1 enables the Vulkan layer, which is off by default. gamscope --hdr-enabled --hdr-debug-force-output --steam runs gamescope with hdr force-enabled (automatically detecting and using HDR instead of that is planned) and with Steam integration, and env ENABLE_GAMESCOPE_WSI=1 DXVK_HDR=1 DISABLE_HDR_WSI=1 steam runs Steam with gamescope’s Vulkan layer enabled and mine disabled, so that they don’t conflict.

You can also adjust the brightness of sdr stuff in gamescope with the --hdr-sdr-content-nits flag; for a list of things you can do just check gamescope --help. The full command I’m using for my screen is

ENABLE_HDR_WSI=1 gamescope --fullscreen -w 5120 -h 1440 --hdr-enabled --hdr-debug-force-output --hdr-sdr-content-nits 600 --steam -- env ENABLE_GAMESCOPE_WSI=1 DXVK_HDR=1 DISABLE_HDR_WSI=1 steam -bigpicture

With that, Steam starts in a nested gamescope instance and games started in it have HDR working, as long as they use Proton 8 or newer. When this was initially implemented as a bunch of hacks at XDC this year there were issues with a few games, but right now, almost all the HDR capable games in my own Steam library work fine and look good in HDR. That includes

  • Ori and the Will of the Wisps
  • Cyberpunk 2077
  • God of War
  • Doom Eternal
  • Jedi: Fallen Order
  • Quake II RTX

Quake II RTX doesn’t even need gamescope! With ENABLE_HDR_WSI=1 SDL_VIDEODRIVER=wayland in the launch options for the game in Steam you can get a Linux- and Wayland-native game working with HDR, which is pretty cool.

I also have Spider-Man: Remastered and Spider-Man: Miles Morales, in both of which HDR also ‘works’, but it looks quite washed out vs. SDR. I found complaints about the same problem from Windows users online, so I assume the implementation in the games is just bad and there’s nothing wrong with the graphics stack around them.

jedi fallen order

god of war

Cyberpunk 2077

(Sorry for showing SDR screenshots of HDR games, but HDR screenshots aren’t implemented yet, and it looks worse when I take a picture of the screen with my phone)


With the same Vulkan layer, you can also run other HDR-capable applications, like for example mpv:

ENABLE_HDR_WSI=1 mpv --vo=gpu-next --target-colorspace-hint --gpu-api=vulkan --gpu-context=waylandvk "path/to/video"

An actual HDR video

This time the video being played is actually HDR, without any hacks! And while my phone camera isn’t great at capturing HDR content in general, this is one of the cases where you can really see how HDR is actually better than SDR, especially on an OLED display:

HDR and SDR side by side


The future

Obviously there is still a lot to do. Color management is limited to either sRGB or full-blown rec.2020, you shouldn’t have to install stuff from Github yourself, and certainly shouldn’t have to mess around with the command line4 to play games and watch videos in HDR, HDR screenshots and HDR screen recording aren’t a thing yet, and many other small and big things need implementing or fixing. There’s a lot of work needed to make these things just work™ as they should outside of special cases like the gamescope embedded session.

Things are moving fast though, and I’m pretty happy with the progress we made so far.





  1. Note that if you do want or need to set an ICC profile in the application for some reason, setting a sRGB profile as the display profile is wrong. It must have rec.709 primaries, but with the gamma 2.2 transfer function instead of the piece-wise sRGB one so often used! 

  2. This is the reason for footnote 1 

  3. As far as I know, Windows 11 still does this wrong! 

  4. I recommend setting up .desktop files to automate that away if you want to use HDR more often. Right click on the application launcher in Plasma -> Edit Applications makes that pretty easy 

Friday, 15 December 2023

Let’s go for my web review for the week 2023-50.


Make a Linux App

Tags: tech, foss, linux

Very needed evangelization. Go forth and make apps for Linux!

https://makealinux.app/


New extensions you’ll love now available on Firefox for Android

Tags: tech, mozilla, foss, android

Definitely the right move, more extensions are pouring in. People should benefit from them on Android as well.

https://blog.mozilla.org/en/mozilla/new-extensions-youll-love-now-available-on-firefox-for-android/


Spritely and Veilid: Exciting Projects Building the Peer-to-Peer Web

Tags: tech, distributed, p2p, privacy

What’s cooking up for the next generation of peer-to-peer applications? Here are two exciting examples of building blocks which are in the works.

https://www.eff.org/deeplinks/2023/12/meet-spritely-and-veilid


W4 Games raises $15M to drive video game development inflection with Godot Engine

Tags: tech, 3d, gaming, godot, foss

Good news for the Godot Engine. Let’s see where this goes in the coming years.

https://w4games.com/2023/12/07/w4-games-raises-15m-to-drive-video-game-development-inflection-with-godot-engine/


Epic v. Google: everything we’re learning live in Fortnite court

Tags: tech, google, law, monopoly

There will be an appeal but this is an important ruling already.

https://www.theverge.com/23945184/epic-v-google-fortnite-play-store-antitrust-trial-updates#stream-entry-65d34a06-1fa5-4eab-abf6-ce450441b543


Pluralistic: “If buying isn’t owning, piracy isn’t stealing”

Tags: tech, DRM, copyright, criticism

Once more, an excellent piece from Cory Doctorow. Allowing DRM encumbered devices could only lead to the mess we’re seeing nowadays.

https://pluralistic.net/2023/12/08/playstationed/


Power Hungry Processing: ⚡ Watts ⚡ Driving the Cost of AI Deployment?

Tags: tech, ai, machine-learning, gpt, energy

Important and interesting study showing how the new generation of models are driving energy consumption way up. As a developer, do the responsible thing and use smaller, more specific models.

https://arxiv.org/pdf/2311.16863.pdf


The AI trust crisis

Tags: tech, ai, machine-learning, surveillance, trust, transparency

There’s definitely a problem here. The lack of transparency from the involved companies doesn’t help. It’s also a chance for local and self-hostable models, let’s hope their use increases.

https://simonwillison.net/2023/Dec/14/ai-trust-crisis/


Kernel vs. User-Level Networking: Don’t Throw Out the Stack with the Interrupts | Proceedings of the ACM on Measurement and Analysis of Computing Systems

Tags: tech, linux, kernel, networking

Interesting deep dive about how network stacks work in kernel or in user land. Also provides some insight on how to improve the kernel stack.

https://dl.acm.org/doi/10.11453626780


What every computer scientist should know about floating-point arithmetic

Tags: tech, floats, mathematics

Probably the definitive resource on how floating-point arithmetic works.

https://dl.acm.org/doi/pdf/10.1145103162.103163


The SQL Murder Mystery

Tags: tech, sql, databases, learning, game, funny

You like SQL? You like murder mysteries? This little game might be right for you.

https://mystery.knightlab.com/


Patching around a C++ crash with a little bit of Lua

Tags: tech, http, safety, bug, c++, lua

Nice trick to get the pressure off the team while it looks for a proper solution.

https://rachelbythebay.com/w/2023/12/07/header/


Real-world match/case

Tags: tech, python, pattern

Nice illustration on how pattern matching can simplify code and make it easier to write.

https://nedbatchelder.com/blog/202312/realworld_matchcase.html


trippy | A network diagnostic tool

Tags: tech, tools, networking

Looks like a nice tool for exploring network issues. I’ll take it for a spin when I get the chance.

https://trippy.cli.rs/


Dynamic music and sound techniques for video games

Tags: tech, music, sound, gaming

Interesting little tricks to create music and sound variations to guide the user.

https://blog.gingerbeardman.com/2023/12/09/dynamic-music-and-sound-techniques-for-video-games/


Behavior Belongs in the HTML

Tags: tech, html, semantic

This would indeed be a nice path forward for HTML. It’s much too dominated by JavaScript for now, having standardized semantic extensibility would be just better.

https://unplannedobsolescence.com/blog/behavior-belongs-in-html/


Painting with Math: A Gentle Study of Raymarching - Maxime Heckel’s Blog

Tags: tech, 3d, shader, mathematics

Another nice introduction to raymarching. I still find this a very interesting rendering approach. It’s really cool what you can do with those Signed Distance Fields functions.

https://blog.maximeheckel.com/posts/painting-with-math-a-gentle-study-of-raymarching/


Canon TDD - by Kent Beck - Software Design: Tidy First?

Tags: tech, tdd, design, tests

This is apparently a much needed clarification. Let’s get back to basics.

https://tidyfirst.substack.com/p/canon-tdd


Advice to a New Speaker - Dan North & Associates Limited

Tags: tech, talk

Nice list of advices in the second section. It makes a good point in some of the dynamics women might have to face in public conferences.

https://dannorth.net/advice-to-a-new-speaker/


The Importance of Career Laddering | CSS-Tricks - CSS-Tricks

Tags: tech, management, career

You got a career ladder in place? Well, that’s just a first step, how do you make sure the expectations are clear to people? How do you follow through? This article helps with those questions.

https://css-tricks.com/the-importance-of-career-laddering/


The surprising connection between after-hours work and decreased productivity

Tags: organization, meetings, productivity, work, life

Interesting survey results. This kind of confirm what we already suspected regarding longer work day and the amount of meetings.

https://slack.com/intl/en-gb/blog/news/the-surprising-connection-between-after-hours-work-and-decreased-productivity?nojsmode=1



Bye for now!

Wednesday, 13 December 2023

There are some plans to have a more official blog post on the plasma-mobile.org, these are my personal ramblings below…

Plasma 6 is coming together nicely on the desktop!

Coming back from hiatus, I was pleasantly greeted by a much more working session than when I last saw it in May; I have now completely switched over to it on my main machine!

On the other hand, there is still a lot of work to do on mobile to prepare it for the Plasma 6 release in February. I will outline the current situation and the work I have done in the past few months in order to make Plasma 6 a possibility for Plasma Mobile.

Context 🔗

I started working on KDE projects again in October (after an 8 month hiatus), slowly getting back into the groove of things. I unfortunately do not have as much spare time these days after work and school, but I try to do what I can!

The distro situation 🔗

For Plasma Mobile shell development on phones, we need to have distributions with KDE packages built from git master.

Many years ago, we used to have Neon images with Plasma Mobile that were maintained by Bhushan that were used for development, but required a large investment in time to maintain. We no longer have the (human) resources to maintain a distribution, so we are dependent on working with other distributions for development images.

Until this year, Manjaro had helped us by providing daily development images. Unfortunately, I have not really had contact with the project since one of their employees left earlier this year.

As a sidenote: Maintenance of the Manjaro Plasma Mobile images seemed to be inactive in the past few months, though there have been some encouraging signs from the forum in the past few days?


And so, there was a predicament. While I could develop the Plasma 6 mobile shell on the desktop, I had no way of testing it on a phone.

Thankfully, postmarketOS graciously took up the effort of maintaining a repository of KDE packages that track git master. Instructions can be viewed here. With the Plasma 6 beta release, there will be postmarketOS images that can be easily downloaded and tested with!

Seshan has also been working on an immutable distro ProLinux which has images that track git master as well, which have been useful to test with.

Porting 🔗

A big part of the porting effort is simply porting the shell and applications to Qt 6 and KDE Frameworks 6.

In the case of the shell, porting to Qt 6 was luckily fairly trivial. There were far more changes to the base KDE frameworks as package structures and QML plugins were being reworked, though that has stabilized in recent months. There are still some major regressions that need to be resolved before February (will be discussed later), but I am reasonably confident that the shell will in good shape by then.

For applications however, it is more of a mixed bag.

Several applications do not have active maintainers, and others need much more polish for mobile usage (as not all application developers have phones to test with).

Technically, I am responsible for KClock, KWeather and KRecorder, but I have typically done contributions to a multitude of applications to ensure that they work well on mobile. This time around though, I have only been really able to work on the shell with the limited spare time I have, and so I have not been able to do some of the heavier porting work for applications.

KRecorder in particular is unlikely to be ported in time for Plasma 6 as it depends on Qt Multimedia, which has had significant changes in Qt 6.

Beyond porting, I have also noticed some significant mobile-specific regressions in other applications that have been ported, which need to be addressed.

I would encourage anyone who is thinking of contributing to KDE to start here, application development is a very good way to learn Qt and get into further KDE contributions (as it is quite self-contained, compared to, say, the shell).

Styles 🔗

Plasma Mobile currently uses a separate Qt Quick style from the desktop (qqc2-breeze-style vs. qqc2-desktop-style), in which maintenance was lagging for Plasma 6.

The separate style is needed in order to have better performance, as it avoids some of the complex theming that the desktop needs to use for unifying styles between Qt Quick and Qt Widgets applications. However, it is a maintenance burden.

In November, I did a bunch of work on qqc2-breeze-style in order fix Plasma 6 related regressions, and to make it render more similarly to qqc2-desktop-style.

Task Switcher moving to KWin 🔗

In Plasma 5, the task switcher was built into the plasmashell process (which contains the homescreen, panels and most of what you see in Plasma), piping the application thumbnails from KWin.

In order to improve performance, it was a bit of a hack; the task switcher was built into the homescreen, so when it was opened, apps were minimized, showing the task switcher underneath. It was not optimal though, as it required convoluted logic in order to swap between the homescreen and task switcher views, and the thumbnails provided from the stream from KWin were not optimal performance wise.

With Plasma 6, I am moving the task switcher to be a self-contained KWin effect instead, which is inline with how the Desktop overview effect is implemented. This moves the task switcher off of plasmashell to KWin, cleaning up the code and potentially having performance improvements with how the application previews will be displayed.

We can also make use of KWin’s infrastructure for gesture-only mode (removing the navigation bar), rather than relying on a hack with invisible panels in order to trigger it.

The move has been a bit problematic though, as KWin developed regressions during Plasma 6 development that cause effect rendering to be broken on the PinePhone and SDM845 devices (possibly due to OpenGL versions?), but the issues are being worked on. As of Dec. 13, this has been fixed.

Rewriting Folio - the homescreen 🔗

Note: I will be writing a separate blog post that goes much more into detail in the future.

For some context, the default homescreen in Plasma 5 is Halcyon, which provides a simple way have a list of applications, while allowing them to be pinned and grouped into folders.

We also have the Folio homescreen, which was the original default (before Plasma 5.26) that was more similar to a traditional homescreen, having favourites pages and an application drawer to access the full list of apps.

The problem with Folio in Plasma 5 though was that it was particularly unstable (known to brick the shell), and was effectively an extended desktop canvas, so screen rotations and scaling changes would completely ruin the layout.

I knew that it would require a very significant effort in order to rewrite it and fix its issues, so I developed Halcyon as a stopgap solution until I had the time to fix Folio.


And so I spent about 5 weeks starting in October working solely on the Folio rewrite! It will be shipping as the default homescreen once again in Plasma 6.

I am pretty happy with how it turned out, it supports:

  • An app drawer
  • KRunner search
  • Folders
  • Pages
  • Drag and drop between all of the above
  • Applets/widgets
  • Row-column flipping for screen rotations
  • Customizable row and column counts
  • Customizable page transitions
  • Ability to import and export homescreen layouts as files
  • … and more!

Applets in particular are pretty exciting, though still need some work. They use the same infrastructure that the Desktop uses, so we can use existing applets!

New applets for mobile apps can eventually also be developed, pending interest.

A new service: plasma-mobile-envmanager 🔗

Plasma Mobile relies on some configurations (set in files) for KWin and the shell in general that directly conflict with what Plasma Desktop expects.

For example, we use different look-and-feel packages to provide pieces such as the lockscreen theme, as well as tweaks for features such as disabling window decorations.

In Plasma 5, this was accomplished by having the distribution ship config files that are installed to /etc/xdg (from plasma-phone-settings), which overrode Plasma related settings for users.

This was problematic in that this would affect the desktop session, making it impossible to use both the desktop and mobile sessions without doing some tweaking before switching. This also made it a barrier to be easily installable as “just another desktop environment”, which was a common complaint.


In Plasma 6, I introduced plasma-mobile-envmanager a utility that runs prior to shell startup that automatically does the configuration switching between what is needed for Plasma Mobile, and what is needed for Plasma Desktop.

This now allows distros to drop having to install hardcoded configs onto the system, and makes it easy to simply install as a separate desktop environment for existing systems.

A new application: plasma-mobile-initial-start 🔗

I added an application that runs when starting Plasma Mobile for the first time, guiding users on configuration on their system, from setting up the Wi-Fi, to configuring cellular settings.

It currently exists as an application that runs when the shell is started for the first time.

However, it likely needs to eventually be ported to be a true first-start wizard similar to what GNOME has as well as pico-wizard (used by Manjaro), in order to have elevated permissions so that the user does not have to be prompted for their password.

Docked mode 🔗

With Plasma 6, I am making some steps toward improving support with attaching a monitor, keyboard and mouse.

A new “Docked Mode” quick setting was introduced that, when activated:

  • Bring back window decorations
  • Stops opening application windows in fullscreen

Eventually, some more work can be done in order to have the external monitors load desktop panels instead of the mobile ones, which should make the experience equivalent to Plasma Desktop.

Telephony 🔗

I have historically not done much work on the telephony front.

There have luckily been contributors that have worked on Spacebar and Plasma Dialer (shoutout to Michael and Alexey!) in the past few years, allowing me to focus on other things.

From recent testing though, there have been a lot of regressions in Plasma 6, so I likely need to start learning the ropes of how it all works in order to help out. Of particular focus for me will be improving the quality of the cellular settings and overall shell integration with ModemManager.

My current carrier only supports VoLTE so I have been unable to test calling, and I have had trouble with my PinePhone in getting cellular working, but I will probably try buying a USB modem to do testing on the desktop with.

Settings module consolidation 🔗

In Plasma 5, a lot of mobile specific settings modules lived outside of the Plasma Mobile repository, in places such as the settings application.

I moved these settings modules together to be in the Plasma Mobile repository. This also removes the need to have a separate build of plasma-nm.

Other things to address 🔗

A big pain point in Plasma 5 was the mobile lockscreen. There were many cases of it crashing (causing the white text on black screen issue) as well as extraordinarily slow load times.

Much of it likely stems from the fact that it has to load the QML files right after the device locks, which can be slow and sometimes has graphical issues when coupled with suspend. I have tried to optimize the load time in the past, but it may be the case that we need to rethink the architecture a bit, not sure…

Conclusion 🔗

I will be returning to a university term in January, likely making it harder for me to contribute for a few months again.

I have luckily finished most of the features I have wanted to get done for Plasma 6, and am now spending my effort fixing bugs and improving code quality. I hope that we can have a successful, bug-free Plasma Mobile release in February, but it is quite daunting at the moment as a single volunteer contributor for the mobile shell.

If you are interested in helping contribute, I encourage you to join the Plasma Mobile matrix room!

There is also some documentation on the wiki that can help you get started.

go konqi!

Friday, 8 December 2023

Let’s go for my web review for the week 2023-49.


Mobilizon V4: the maturity stage – Framablog

Tags: tech, framasoft, privacy, social-media, foss

Another important software release. Let’s wish luck to the new maintainers!

https://framablog.org/2023/12/05/mobilisation-v4-the-maturity-stage/


Introducing Wikifunctions: first Wikimedia project to launch in a decade creates new forms of knowledge – Wikimedia Foundation

Tags: tech, wikipedia, knowledge, programming

Interesting move, I’m wondering how far this will go. Reuse of those functions in other Wikimedia project will be critical to its success.

https://wikimediafoundation.org/news/2023/12/05/introducing-wikifunctions-first-wikimedia-project-to-launch-in-a-decade-creates-new-forms-of-knowledge/


Toxic comments are associated with reduced activity of volunteer editors on Wikipedia | PNAS Nexus | Oxford Academic

Tags: tech, wikipedia, knowledge, community, sociology

Very interesting study, shows how toxic comments impact contributions. Gives a good idea of the probability for people to leave. In the case of Wikipedia this highlights reasons which contribute to the lack of diversity in the contributors. This is a complex community issue in general, this studies does a good thing by shedding some light on the dynamics in the case of Wikipedia.

https://academic.oup.com/pnasnexus/article/2/12/pgad385/7457939?login=false


An Open Letter to the Python Software Foundation

Tags: tech, python, community

The fact that they felt the need to write such a letter is troubling. What’s going on in the Python Software Foundation really? Something needs to be fixed it seems.

https://pythonafrica.blogspot.com/2023/12/an-open-letter-to-python-software_5.html


Firefox on the brink? | BryceWray.com

Tags: tech, web, mozilla, google

Let’s hope it won’t get there… I wish people would abandon Chrome en masse. I unfortunately don’t see it happening and it’ll just weaken the Web.

https://www.brycewray.com/posts/2023/11/firefox-brink/


Chrome’s next weapon in the War on Ad Blockers: Slower extension updates | Ars Technica

Tags: tech, google, browser, attention-economy

Still using Chrome? What are you waiting for to change for another browser which doesn’t play against your interests.

https://arstechnica.com/google/2023/12/chromes-next-weapon-in-the-war-on-ad-blockers-slower-extension-updates/


Automakers’ data privacy practices “are unacceptable,” says US senator | Ars Technica

Tags: tech, automotive, privacy

A senator is stepping up and rightfully pointing the finger at automakers. Let’s hope more will follow.

https://arstechnica.com/cars/2023/12/automakers-data-privacy-practices-are-unacceptable-says-us-senator/


PlayStation keeps reminding us why digital ownership sucks - The Verge

Tags: tech, DRM, copyright

If you can’t download it without DRMs you just don’t own it, you’re renting it. This is completely different.

https://www.theverge.com/2023/12/5/23989290/playstation-digital-ownership-sucks


Just about every Windows and Linux device vulnerable to new LogoFAIL firmware attack

Tags: tech, security, bios

Fascinating vulnerability. When the BIOS is at fault with a crappy image parser… you can’t do much to prevent problems from happening.

https://arstechnica.com/security/2023/12/just-about-every-windows-and-linux-device-vulnerable-to-new-logofail-firmware-attack/


AI and Mass Spying - Schneier on Security

Tags: tech, ai, gpt, surveillance, spy

Definitely one of the worrying aspects of reducing human labor needs for analyzing texts. Surveillance is on the brink of being increased thanks to it.

https://www.schneier.com/blog/archives/2023/12/ai-and-mass-spying.html


Google Researchers’ Attack Prompts ChatGPT to Reveal Its Training Data

Tags: tech, ai, machine-learning, gpt, copyright

A glimpse into how those generator models can present a real copyright problem… there should be more transparency on the training data sets.

https://www.404media.co/google-researchers-attack-convinces-chatgpt-to-reveal-its-training-data/


Block the Bots that Feed “AI” Models by Scraping Your Website – Neil Clarke

Tags: tech, ai, machine-learning, gpt, copyright, criticism

This is clearly an uphill battle. And yes, this is because it’s broken by design, it should be opt-in and not opt-out.

https://neil-clarke.com/block-the-bots-that-feed-ai-models-by-scraping-your-website/


Introducing Gemini: Google’s most capable AI model yet

Tags: tech, ai, machine-learning, gpt

The Large Language Model arm race is still going strong. Models are still mostly hidden behind APIs of course, and this is likely consuming lots of energy to run. Results seem interesting though, even though I suspect they’re over inflating the “safety” built in all this. Also be careful of the demo videos, they’ve been reported as heavily edited and misleading…

https://blog.google/technology/ai/google-gemini-ai/#availability


Multifaceted: the linguistic echo chambers of LLMs - by James Padolsey

Tags: tech, linguistics, ai, machine-learning, gpt

LLMs training had a bias from the start… and now we got a feedback loop since people are posting generated content online which is then used for training again. Expect idiosyncrasies to increase with time.

https://blog.j11y.io/2023-11-22_multifaceted/


Seamless Communication - AI at Meta

Tags: tech, ai, machine-learning, gpt, translation, speech

Now this is a very interesting use of generator models. I find this more exciting than the glorified chatbots.

https://ai.meta.com/research/seamless-communication/#our-approach


ChatGPT’s One-year Anniversary: Are Open-Source Large Language Models Catching up?

Tags: tech, ai, machine-learning, gpt, foss

Very interesting review, we can see some interesting strengths and weaknesses. Also gives a good idea of the different ways to evaluate such models.

https://arxiv.org/abs/2311.16989


reaction, in replacement of fail2ban

Tags: tech, security, server, self-hosting

Could indeed turn into a nice alternative to fail2ban.

https://blog.ppom.me/en-reaction/


Standard Webhooks

Tags: tech, web, services, webhooks

Interesting attempt at having webhooks implementation a bit more standardized. This is indeed needed, currently everyone does them in slightly different ways and sometimes the quality is debatable. If it gets adopted it’d give a good baseline.

https://www.standardwebhooks.com/


You (probably) don’t need DateTime · Scorpil

Tags: tech, date, time, unix, complexity

Good reminder that the raw UNIX timestamps have interesting properties and often are enough not necessarily needing to rely on something more complex. Also gives nice criteria for picking between said timestamps and higher level types.

https://scorpil.com/post/you-dont-need-datetime/


You don’t need JavaScript for that - HTMHell

Tags: tech, web, html, css, frontend

Nice examples showing JavaScript use can be reduced in the browser. HTML and CSS are gaining nice features.

https://www.htmhell.dev/adventcalendar/2023/2/


Documentation unit tests

Tags: tech, tests, documentation

Interesting approach to reduce the amount of undocumented features because we simply forgot to update the documentation. Shows a few inspiring tricks to get there.

https://simonwillison.net/2018/Jul/28/documentation-unit-tests/


Struct initialization | Sandor Dargo’s Blog

Tags: tech, c++

Good walkthrough the finer points of members initialization in C++. Worth keeping in mind.

https://www.sandordargo.com/blog/2023/11/22/struct-initialization


When static types make your code shorter

Tags: tech, programming, type-systems

Somehow unsurprising, this is often the case: less validation code, but also less automated tests. With types you can write unwanted states out of existence.

https://evanhahn.com/when-static-types-make-your-code-shorter/


Profiling Rust programs the easy way | nicole@web

Tags: tech, rust, optimization, profiling

The Rust tooling makes it super easy to profile your programs. This is neat.

https://ntietz.com/blog/profiling-rust-programs-the-easy-way/


Topics in computer graphics

Tags: tech, graphics, 3d, learning

Very nice collection of tidbits of information for the main topics in computer graphics. A good way to get started or refresh the basics.

https://mrl.cs.nyu.edu/~perlin/graphics/


Nuclear Reactor Simulator

Tags: tech, web, game, 3d, simulation

Very cool simplified simulator. Gives a good idea of how this roughly works.

https://dalton-nrs.manchester.ac.uk/


“Smartifying” my Hi-Fi system

Tags: tech, hacking, raspberry-pi, music, networking, usb

Alright, this is definitely a cool hack.

https://blog.rgsilva.com/smartifying-my-hi-fi-system/


Deciphering Glyph :: Safer, Not Later

Tags: tech, quality, project-management, programming

An interesting interpretation of what was behind the “move fast and break things” motto which is nowadays blindly followed by some. A bit of a long piece but does the job and propose a more complete view and an alternative approach.

https://blog.glyph.im/2023/12/safer-not-later.html


TDD Isn’t Design - by Kent Beck

Tags: tech, tdd, design

Definitely this. Again TDD helps to work on the design, but it’s not a silver bullet which will give you the right design on a platter.

https://tidyfirst.substack.com/p/tdd-isnt-design


A few words about Blameless culture

Tags: tech, culture, blameless, quality, trust

Shows why it’s important to go for a blameless culture, also outside of postmortem. This is definitely not easy but worth it.

https://www.gybe.ca/a-few-words-about-blameless-culture/


How to do annual planning and strategy for an engineering organization — Lena Reinhard

Tags: tech, organization, strategy, planning

Good blueprint for building up and following up (the most important part really) of a strategy in your organization.

https://www.lenareinhard.com/articles/annual-engineering-organization-strategy-planning


Return to office is dead, Stanford economist says. Here’s why

Tags: tech, remote-working

Looks like remote work is here to stay for good now.

https://www.cnbc.com/2023/11/30/return-to-office-is-dead-stanford-economist-says-heres-why.html


RFC processes are a poor fit for most organizations - Jacob Kaplan-Moss

Tags: business, organization, decision-making

Good point on why you don’t want to drive your organization simply on RFCs. Yet another fad of “this worked for them, let’s do it as well”… per usual this fails to take into account the specificity of the context where it worked.

https://jacobian.org/2023/dec/1/against-rfcs/


First decide how to decide: “one weird trick” for easier decisions - Jacob Kaplan-Moss

Tags: tech, management, decision-making

Nice ideas for decision making in larger groups.

https://jacobian.org/2023/dec/5/how-to-decide/



Bye for now!

Thursday, 7 December 2023

For the fourth installment of Off-Theme we have a global theme based on the granddaddy of all the classic Unix desktops, a desktop that ruled the roost of the workstations from a bygone era. It is time to pay tribute to the DE that once dominated the Unix world.

Tuesday, 5 December 2023

Thank you to everyone who reported issues and contributed to QCoro. Your help is much appreciated!

Support for awaiting Qt signals with QPrivateSignal

Qt has a feature where signals can be made “private” (in the sense that only class that defines the signal can emit it) by appending QPrivateSignal argument to the signal method:

class MyObject : public QObject {
 Q_OBJECT
...
Q_SIGNALS:
 void error(int code, const QString &message, QPrivateSignal);
};

QPrivateSignal is a type that is defined inside the Q_OBJECT macro, so it’s private and as such only MyObject class can emit the signal, since only MyObject can instantiate QPrivateSignal:

void MyObject::handleError(int code, const QString &message)
{
 Q_EMIT error(code, message, QPrivateSignal{});
}

QCoro has a feature that makes it possible to co_await a signal emission and returns the signals arguments as a tuple:


MyObject myObject;
const auto [code, message] = co_await qCoro(&myObject, &MyObject::handleError);

While it was possible to co_await a “private” signal previously, it would get return the QPrivateSignal value as an additional value in the result tuple and on some occasions would not compile at all.

In QCoro 0.10, we can detect the QPrivateSignal argument and drop it inside QCoro so that it does not cause trouble and does not clutter the result type.

Achieving this wasn’t simple, as it’s not really possible to detect the type (because it’s private), e.g. code like this would fail to compile, because we are not allowed to refer to Obj::QPrivateSignal, since that type is private to Obj.

template<typename T, typename Obj>
constexpr bool is_qprivatesignal = std::same_as_v<T, typename Obj::QPrivateSignal>;

After many different attempts we ended up abusing __PRETTY_FUNCTION__ (and __FUNCSIG__ on MSVC) and checking whether the function’s name contains QPrivateSignal string in the expected location. It’s a whacky hack, but hey - if it works, it’s not stupid :). And thanks to improvements in compile-time evaluation in C++20, the check is evaluated completely at compile-time, so there’s no runtime overhead of obtaining current source location and doing string comparisons.

Source Code Reorganization (again!)

Big part of QCoro are template classes, so there’s a lot of code in headers. In my opinion, some of the files (especially qcorotask.h) were getting hard to read and navigate and it made it harder to just see the API of the class (like you get with non-template classes), which is what users of a library are usually most interested in.

Therefore I decided to move definitions into separated files, so that they don’t clutter the main include files.

This change is completely source- and binary-compatible, so QCoro users don’t have to make any changes to their code. The only difference is that the main QCoro headers are much prettier to look at now.

Bugfixes

  • QCoro::waitFor() now re-throws exceptions (#172, Daniel Vrátil)
  • Replaced deprecated QWebSocket::error with QWbSocket::errorOccured in QCoroWebSockets module (#174, Marius P)
  • Fix QCoro::connect() not working with lambdas (#179, Johan Brüchert)
  • Fix library name postfix for qmake compatibilty (#192, Shantanu Tushar)
  • Fix std::coroutine_traits isn't a class template error with LLVM 16 (#196, Rafael Sadowski)

Full changelog

See changelog on Github

Sunday, 3 December 2023


KStars v3.6.8 is released on 2023.12.03 for Windows, MacOS & Linux. It's a bi-monthly bug-fix release with a couple of exciting features.

Aberration Inspector


John Evans introduces the very exciting Aberration Inspector tool. The Aberration Inspector is a tool that makes use of Autofocus to analyze backfocus and sensor tilt in the connected optical train. It solves up to 9 virtual tiles on the sensor as defined by the existing Mosaic Mask.


The information is then used to analyze:
  • Back focus.
  • Sensor Tilt.
There are 4 sections:
  • V-curve for the each tile.
  • Table of data detailing the curve fitting results.
  • Analysis of back focus and tilt.
  • 3D Surface graphic to explain the Petzval Surface intersection with the sensor.
This release provides display only functionality. In future it would be possible to add functionality to offer recommendations for adjustments using Octopi, PhotonCage, etc.

Sub-exposure Calculator


Joseph McGee continues to add improvements and fixes for the Sub-exposure calculator. For usability, the window is now re-sizeable, an issue with the display of tool tips was corrected, and an indicator has been added for the sensor type of the selected camera (Mono / Color).  For functionality: the upper limit of the Noise Increase input parameter was increased, support was added for cameras with non-variable read noise, (cameras with CCD sensors).


Several new camera data files were added to the KStars source code repository, and a function to allow direct direct download of camera files from the repository was enabled. (Note: users who have created their own camera data files, may wish set the file attribute to read-only, and/or make a back up copy in case of an accidental over-write from the download function if the camera file has the same name).

A new experimental graphical tool to determine an appropriate number of sub-exposures for integration was added. This tool allows the selection of an exposure time to noise ratio for a stacked image; the tool will compute the number of sub-exposures required to achieve that value.

Added several new camera data files:
  • Atik-16200CCD_Mono.xml
  • FLI-16200CCD_Mono.xml 
  • QHY_CCD_294M_Pro.xml
  • QHY_CCD_461_PH.xml
  • QHY_CCD_163C.xml 
  • QHY_CCD_163M.xml
  • QHY_CCD_268C.xml
  • QHY_CCD_294M.xml
  • QHY_CCD_600_PH.xml
  • ZWO_CCD_ASI294MC
  • Pro.xml ZWO_CCD_ASI294MM
  • Pro.xml ZWO_CCD_ASI533MC
  • Pro.xml ZWO_CCD_ASI2600MC
  • Pro.xml ZWO_CCD_ASI6200MC
  • Pro.xml ZWO_CCD_ASI533MC
  • Pro.xml ZWO_CCD_ASI533MM
  • Pro.xml Nikon_DSLR_DSC_D5100_(PTP_mode).xml Nikon_DSLR_DSC_D700_(PTP_mode).xml

FITSViewer Solver


Hy Murveit added a very useful feature to the FITS Viewer: a built-in solver!

The FITS Viewer Solver is used to plate-solve the image loaded in the FITS Viewer's tab. It only works with the internal StellarSolver. You get the RA and DEC coordinates for the center of the image, the image's scale, the angle of rotation, and the number of stars detected in the image. Its main use case is debugging plate-solving issues in Ekos, though the information displayed can be generally useful. The controls and displays are described below.


This adds a new tool inside the splitter on the FITS Viewer. It plate-solves the displayed image, and allows the user to experiment with a number of plate-solving parameters, and thus help debug plate-solving issues.

How to test it out?
  • Open the sliding panel on the left part way, click on Plate Solving, and resize the windows appropriately.
  • Experiment with the parameters available (Use Scale, Use Position, the scale and RA/DEC positions, choose a profile and/or edit it)
  • Click Solve, and the image is solved and the solution presented in the Scale and RA & DEC and Angle boxes.
  • If you enable "Mark Stars" above the image window, you will also see the stars that were detected.

Quality of Life improvements

  • Make "Set Coordinates Manually" dialog more intuitive.
  • Telescope name specified in the optical trains are now saved in the  FITS header (the mount name was saved before).
  • New placeholders for ISO, binning and pure exposure time added.
  • Add a new not-default scheduler option to disable greedy scheduling.
  • Reduce latency between captures, especially when guiding / dithering.
  • Fix issue with differential slewing.
  • Separate Business Logic from UI in Scheduler.
  • Fix bug in estimating job time, capture delays were misinterpreted.
  • Fixed guide start deviation was not saved properly in esq file.
  • Bugfix in one-pulse dither. Dither pulses were going the wrong way.
  • Fix Scheduler hangs when Focus does not signal Autofocus start failure.
  • Focus Guide Settle Bug.

Dear digiKam fans and users,

After five months of active maintenance and long bugs triage, the digiKam team is proud to present version 8.2.0 of its open source digital photo manager.

See below the list of most important features coming with this release.

  • Libraw : Updated to snapshot 2023-11-21
  • Bundles : Updated Exiv2 to last 0.28.1 release
  • Bundles : Updated ExifTool to last 12.70 release.
  • Bundles : Linux and macOS uses KF5 framework to last 5.110

This version arrives with a long review of bugzilla entries. Long time bugs present in older versions have been fixed and we spare a lots of time to contact users to validate changes in pre-release to confirm fixes before to deploy the program in production.