-
Notifications
You must be signed in to change notification settings - Fork 1
Chromium #2
Comments
Hi @p1839251. Your question made me realise this 'supported web browser' phrase is indeed not very clear. It needs to be a web browser with a working firejail profile. Either one that comes with the default firejail installation or one that a user put together manually. Hopefully this can clear up any confusion.
Correct. Because chromium is officially supported by firejail it fully qualifies to be used as your preferred web browser for handling http(s) links. |
Let's see; I don't know what else I should do! |
Apologies for responding so late. If you're still interested, there's a |
|
In that case I'd try to $ firejail-handler-http https://example.com I do hope Konversation is actually using xdg-open in the first place, something I never actually researched (not having touched KDE ever). I'll try to found out. |
Hang on! I just had a look at /etc/firejail/konversation.profile. That has private-bin, so what happens when you add |
Thanks, fortunately it was just a typo here
I'm not sure if you meant this:
Adding I tried running |
You will need to add your custom browser (chromium) AND every command used by firejail-handler-http and firejail-xdg-open to konversation's private-bin in a konversation.local.
HTH |
I hope it'll work but I have this error message: https://github.com/glitsj16/firejail-handler-http/blob/master/firejail-handler-http#L17 |
@p1839251 Thanks for reporting the error message. I definately will look into this, and I have some time to do just that. But I would appreciate some input, as the above error message (partly) puzzles me a bit. Let me elaborate.
I'm not sure how exactly It would also be helpful if you could tell me the command you ran that produced the error message. In the mean time I'll do some more digging to see where I can improve the scripts and solve this ASAP. |
Thank you for your quick response.
I followed your instructions and they wouldn't work. I mean I still wasn't able to open links. Nothing happened. I ran the command I wrote here #2 (comment)
|
Good.
Correct. The settings file now resides in /etc/firejail as per 7dbfd00 to fix #4. Before we proceed to the testing part, let's double-check your file layout is exactly the same as in the PKGBUILD for 0.1.0-5:
It's still unclear to me why you have a
That command sandboxes firejail-handler-http (a simple shell script) with the konversation profile. It's not what I meant by "I'd try to join the konversation sandbox and run firejail-handler-http manually from inside the sandbox". Let's try to clear up the confusion here. If you have the files from this repo installed to the correct locations and have a konversation.local to support them, it's easy to join the konversation sandbox after you've started konversation like you're used to. Firejail has a seperate
After checking your file layout (as per above) and editing konversation.local, start your konversation app. Once that is running, join its sandbox by running:
You should get a bash prompt after issueing that command. On a side note, /etc/firejail/firejail.config has a setting to turn this into a green prompt, making it stand out from your regular shell prompts, so you'd be aware of being |
@p1839251 Shortly after adding the above comment, I decided to bump the AUR package to 0.1.1-1. So if you would like to test the above, try the newly released version please. Thanks for your continued attempts to get chromium working just as well as firefox with these scripts. However challenging it might (prove to) be, it is something I regard as very worthwhile. Regards! |
I went through the files:
I didn't/don't have
That was what the error message also said: I followed your instructions carefully and updated
Thank you for your patience |
That's good, one less thing to focus on. Also, the rest of your output really helps, thanks for that. It gives me a better view on the whole context and what we need to try to get chromium working. Personally I've zero experience with KDE, but that shouldn't stop us here.
Likewise :-). We'll get there, it's just a matter of putting together the correct private-bin without loosening the sandbox. I'll go over your output and will try to explain what's happening as straightforward as I can.
The above
This one instead is very relevant indeed. The
|
It's still not working :/
|
I think your system is missing the |
That's kind of awkward. I did check it but I thought it was part of the
|
Needed to fix the error you saw so I cut a new release again (0.1.2-1). I do want to thank you for pursuing this. We're pretty close now I think. Apparently I had a very bad day coding in the user-defined settings support. Things should be quite a bit saner now. |
Ok, debugging isn't going to be that 'simple' anymore:
(The output hasn't been stripped. There's no output.) |
That's expected behaviour. There is nothing to output, the URL simply gets written to ~/Downloads/.firejail-dropzone/firejail.drop temporarily. Once the inotifywait script (firejail-handler-http-ctl) observes that something has been written to that file it passes on the URL to /usr/local/bin/xdg-open and clears out the file, waiting for the next URL to arrive. If you change _debug=0 to |
I tried enabling debug mode (_debug=1) but ~/Downloads remained empty.
Oh, I didn't know it had to be closed! A wiki or manual page should be created because it's not something I could have figured out all by myself. |
Strange. It would be interesting to test this once more with the below settings file. If you still use the same settings file as you showed in #2 (comment) you should have ~/Downloads/.firejail-dropzone containing only one file called firejail-drop. If you use a GUI file-manager it might be needed to activate 'Show hidden files' (or similar wording) before you can see the subdir. I used a dotted subdir name on purpose here, to not clutter your ~/Downloads folder with dirs/files that are not very relevant when these scripts work as expected. But for testing you can also set the dir to a path of your choice. Please test with the below settings file:
With the above you should see ~/Downloads/firejail-drop (_debug=0) or ~/Downloads/xdg-open.log (_debug=1), regardless of any GUI file manager settings. And you can always confirm these files exist via regular CLI commands like ls.
Although I'm happy to read you got things working, I'm not quite convinced this is the case. Your chromium
I fully understand and agree. I'll be adding something soonish. And again, I really appreciate the trouble you have taken to improve the code. This all started out as a quick and dirty POC after dealing with an issue on Firejail's GitHub tracker. It's in a better state now thanks to your questions/posts. |
I'm using your config file:
Hmm, this isn't really consistent. It worked yesterday. $ firejail --tree Chromium is not firejailed. #2 (comment) Hmm, maybe I shouldn't have deleted my ~/Downloads folder. I thought it would be a good idea...
After running
Chromium didn't open UPDATE: |
By emptying out your ~Downloads folder you broke the 'logic' these scripts share and things don't work anymore. The Changing _debug=0 to _debug=1 makes /usr/local/bin/xdg-open echo out the URL and exit. In this debug mode the URL never reaches the configured web browser, so it's expected behaviour that your chromium didn't open the test URL (https://example.com). When you revert to your settings file (with _debug=0) you should log out and login to ensure all the scripts properly receive the same changes. I'm quite sure that things will start to work again once you do that.
Although the scripts should also work with a non-firejailed web browser, that was never the intended use case. Obviously this is up to you, but personally I don't see the point of using firejail for konversation and not for any web browser. The attack surface of the latter is considerably larger IMO. It's also the reason why Firejail is called |
Ok, I'm lost. I may be alone with this but I don't really use the It would be great if I was a little bit misunderstood, I manually recreated the missing
Although
My config file still looks like this: #2 (comment) |
The
This is indeed a breakage point. The folder and file that needs to be watched by inotifywait for an incoming URL gets removed and the logic is broken from that moment on.
Try to follow the logic of the scripts here. If you cannot exclude ~/Downloads/.firejail-dropzone from your script that empties it I see only one other option: use another location for the _drop_dir than ${HOME}/Downloads. There's nothing stopping you from doing so, but there's a BIG catch: this location needs to be read-writable from inside the sandbox (cfr. https://github.com/glitsj16/firejail-handler-http/blob/master/firejail-handler-settings-http.inc#L20). I didn't go for ${HOME}/Downloads for fun or out of sheer coincidence, but because this location is special in Firejail, together with ${DESKTOP}. Most of the Firejail profiles will be able to access these dirs, which makes them perfect candidates for what these scripts try to achieve. To repeat, these are the options you have AFAICT, from 'fairly easy' to 'tricky':
An example of the latter would be:
|
Thanks once again! |
We touched on this above.
The
I think this is the best option indeed.
Sure, feel free to add to this thread. All the best! |
I was wondering what a 'supported web browser' is.
Did you mean Firefox?
I'd like to use Chromium. Should I just modify this line
firejail-handler-http/firejail-handler-settings-http.inc
Line 14 in bebd244
to
_browser_bin=/usr/bin/chromium
and I'm ready to go?There isn't much documentation of this issue.
The text was updated successfully, but these errors were encountered: