Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
adbde6b498 | ||
![]() |
f448b45223 | ||
![]() |
41d5f342aa | ||
![]() |
c0db54fa84 | ||
![]() |
60f0160ba8 | ||
![]() |
f249f1c8aa | ||
![]() |
cc0093dc37 | ||
![]() |
417f316f08 | ||
![]() |
2ec5016551 | ||
![]() |
72042103ff | ||
![]() |
fb76a03b42 | ||
![]() |
441ccf30e1 | ||
![]() |
c8f1f6f20b | ||
![]() |
ed31649fc2 | ||
![]() |
db65f4dce6 | ||
![]() |
44615fc082 | ||
![]() |
1ee1d9bc68 | ||
![]() |
ff22c1f947 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,2 +1,6 @@
|
||||
i2pfirefox
|
||||
i2pfox
|
||||
i2pfox
|
||||
ifox
|
||||
i2p-fox
|
||||
i2pfirefox.exe
|
||||
i2pfirefox-darwin
|
||||
|
61
Makefile
61
Makefile
@@ -1,15 +1,66 @@
|
||||
|
||||
export GO111MODULE=on
|
||||
GO111MODULE=on
|
||||
|
||||
VERSION=0.73
|
||||
SNOW_VERSION=0.2.2
|
||||
UMAT_VERSION=1.25.2
|
||||
UBLO_VERSION=1.4.0
|
||||
LAUNCH_VERSION=$(VERSION).04
|
||||
|
||||
build: setup assets.go
|
||||
go build
|
||||
|
||||
|
||||
assets: clean setup assets.go
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
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-$(UBLO_VERSION)-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-$(UMAT_VERSION)-an+fx.xpi
|
||||
|
||||
sums: setup
|
||||
sha256sum ifox/i2ppb@eyedeekay.github.io.xpi
|
||||
sha256sum 'ifox/{b11bea1f-a888-4332-8d8a-cec2be7d24b9}.xpi'
|
||||
sha256sum ifox/uBlock0@raymondhill.net.xpi
|
||||
sha256sum ifox/uMatrix@raymondhill.net.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"
|
||||
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
7
README.md
Normal 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
|
2
gen.go
2
gen.go
@@ -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/")
|
||||
}
|
||||
|
9
go.mod
Normal file
9
go.mod
Normal file
@@ -0,0 +1,9 @@
|
||||
module github.com/eyedeekay/i2pfirefox
|
||||
|
||||
go 1.14
|
||||
|
||||
require (
|
||||
github.com/eyedeekay/checki2cp v0.0.12
|
||||
github.com/eyedeekay/go-fpw v0.0.01
|
||||
github.com/zserge/lorca v0.1.9
|
||||
)
|
13
go.sum
Normal file
13
go.sum
Normal file
@@ -0,0 +1,13 @@
|
||||
github.com/eyedeekay/checki2cp v0.0.0-20200403213308-750ce7e6d81f h1:rpkO9pKHoNxoUAH2dY9gtIRt+vDCS3t2VUq5V7ZalXA=
|
||||
github.com/eyedeekay/checki2cp v0.0.0-20200403213308-750ce7e6d81f/go.mod h1:ZilEsKkjp1K0e9qfUUdrHnz8teb1LU70L8JQzNSQmO8=
|
||||
github.com/eyedeekay/go-fpw v0.0.0-20200403201858-3d24733073ff h1:nmfiBxYeXYnUUB7sYoez7VT7mB99hFeHeZtXE69ot9A=
|
||||
github.com/eyedeekay/go-fpw v0.0.0-20200403201858-3d24733073ff/go.mod h1:F4d0cXDXTK6ZsAnxmATan3VyDV4k9P9ciCGRKt/fVik=
|
||||
github.com/eyedeekay/go-i2cp v0.0.0-20190716135428-6d41bed718b0 h1:rnn9OlD/3+tATEZNuiMR1C84O5CX8bZL2qqgttprKrw=
|
||||
github.com/eyedeekay/go-i2cp v0.0.0-20190716135428-6d41bed718b0/go.mod h1:+P0fIhkqIYjo7exMJRTlSteRMbRyHbiBiKw+YlPWk+c=
|
||||
github.com/zserge/lorca v0.1.9 h1:vbDdkqdp2/rmeg8GlyCewY2X8Z+b0s7BqWyIQL/gakc=
|
||||
github.com/zserge/lorca v0.1.9/go.mod h1:bVmnIbIRlOcoV285KIRSe4bUABKi7R7384Ycuum6e4A=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0 h1:MsuvTghUPjX762sGLnGsxC3HM0B5r83wEtYcYR8/vRs=
|
||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
103
main.go
103
main.go
@@ -3,43 +3,104 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/eyedeekay/checki2cp"
|
||||
. "github.com/eyedeekay/go-fpw"
|
||||
)
|
||||
|
||||
var EXTENSIONS = []string{"i2ppb@eyedeekay.github.io.xpi"}
|
||||
var EXTENSIONHASHES = []string{"bca6f385637c76445775af6271f8e9621966283f2f648cef9db9c635b6662f6d"}
|
||||
var EXTENSIONS = []string{
|
||||
"i2ppb@eyedeekay.github.io.xpi",
|
||||
"{b11bea1f-a888-4332-8d8a-cec2be7d24b9}.xpi",
|
||||
"uBlock0@raymondhill.net.xpi",
|
||||
"uMatrix@raymondhill.net.xpi",
|
||||
}
|
||||
var EXTENSIONHASHES = []string{
|
||||
"bca6f385637c76445775af6271f8e9621966283f2f648cef9db9c635b6662f6d",
|
||||
"f53f00ec9e689c7ddb4aaeec56bf50e61161ce7fbaaf2d2b49032c4c648120a2",
|
||||
"997aac00064665641298047534c9392492ef09f0cbf177b6a30d4fa288081579",
|
||||
"991f0fa5c64172b8a2bc0a010af60743eba1c18078c490348e1c6631882cbfc7",
|
||||
}
|
||||
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 *fs) {
|
||||
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 writeProfile(FS *fs) {
|
||||
if embedded, err := FS.Readdir(-1); err != nil {
|
||||
log.Fatal("Extension error, embedded extension not read.", err)
|
||||
} else {
|
||||
os.MkdirAll(userdir+"/extensions", 0755)
|
||||
for _, val := range embedded {
|
||||
if val.IsDir() {
|
||||
os.MkdirAll(userdir+"/"+val.Name(), val.Mode())
|
||||
} else {
|
||||
writeExtension(val, FS)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
if ok, err := checki2p.ConditionallyLaunchI2P(); ok {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
} else {
|
||||
log.Fatal("Undefined I2P launching error")
|
||||
}
|
||||
writeProfile(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 {
|
||||
|
Reference in New Issue
Block a user