18 Commits

Author SHA1 Message Date
idk
adbde6b498 update module 2020-04-03 21:07:32 -04:00
idk
f448b45223 maybe start i2pd too 2020-04-03 20:58:14 -04:00
idk
41d5f342aa start an i2p router if one is present, only works for java i2p right now 2020-04-03 20:53:01 -04:00
idk
c0db54fa84 start an i2p router if one is present, only works for java i2p right now 2020-04-03 20:43:03 -04:00
idk
60f0160ba8 start an i2p router if one is present, only works for java i2p right now 2020-04-03 20:41:31 -04:00
idk
f249f1c8aa force modules 2020-04-03 19:55:17 -04:00
idk
cc0093dc37 force modules 2020-04-03 19:54:45 -04:00
idk
417f316f08 force modules 2020-04-03 19:54:25 -04:00
idk
2ec5016551 force modules 2020-04-03 19:53:12 -04:00
idk
72042103ff fix build 2020-04-03 19:44:41 -04:00
idk
fb76a03b42 fix build 2020-04-03 19:42:04 -04:00
idk
441ccf30e1 fix build 2020-04-03 19:30:27 -04:00
idk
c8f1f6f20b settle the assets 2020-04-03 18:56:34 -04:00
idk
ed31649fc2 try and make it launch I2P at runtime 2020-04-03 17:52:56 -04:00
idk
db65f4dce6 Fix firefox not installed message 2020-04-03 16:19:10 -04:00
idk
44615fc082 add additional plugins! 2020-04-03 15:38:36 -04:00
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
8 changed files with 177 additions and 29 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,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
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/")
}

9
go.mod Normal file
View 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
View 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
View File

@@ -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 {