update the manager to include noui

This commit is contained in:
idk
2019-09-27 23:29:17 -04:00
parent fc36f9cf6f
commit a884fa4692
6 changed files with 40 additions and 25 deletions

View File

@ -240,3 +240,11 @@ tar:
sed:
sed -i 's|func(\*Conf)|func(samtunnel.SAMTunnel)|g' ./config/*.go
sed -i 's|func(c \*Conf)|func(c samtunnel.SAMTunnel)|g' ./config/*.go
tasks:
golint ./tcp
#golint ./udp
#golint ./config
#golint ./config
#golint ./config
#golint ./config

View File

@ -74,9 +74,10 @@ keys = httpserver
#keys = proxy
[sam-forwarder-tcp-socks-outproxy]
type = outproxy
type = client
host = 127.0.0.1
port = 8087
inbound.length = 3
inbound.length = 2
outbound.length = 3
keys = outproxy
destination = 4oymiquy7qobjgx36tejs35zeqt24qpemsnzgtfeswmrw6csxbkq.b32.i2p
keys = tcpclient

4
go.mod
View File

@ -3,14 +3,18 @@ module github.com/eyedeekay/sam-forwarder
go 1.12
require (
crawshaw.io/littleboss v0.0.0-20190317185602-8957d0aedcce
github.com/boreq/friendlyhash v0.0.0-20190522010448-1ca64b3ca69e
github.com/cryptix/goSam v0.1.0 // indirect
github.com/eyedeekay/eephttpd v0.0.0-20190903000420-52f5a8485a4e
github.com/eyedeekay/httptunnel v0.0.0-20190831071439-0ff3d5f798fb
github.com/eyedeekay/i2pdig v0.0.0-20180718204453-a67cb46e2e5f // indirect
github.com/eyedeekay/outproxy v0.0.0-20190908174238-22bd71d43733
github.com/eyedeekay/portcheck v0.0.0-20190218044454-bb8718669680
github.com/eyedeekay/sam3 v0.0.0-20190730185140-f8d54526ea25
github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69
github.com/justinas/nosurf v0.0.0-20190416172904-05988550ea18
github.com/spf13/pflag v1.0.3 // indirect
github.com/zieckey/goini v0.0.0-20180118150432-0da17d361d26
github.com/zserge/lorca v0.1.8
github.com/zserge/webview v0.0.0-20190123072648-16c93bcaeaeb

View File

@ -86,8 +86,7 @@ func SetKeyFile(s string) func(SAMTunnel) error {
}
}
//SetSaveFile tells the router to save the tunnel's keys long-term to allow a
//persistent identity
//SetDestination tells the
func SetDestination(b string) func(SAMTunnel) error {
return func(c SAMTunnel) error {
c.Config().ClientDest = b
@ -134,7 +133,7 @@ func SetPort(s string) func(SAMTunnel) error {
}
}
//SetEncrypt tells the router to use an encrypted leaseset
//SetEncrypt tells the outproxy.SetHttp to use an encrypted leaseset
func SetEncrypt(b bool) func(SAMTunnel) error {
return func(c SAMTunnel) error {
c.Config().EncryptLeaseSet = b //"false"
@ -196,7 +195,7 @@ func SetName(s string) func(SAMTunnel) error {
}
}
//SetSaveFile tells the router to save the tunnel's keys long-term
//SetSaveFile tells the application to save the tunnel's keys long-term
func SetSaveFile(b bool) func(SAMTunnel) error {
return func(c SAMTunnel) error {
c.Config().SaveFile = b

View File

@ -5,48 +5,51 @@ import (
"github.com/eyedeekay/sam3/i2pkeys"
)
// SAMTunnel is an interface comprehensively representing an I2P tunnel over SAM
// in Go
type SAMTunnel interface {
// Config returns the appropriate underlying config object all options, or
// the common options passed into a compound tunnel.
// Config returns the appropriate underlying config object all options, or
// the common options passed into a compound tunnel.
Config() *i2ptunconf.Conf
// Tunnel Options
// GetType Get the type of the tunnel in use(server, client, http, udp, etc)
// GetType Get the type of the tunnel in use(server, client, http, udp, etc)
GetType() string
// Print all the tunnel options as a string
// Print all the tunnel options as a string
Print() string
// Props Get a full list of tunnel properties as a map for user display/analysis
// Props Get a full list of tunnel properties as a map for user display/analysis
Props() map[string]string
//Search the Props for a common term
//Search the Props for a common term
Search(search string) string
//Target The address of the local client or service to forward with a SAM tunnel
//Target The address of the local client or service to forward with a SAM tunnel
Target() string
//ID The user-chosen tunnel name
//ID The user-chosen tunnel name
ID() string
//Destination() string
// Key handling
// Get the .b32.i2p address of your service
// Get the .b32.i2p address of your service
Base32() string
// Create a more-readable representation of the .b32.i2p address using English words
// Create a more-readable representation of the .b32.i2p address using English words
Base32Readable() string
// Get the public base64 address of your I2P service
// Get the public base64 address of your I2P service
Base64() string
// Get all the parts of the keys to your I2P service
// Get all the parts of the keys to your I2P service
Keys() i2pkeys.I2PKeys
// Service Management
// Prepare tunnel keys and tunnel options
// Prepare tunnel keys and tunnel options
Load() (SAMTunnel, error)
// Start the tunnel
// Start the tunnel
Serve() error
// Stop the tunnel and close all connections
// Stop the tunnel and close all connections
Close() error
// Stop the tunnel but leave the sockets alone for now
// Stop the tunnel but leave the sockets alone for now
Cleanup()
// Return "true" if the tunnel is ready to go up.
// Return "true" if the tunnel is ready to go up.
Up() bool
}
// WebUI is an interface which is used to generate a minimal UI. Open to suggestions.
type WebUI interface {
Title() string
URL() string

View File

@ -12,7 +12,7 @@ import (
func RunUI() {
}
func (s *app) Serve() bool {
func (s *SAMManager) Serve() bool {
log.Println("Starting Tunnels()")
for _, element := range s.clientMux.Tunnels() {
log.Println("Starting service tunnel", element.ID())