Add some useful stuff to the readme.

This commit is contained in:
idk
2022-01-23 11:42:23 -05:00
parent 6d39484aef
commit de35eba687
7 changed files with 75 additions and 11 deletions

View File

@ -62,6 +62,7 @@ su3:
-desc="`cat desc`" \
-exename=$(BINARY)-$(GOOS)-$(GOARCH) \
-icondata=icon/icon.png \
-consoleurl="http://127.0.0.1:7695" \
-updateurl="http://idk.i2p/$(BINARY)/$(BINARY)-$(GOOS)-$(GOARCH).su3" \
-website="http://idk.i2p/$(BINARY)/" \
-command="$(BINARY)-$(GOOS)-$(GOARCH)" \

View File

@ -1,6 +1,55 @@
# i2p.plugins.tor-updater
A Tor package updater and runner as an I2P Plugin.
A Tor package updater and runner as an I2P Plugin. This plugin is
still being changed rapidly but it should be usable on most Linux
distributions as of 23 Jan, 2022.
Ship known-good public keys, download a current Tor for the platform in the background, authenticate it, and launch it only if necessary.
Manage it as a shellservice plugin.
Usage:
------
```sh
Usage of ./i2p.plugins.tor-manager-linux-amd64:
-arch string
OS/arch to download (default "64")
-i2pbrowser
Open I2P in Tor Browser
-lang string
Language to download
-os string
OS/arch to download (default "linux")
-torbrowser
Open Tor Browser
```
### Primary Goals
- Ship known-good public keys, download a current Tor for the platform in the background, authenticate it, and launch it only if necessary.
- Works on Windows, Linux, probably also OSX
- Supervise Tor as a ShellService plugin to I2P
- Works on Linux
- Keep Tor up-to-date
- Works on Windows, Linux, probably also OSX
- Work as an I2P Plugin OR as a freestanding app to be compatible with all I2P distributions
- Works on Linux
- Download Tor Browser from an in-I2P mirror(or one of a network of in-I2P mirrors)
- Not done
### Secondary Goals:
- Launch Tor Browser
- Works on Linux
- Configure and launch Tor browser for use with I2P
- Works on Linux
#### Optional Features I might add if there is interest
- Mirror the files which it downloads to an I2P Site
- Mirror the files which it downloads to I2P torrents
- Set up an onion site which announces an I2P mirror exists
- Use Bittorrent-over-I2P to download the Tor Browser software
### Similar Projects:
- https://github.com/micahflee/torbrowser-launcher
- https://github.com/whonix/tb-updater

1
go.mod
View File

@ -10,6 +10,7 @@ require (
)
require (
github.com/justinas/nosurf v1.1.1
github.com/mitchellh/go-ps v1.0.0
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.17.0 // indirect

2
go.sum
View File

@ -24,6 +24,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/jchavannes/go-pgp v0.0.0-20200131171414-e5978e6d02b4 h1:AfTUqDjVFyY40SghT85bXRhpj34DOuIUQLB4DwExzkQ=
github.com/jchavannes/go-pgp v0.0.0-20200131171414-e5978e6d02b4/go.mod h1:dtFptCZ3M/9AWU38htm1xFvWqaJr5ZvkiOiozne99Ps=
github.com/justinas/nosurf v1.1.1 h1:92Aw44hjSK4MxJeMSyDa7jwuI9GR2J/JCQiaKvXXSlk=
github.com/justinas/nosurf v1.1.1/go.mod h1:ALpWdSbuNGy2lZWtyXdjkYv4edL23oSEgfBT1gPJ5BQ=
github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc=
github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=

24
main.go
View File

@ -11,16 +11,20 @@ import (
//var runtimePair = tbget.GetRuntimePair()
var (
lang = flag.String("lang", "", "Language to download")
os = flag.String("os", "linux", "OS/arch to download")
arch = flag.String("arch", "64", "OS/arch to download")
browse = flag.Bool("browse", false, "Open the browser")
lang = flag.String("lang", "", "Language to download")
os = flag.String("os", "linux", "OS/arch to download")
arch = flag.String("arch", "64", "OS/arch to download")
i2pbrowser = flag.Bool("i2pbrowser", false, "Open I2P in Tor Browser")
torbrowser = flag.Bool("torbrowser", false, "Open Tor Browser")
/*mirror = flag.String("mirror", "", "Mirror to use")*/
bemirror = flag.Bool("bemirror", false, "Act as an in-I2P mirror when you're done downloading")
/*bemirror = flag.Bool("bemirror", false, "Act as an in-I2P mirror when you're done downloading")*/
)
func main() {
flag.Parse()
if *i2pbrowser == true && *torbrowser == true {
log.Fatal("Please don't open I2P and Tor Browser at the same time when running from the terminal.")
}
if *lang == "" {
var err error
*lang, err = jibber_jabber.DetectIETF()
@ -33,7 +37,13 @@ func main() {
if err != nil {
log.Fatal("Couldn't create client", err)
}
if err := client.Serve(); err != nil {
log.Fatal(err)
if *i2pbrowser {
client.TBS.RunI2PBWithLang()
} else if *torbrowser {
client.TBS.RunTBWithLang()
} else {
if err := client.Serve(); err != nil {
log.Fatal(err)
}
}
}

BIN
screenshot-console.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -9,6 +9,7 @@ import (
"path/filepath"
"strings"
"github.com/justinas/nosurf"
tbget "i2pgit.org/idk/i2p.plugins.tor-manager/get"
TBSupervise "i2pgit.org/idk/i2p.plugins.tor-manager/supervise"
)
@ -91,7 +92,7 @@ func (m *Client) ServeHTTP(rw http.ResponseWriter, rq *http.Request) {
func (m *Client) Serve() error {
//http.Handle("/", m)
go m.TBS.RunTorWithLang()
return http.ListenAndServe("127.0.0.1:7695", m)
return http.ListenAndServe("127.0.0.1:7695", nosurf.New(m))
}
func (m *Client) generateMirrorJSON() (map[string]interface{}, error) {