iceweasel-uxp.bash 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/bash
  2. set -euo pipefail
  3. (exec bwrap \
  4. --proc /proc \
  5. --dev /dev \
  6. --tmpfs /tmp \
  7. --dev-bind /dev/dri /dev/dri \
  8. --dev-bind /dev/snd /dev/snd \
  9. --ro-bind /etc/fonts/ /etc/fonts/ \
  10. --ro-bind /etc/sndio.conf /etc/sndio.conf \
  11. --ro-bind /etc/ssl/certs /etc/ssl/certs \
  12. --ro-bind /etc/resolv.conf /etc/resolv.conf \
  13. --ro-bind /lib /lib \
  14. --ro-bind /lib64 /lib64 \
  15. --ro-bind /sys/dev/char /sys/dev/char \
  16. --ro-bind /sys/devices /sys/devices \
  17. --ro-bind /usr/bin /usr/bin \
  18. --ro-bind /usr/include/fontconfig /usr/include/fontconfig \
  19. --ro-bind /usr/lib /usr/lib \
  20. --ro-bind /usr/lib64 /usr/lib64 \
  21. --ro-bind /usr/share/alsa /usr/share/alsa \
  22. --ro-bind /usr/share/applications /usr/share/applications \
  23. --ro-bind /usr/share/ca-certificates /usr/share/ca-certificates \
  24. --ro-bind /usr/share/fonts /usr/share/fonts \
  25. --ro-bind /usr/share/glib-2.0 /usr/share/glib-2.0 \
  26. --ro-bind /usr/share/icons /usr/share/icons \
  27. --ro-bind /usr/share/libdrm /usr/share/libdrm \
  28. --ro-bind /usr/share/mime /usr/share/mime \
  29. --ro-bind /usr/share/X11/xkb /usr/share/X11/xkb \
  30. --ro-bind /var/cache/fontconfig /var/cache/fontconfig \
  31. --ro-bind /var/lib/alsa /var/lib/alsa \
  32. --bind-try /tmp/sndio /tmp/sndio \
  33. --bind-try /tmp/sndio-"$(id -u)" /tmp/sndio-"$(id -u)" \
  34. --bind-try "${HOME}/.sndio" "${HOME}/.sndio" \
  35. --ro-bind "${HOME}/.Xauthority" "${HOME}/.Xauthority" \
  36. --bind "${HOME}/.cache/hyperbola" "${HOME}/.cache/hyperbola" \
  37. --bind "${HOME}/.hyperbola" "${HOME}/.hyperbola" \
  38. --bind "${HOME}/.config/gtk-2.0" "${HOME}/.config/gtk-2.0" \
  39. --bind "${HOME}/.gtkrc-2.0" "${HOME}/.gtkrc-2.0" \
  40. --bind "${HOME}/.icons" "${HOME}/.icons" \
  41. --bind "${HOME}/.local/share/fonts" "${HOME}/.local/share/fonts" \
  42. --bind "${HOME}/.themes" "${HOME}/.themes" \
  43. --bind "$(xdg-user-dir DOWNLOAD)" "$(xdg-user-dir DOWNLOAD)" \
  44. --chdir "${HOME}" \
  45. --unshare-all \
  46. --share-net \
  47. --die-with-parent \
  48. --hostname RESTRICTED \
  49. --setenv SHELL /bin/false \
  50. --setenv PATH /usr/bin \
  51. --file 11 /etc/passwd \
  52. --file 12 /etc/group \
  53. --new-session \
  54. /usr/bin/iceweasel-uxp) \
  55. 11< <(getent passwd $UID 65534 audio) \
  56. 12< <(getent group "$(id -g)" 65534 audio)
  57. # note: running iceweasel-uxp mode sanbox