2 Commits

Author SHA1 Message Date
idk
1ee1d9bc68 add additional plugins! 2020-04-03 13:43:33 -04:00
idk
ff22c1f947 Fix it so it actually writes the file 2020-04-03 11:38:32 -04:00
6 changed files with 123 additions and 91 deletions

6
.gitignore vendored
View File

@@ -1,2 +1,6 @@
i2pfirefox
i2pfox
i2pfox
ifox
i2p-fox
i2pfirefox.exe
i2pfirefox-darwin

View File

@@ -1,15 +1,54 @@
VERSION=0.73
SNOW_VERSION=0.2.2
LAUNCH_VERSION=$(EXT_VERSION).01
build: setup assets.go
go build
assets.go:
go run -tags generate gen.go
setup: i2pfox/extensions/i2ppb@eyedeekay.github.io.xpi
clean:
rm -rf ifox i2pfirefox* assets.go i2pfox i2p-fox
gofmt -w -s *.go
setup: i2ppb snowflake ublock umatrix
i2ppb: ifox/i2ppb@eyedeekay.github.io.xpi
snowflake: ifox/snowflake@torproject.org.xpi
ublock: ifox/uBlock0@raymondhill.net.xpi
umatrix: ifox/uMatrix@raymondhill.net.xpi
ifox:
mkdir -p ifox
ifox/i2ppb@eyedeekay.github.io.xpi: ifox
wget -c -O ifox/i2ppb@eyedeekay.github.io.xpi https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/download/$(VERSION)/i2ppb@eyedeekay.github.io.xpi
ifox/snowflake@torproject.org.xpi: ifox/{b11bea1f-a888-4332-8d8a-cec2be7d24b9}.xpi
ifox/{b11bea1f-a888-4332-8d8a-cec2be7d24b9}.xpi: ifox
wget -c -O 'ifox/{b11bea1f-a888-4332-8d8a-cec2be7d24b9}.xpi' https://addons.mozilla.org/firefox/downloads/file/3519836/snowflake-0.2.2-fx.xpi
ifox/uBlock0@raymondhill.net.xpi: ifox
wget -c -O ifox/uBlock0@raymondhill.net.xpi https://addons.mozilla.org/firefox/downloads/file/3521827/ublock_origin-1.25.2-an+fx.xpi
ifox/uMatrix@raymondhill.net.xpi: ifox
wget -c -O ifox/uMatrix@raymondhill.net.xpi https://addons.mozilla.org/firefox/downloads/file/3396815/umatrix-1.4.0-an+fx.xpi
i2pfox/extensions/i2ppb@eyedeekay.github.io.xpi:
mkdir -p i2pfox/extensions/
wget -c -O i2pfox/extensions/i2ppb@eyedeekay.github.io.xpi https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/download/$(VERSION)/i2ppb@eyedeekay.github.io.xpi
all: setup assets.go
GOOS=windows go build -o i2pfirefox.exe
GOOS=darwin go build -o i2pfirefox-darwin
GOOS=linux go build -o i2pfirefox
release:
gothub release -p -u eyedeekay -r "i2pfirefox" -t $(LAUNCH_VERSION) -n "Launchers" -d "A self-configuring launcher for mixed I2P and clearnet Browsing with Firefox"; true
gothub upload -R -u eyedeekay -r "i2pfirefox" -t $(LAUNCH_VERSION) -n "i2pfirefox.exe" -f "i2pfirefox.exe"
gothub upload -R -u eyedeekay -r "i2pfirefox" -t $(LAUNCH_VERSION) -n "i2pfirefox-darwin" -f "i2pfirefox-darwin"
gothub upload -R -u eyedeekay -r "i2pfirefox" -t $(LAUNCH_VERSION) -n "i2pfirefox" -f "i2pfirefox"
linux-release:
gothub release -p -u eyedeekay -r "i2pfirefox" -t $(LAUNCH_VERSION) -n "Launchers" -d "A self-configuring launcher for mixed I2P and clearnet Browsing with Firefox"; true
gothub upload -R -u eyedeekay -r "i2pfirefox" -t $(LAUNCH_VERSION) -n "i2pfirefox" -f "i2pfirefox"

7
README.md Normal file
View File

@@ -0,0 +1,7 @@
I2P Profile Configuring Launcher for Firefox, Multiplatform
===========================================================
Configures a Firefox profile in the working directory with extensions and
configuration settings for I2P. At this time, it is configured for mixed I2P
and clearnet browsing via my browser plugin. In the near future, other plugins
may be configured as well as additional settings in user.js

File diff suppressed because one or more lines are too long

2
gen.go
View File

@@ -7,5 +7,5 @@ import "github.com/zserge/lorca"
func main() {
// You can also run "npm build" or webpack here, or compress assets, or
// generate manifests, or do other preparations for your assets.
lorca.Embed("main", "assets.go", "i2pfox/extensions/i2ppb@eyedeekay.github.io.xpi")
lorca.Embed("main", "assets.go", "ifox/")
}

85
main.go
View File

@@ -3,8 +3,11 @@
package main
import (
"bytes"
"io"
"io/ioutil"
"log"
"net/http"
"os"
. "github.com/eyedeekay/go-fpw"
@@ -16,30 +19,74 @@ var ARGS = []string{
/*"--example-arg",*/
}
var userdir = "i2pfox"
var PREFS = `user_pref("privacy.firstparty.isolate", true); // [SET] [SAFE=false] [!PRIV=true] whether to enable First Party Isolation (FPI) - higly suggested to set this to true- IF DISABLING FPI, READ RELEVANT SECTIONS OF USER.JS!
user_pref("privacy.resistFingerprinting", true); // [SET] [SAFE=false] [!PRIV=true] whether to enable Firefox built-in ability to resist fingerprinting by web servers (used to uniquely identify the browser)) - higly suggested to set this to true
user_pref("privacy.resistFingerprinting.letterboxing", true); // [SET] [!PRIV=true] whether to set the viewport size to a generic dimension in order to resist fingerprinting) - suggested to set this to true, however doing so may make the viewport smaller than the window
user_pref("browser.display.use_document_fonts", 0); // [SET] [SAFE=1] [!PRIV=0] whether to allow websites to use fonts they specify - 0=no, 1=yes - setting this to 0 will uglify many websites - value can be easily flipped with the Toggle Fonts add-on
user_pref("browser.download.forbid_open_with", true); // whether to allow the 'open with' option when downloading a file
user_pref("browser.library.activity-stream.enabled", false); // whether to enable Activity Stream recent Highlights in the Library`
func main() {
if embedded, err := FS.Readdir(0); err != nil {
log.Fatal("Extension error, embedded extension not read.", err)
} else {
os.MkdirAll(userdir, FS.Mode())
os.MkdirAll(userdir+"/extensions", FS.Mode())
for _, val := range embedded {
sys := val.Sys()
if sys != nil {
if _, err := os.Stat(userdir+"/extensions/"+val.Name()); !os.IsNotExist(err) {
os.Remove(userdir+"/extensions/"+val.Name())
}
if err := ioutil.WriteFile(userdir+"/extensions/"+val.Name(), sys.([]byte), val.Mode()); err != nil {
var userdir = "./i2pfox"
func writeExtension(val os.FileInfo, system http.FileSystem) {
if len(val.Name()) > 3 {
if !val.IsDir() {
file, err := system.Open(val.Name())
if err != nil {
log.Fatal(err.Error())
}
sys := bytes.NewBuffer(nil)
if _, err := io.Copy(sys, file); err != nil {
log.Fatal(err.Error())
}
log.Println(val.Name()[len(val.Name())-3:], "== xpi")
if val.Name()[len(val.Name())-3:] == "xpi" {
extension := userdir + "/extensions/" + val.Name()
if _, err := os.Stat(extension); !os.IsNotExist(err) {
os.Remove(extension)
}
if err := ioutil.WriteFile(extension, sys.Bytes(), val.Mode()); err == nil {
ARGS = append(ARGS, extension)
log.Println("wrote", extension)
} else {
log.Fatal(err)
ARGS = append(ARGS, userdir+"/extensions/"+val.Name())
log.Println(userdir + "/extensions/" + val.Name())
}else{
log.Fatal(err)
}
}
} else {
log.Println("'"+userdir+"/"+val.Name()+"'", "ignored")
}
}
} else {
log.Println("'"+userdir+"/"+val.Name()+"'", "ignored", "contents", val.Sys())
}
}
func main() {
if embedded, err := FS.Readdir(-1); err != nil {
log.Fatal("Extension error, embedded extension not read.", err)
} else {
os.MkdirAll(userdir+"/extensions", FS.Mode())
for _, val := range embedded {
if val.IsDir() {
if embedded, err := FS.Readdir(-1); err != nil {
log.Fatal("Extension error, embedded extension not read.", err)
} else {
os.MkdirAll(userdir+"/extensions", FS.Mode())
for _, val := range embedded {
writeExtension(val, FS)
}
}
} else {
writeExtension(val, FS)
}
}
}
prefs := userdir + "/user.js"
if _, err := os.Stat(prefs); os.IsNotExist(err) {
if err := ioutil.WriteFile(prefs, []byte(PREFS), 0644); err == nil {
log.Println("wrote", prefs)
} else {
log.Fatal(err)
}
}
FIREFOX, ERROR := SecureExtendedFirefox(userdir, false, EXTENSIONS, EXTENSIONHASHES, ARGS...)
if ERROR != nil {