icedove-uxp.bash 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. --ro-bind /etc/fonts/ /etc/fonts/ \
  9. --ro-bind /etc/ssl/certs /etc/ssl/certs \
  10. --ro-bind /etc/resolv.conf /etc/resolv.conf \
  11. --ro-bind /lib /lib \
  12. --ro-bind /lib64 /lib64 \
  13. --ro-bind /sys/dev/char /sys/dev/char \
  14. --ro-bind /usr/bin /usr/bin \
  15. --ro-bind /usr/include/fontconfig /usr/include/fontconfig \
  16. --ro-bind /usr/lib /usr/lib \
  17. --ro-bind /usr/lib64 /usr/lib64 \
  18. --ro-bind /usr/share/applications /usr/share/applications \
  19. --ro-bind /usr/share/ca-certificates /usr/share/ca-certificates \
  20. --ro-bind /usr/share/fonts /usr/share/fonts \
  21. --ro-bind /usr/share/glib-2.0 /usr/share/glib-2.0 \
  22. --ro-bind /usr/share/icons /usr/share/icons \
  23. --ro-bind /usr/share/libdrm /usr/share/libdrm \
  24. --ro-bind /usr/share/mime /usr/share/mime \
  25. --ro-bind /usr/share/X11/xkb /usr/share/X11/xkb \
  26. --ro-bind /var/cache/fontconfig /var/cache/fontconfig \
  27. --ro-bind "${HOME}/.Xauthority" "${HOME}/.Xauthority" \
  28. --bind "${HOME}/.cache/hyperbola" "${HOME}/.cache/hyperbola" \
  29. --bind "${HOME}/.hyperbola" "${HOME}/.hyperbola" \
  30. --bind "${HOME}/.config/gtk-2.0" "${HOME}/.config/gtk-2.0" \
  31. --bind "${HOME}/.gtkrc-2.0" "${HOME}/.gtkrc-2.0" \
  32. --bind "${HOME}/.gnupg" "${HOME}/.gnupg" \
  33. --bind "${HOME}/.icons" "${HOME}/.icons" \
  34. --bind "${HOME}/.local/share/fonts" "${HOME}/.local/share/fonts" \
  35. --bind "${HOME}/.themes" "${HOME}/.themes" \
  36. --bind "$(xdg-user-dir DOWNLOAD)" "$(xdg-user-dir DOWNLOAD)" \
  37. --chdir "${HOME}" \
  38. --unshare-all \
  39. --share-net \
  40. --die-with-parent \
  41. --hostname RESTRICTED \
  42. --setenv SHELL /bin/false \
  43. --setenv PATH /usr/bin \
  44. --file 11 /etc/passwd \
  45. --file 12 /etc/group \
  46. --new-session \
  47. /usr/bin/icedove-uxp) \
  48. 11< <(getent passwd $UID 65534) \
  49. 12< <(getent group "$(id -g)" 65534)
  50. # note: running icedove-uxp mode sanbox