Whonix Repository GUI Tool (Python)

We could use ‘[font=courier]anon[/font]’ then?[/quote]
I suppose that ‘[font=courier]anon[/font]’ is best suited when the package is potentially useful for Whonix, Tails and other Linux distributions with focus on anonymity. For stuff that could be potentially reused by plain Debian, Ubuntu, etc. the ‘[font=courier]anon[/font]’ is a unnecessary limitation by name. In the latter case, I find a neutral name better. A lib for translation is as I understand this topic neither Whonix nor anon specific.

I am in favor of Debian packages for two reasons:

  • It stays consistent with Whonix packaging.
  • I am not familiar with Python packaging (never came accross setup.py).

Now, we’ll have to decide the path for installing the modules. Needed before packaging.

Provisionally, I have

user@host:/usr/lib/python2.7/dist-packages/whonix$ lt 
total 40
-rw-r--r-- 1 root root    3 Nov 13 22:09 __init__.py
-rw-r--r-- 1 root root  138 Nov 13 22:12 __init__.pyc
-rw-r--r-- 1 root root  607 Nov 13 22:09 guimessage.py
-rw-r--r-- 1 root root 1270 Nov 13 22:12 guimessage.pyc
-rw-r--r-- 1 root root  945 Nov 13 22:09 translations.py
-rw-r--r-- 1 root root 1487 Nov 13 22:12 translations.pyc
-rw-r--r-- 1 root root 6651 Nov 13 22:13 whonix_repository_wizard.py
-rw-r--r-- 1 root root 5652 Nov 13 22:13 whonix_repository_wizard.pyc

translations.py and guimessage.py will most likely end in another place in the future (common to all modules).

/usr/bin/whonix-repository-wizard:

#!/usr/bin/python
from whonix import whonix_repository_wizard

if __name__ == '__main__':
  whonix_repository_wizard.main()

As suggested by nrgaway, we could(should) put the whonixsetup-wizard(s) in the same package. It would be a matter of creating /usr/bin/whonixsetup-wizard.

We could install the package in something like /usr/lib/python2.7/anon-packages/whonixsetup. I believe that for doing so, we would have to modify PYTHONPATH environment variable.

Sounds good.

“creating” sounds a bit scary. I am not a fan of dynamically generating files in /usr/bin. No package does that and I think it has a good reason.

Not a big deal? /usr/bin/whonix-gateway-setup-wizard /usr/bin/whonix-workstation-setup-wizard? The names do not need to be that pretty, since those are started from start menu, desktop icon [or other wizards]. And a /usr/bin/whonix-gateway-setup-wizard run on Whonix-Workstation could just complain and exit.

What however also could be done would be shipping /usr/lib/whonix-gateway-setup-wizard and /usr/lib/whonix-workstation-setup-wizard, and then have the debian maintainer script conditionally depending on being installed on Whonix-Gateway or Whonix-Workstation create /usr/bin/whonix-setup-wizard(?) as a symlink. (Not hard.) The latter however does not seem so attractive to me. Above sounds better to me. Up to you.

We could install the package in something like /usr/lib/python2.7/anon-packages/whonixsetup.
Any reason for keeping "anon-packages"? What about /usr/lib/python2.7/whonixsetup-wizard?
I believe that for doing so, we would have to modify PYTHONPATH environment variable.
Sounds pretty non-standard? Where would we set it? I hope not globally but just in the /usr/bin wrapper? Can it be avoided?

[quote=“Patrick, post:63, topic:635”]Sounds good.

“creating” sounds a bit scary. I am not a fan of dynamically generating files in /usr/bin. No package does that and I think it has a good reason.[/quote]
Wrong phrasing. I meant “writing”, as a static file included in the package.

[quote]We could install the package in something like /usr/lib/python2.7/anon-packages/whonixsetup.[/quote] Any reason for keeping "anon-packages"? What about /usr/lib/python2.7/whonixsetup-wizard?
No reason, actually. It can be /usr/lib/python2.7/whonixsetup, containing: [code] __init__.py guimessage.py translations.py connection_wizard_gateway.py connection_wizard_workstation.py whonix_repository_wizard.py [/code]

In /usr/bin/whonixsetup, may be check an environment variable.

if os.getenv('TOR_CONTROL_PORT'):
    from whonix-setup import connection_wizard_workstation
    connection_wizard_workstation -> start

else:
    from whonix-setup import connection_wizard_gateway
    connection_wizard_gateway -> start

Ok.

In /usr/bin/whonixsetup, may be check an environment variable.
That env var is for that use case not the right tool. Users may set that variable for some other reason or we later do in development for some reason (tor-launcher or so).

There is a GitHub - Whonix/anon-gw-base-files or GitHub - Whonix/anon-ws-base-files always installed by default (those cannot be installed together, they conflict by design) that do no more than ship either a [font=courier]/usr/share/anon-gw-base-files/gateway[/font] or [font=courier]/usr/share/anon-ws-base-files/workstation[/font] file as a reliable method for other packages to detect whether they are running on gw or ws.

Does that seem like a robust detection method?

I does the job perfectly, that’s what I was looking for.

Pushed wonixsetup-wizards package for review.

At the moment, it contains whonix-repository-wizard only.

Please feel free to rename the package. Anyhow, I will pull from you repository, in order to make it origin.

We could rename this thread “Whonix Setup Wizards” or something like that.

Or Whonix Setup GUI Tools.

Do you consider to put whonix-setup-wizard and whonix-repository-wizard into the same package?

I am wondering if one could want to have only either one installed and if you would be willing to support that use case by providing two packages?

One may not wish to use Whonix’s repository, but needs whonixsetup to enable Tor.

Yes. The package would install both /usr/bin/whonixsetup-wizard and /usr/bin/whonix-repository-wizard, and two distinct Desktop files in /usr/share/applications. All the Python modules would be installed in /usr/lib/python2.7/whonixsetup.

I am wondering if one could want to have only either one installed and if you would be willing to support that use case by providing two packages?
The number of packages is up to you, it's not a big penalty.

In that case we’ll have to make a separate library (/usr/lib/python2.7/whonix-common?) for the translations and guimessage modules, and create a third package for it?

That would be:

  • whonixsetup-wizard
  • whonix-repository-wizard
  • whonix-common-modules (or whatever)

Then there would be no point having two scripts in /usr/bin each importing a single module from /usr/lib/pyton2.7/. The code could as well be in /usr/bin.

One may not wish to use Whonix's repository, but needs whonixsetup to enable Tor.
whonixsetup-wizard can mimic whonixsetup (bash version), that is running whonix-repository on first boot and create /var/lib/whonix/do_once/whonixsetup.done. After that, whonix-repository can be run on its own, even with a single package.

I do prefer a single package for the ease of maintenance, but it’s probably better to split it, not ending with multi-purpose packages.