Information
ID: 155
PHID: PHID-TASK-tzqbaoqwiqfbuqswjma2
Author: Patrick
Status at Migration Time: resolved
Priority at Migration Time: Normal
Description
We have
/home/user/.gateway/first_use_check.done
/var/lib/whonix/do_once/whonixsetup.done
as whonix-repository-wizard done file
We also need one for locale_settings_finish
?
I am prosing a more generic approach. Here is an example:
/var/lib/whonix-setup-wizard/status-files/disclaimer.skip
/var/lib/whonix-setup-wizard/status-files/disclaimer.done
/var/cache/whonix-setup-wizard/status-files/disclaimer.skip
/var/cache/whonix-setup-wizard/status-files/disclaimer.done
/var/lib/whonix-setup-wizard
:
Users, custom builders and derivative distributions (Whonix Qubes can be considered a derivative of Whonix) can use that one. whonix-setup-wizard never touches folder for writing. Also not during apt-get purge
. Only for reading.
Whonix Qubes does not need/want the disclaimer, so their qubes-whonix
package could ship a /var/lib/whonix-setup-wizard/status-files/disclaimer.skip
file.
/var/cache/whonix-setup-wizard/status-files
:
Used by whonix-setup-wizard for status files. Once the user accepted the disclaimer, a file /var/lib/whonix-setup-wizard/status-files/disclaimer.done
could be created. And on next run, we can skip the disclaimer wizard page. The /var/cache/whonix-setup-wizard/status-files
folder would not be deleted on apt-get remove
, but it would be removed on apt-get purge
.
We could also stick to the current convention whonix/do_once
, since it’s a Whonix specific application.
Having this mechanism, we could have a python function, that abstracts checking these two folders for existing status files. So we can run that function and say “if function says, state file exists, skip it, otherwise continue”.
The apt-get
remove
vs purge
distinction can very easily be implemented by me in debian/
maintainer scripts.
What do you think?
Comments
troubadour
2015-02-10 22:00:31 UTC
Yes, it’s certainly better to skip the disclaimer pages when the user re-run the wizard. That means that in Workstation, it could be shown only once, at first boot (it has only disclaimer and whonix repository, if disclaimer.done
and whonixsetup.done
, that’s it, only whonix repository available. It’s not a problem).
We still need whonix/do_once
anyhow, in order not to run the wizard at each boot (in Workstation), but it looks like only two new files are sufficient for achieving this.
/var/lib/whonix-setup-wizard/status-files/disclaimer.skip
for Whonix Qupes or other derivatives not wanting the disclaimer. If the file exists, never show the pages.
/var/cache/whonix-setup-wizard/status-files/disclaimer.done
could work the same way as /var/lib/whonix/do_once/whonixsetup.done
(do not show the pages if the file exists).
Having this mechanism, we could have a python function, that abstracts checking these two folders for existing status files. So we can run that function and say “if function says, state file exists, skip it, otherwise continue”.
The only place where to implement the check seems to be the wizard itself (a few more if
. At some stage, will have to comment all that in the code, for future re-reading).
Patrick
2015-02-11 01:30:23 UTC
troubadour
2015-02-11 19:51:21 UTC
done
state files: we have first_use_check.done
, disclaimer.done
and whonixsetup.done
. Since they are all used exclusively by whonix-setup-wizard, they could be grouped in a single directory instead of being scattered in three different places.
troubadour
2015-02-11 20:16:51 UTC
whonixsetup.done
could become whonix_repository.done
. That’s its exact function in Gateway, and in Workstation too, if we put aside the disclaimer.
The change for the done
files is completed in whonix-setup-wizard. Provisionally, will create /var/cache/whonix-setup-wizard/status-files/
and write the state files there, except may be for disclaimer.skip
.
Patrick
2015-02-11 21:31:09 UTC
troubadour
2015-02-11 21:46:51 UTC
Done now.
Was a problem with whonix-repository when going back from the finish page. Do not delete the repository pages any longer, so the back button goes through all the pages. Apart from fixing the issue, it’s sensible, I think, and the code is clearer.
Patrick
2015-02-11 22:02:48 UTC
Yeah, maybe just one folder with “.skip” and “.done” files will be better. Not 100% Debian policy compliant, but whonix-setup-wizard won’t get into Debian anyhow, so it does not matter. This simpler solution is better overall.
You have one /var/lib/
left at the moment. The rest uses /var/cache
.
What makes this non-intuitive is, that “.skip” and “.done” files are not supported for every action. That’s why I suggested a function that abstracts /var/cache/whonix-setup-wizard/status-files/$varname[.skip|.done]
.
troubadour
2015-02-11 22:10:05 UTC
Patrick
2015-02-11 22:41:16 UTC
troubadour
2015-02-12 20:39:35 UTC
nrgaway
2015-02-12 21:35:22 UTC
Awesome! I will test it out tonight.
Patrick, Can you create a branch/tag and sign it for whonix-setup-wizard / pythton-guimessages so I can include it in the Qubes Whonix 9.6 release that I hope to have completed today or tomorrow?
Patrick
2015-02-12 21:42:38 UTC
I am wondering, if instead of having.
if environment == 'gateway' and show_disclaimer:
elif environment == 'gateway' and not show_disclaimer:
If it would require less code/duplication to skip the disclaimer in the actual function? But I don’t know, it might not be (easily) possible.
show_disclaimer = (not os.path.exists('/var/cache/whonix-setup-wizard/status-files/disclaimer_done') and
not os.path.exists('/var/cache/whonix-setup-wizard/status-files/disclaimer_skip'))
Why _
, i.e. why _skip
and _done
instead of .
[…]?
For consistency, I think it would be better to also have whonix_repository.skip
and first_use_check.skip
.
And I am wondering, how could we deal with locale_settings[.done|.skip]? Because then whonix-setup-wizard runs as user, not root. Means there would be no write access to /var/cache/whonix-setup-wizard/status-files/, unless we set it to writeable by anyone. That would be easily doable by using a Debian maintainer script, if that is acceptable. (The policy conform way would be to write into the user’s home folder, but then we wouldn’t have a consistent /var/cache/whonix-setup-wizard/status-files/ folder.)
Patrick
2015-02-12 22:00:47 UTC
Patrick
2015-02-12 22:06:39 UTC
! In T155#1895, @nrgaway wrote:
Patrick, Can you create a branch/tag and sign it for whonix-setup-wizard / pythton-guimessages so I can include it in the Qubes Whonix 9.6 release that I hope to have completed today or tomorrow?
→ T160
troubadour
2015-02-13 20:21:16 UTC
If it would require less code/duplication to skip the disclaimer in the actual function? But I don’t know, it might not be (easily) possible.
No, we have to leave with this one (tried reducing the code duplication, could not find a way).
Why _, i.e. why _skip and _done instead of .[…]?
My mistake. status files -> "." · troubadoour/whonix-setup-wizard@04a7a34 · GitHub
The policy conform way would be to write into the user’s home folder, but then we wouldn’t have a consistent /var/cache/whonix-setup-wizard/status-files/ folder.
I’m not familiar with Debian policy, but, why not write all the files in ~/.whonix-setup-wizard/
. That would solve the issue with locale_settings[.done|.skip]
? This part of the wizard is run as user.
Patrick
2015-02-14 03:18:37 UTC
Okay, merged.
! In T155#1915, @troubadour wrote:
The policy conform way would be to write into the user’s home folder, but then we wouldn’t have a consistent /var/cache/whonix-setup-wizard/status-files/ folder.
I’m not familiar with Debian policy, but, why not write all the files in ~/.whonix-setup-wizard/
. That would solve the issue with locale_settings[.done|.skip]
? This part of the wizard is run as user. (underline added by me)
There would be two issues. 1) Which ~
? user
or root
? 2) The worse issue is, that as per Debian policy, packages must not write into ~/
. If the qubes-whonix
package would add its .skip
files there, then they would also have to add a lintian
override, because lintian
would report a grave issue for installing files to ~/
.
troubadour
2015-02-15 21:06:30 UTC
OK.
In T155#1896, @Patrick wrote:
And I am wondering, how could we deal with locale_settings[.done|.skip]? Because then whonix-setup-wizard runs as user, not root. Means there would be no write access to /var/cache/whonix-setup-wizard/status-files/, unless we set it to writeable by anyone. That would be easily doable by using a Debian maintainer script, if that is acceptable. (The policy conform way would be to write into the user’s home folder, but then we wouldn’t have a consistent /var/cache/whonix-setup-wizard/status-files/ folder.)
I don’t know what is better, policy wise, but as whonix-setup-wizard is too specific to be ever upstreamed, perhaps we’re free to put it in /var/cache/whonix-setup-wizard/status-files/
, writeable by anyone.
Patrick
2015-02-16 07:41:57 UTC
troubadour
2015-02-16 20:23:18 UTC
Patrick
2015-02-16 21:17:49 UTC
Patrick
2015-03-09 20:09:23 UTC
Patrick
2015-03-09 20:15:22 UTC
Patrick
2015-03-09 20:20:53 UTC
Patrick
2015-03-09 20:30:39 UTC
Patrick
2015-03-10 09:20:21 UTC
Patrick
2015-03-10 09:27:00 UTC
Patrick
2015-03-10 09:42:06 UTC
Patrick
2015-03-10 09:43:32 UTC
Patrick
2015-03-10 09:45:40 UTC
Patrick
2015-03-10 10:25:24 UTC
Patrick
2015-03-10 12:03:22 UTC
troubadour
2015-03-11 20:30:15 UTC