Whonix Repository GUI Tool (Python)

Agreed on a GUI version, leaving the bash scripts for CLI users untouched.
It’s not your top priority, but since I was on it, I have started with whonix_repository.

It’s not complete. At the moment it reads the settings from “/root/.whonix.d/”, displays the GUI accordingly and prints the new user settings.

Can you review and tell if this approach looks sound? (use kdesudo to run the script.)[/quote]

Calling tools .py is not usual in Debian as far I know. Would whonix_repository_gui be better name? I am not sure if whonix_repository was a mistake and if whonix-repository would have been better.

I was inspired by Qubes "The Underscore Revolution” (The Invisible Things Lab's blog: Qubes R2 Beta 3 has been released!). But that won’t work for Debian. Package names in Debian may only use - not _ as per Debian policy. (Thereby also their toolchain does not work well with “_”.)

[hr]

Maybe ideally the gui tool shouldn’t try/learn how to parse /root/.whonix.d/? Perhaps it should just provide the GUI. And depending on user choices, call whonix_repository with the appropriate command line options to do the changes? (Everything you can do with whonix_repository [(dialog) --gui] you can also do with cmd line only.)

Maybe ideally the gui tool shouldn't try/learn how to parse /root/.whonix.d/? Perhaps it should just provide the GUI. And depending on user choices, call whonix_repository with the appropriate command line options to do the changes? (Everything you can do with whonix_repository [(dialog) --gui] you can also do with cmd line only.)

Yeah. I was reinventing the wheel. It’s now called whonix-repository-gui and it works (here).
GitHub - troubadoour/whonix-repository-gui.

Not reviewed yet, just two small things.

There is a useless file:
nohup.out

You tend to forget one file. :wink:
The dotfiles.
.gitattributes
https://github.com/Whonix/anon-apt-sources-list/blob/master/.gitattributes

Added Whonix icon.

Will deal with the small issues. :-[

Will deal with the small issues.

Done.

Looks nice!

It needs some kind of root check.

whonix_repository says:

ERROR: This must be run as root (sudo)!

We cannot use the same, because running gui tools with sudo won’t work. kdesudo is KDE specific. gksudo is also specific. And there is nothing like xsudo? Perhaps we just say

ERROR: This must be run as root!

?

Shouldn’t happen often anyhow. Only when the user manually starts the gui tool by using a terminal emulator.

When running whonix-repository-gui in a terminal, please keep the output mostly as is. It’s useful for debugging purposes.

One small issue…

With whonix_repository the last line for example is:

With whonix-repository-gui the last lines for example are:

INFO /usr/bin/whonix_repository: Done, deleted /etc/apt/sources.list.d/whonix.list. whonix_repository --disable

Echoing what whonix-repository-gui is running (whonix_repository --disable) is a useful thing. But that echo happens a bit late. Could you do that earlier? Only a small thing, don’t put too much effort into it.

Other small issues:

  • link not clickable
  • formatting (blockquote) apparently inactive
  • copy and paste text not possible
It needs some kind of root check.
https://github.com/troubadoour/whonix-repository-gui/commit/27532853e42a331e553d376c8a5251f5def1a21d
Echoing what whonix-repository-gui is running (whonix_repository --disable) is a useful thing. But that echo happens a bit late. Could you do that earlier? Only a small thing, don't put too much effort into it.
It was a line left from testing. Removed. https://github.com/troubadoour/whonix-repository-gui/commit/c2cbd9607f82284a1b7f4e8eb8ef79e87672c00f
Other small issues: - link not clickable - formatting (blockquote) apparently inactive - copy and paste text not possible
Link fixed, copy and paste fixed, but the formatting works...? https://github.com/troubadoour/whonix-repository-gui/commit/3128d41a68c5663cd780235089b49d22388f8d65

Looks good. Could you add to the terminal output please what command you’re passing to whonix_repository?

Okay, let’s enable others being able to comment on usability. Here are screenshots of the current version.

Default:

When no has been selected:

To compare with the cli version, run:

sudo whonix_repository

To obtain the gui version, get it from git:

git clone https://github.com/troubadoour/whonix-repository-gui.git

Try it live.

kdesudo /path/to/usr/bin/whonix-repository-gui
  • When whonix-repository-gui gets run [less likely, from terminal], or as part of whonixsetup as part of a first start of a Whonix-(Gateway|Workstation), the terminal output of whonix-repository-gui will be visible when users scroll up. So they can check whonix_repository's output and look if all goes well (which should, no bugs in the whonix_repository tool yet).

  • When whonix-repository-gui gets run from start menu, we do not have some kind of feedback yet when the user clicked OK or Cancel. The window simply disappears and that’s it. Should we solve this some other way? Such as with some kind of new popup when its done as feedback? Or is that okay as is?

Pushed print command at the end of messages · troubadoour/whonix-repository-gui@16bcd26 · GitHub (command printed at the end of the messages).

Could you make it a “will run…” rather than “was run…” please? This would better show the sequence of events.

Another thing that would be useful is checking the exit code of whonix_repository and show an error popup of the the stdout + stderr in case of a non-zero exit code.

Did some work on whonixsetup today so it all integrates well soon:

I guess we’ll be ready here soon.

Wondering… Not important… In the future. Do you think that dialog could someday be integrated into a bigger dialog?

Looks great!

If I must nitpick…

What happens when you hit cancel? Should that be allowed?

The Repository section is mildly confusing. It doesn’t say what it is about, just that “you should leave it on stable”. Right now it’s like “If you know what this is, go ahead and change it. If this confuses you, leave it where it is.” Ideally, we wouldn’t make the user wonder in the first place.

We could educate the user at this point with more text.

The simplest solution is to remove this section entirely. Any user that is only now learning of testers and developers repo doesn’t need to change anything. But if you are a tester or developer, you can easily switch to testers/devs at the command-line… Ugh, but that ruins the “all-in-one GUI”. Devs/testers like GUIs too! So, I dunno.

The easy answer is “nothing”. So let’s break it down. For one, same thing happens as with whonix_repository tool, because whonix-repository-gui “only” forwards actions to whonix_repository. And Whonix comes without having Whonix’s repository enabled by default. This was a useful (compromise|consensus) when that discussion came up in Whonix (7?).

Should that be allowed?
Yes?
The Repository section is mildly confusing. It doesn't say what it is about, just that "you should leave it on stable". Right now it's like "If you know what this is, go ahead and change it. If this confuses you, leave it where it is." Ideally, we wouldn't make the user wonder in the first place.

We could educate the user at this point with more text.

The simplest solution is to remove this section entirely. Any user that is only now learning of testers and developers repo doesn’t need to change anything. But if you are a tester or developer, you can easily switch to testers/devs at the command-line… Ugh, but that ruins the “all-in-one GUI”. Devs/testers like GUIs too! So, I dunno.

Yes.

Having made both dialogs from whonix_repository into one in whonix-repository-gui is non-ideal.

This is whonix_repository second screen.

                             │ Which Whonix Repository would you like to receive updates from?                                                      │  
                             │                                                                                                                      │  
                             │ Most users should select the Stable repository.                                                                      │  
                             │                                                                                                                      │  
                             │ You can always start the Whonix Repository Tool again by running:                                                    │  
                             │     sudo whonix_repository

@troubadour, could you make it more wizard style? Bonus: with forward/backward button?

Screen 1)
The “yes/no / ok/cancel question” if the user wants to use it or not.

Screen 2)

  • When chosen yes in Screen 1: Show the “Most users should select the Stable repository. […]” + selection dialog + OK / Cancel.
  • When chosen no: in Screen 1: Inform, that Whonix’s repository has been disabled. + “To start it again do x.” message. + OK button. End.
  • When chosen cancel in Screen 1: Inform, that nothing has been done. + “To start it again do x.” message. + OK button. End.

Screen 3)

  • When chosen OK in Screen 2: Inform, that Whonix’s X repository has been enabled. + “To start it again do x.” message. + OK button. End.
  • When chosen Cancel in Screen 2: Inform, that nothing has been done. + “To start it again do x.” message. + OK button. End.

What do you think, @troubadour, @JasonJAyalaP?

@JasonJAyalaP @patrick.
After your comments, it becomes obvious that the GUI should be wizard style. A nice wizard class is available from Qt’s library, and it opens new perspectives for Whonix usability. :slight_smile:

This is all cool. Great work!!!

I can be using the GUI for Qubes. I wish I was reading the forums instead of coding since I wrote an alert box in Python using QT which took a few hours to complete. I separated the messages into a configuration file like this:

update:
  icon: Critical
  en:
    title: Tor netvm required for updates
    message: |
      <p><B>Tor netvm required for updates!</B></p>
      <p>Please ensure your template vm has a Whonix gateway as it's VM.</p>
      <p>No updates are possible without an active (running) Whonix gateway VM.</p>
      <p/>
      <p><b>Template will now power off</b></p>

Can’t wait to get my hands on the repository tool (and setup too since the current screens are huge).

It will be available form github, but in another shape (wizard). Stay tuned!