summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan-boikov <ik.boikov.public@protonmail.com>2024-05-18 19:52:53 +0200
committerivan-boikov <ik.boikov.public@protonmail.com>2024-05-18 19:52:53 +0200
commit66a0e21edbdb903eba7dcea76c1a4d1634b7ab7f (patch)
treec234a8b71f55a3f39f3587abcafdcc6b7ccad6a2
parent5e29f15b7794db9cb038fc0ccfcd9a75612762d3 (diff)
Arkenfox user.js v122
-rw-r--r--README.md6
-rw-r--r--www-misc/arkenfox/Manifest2
-rw-r--r--www-misc/arkenfox/arkenfox-122.ebuild67
3 files changed, 72 insertions, 3 deletions
diff --git a/README.md b/README.md
index 447d6cd..6501468 100644
--- a/README.md
+++ b/README.md
@@ -10,12 +10,12 @@ Essential privacy and usability addons for Firefox, handled like Gentoo packages
1. `eselect repository add genfox-overlay git https://github.com/ivan-boikov/genfox-overlay.git`
2. `emaint sync --repo genfox-overlay`
3. `emerge www-misc/firefox-policy` installs a system-wide policy for blocking updates for the browser and addons specified with USE flags.
+4. `emerge www-misc/arkenfox` installs the [arkenfox](https://github.com/arkenfox/user.js) configuration.
+**WARNING by default this clears your history on exit, among other potentially destructive things.**
+Apply user-overrides.js with `savedconfig` USE flag.
## Notes
* Addon policies are permissive: they can be disabled/deleted by a user.
* [Since 2020 Firefox no longer supports addon sideloading](https://blog.mozilla.org/addons/2020/03/10/support-for-extension-sideloading-has-ended) except for [ESR, Developer, Nightly and unbranded editions](https://support.mozilla.org/en-US/kb/add-on-signing-in-firefox).
Only binary packages for addons are supported, although there is a source-based `uBlock Origin` package.
* [Excess addons harm privacy](https://github.com/arkenfox/user.js/wiki/4.1-Extensions), so only a few addons are included.
-
-## TODO
-* arkenfox configs
diff --git a/www-misc/arkenfox/Manifest b/www-misc/arkenfox/Manifest
new file mode 100644
index 0000000..6ebf5cb
--- /dev/null
+++ b/www-misc/arkenfox/Manifest
@@ -0,0 +1,2 @@
+DIST 122.0.tar.gz 41602 BLAKE2B d8cab12236241baafda61c3e2f45ece3973246af7f3fb61d8618a06ed6a9e969d298f4c750b1e805a356a11e62280656cc961342052da24b29bd9c94d608452b SHA512 5c5dd630f762216b455abb60846f9655180dcd2aad2d32cc685f68af7c4f8d5937c138d42f426180375da89a5fa7614dac7e114f40071db4d254240d3fd2c29f
+EBUILD arkenfox-122.ebuild 1875 BLAKE2B 52c9da8c62cbf759ae4e69696b4445bf02fedc3ff8c6a30f055dd2c605dbbb7bd5f70d4446fe03003246f6871ac464385e2ab4808f532cfbccdcea559c6fb02a SHA512 f27d48ced19c70a1ff386e07d7e838c25a8318ccd047e81be2312e752b274a852a130eaf81f67b1a365ebaed4b4cb4a542556dba255e89d3e1916e13fcebad94
diff --git a/www-misc/arkenfox/arkenfox-122.ebuild b/www-misc/arkenfox/arkenfox-122.ebuild
new file mode 100644
index 0000000..339a355
--- /dev/null
+++ b/www-misc/arkenfox/arkenfox-122.ebuild
@@ -0,0 +1,67 @@
+# Copyright 2024 Ivan Boikov
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit savedconfig
+
+DESCRIPTION="Firefox privacy, security and anti-tracking: a comprehensive user.js template for configuration and hardening"
+HOMEPAGE="https://github.com/arkenfox/user.js"
+VER="122.0"
+SRC_URI="https://github.com/arkenfox/user.js/archive/refs/tags/${VER}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="+savedconfig"
+
+RDEPEND="
+"
+DEPEND="${RDEPEND}"
+BDEPEND=""
+
+S="${WORKDIR}"
+
+sanitize() {
+ # firefox is restrictive about the config content, so only leave the bare minimum
+ # arkenfox's updating script does a similar thing
+ cat "$1" | grep "user_pref" | grep -v "// user_pref" | sed "s/^user_pref/pref/g"
+}
+
+src_prepare() {
+ default
+
+ tar -xf "${DISTDIR}/${VER}.tar.gz"
+
+ restore_config user-overrides.js
+ if [ ! -f "user-overrides.js" ]; then
+ echo '// user_pref("parameter", "value")' > "user-overrides.js"
+ fi
+}
+
+src_compile() {
+ echo "// IMPORTANT: Start your code on the 2nd line" > "user.js-${VER}/arkenfox.cfg"
+ sanitize "user.js-${VER}/user.js" >> "user.js-${VER}/arkenfox.cfg"
+ sanitize "user-overrides.js" >> "user.js-${VER}/arkenfox.cfg"
+}
+
+src_install() {
+ # https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig
+ dodir "/etc/firefox/defaults/pref"
+ cat >> "${D}/etc/firefox/defaults/pref/autoconfig.js" << EOF
+pref("general.config.filename", "arkenfox.cfg");
+pref("general.config.obscure_value", 0);
+EOF
+
+ # it appears we can only install configs inside the install directory
+ if [ -d "/opt/firefox" ]; then # "firefox-bin" in installed
+ dodir "/opt/firefox"
+ cp "user.js-${VER}/arkenfox.cfg" "${D}/opt/firefox/"
+ fi
+ if [ -d "/usr/lib/firefox" ]; then # "firefox" in installed
+ dodir "/usr/lib/firefox"
+ cp "user.js-${VER}/arkenfox.cfg" "${D}/usr/lib/firefox/"
+ fi
+
+ save_config user-overrides.js
+}