bubblewrap-scripts/profiles/firefox

69 lines
2.4 KiB
Plaintext
Raw Normal View History

2017-02-22 21:16:05 +01:00
#!/usr/bin/env bash
set -euo pipefail
(
exec bwrap \
2018-12-23 15:55:40 +01:00
--ro-bind /usr/bin/sh /usr/bin/sh \
2019-02-12 15:51:34 +01:00
--ro-bind /usr/share /usr/share/ \
2018-12-23 15:55:40 +01:00
--ro-bind /usr/lib /usr/lib \
--ro-bind /usr/lib64 /usr/lib64 \
--symlink /usr/lib64 /lib64 \
--symlink /usr/lib /lib \
--symlink /usr/bin /bin \
--symlink /usr/bin /sbin \
--proc /proc \
--dev /dev \
--dev-bind /dev/snd /dev/snd \
--ro-bind /etc/passwd /etc/passwd \
--ro-bind /etc/group /etc/group \
--ro-bind /etc/hostname /etc/hostname \
--ro-bind /etc/hosts /etc/hosts \
--ro-bind /etc/localtime /etc/localtime \
--ro-bind /etc/nsswitch.conf /etc/nsswitch.conf \
--ro-bind /etc/resolv.conf /etc/resolv.conf \
--ro-bind /etc/xdg /etc/xdg \
--ro-bind /etc/gtk-2.0 /etc/gtk-2.0 \
--ro-bind /etc/gtk-3.0 /etc/gtk-3.0 \
--ro-bind /etc/fonts /etc/fonts \
--ro-bind /etc/mime.types /etc/mime.types \
--ro-bind /etc/pulse /etc/pulse \
2019-12-01 20:35:22 +01:00
--ro-bind /etc/asound.conf /etc/asound.conf \
2018-12-23 15:55:40 +01:00
--tmpfs /run \
2020-08-31 13:10:03 +02:00
--ro-bind /run/user/"$(id -u)"/wayland-0 /run/user/"$(id -u)"/wayland-0 \
--bind ~/.mozilla ~/.mozilla \
--bind ~/.cache/mozilla ~/.cache/mozilla \
--bind ~/Downloads ~/Downloads \
--chdir ~/ \
2018-12-23 15:55:40 +01:00
--unsetenv DBUS_SESSION_BUS_ADDRESS \
2020-08-31 13:10:03 +02:00
--setenv MOZ_ENABLE_WAYLAND 1 \
2018-12-23 15:55:40 +01:00
--unshare-user-try \
--unshare-pid \
--unshare-uts \
2020-08-31 13:10:03 +02:00
--unshare-cgroup-try \
2018-12-23 15:55:40 +01:00
--new-session \
--seccomp 10 \
10< /usr/local/bin/seccomp_default_filter.bpf \
2022-03-12 13:48:30 +01:00
/usr/lib/firefox/firefox
2017-02-22 21:16:05 +01:00
)
2022-03-12 13:48:30 +01:00
# note: For the sandbox to be effective, run on wayland environments only (instead of X11)
2020-08-31 13:10:03 +02:00
2022-03-12 13:48:30 +01:00
# in case firefox was build without the --enable-alsa flag, change to script to run with apulse like this:
# --ro-bind /usr/bin/apulse /usr/bin/apulse \
# apulse /usr/lib/firefox/firefox
2020-08-31 13:10:03 +02:00
# -ro-bind /etc/alsa /etc/alsa \
2018-08-07 19:42:21 +02:00
2017-02-22 21:16:05 +01:00
# todo:
# --ro-bind /usr/share/locale /usr/share/locale \
# --ro-bind /usr/share/X11 /usr/share/X11 \
# --ro-bind /usr/share/gtk-3.0 /usr/share/gtk-3.0 \
# --ro-bind /usr/share/fonts /usr/share/fonts \
# --ro-bind /usr/share/ca-certificates /usr/share/ca-certificates \
# --ro-bind /usr/share/icons /usr/share/icons \
# --ro-bind /usr/share/pixmaps /usr/share/pixmaps \
# --ro-bind /usr/share/mime /usr/share/mime \
# --ro-bind /usr/share/applications /usr/share/applications \
# --ro-bind /usr/share/glib-2.0 /usr/share/glib-2.0 \
# --bind /var/cache/fontconfig