-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE REQUEST] whonix support #54
Comments
ClientOnionAuthDir should be considered differently. onionjuggler/usr/bin/onionjuggler-cli Line 928 in 4006a3d
This expects the configuration to be present on the indicated torrc (tor_conf). But it is not present on 50_user.conf, also, the directory is called As was done on tor-ctrl and onion-wash, onionjuggler-cli should --verify-config and grep from there, not from a single file. The same applies to every other non HS options, which happens to be only ControlPort and CookieAuthentication for Vanguards. onionjuggler/usr/bin/onionjuggler-cli Line 1371 in 4006a3d
onionjuggler/usr/bin/onionjuggler-cli Line 1376 in 4006a3d
|
backupdoes not apply to whonix and never will because the file needs to be transfered from one vm to another. |
modifying user configurationtor-control-panel has its own configuration file, which really helps avoid user modification. one example is the function will fail if there are commented lines or empty lines between the hs options. this is because it only read lines start with HiddenService and it doens't know where to stop, but maybe it should consider empty lines and commented lines but not other configuration options? Anyway, if the user doesn't mess with the configuration in a way that would break the script, it would be with an extra included file, or I should find a better way for that function to work. It prints correctly, it just does not delete correctly, leaving the temporary copy in a broken state, tor will show the the configuration is invalid and it won't be replaced. Tor will not reload and no configuration will be modified. This is leaves tor up and not broken, which is great, but still shows problems with the script. |
Eval does not like the first characters of a variable being a number, and the file is saved to the current dir without the first characters 50_user_conf_tmp becomes 0_user_conf_tmp
|
It is now possible to create onion services on the gateway for the workstation with: onionjuggler-cli --activate -s ssh -p 22 for the gateway itself: onionjuggler-cli --activate -s ssh -p 22 -g |
auth-server and auth-client also working. |
webDoes not work. Webserver is installed by default and I am thinking of removing it because:
This leads me to think that onionjuggler has to be divided in more scripts, at least separate client options ( conclusionhttps://forums.whonix.org/t/improve-onion-service-usability-by-script-gui/9117/8 So onionjuggler-cli should be separate in more scripts, the web part depends on a webserver being installed, in this case, nginx. The rest doesn't. |
todoChanges marked as complete means that was completed on my local branch, could be still not pushed to github yet.
|
This is wrong because as the command is ran on the Gateway, it gets the gateway qube ip, not the workstation qube ip. elif command -v qubesdb-read >/dev/null; then
target_ip_default="$(qubesdb-read /qubes-ip)" ## Qubes-Whonix .... the default target ip is 127.0.0.1, but this can be made a configuration option so no need to specify the WS qube ip every time to set the target. on WS: qubesdb-read /qubes-ip on GW echo "tor_hiddenserviceport_target_addr=WS_QUBE_IP" | sudo tee -a /etc/onionjuggler/conf.d/file.conf |
requirements_ws="grep sed nginx whiptail" requirements_gw="tor grep sed tar openssl basez git python3-stem whiptail" For the separate scripts to work indepdently, each one will need option parsin, so the common functions gotta go to /usr/share so every script can source from there. |
Yes.
This is certainly possible. You'd need multiple And additional package would have to be declared in debian/control. To split into multiple packages, let's consider the source code structure.
Good idea? I also wondering about an additional |
If auto-generated by a script, better not to use
Yes, that seems pretty Whonix (actually VM) specific. Getting an onion service private key out of a VM is certainly non-trivial usability wise. Adding a reminder, link to documentation might be helpful. Other than that, seems pretty difficult and probably best if out of scope of initial implementation. Even later, seems pretty difficult (Qubes qrexec based) to improve upon.
Why not ignore empty and commented lines? Maybe I don't understand something. Not sure parsing should be done. Perhaps more robust to just do auto generation of config files?
Are you sure |
The debian installation is default to using debian.conf, later rethink how to make it use other debian derivatives such as whonix for building specific deb packages.
I don't understand.
Reminder to change this later, to 45_onionjuggler.conf or somethinkg like it.
Issue #51 onionjuggler/usr/bin/onionjuggler-cli Line 500 in c10a8de
Because of user modification, if the script is the only modifier of that file, than it is ok. For example, this would work to delete the lines: HiddenServiceDir /var/lib/tor/services/hs1
HiddenServiceVersion 3
HiddenServicePort 80 127.0.0.1:80
HiddenServicePort 22 127.0.0.1:22 ## 80 for http and 22 for ssh
HiddenServiceDir /var/lib/tor/services/hs1
HiddenServiceVersion 3
HiddenServicePort 80 127.0.0.1:80
HiddenServicePort 22 127.0.0.1:22 But this wouldn't: HiddenServiceDir /var/lib/tor/services/hs1
HiddenServiceVersion 3
HiddenServicePort 80 127.0.0.1:80
HiddenServicePort 22 127.0.0.1:22 HiddenServiceDir /var/lib/tor/services/hs1
HiddenServiceVersion 3
## http port
HiddenServicePort 80 127.0.0.1:80
## ssh port
HiddenServicePort 22 127.0.0.1:22 And I don't want it to only break on empty lines between blocks, so this can be valid: HiddenServiceDir /var/lib/tor/services/hs1
HiddenServiceVersion 3
HiddenServicePort 80 127.0.0.1:80
HiddenServicePort 22 127.0.0.1:22
HiddenServiceDir /var/lib/tor/services/hs2
HiddenServiceVersion 3
HiddenServicePort 8080 127.0.0.1:8080 and this also can be valid: HiddenServiceDir /var/lib/tor/services/hs1
HiddenServiceVersion 3
HiddenServicePort 80 127.0.0.1:80
HiddenServicePort 22 127.0.0.1:22
HiddenServiceDir /var/lib/tor/services/hs2
HiddenServiceVersion 3
HiddenServicePort 8080 127.0.0.1:8080 and by valid I mean, it will only delete the correct service block, no more, no less. Comments on top are ignored, the comments will not be deleted, just the configuration lines. Deleting blocks of lines are difficult, because I am thinking how to would read that file.
Yes and that was not an eval proble, it is a shellscript rule, variables can not start with numbers. Anyway, that problem was fixed. |
On one hand, I was not wanting to separate script before because
On the other hand
|
To split into multiple packages, let's consider the source code structure.
Or...
Ok.
Whonix package Since you already created a whonix.conf it would also be great to keep/maintain that file upstream, here. Then it could be moved to Or since the config is |
Now I get it. I am currently separating the scripts, so after I commit, we should review this.
Yes. |
Scripts separated https://github.com/nyxnor/onionjuggler/tree/main/usr/bin |
#54 (comment)
|
This is what I am thinking:
All the plugins have dependency on the main configuration because the functions will be installed from the main Renaming from plugins to modules because:
That is why your download |
The debian packages will take some time for me to learn how to properly separate them with #54 (comment) But if installing from git, the ws and the gw have their own conf now, so running: sudo ./configure.sh -i will install correctly on each host. |
nyxnor:
#54 (comment)
Now, after separating the scripts and configuration, I can see better on how to separate the debian packages. But I don't know which would be the best approach?
- Consider every plugin a deb package?
If it's sufficiently complex, yes.
- Default package installs everything or no plugins?
Can be a plugin strucutre but a small number of packages or even just 1
package is better than many packages.
Because one thing is for sure. Debian FTP master don't like 1 file = 1
package. Each package adds overhead to packages.debian.org. Therefore
minuscule packages are discouraged.
|
Lets take onionjuggler-cli-web for example. It is not complex but it should not be installed on the gateway, as the webserver will be installed as a dependency. The other dependencies of the other packages are very light, but normally installing webservers comes with a lot of security concerns.
Can you suggest how you'd separate onionjuggler? Another possibility is installed core pkg
pkg
But backup will not work on whonix and web should not be installed on the GW because of webserver. So if you know and alternative for this, pls share. |
These are good questions. I don't know and would suggest Debian Mentors. Lots of search results. Then either asking Debian Mentors on IRC and/or the Debian Mentors mailing list. |
on IRC they sent me this introduction https://mentors.debian.net/intro-maintainers/ after my questions. So it feels like I have to submit the package before asking questions about how to organize it. This will take some time to process. I should submit via https://www.debian.org/devel/wnpp/
You don't need to respond, sometimes I write things just so I can remember why some actions were taken or not and why that direction. |
First run fails on gateway service creation if I use a non existent file, it won't be created as of not, it just fails $ sudo onionjuggler-tui
grep: /usr/local/etc/torrc.d/45_onionjuggler.conf: No such file or directory
Saving a copy of /usr/local/etc/torrc.d/45_onionjuggler.conf to /tmp/45_onionjuggler.conf.jQFJBS
cp: cannot stat '/usr/local/etc/torrc.d/45_onionjuggler.conf': No such file or directory
Including Hidden Service configuration to /tmp/45_onionjuggler.conf.jQFJBS
HiddenServiceDir /var/lib/tor/services/ssh
HiddenServiceVersion 3
error: Please set the Workstation Qube IP address using the option 'tor_hiddenserviceport_target_addr' on /etc/onionjuggler/conf.d/*.conf
Exiting script onionjuggler-cli
Deleting /tmp/45_onionjuggler.conf.jQFJBS
Press ENTER to return to the TUI! Edit: |
nyxnor:
> Where would that be added?
I was thinking of this: _Whonix package anon-apps-config would drop a config snippet into a config.d folder, i.e. /etc/onionjuggler/conf.d/30_whonix.conf._
Ah. Yes. That is nicely mostly static/declarative.
Note: anon-apps-config is installed on both workstation and gateway. But
that is good enough. The config snippet itself could check where it's
running (the usual marker files) and only apply gateway config to
gateway and workstation config to workstation.
Bonus wish: onion-juggler pointing out by using a config comment
somewhere or so the Whonix snippet by anon-apps-config to make it easier
to grasp for others how Whonix support was implemented.
|
Edit: done in edd5051 There is not much secret, I can include some comments later, but here is a sketch:
## web is the only useful plugin for the WS
onionjuggler_plugin="web"
## requirements only used if installing with configure.sh
requirements="grep sed qrencode ${dialog_box} ${webserver}"
## only allow plugins that are useful and works on the gateway
## backup not possible because of VMs
## web should be on the WS
## vanguards maybe could be included but it is installed from git, not from deb pkg
onionjuggler_plugin="auth-server,auth-client"
## webserver does not matter of web plugin is disabled
webserver="nginx"
## removed webserver from GW requirements
## requirements does not affect if building the debian package
## it is only used by configure.sh
requirements="tor grep sed tar openssl basez qrencode ${dialog_box}"
## included directory
tor_conf_dir="/usr/local/etc/torrc.d"
## select unique torrc for the script
tor_conf="${tor_conf_dir}/45_onionjuggler.conf"
## default ClientOnionAuthDir
tor_data_dir_auth="${tor_data_dir}/authdir" So, building the deb package has very minimal dependencies:
|
what is missing:
|
#54, no abrevs for whonix, change whonix to anon preparing in the case of project division
#54; cannot be os to be different than the one got in configure.sh.
whonix is supported, some scripts can run on the workstation and most of them on the gateway. closing as completed. If bugs appear for Whonix in the future, better to create a new issue because this got too long. |
still related to implementation, there is a simple problem to be solved for qubes whonix:
Currently, it is only checking For me to also read. I am thinking of
Else they would need to bind I didn't notice this before because I use the defaults, and didn't notice of loosing a conf.d configuration because that was only used for testing. |
The project ships Also, insluded and excluded files are shown when running with the |
Sounds perfect! |
Is your feature request related to a problem? Please describe.
It is missing setting the correct configuration file on
onionjuggler/configure.sh
Line 239 in 4006a3d
it just needs to test if its the GW and if it is the WS, than block it and warn to run on GW.
same flow as was done here basically
onionjuggler/usr/bin/onionjuggler-cli
Lines 657 to 666 in 4006a3d
Describe the solution you'd like
Describe alternatives you've considered
Additional context
b645b85 - define target for whonix-gw running on qubes, non-qubes, for itself
http://forums.dds6qkxpwdeubwucdiaord2xgbbeyds25rbsgr73tbfpqpt4a6vjwsyd.onion/t/improve-onion-service-usability-by-script-gui/9117/8
The text was updated successfully, but these errors were encountered: