Whonixcheck, timesync GUI, msgcollector

By the way, I succeeded building Whonix early Whonix 9 gateway with split packages.

Noticed, there is a small problem with gateway first run notice (https://github.com/Whonix/anon-gw-first-run-notice).

How to reproduce: Can you install the package on your local system please? Either by building the package, or a simple “sudo make install” should do as well. Then reboot. You’ll see the notice works, but it also opens an ugly console window, where it runs “ls ~/.gateway”.

I guess the issue is here somewhere.

folder_return_code = call("ls ~/.gateway", shell=True) if folder_return_code == 0: file_return_code = call("cat ~/.gateway/first_use_check.done", shell=True) if file_return_code == 0: sys.exit() else: call("mkdir ~/.gateway", shell=True)

Could you pythonify [using real python commands instead of shell?] / prettify the code a bit please? Keep your time will be a while until I fixed the remaining bugs (mostly wrong paths) and testing in Whonix 9.

Could you pythonify [using real python commands instead of shell?] / prettify the code a bit please?

It has been in the pipeline for a while. I’ll rewrite with code not using stdout (os instead of subprocess), and also make it consistent with the whonixcheck/timesync GUI, with the text beside the info icon. It could be reusable too.

The striphtml script would be better implemented in the dispatch_cli function in msgdispatcher rather than in the while loop in msgdispatcher. If you push your progress to github, I will fix the bash parts.

For now, it’s in msgcollector. I have tried it in dispatch_cli, it does nor work from there. As I do not know the scope of ‘msg’ and how or when the main_function is called, amongst a few other mysteries… it’s up to you. I’m eager to see how you do it.

Pushes.

msgcollector:
striphtml
msgcollector
msgdispatcher_dispatch_x richtext

whonixcheck with messages modified for rich text in:
check_apt_repository
check_news
check_operating_system
check_stream_isolation
check_tor_socks_or_trans_port
disclaimer

If any message other than the ones modified in the list is dispatched by whonixchek, it will slightly mess up the display in the GUI, but it should be enough for demonstration.

By the way, I succeeded building Whonix early Whonix 9 gateway with split packages.

That’s great. If this progress on the GUI-cli is fine, it would be nice to have ready in Whonix 9. The release date should become clearer.

troubadour, what is really really really important, please, please, please, before you start editing, remember to get latest updates from git. Commit and push often. Otherwise merging gets really complicated.

This change is really problematic:
https://github.com/troubadoour/msgcollector/commit/4659e05e3c38ea8e538e18b1f484ac699de38a75
It reverts lots of changes. Can you base your changes on latest git please? Or… I am thinking on how to best resolve this.

You didn’t change /usr/lib/msgcollector/msgcollector at all? If yes, that would be good actually. Then the merge would be simpler.

whonixcheck merge manually fixed.

Looks good. But please get latest git before making new edits.

troubadour, what is really really really important, please, please, please, before you start editing, remember to get latest updates from git. Commit and push often. Otherwise merging gets really complicated.

Sorry for the inconvenience. But, when I made a new fork of msgcollector, after deleting my copy in troubadoour (troubadour) · GitHub (I do it that way to avoid complicated merges), the latest change in the Whonix repo was 4 hours old. Made the changes in my local repo, then forked Whonix/whonixcheck, made the changes and pushed both on troubadoour.

So it seems that you edited either or both repos before I pushed them. May be we could avoid that situation in the future if I let you know that I’m working on such and such package.

Now, if there is any problem left, I can do it all over later in the day.

As long we’re not editing the same file and function at the same time, there usually should not be any conflicts. In this specific case, I think you don’t need to make any changes to msgdispatcher? Just a new python file (htmlstrip) and edited msgdispatch_x? If you could just add those improvements to latest git that would be great.

No problem.

As long we're not editing the same file and function at the same time, there usually should not be any conflicts. In this specific case, I think you don't need to make any changes to msgdispatcher? Just a new python file (htmlstrip) and edited msgdispatch_x? If you could just add those improvements to latest git that would be great.

It was done, but I just pushed it again, with the right directory for the call to striphtml in msgcollector. You should be able tot test it, with the restrictions explained in post #196.

I don’t think we can edit the same file at the same time, because I don’t have write access to the Whonix repository. That is why, before committing/pushing, I check for the latest edits in Whonix. Yesterday, it appears that between my fork of whonixcheck and my actual push, you had done some work in whonixcheck.

When I look at:

Then click at latest commit, then I see:
https://github.com/troubadoour/msgcollector/commit/c2a2e1acbb062a5013237ced138fae1c2545881e

A lot changes are again made in usr/lib/msgcollector/msgcollector, that should not be done.

Before “git add *”, you can run “git diff” and after you run “git add *”, you can run “git diff --cached”. Then you can see this in advance before git push. (Advice to use a graphical diff viewer, but whatever you most comfortable with. Anything is possible.) Then it will show what you are going to change in relation to your latest git head.

And before you make changes, please make sure they are based on latest git head. At the moment it is.

[code]msgcollector $ git log
commit 525c036dfd754950c5f84872082eb1da5e25fffa

Merge: 22d6639 8dd4bda
Author: Patrick Schleizer adrelanos@riseup.net
Date: Tue Jun 17 21:17:41 2014 +0000

Merge remote-tracking branch 'troubadoour/master'[/code]

(Same is visible on https://github.com/Whonix/msgcollector/commits/master.)

Editing the same file in git is possible, because it records atomic changes. Not full files. Git thinks of files in a sense of changes (or patches) over time. When you go back in time (git checkout olderbranch [or older commit]) it plays back change by change. For example, if I were to change something in same file in function “preparation” and you in function “colors”, it could always be perfectly merged, because git views this just as two different patches around differs lines. Merge conflicts only happen if the same lines get edited before merge.

Please don’t use git push --force for any repositories Whonix/… ever, because it messes up the repository for everyone. Usually --force is never required. There are always other solutions.

A work flow could look like this.

What were your git remotes called again? GitHub - Kicksecure/msgcollector: GUI / CLI Toolkit Library - collects messages send to it by applications (API) and dispatches them when instructed to do so by the application called “origin” or “whonix”? Find out:
git remote -v

Then fetch.

git fetch origin
[replace origin with whonix if it is called whonix in your repo]

Then temporarily switch to origin/master branch.
git checkout origin/master

Now create a new branch based on origin/master branch.
git branch striphtml

Switch to striphtml branch.
git checkout striphtml

Make your changes in editor.

git status

add files…
git add *

See the diff in relation to your current branch.
git diff --cached
(Graphical diff viewer opens if configured.)

If they are fine, commit them.
git commit -a
(Graphical editor with spell checking opens if configured.)

Just to make double sure, diff your branch with origin/master.
git diff striphtml origin/master

If it’s fine, push your branch to github.
git push troubadoour striphtml

Then you can either inform here in the forum, that you have a new striphtml branch, that you would like to see merged into whonix/master.

I would fetch it.
git fetch troubadoour

Diff it.
git diff troubadoour/striphtml
(Graphical diff viewer opens if configured.)

Merge it.
git merge troubadoour/striphtml

Alternatively you could also use github’s git pull functionality. Then a github ticket is created. This is also nice. If you login into github after a pushing a new branch, it will already suggest you to ask for merge into original repo.

:slight_smile: Official announcement. There is a new branch “troubadoour/msgcollector-richtext” in github that you can merge in whonix/master. :slight_smile:

Besides the fact that I was not checking the differences, I was doing it the lazy way, i.e. copying my “/usr/lib/whonix/msgcollector” in the package’s “usr/lib/msgcollector/msgcollector”. They are quite different.

Anyhow, thank you for your patience, (re-)explaining.

You don’t have to delete GitHub - troubadoour/msgcollector. No need to create https://github.com/troubadoour/msgcollector-richtext. Usually pushing to the same repository GitHub - troubadoour/msgcollector is better. However, it is now merged. Adding it to msgcollector is actually an even better than I had (adding to msgdispatcher), because msgdispatcher could be better of not being busy (not introducing a blocking call). msgcollector could be run in background.

Question: can I install Whonix 9 whonixcheck in my current version (8.2)? That would help me a lot for checking the output in rich text format.

EDIT: May be, if I create “/usr/share/anon-ws-base-files/workstation”?

EDIT#2: Most likely no. Too many dependencies, creating themselves more dependencies.

Unfortunately, true.

Unfortunately, true.

Yes. Nevertheless, I managed to check some of the modified messages (the long ones) in “35_disclaimer”, running only the beginning of whonixcheck. Hopefully, there are not too many typos.

So all the messages in whonixcheck are modified for rich text, and msgdispatcher_dispach_x calculates the vertical size of the text accordingly.

Git note. I wanted to get rid of the previous differences and of the name “msgcollector-richtext”, so I deleted and forked again the repositories. When I tried to push, git complained (rightly) that my current branch was behind its remote counterpart. I was scared to loose the work in whonixcheck, so I deleted whonixcheck and msgcollector, and created empty new ones before pushing. So my repos might lag slightly from yours. I have seen that you made some edits 12 hours ago or so. Hope they are minor.

(Yep only minor changes. [Fixed paths.])

Both whonixcheck and msgcollector changes are merged.

dispatch_x no longer works when $type is “error”. Can you fix this please?

Could you please give me access to the Whonix git repositories I am working on:

  • msgcollector
  • whonixcheck
  • anon-gw-first-run-notice

It seems that all the recent git problems were arising from my work in troubadoour (troubadour) · GitHub, making it difficult to synchronize with Whonix · GitHub.

Done the following for the last update in dispatch_x.

git clone https://github.com/Whonix/msgcollector.git
git checkout origin/master
git branch type_error
git checkout type_error

Made the edits (msgcollector and .msgdispatcher_dispatch_x).

git add *
git diff --cached -> OK
git commit -a -m "fixed type error"
git diff origin/master type_error -> OK
git remote add troubadoour git@github.com:Whonix/msgcollector.git

git push troubadoour type_error
Enter passphrase for key '/home/user/.ssh/id_rsa': 
ERROR: Permission to Whonix/msgcollector.git denied to troubadoour.
fatal: The remote end hung up unexpectedly

I think the flow is correct.

ERROR: Permission to Whonix/msgcollector.git denied to troubadoour. fatal: The remote end hung up unexpectedly

This was expected, because no access to Whonix/*.

That was the mistake.

You either meant.

git remote add origin git@github.com:Whonix/msgcollector.git

Or.

git remote add troubadoour git@github.com:troubadoour/msgcollector.git

To fix “git remote rm troubadoour”.

Could you please give me access to the Whonix git repositories I am working on:
I did that, but...
It seems that all the recent git problems were arising from my work in github.com/troubadoour, making it difficult to synchronize with github.com/Whonix.

…no offense, I am not sure you know git well enough yet. Please don’t use git push --force, because that messes up the repository for everyone. Git is a distributed source control system. Usually using multiple remote repositories don’t cause any issues. I don’t think you understand git while saving to read the basics of something like Git - Book.