News for hackers. Stuff that matters.
Re:Show HN: Open-source isolated browser, free for journalis... by techntoke on Sunday July 26, 2020 @06:36AM (#23956021)
Here is an open source way to do this yourself:

  # Dockerfile

  FROM node:alpine3.12
  RUN apk add --no-cache chromium \
  && yarn add puppeteer-core \
  && apk add \
    --no-cache \
    --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
      novnc
Re:Show HN: Open-source isolated browser, free for journalis... by erk__ on Sunday July 26, 2020 @09:45AM (#23957000)
You can also do it with jails on FreeBSD: https://honeyguide.eu/posts/pot-throwaway-firefox/
Re:Show HN: Open-source isolated browser, free for journalis... by win66 on Sunday July 26, 2020 @12:53PM (#23958353)
I appreciate you sharing that, thanks! On here I set up the restrictions using user accounts and groups, iptables, cgroups and some monitoring of CPU and memory, with cpulimit and pkill for excessive use. Sort of like a lightweight "container" for each browser process.

In other words, each chrome process runs in its own user-space (a no-login user which exists only for the duration of the session), which has cpu and memory limits thanks to cgroups, bandwidth limits and restrictions thanks to iptables, and disk and browser cache limits thanks to chrome command-line flags.

Re:Show HN: Open-source isolated browser, free for journalis... by win66 on Sunday July 26, 2020 @07:36AM (#23956303)
This is really cool, I'm just building an image now. Excited to try it out. One small error is I think you are missing a '\' from the end of line 7 (repository flag)

edit:

I just got this error trying to build an image. Any idea what's wrong or how to fix it?

    ERROR: unsatisfiable constraints:
      novnc (missing):
        required by: world[novnc]
    The command '/bin/sh -c apk add --no-cache chromium   && yarn add puppeteer-core   && apk add   --no-cache   --repository http://dl-cdn.alpinelinux.org/alpine/edge/main novnc' returned a non-zero code: 1
I would super like to try this out! :)
Re:Show HN: Open-source isolated browser, free for journalis... by techntoke on Sunday July 26, 2020 @07:55AM (#23956398)
Thanks! It looks like the novnc package is in testing, not main:

http://dl-cdn.alpinelinux.org/alpine/edge/testing

Please note I did oversimplify this a bit. You'll still need something like WayVNC, but it doesn't have WebSocket support yet. You can track it here:

https://github.com/any1/neatvnc/issues/2

In the meantime, you should be able to use websockify (there is an alpine package already).

For a simple app, I'd recommend cage which is a kiosk wayland WM for a single app:

https://pkgs.alpinelinux.org/package/edge/community/x86_64/c...

Here is an example for Sway that you could use for Cage as well:

https://github.com/any1/wayvnc/blob/master/FAQ.md

Re:Show HN: Open-source isolated browser, free for journalis... by win66 on Sunday July 26, 2020 @08:05AM (#23956476)
Wow, you really nailed it! Thanks, I'm definitely going to build this :)
Re:Show HN: Open-source isolated browser, free for journalis... by techntoke on Sunday July 26, 2020 @08:10AM (#23956500)
Sweet. I got it working but haven't automated it yet. I'll try to share a link eventually.