Skip to content

Commit

Permalink
Added option in linux for configuring firefox preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
hash3liZer committed Sep 30, 2021
1 parent 49b8f92 commit be9d77b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions proxverter/certgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,25 @@ def __import_windows(self):
else:
return 1

def __config_ln_firefox(self):
if not os.path.isdir('/usr/lib/firefox/defaults'):
return

path = "/usr/lib/firefox/"
autoconfig = os.path.join(path, 'defaults/pref/autoconfig.js')
proxconfig = os.path.join(path, 'proxverter.cfg')

fl = open(autoconfig, 'w')
fl.write('pref("general.config.filename", "proxverter.cfg");\n')
fl.write('pref("general.config.obscure_value", 0);\n')
fl.close()

fl = open(proxconfig, 'w')
fl.write('//\n')
fl.write('lockPref("network.proxy.type", 5);\n')
fl.write('lockPref("security.enterprise_roots.enabled", true);\n')
fl.close()

def __import_linux(self):
globals()["pwd"] = __import__("pwd")
shutil.copy(self.home_paths['certname'], f"/usr/local/share/ca-certificates/proxverter.crt")
Expand Down Expand Up @@ -191,6 +210,7 @@ def cimport(self):
return rtval
elif plat == "linux":
rtval = self.__import_linux()
self.__config_ln_firefox()
return rtval
elif plat == "macos":
pass
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="proxverter",
version="0.4.9",
version="0.5.1",
author="hash3liZer",
author_email="admin@shellvoide.com",
description="Cross platform system wide proxy server & TLS Interception library for Python",
Expand Down

0 comments on commit be9d77b

Please sign in to comment.