13 Commits

Author SHA1 Message Date
idk
029317222e bandwidth limits for TCP 2019-09-05 17:26:04 -04:00
idk
bcd32aa8ad bandwidth limits for TCP 2019-09-05 17:25:46 -04:00
idk
3c1a44e1d2 only limit if bytelimit > 0 2019-09-05 02:08:31 -04:00
idk
7167ba3a1c add per-client bandwidth limiter 2019-09-05 01:54:28 -04:00
idk
3ff494c374 add per-client bandwidth limiter 2019-09-05 01:45:17 -04:00
idk
aebbe18f3b bump version 2019-09-02 20:49:55 -04:00
idk
081b25d54c re-add noui version 2019-09-02 20:46:17 -04:00
idk
78306cc9e6 give more information when saving a key, like the name 2019-09-01 23:48:16 -04:00
idk
0e40939f7d ssure that a config file exists even if null 2019-09-01 21:23:00 -04:00
idk
ccc29b5e66 purge redundant config items! 2019-08-31 16:55:22 -04:00
idk
36655256c3 fix client control panel in webui 2019-08-31 15:12:08 -04:00
idk
efccedaafb next part of the migration to a single standardized config struct 2019-08-31 13:22:32 -04:00
idk
a75baf9db7 next part of the migration to a single standardized config struct 2019-08-31 13:22:12 -04:00
173 changed files with 1011 additions and 38991 deletions

View File

@@ -17,7 +17,7 @@ LOG := log/
ETC := etc/
USR := usr/
LOCAL := local/
VERSION := 0.32.03
VERSION := 0.32.07
GO111MODULE=on
@@ -27,6 +27,9 @@ echo:
find . -path ./.go -prune -o -name "*.i2pkeys" -exec rm {} \;
find . -path ./.go -prune -o -name "*.go" -exec cat {} \; | nl
tag:
gothub release -s $(GITHUB_TOKEN) -u $(USER_GH) -r $(packagename) -t v$(VERSION) -d "I2P Tunnel Management tool for Go applications"
recopy:
#find ./tcp/ -name '*.go' -exec cp -rv {} . \;
#sed -i '1s|^|//AUTO-GENERATED FOR BACKWARD COMPATIBILITY, USE ./tcp in the future\n|' *.go
@@ -37,7 +40,7 @@ fix-debian:
find ./debian -type f -exec sed -i 's|eyedeekay@safe-mail.net|hankhill19580@gmail.com|g' {} \;
try:
cd etc/samcatd/ && ../../bin/samcatd -f tunnels.ini
./bin/samcatd -f etc/samcatd/tunnels.ini
test: test-keys test-ntcp test-ssu test-config test-manager
@@ -85,6 +88,15 @@ daemon: clean-daemon bin/$(samcatd)
daemon-webview: bin/$(samcatd)-webview
daemon-cli: bin/$(samcatd)-cli
bin/$(samcatd)-cli:
mkdir -p bin
cd samcatd && go build -a -tags "netgo" \
-ldflags '-w -extldflags "-static"' \
-o ../bin/$(samcatd)-cli \
./*.go
bin/$(samcatd):
mkdir -p bin
cd samcatd && go build -a -tags "netgo static" \
@@ -101,9 +113,9 @@ bin/$(samcatd)-webview:
update:
git config --global url."git@github.com:RTradeLtd".insteadOf "https://github.com/RTradeLtd"
all: daemon daemon-webview
all: daemon-cli daemon daemon-webview
clean: clean-all
clean: clean-all echo
clean-all: clean-daemon
@@ -150,6 +162,7 @@ key-management:
example-config:
@echo "example config - valid for both ephsite and samcat" >> USAGE.md
@echo "==================================================" >> USAGE.md
@echo "" >> USAGE.md
@echo "Options are still being added, pretty much as fast as I can put them" >> USAGE.md
@echo "in. For up-to-the-minute options, see [the checklist](config/CHECKLIST.md)" >> USAGE.md
@echo "" >> USAGE.md
@@ -224,9 +237,6 @@ tar:
--exclude bin \
-cJvf ../$(packagename)_$(VERSION).orig.tar.xz .
tag:
gothub release -s $(GITHUB_TOKEN) -u $(USER_GH) -r $(packagename) -t v$(VERSION) -d "I2P Tunnel Management tool for Go applications"
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

1
config/helpers/helper.go Normal file
View File

@@ -0,0 +1 @@
package i2ptunhelper

View File

@@ -0,0 +1,225 @@
package i2ptunhelper
import (
"github.com/eyedeekay/httptunnel"
"github.com/eyedeekay/httptunnel/multiproxy"
"github.com/eyedeekay/sam-forwarder/config"
"github.com/eyedeekay/sam-forwarder/tcp"
"github.com/eyedeekay/sam-forwarder/udp"
)
func NewSAMHTTPClientFromConf(config *i2ptunconf.Conf) (*i2phttpproxy.SAMHTTPProxy, error) {
if config != nil {
return i2phttpproxy.NewHttpProxy(
i2phttpproxy.SetName(config.TunName),
i2phttpproxy.SetKeysPath(config.KeyFilePath),
i2phttpproxy.SetHost(config.SamHost),
i2phttpproxy.SetPort(config.SamPort),
i2phttpproxy.SetProxyAddr(config.TargetHost+":"+config.TargetPort),
i2phttpproxy.SetControlHost(config.ControlHost),
i2phttpproxy.SetControlPort(config.ControlPort),
i2phttpproxy.SetInLength(uint(config.InLength)),
i2phttpproxy.SetOutLength(uint(config.OutLength)),
i2phttpproxy.SetInQuantity(uint(config.InQuantity)),
i2phttpproxy.SetOutQuantity(uint(config.OutQuantity)),
i2phttpproxy.SetInBackups(uint(config.InBackupQuantity)),
i2phttpproxy.SetOutBackups(uint(config.OutBackupQuantity)),
i2phttpproxy.SetInVariance(config.InVariance),
i2phttpproxy.SetOutVariance(config.OutVariance),
i2phttpproxy.SetUnpublished(config.Client),
i2phttpproxy.SetReduceIdle(config.ReduceIdle),
i2phttpproxy.SetCompression(config.UseCompression),
i2phttpproxy.SetReduceIdleTime(uint(config.ReduceIdleTime)),
i2phttpproxy.SetReduceIdleQuantity(uint(config.ReduceIdleQuantity)),
i2phttpproxy.SetCloseIdle(config.CloseIdle),
i2phttpproxy.SetCloseIdleTime(uint(config.CloseIdleTime)),
)
}
return nil, nil
}
// NewSAMClientForwarderFromConfig generates a new SAMForwarder from a config file
func NewSAMHTTPClientFromConfig(iniFile, SamHost, SamPort string, label ...string) (*i2phttpproxy.SAMHTTPProxy, error) {
if iniFile != "none" {
config, err := i2ptunconf.NewI2PTunConf(iniFile, label...)
if err != nil {
return nil, err
}
if SamHost != "" && SamHost != "127.0.0.1" && SamHost != "localhost" {
config.SamHost = config.GetSAMHost(SamHost, config.SamHost)
}
if SamPort != "" && SamPort != "7656" {
config.SamPort = config.GetSAMPort(SamPort, config.SamPort)
}
return NewSAMHTTPClientFromConf(config)
}
return nil, nil
}
func NewSAMBrowserClientFromConf(config *i2ptunconf.Conf) (*i2pbrowserproxy.SAMMultiProxy, error) {
if config != nil {
return i2pbrowserproxy.NewHttpProxy(
i2pbrowserproxy.SetName(config.TunName),
i2pbrowserproxy.SetKeysPath(config.KeyFilePath),
i2pbrowserproxy.SetHost(config.SamHost),
i2pbrowserproxy.SetPort(config.SamPort),
i2pbrowserproxy.SetProxyAddr(config.TargetHost+":"+config.TargetPort),
i2pbrowserproxy.SetControlHost(config.ControlHost),
i2pbrowserproxy.SetControlPort(config.ControlPort),
i2pbrowserproxy.SetInLength(uint(config.InLength)),
i2pbrowserproxy.SetOutLength(uint(config.OutLength)),
i2pbrowserproxy.SetInQuantity(uint(config.InQuantity)),
i2pbrowserproxy.SetOutQuantity(uint(config.OutQuantity)),
i2pbrowserproxy.SetInBackups(uint(config.InBackupQuantity)),
i2pbrowserproxy.SetOutBackups(uint(config.OutBackupQuantity)),
i2pbrowserproxy.SetInVariance(config.InVariance),
i2pbrowserproxy.SetOutVariance(config.OutVariance),
i2pbrowserproxy.SetUnpublished(config.Client),
i2pbrowserproxy.SetReduceIdle(config.ReduceIdle),
i2pbrowserproxy.SetCompression(config.UseCompression),
i2pbrowserproxy.SetReduceIdleTime(uint(config.ReduceIdleTime)),
i2pbrowserproxy.SetReduceIdleQuantity(uint(config.ReduceIdleQuantity)),
//i2pbrowserproxy.SetCloseIdle(config.CloseIdle),
//i2pbrowserproxy.SetCloseIdleTime(uint(config.CloseIdleTime)),
)
}
return nil, nil
}
func NewSAMBrowserClientFromConfig(iniFile, SamHost, SamPort string, label ...string) (*i2pbrowserproxy.SAMMultiProxy, error) {
if iniFile != "none" {
config, err := i2ptunconf.NewI2PTunConf(iniFile, label...)
if err != nil {
return nil, err
}
if SamHost != "" && SamHost != "127.0.0.1" && SamHost != "localhost" {
config.SamHost = config.GetSAMHost(SamHost, config.SamHost)
}
if SamPort != "" && SamPort != "7656" {
config.SamPort = config.GetSAMPort(SamPort, config.SamPort)
}
return NewSAMBrowserClientFromConf(config)
}
return nil, nil
}
// NewSAMClientForwarderFromConf generates a SAMforwarder from *i2ptunconf.Conf
func NewSAMClientForwarderFromConf(config *i2ptunconf.Conf) (*samforwarder.SAMClientForwarder, error) {
if config != nil {
return samforwarder.NewSAMClientForwarderFromOptions(
samforwarder.SetClientSaveFile(config.SaveFile),
samforwarder.SetClientFilePath(config.SaveDirectory),
samforwarder.SetClientHost(config.TargetHost),
samforwarder.SetClientPort(config.TargetPort),
samforwarder.SetClientSAMHost(config.SamHost),
samforwarder.SetClientSAMPort(config.SamPort),
samforwarder.SetClientSigType(config.SigType),
samforwarder.SetClientName(config.TunName),
samforwarder.SetClientInLength(config.InLength),
samforwarder.SetClientOutLength(config.OutLength),
samforwarder.SetClientInVariance(config.InVariance),
samforwarder.SetClientOutVariance(config.OutVariance),
samforwarder.SetClientInQuantity(config.InQuantity),
samforwarder.SetClientOutQuantity(config.OutQuantity),
samforwarder.SetClientInBackups(config.InBackupQuantity),
samforwarder.SetClientOutBackups(config.OutBackupQuantity),
samforwarder.SetClientEncrypt(config.EncryptLeaseSet),
samforwarder.SetClientLeaseSetKey(config.LeaseSetKey),
samforwarder.SetClientLeaseSetPrivateKey(config.LeaseSetPrivateKey),
samforwarder.SetClientLeaseSetPrivateSigningKey(config.LeaseSetPrivateSigningKey),
samforwarder.SetClientAllowZeroIn(config.InAllowZeroHop),
samforwarder.SetClientAllowZeroOut(config.OutAllowZeroHop),
samforwarder.SetClientFastRecieve(config.FastRecieve),
samforwarder.SetClientCompress(config.UseCompression),
samforwarder.SetClientReduceIdle(config.ReduceIdle),
samforwarder.SetClientReduceIdleTimeMs(config.ReduceIdleTime),
samforwarder.SetClientReduceIdleQuantity(config.ReduceIdleQuantity),
samforwarder.SetClientCloseIdle(config.CloseIdle),
samforwarder.SetClientCloseIdleTimeMs(config.CloseIdleTime),
samforwarder.SetClientAccessListType(config.AccessListType),
samforwarder.SetClientAccessList(config.AccessList),
samforwarder.SetClientMessageReliability(config.MessageReliability),
samforwarder.SetClientPassword(config.KeyFilePath),
samforwarder.SetClientDestination(config.ClientDest),
)
}
return nil, nil
}
// NewSAMClientForwarderFromConfig generates a new SAMForwarder from a config file
func NewSAMClientForwarderFromConfig(iniFile, SamHost, SamPort string, label ...string) (*samforwarder.SAMClientForwarder, error) {
if iniFile != "none" {
config, err := i2ptunconf.NewI2PTunConf(iniFile, label...)
if err != nil {
return nil, err
}
if SamHost != "" && SamHost != "127.0.0.1" && SamHost != "localhost" {
config.SamHost = config.GetSAMHost(SamHost, config.SamHost)
}
if SamPort != "" && SamPort != "7656" {
config.SamPort = config.GetSAMPort(SamPort, config.SamPort)
}
return NewSAMClientForwarderFromConf(config)
}
return nil, nil
}
// NewSAMSSUClientForwarderFromConf generates a SAMSSUforwarder from *i2ptunconf.Conf
func NewSAMSSUClientForwarderFromConf(config *i2ptunconf.Conf) (*samforwarderudp.SAMSSUClientForwarder, error) {
if config != nil {
return samforwarderudp.NewSAMSSUClientForwarderFromOptions(
samforwarderudp.SetClientSaveFile(config.SaveFile),
samforwarderudp.SetClientFilePath(config.SaveDirectory),
samforwarderudp.SetClientHost(config.TargetHost),
samforwarderudp.SetClientPort(config.TargetPort),
samforwarderudp.SetClientSAMHost(config.SamHost),
samforwarderudp.SetClientSAMPort(config.SamPort),
samforwarderudp.SetClientSigType(config.SigType),
samforwarderudp.SetClientName(config.TunName),
samforwarderudp.SetClientInLength(config.InLength),
samforwarderudp.SetClientOutLength(config.OutLength),
samforwarderudp.SetClientInVariance(config.InVariance),
samforwarderudp.SetClientOutVariance(config.OutVariance),
samforwarderudp.SetClientInQuantity(config.InQuantity),
samforwarderudp.SetClientOutQuantity(config.OutQuantity),
samforwarderudp.SetClientInBackups(config.InBackupQuantity),
samforwarderudp.SetClientOutBackups(config.OutBackupQuantity),
samforwarderudp.SetClientEncrypt(config.EncryptLeaseSet),
samforwarderudp.SetClientLeaseSetKey(config.LeaseSetKey),
samforwarderudp.SetClientLeaseSetPrivateKey(config.LeaseSetPrivateKey),
samforwarderudp.SetClientLeaseSetPrivateSigningKey(config.LeaseSetPrivateSigningKey),
samforwarderudp.SetClientAllowZeroIn(config.InAllowZeroHop),
samforwarderudp.SetClientAllowZeroOut(config.OutAllowZeroHop),
samforwarderudp.SetClientFastRecieve(config.FastRecieve),
samforwarderudp.SetClientCompress(config.UseCompression),
samforwarderudp.SetClientReduceIdle(config.ReduceIdle),
samforwarderudp.SetClientReduceIdleTimeMs(config.ReduceIdleTime),
samforwarderudp.SetClientReduceIdleQuantity(config.ReduceIdleQuantity),
samforwarderudp.SetClientCloseIdle(config.CloseIdle),
samforwarderudp.SetClientCloseIdleTimeMs(config.CloseIdleTime),
samforwarderudp.SetClientAccessListType(config.AccessListType),
samforwarderudp.SetClientAccessList(config.AccessList),
samforwarderudp.SetClientMessageReliability(config.MessageReliability),
samforwarderudp.SetClientPassword(config.KeyFilePath),
samforwarderudp.SetClientDestination(config.ClientDest),
)
}
return nil, nil
}
func NewSAMSSUClientForwarderFromConfig(iniFile, SamHost, SamPort string, label ...string) (*samforwarderudp.SAMSSUClientForwarder, error) {
if iniFile != "none" {
config, err := i2ptunconf.NewI2PTunConf(iniFile, label...)
if err != nil {
return nil, err
}
if SamHost != "" && SamHost != "127.0.0.1" && SamHost != "localhost" {
config.SamHost = config.GetSAMHost(SamHost, config.SamHost)
}
if SamPort != "" && SamPort != "7656" {
config.SamPort = config.GetSAMPort(SamPort, config.SamPort)
}
return NewSAMSSUClientForwarderFromConf(config)
}
return nil, nil
}

View File

@@ -0,0 +1,193 @@
package i2ptunhelper
import (
"github.com/eyedeekay/eephttpd"
"github.com/eyedeekay/sam-forwarder/config"
"github.com/eyedeekay/sam-forwarder/tcp"
"github.com/eyedeekay/sam-forwarder/udp"
)
// NewSAMForwarderFromConf generates a SAMforwarder from *i2ptunconf.Conf
func NewSAMForwarderFromConf(config *i2ptunconf.Conf) (*samforwarder.SAMForwarder, error) {
if config != nil {
return samforwarder.NewSAMForwarderFromOptions(
samforwarder.SetType(config.Type),
samforwarder.SetSaveFile(config.SaveFile),
samforwarder.SetFilePath(config.SaveDirectory),
samforwarder.SetHost(config.TargetHost),
samforwarder.SetPort(config.TargetPort),
samforwarder.SetSAMHost(config.SamHost),
samforwarder.SetSAMPort(config.SamPort),
samforwarder.SetSigType(config.SigType),
samforwarder.SetName(config.TunName),
samforwarder.SetInLength(config.InLength),
samforwarder.SetOutLength(config.OutLength),
samforwarder.SetInVariance(config.InVariance),
samforwarder.SetOutVariance(config.OutVariance),
samforwarder.SetInQuantity(config.InQuantity),
samforwarder.SetOutQuantity(config.OutQuantity),
samforwarder.SetInBackups(config.InBackupQuantity),
samforwarder.SetOutBackups(config.OutBackupQuantity),
samforwarder.SetEncrypt(config.EncryptLeaseSet),
samforwarder.SetLeaseSetKey(config.LeaseSetKey),
samforwarder.SetLeaseSetPrivateKey(config.LeaseSetPrivateKey),
samforwarder.SetLeaseSetPrivateSigningKey(config.LeaseSetPrivateSigningKey),
samforwarder.SetAllowZeroIn(config.InAllowZeroHop),
samforwarder.SetAllowZeroOut(config.OutAllowZeroHop),
samforwarder.SetFastRecieve(config.FastRecieve),
samforwarder.SetCompress(config.UseCompression),
samforwarder.SetReduceIdle(config.ReduceIdle),
samforwarder.SetReduceIdleTimeMs(config.ReduceIdleTime),
samforwarder.SetReduceIdleQuantity(config.ReduceIdleQuantity),
samforwarder.SetCloseIdle(config.CloseIdle),
samforwarder.SetCloseIdleTimeMs(config.CloseIdleTime),
samforwarder.SetAccessListType(config.AccessListType),
samforwarder.SetAccessList(config.AccessList),
samforwarder.SetMessageReliability(config.MessageReliability),
samforwarder.SetKeyFile(config.KeyFilePath),
//samforwarder.SetTargetForPort443(config.TargetForPort443),
)
}
return nil, nil
}
// NewSAMForwarderFromConfig generates a new SAMForwarder from a config file
func NewSAMForwarderFromConfig(iniFile, SamHost, SamPort string, label ...string) (*samforwarder.SAMForwarder, error) {
if iniFile != "none" {
config, err := i2ptunconf.NewI2PTunConf(iniFile, label...)
if err != nil {
return nil, err
}
if SamHost != "" && SamHost != "127.0.0.1" && SamHost != "localhost" {
config.SamHost = config.GetSAMHost(SamHost, config.SamHost)
}
if SamPort != "" && SamPort != "7656" {
config.SamPort = config.GetSAMPort(SamPort, config.SamPort)
}
return NewSAMForwarderFromConf(config)
}
return nil, nil
}
// NewSAMSSUForwarderFromConf generates a SAMSSUforwarder from *i2ptunconf.Conf
func NewSAMSSUForwarderFromConf(config *i2ptunconf.Conf) (*samforwarderudp.SAMSSUForwarder, error) {
if config != nil {
return samforwarderudp.NewSAMSSUForwarderFromOptions(
samforwarderudp.SetSaveFile(config.SaveFile),
samforwarderudp.SetFilePath(config.SaveDirectory),
samforwarderudp.SetHost(config.TargetHost),
samforwarderudp.SetPort(config.TargetPort),
samforwarderudp.SetSAMHost(config.SamHost),
samforwarderudp.SetSAMPort(config.SamPort),
samforwarderudp.SetSigType(config.SigType),
samforwarderudp.SetName(config.TunName),
samforwarderudp.SetInLength(config.InLength),
samforwarderudp.SetOutLength(config.OutLength),
samforwarderudp.SetInVariance(config.InVariance),
samforwarderudp.SetOutVariance(config.OutVariance),
samforwarderudp.SetInQuantity(config.InQuantity),
samforwarderudp.SetOutQuantity(config.OutQuantity),
samforwarderudp.SetInBackups(config.InBackupQuantity),
samforwarderudp.SetOutBackups(config.OutBackupQuantity),
samforwarderudp.SetEncrypt(config.EncryptLeaseSet),
samforwarderudp.SetLeaseSetKey(config.LeaseSetKey),
samforwarderudp.SetLeaseSetPrivateKey(config.LeaseSetPrivateKey),
samforwarderudp.SetLeaseSetPrivateSigningKey(config.LeaseSetPrivateSigningKey),
samforwarderudp.SetAllowZeroIn(config.InAllowZeroHop),
samforwarderudp.SetAllowZeroOut(config.OutAllowZeroHop),
samforwarderudp.SetFastRecieve(config.FastRecieve),
samforwarderudp.SetCompress(config.UseCompression),
samforwarderudp.SetReduceIdle(config.ReduceIdle),
samforwarderudp.SetReduceIdleTimeMs(config.ReduceIdleTime),
samforwarderudp.SetReduceIdleQuantity(config.ReduceIdleQuantity),
samforwarderudp.SetCloseIdle(config.CloseIdle),
samforwarderudp.SetCloseIdleTimeMs(config.CloseIdleTime),
samforwarderudp.SetAccessListType(config.AccessListType),
samforwarderudp.SetAccessList(config.AccessList),
samforwarderudp.SetMessageReliability(config.MessageReliability),
samforwarderudp.SetKeyFile(config.KeyFilePath),
)
}
return nil, nil
}
// NewSAMSSUForwarderFromConfig generates a new SAMSSUForwarder from a config file
func NewSAMSSUForwarderFromConfig(iniFile, SamHost, SamPort string, label ...string) (*samforwarderudp.SAMSSUForwarder, error) {
if iniFile != "none" {
config, err := i2ptunconf.NewI2PTunConf(iniFile, label...)
if err != nil {
return nil, err
}
if SamHost != "" && SamHost != "127.0.0.1" && SamHost != "localhost" {
config.SamHost = config.GetSAMHost(SamHost, config.SamHost)
}
if SamPort != "" && SamPort != "7656" {
config.SamPort = config.GetSAMPort(SamPort, config.SamPort)
}
return NewSAMSSUForwarderFromConf(config)
}
return nil, nil
}
// NewEepHttpdFromConf generates a SAMforwarder from *i2ptunconf.Conf
func NewEepHttpdFromConf(config *i2ptunconf.Conf) (*eephttpd.EepHttpd, error) {
if config != nil {
return eephttpd.NewEepHttpdFromOptions(
eephttpd.SetType(config.Type),
eephttpd.SetSaveFile(config.SaveFile),
eephttpd.SetFilePath(config.SaveDirectory),
eephttpd.SetHost(config.TargetHost),
eephttpd.SetPort(config.TargetPort),
eephttpd.SetSAMHost(config.SamHost),
eephttpd.SetSAMPort(config.SamPort),
eephttpd.SetSigType(config.SigType),
eephttpd.SetName(config.TunName),
eephttpd.SetInLength(config.InLength),
eephttpd.SetOutLength(config.OutLength),
eephttpd.SetInVariance(config.InVariance),
eephttpd.SetOutVariance(config.OutVariance),
eephttpd.SetInQuantity(config.InQuantity),
eephttpd.SetOutQuantity(config.OutQuantity),
eephttpd.SetInBackups(config.InBackupQuantity),
eephttpd.SetOutBackups(config.OutBackupQuantity),
eephttpd.SetEncrypt(config.EncryptLeaseSet),
eephttpd.SetLeaseSetKey(config.LeaseSetKey),
eephttpd.SetLeaseSetPrivateKey(config.LeaseSetPrivateKey),
eephttpd.SetLeaseSetPrivateSigningKey(config.LeaseSetPrivateSigningKey),
eephttpd.SetAllowZeroIn(config.InAllowZeroHop),
eephttpd.SetAllowZeroOut(config.OutAllowZeroHop),
eephttpd.SetFastRecieve(config.FastRecieve),
eephttpd.SetCompress(config.UseCompression),
eephttpd.SetReduceIdle(config.ReduceIdle),
eephttpd.SetReduceIdleTimeMs(config.ReduceIdleTime),
eephttpd.SetReduceIdleQuantity(config.ReduceIdleQuantity),
eephttpd.SetCloseIdle(config.CloseIdle),
eephttpd.SetCloseIdleTimeMs(config.CloseIdleTime),
eephttpd.SetAccessListType(config.AccessListType),
eephttpd.SetAccessList(config.AccessList),
eephttpd.SetMessageReliability(config.MessageReliability),
eephttpd.SetKeyFile(config.KeyFilePath),
eephttpd.SetServeDir(config.ServeDirectory),
//eephttpd.SetTargetForPort443(config.TargetForPort443),
)
}
return nil, nil
}
// NewEepHttpdFromConfig generates a new EepHttpd from a config file
func NewEepHttpdFromConfig(iniFile, SamHost, SamPort string, label ...string) (*eephttpd.EepHttpd, error) {
if iniFile != "none" {
config, err := i2ptunconf.NewI2PTunConf(iniFile, label...)
if err != nil {
return nil, err
}
if SamHost != "" && SamHost != "127.0.0.1" && SamHost != "localhost" {
config.SamHost = config.GetSAMHost(SamHost, config.SamHost)
}
if SamPort != "" && SamPort != "7656" {
config.SamPort = config.GetSAMPort(SamPort, config.SamPort)
}
return NewEepHttpdFromConf(config)
}
return nil, nil
}

View File

@@ -26,6 +26,7 @@ type Conf struct {
SigType string
Type string
SaveDirectory string
ServeDirectory string
SaveFile bool
TargetHost string
TargetPort string
@@ -96,7 +97,7 @@ func (c *Conf) PrintSlice() []string {
c.lsspk(),
}
log.Println(confstring)
log.Println("Tunnel:", c.TunName, "using config:", confstring)
return confstring
}
@@ -273,6 +274,7 @@ func (c *Conf) I2PINILoad(iniFile string, label ...string) error {
c.SetPassword(label...)
c.SetControlHost(label...)
c.SetControlPort(label...)
c.SetWWWDir(label...)
if v, ok := c.Get("i2cp.accessList", label...); ok {
csv := strings.Split(v, ",")
for _, z := range csv {

View File

@@ -25,15 +25,27 @@ func (c *Conf) GetTypes(argc, argu, argh bool, def string, label ...string) stri
} else {
typ += "server"
}
if typ != def {
return typ
}
}
if def == "kcpclient" {
typ = "kcpclient"
return def
}
if def == "kcpserver" {
typ = "kcpserver"
return def
}
if typ != def {
return typ
if def == "eephttpd" {
return def
}
if def == "vpnclient" {
return def
}
if def == "vpnserver" {
return def
}
if def == "browserclient" {
return def
}
if c.Config == nil {
return typ
@@ -78,6 +90,8 @@ func (c *Conf) SetType(label ...string) {
c.Type = v
case "udpclient":
c.Type = v
case "eephttpd":
c.Type = v
case "vpnserver":
c.Type = v
case "vpnclient":

29
config/wwwdir.go Normal file
View File

@@ -0,0 +1,29 @@
package i2ptunconf
//
// GetDir takes an argument and a default. If the argument differs from the
// default, the argument is always returned. If the argument and default are
// the same and the key exists, the key is returned. If the key is absent, the
// default is returned.
func (c *Conf) GetWWWDir(arg, def string, label ...string) string {
if arg != def {
return arg
}
if c.Config == nil {
return arg
}
if x, o := c.Get("wwwdir", label...); o {
return x
}
return arg
}
// SetDir sets the key save directory from the config file
func (c *Conf) SetWWWDir(label ...string) {
if v, ok := c.Get("wwwdir", label...); ok {
c.ServeDirectory = v
} else {
c.ServeDirectory = "./www"
}
}

View File

@@ -1,27 +0,0 @@
// Copyright 2015 The Chromium Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1 +0,0 @@
[{"description":"treehash per file","signed_content":{"payload":"eyJjb250ZW50X2hhc2hlcyI6W3siYmxvY2tfc2l6ZSI6NDA5NiwiZGlnZXN0Ijoic2hhMjU2IiwiZmlsZXMiOlt7InBhdGgiOiJMSUNFTlNFIiwicm9vdF9oYXNoIjoiUGIwc2tBVUxaUzFqWldTQnctV0hIRkltRlhVcExiZDlUcVkwR2ZHSHBWcyJ9LHsicGF0aCI6ImNybC1zZXQiLCJyb290X2hhc2giOiJxZVQyMjMyaGhpQmdVellVbDg5NV9zYkJXbnFVeGR1Y2prX3dvVzAtWHdnIn0seyJwYXRoIjoibWFuaWZlc3QuanNvbiIsInJvb3RfaGFzaCI6IjRmLUdfbmRDY3p3Y3pMVWo4Y1lNODVsTnpKZ0R4VzZnNk10TXdfU0Jvb0kifV0sImZvcm1hdCI6InRyZWVoYXNoIiwiaGFzaF9ibG9ja19zaXplIjo0MDk2fV0sIml0ZW1faWQiOiJoZm5rcGltbGhoZ2llYWRkZ2ZlbWpob2ZtZmJsbW5pYiIsIml0ZW1fdmVyc2lvbiI6IjUzNDUiLCJwcm90b2NvbF92ZXJzaW9uIjoxfQ","signatures":[{"header":{"kid":"publisher"},"protected":"eyJhbGciOiJSUzI1NiJ9","signature":"DkCqhqZtm5nn1tYnzpbcothSNvmVdpOJaZW4m3Dhe188iM1tD2OkNtGJrPa6kbAZ3csxiEnv6tyGmF9CUeFskfQunyRLxHhXw3yWXR1e89qcZJMNZisopmrGjlHwXwCmuM7RRo5Qcjb2yIuTnAPg3gWBAcuoUsMoFVkGFxF77FpBnexNkh74V6-mQ-PwmhF1snqCI_mUUXlt9CDgVtCpIeHYgfGyqYIXRS-joe6D8z9OiWa9UsD2gxZPtxPjP4-6Hqs6RR1rUD7JkHKUoqdPbCvKFTjwkso1N39lsD6Eg0tWnxRZseY178aDKc-D3uFnYQsKSA632gFYMHQ28eTrIA"},{"header":{"kid":"webstore"},"protected":"eyJhbGciOiJSUzI1NiJ9","signature":"LM43s6rOa8znJq_YQ4Gc_IM4gMNIB4lVHpcv5fCLJ8OPLLcLiAebdbaxqPlGMk8a98j5_1dpU3DzKaEudJaJZfrefS_lJXEX6N345OPJSCcGYxaKoePb3JAs6ck9pd__FhTDJ2RfwT4H2OBbbv6CwkQtRFmuFyRnGMMCIbUPPJd1Ip08odVqC14RqdefeNHGxVdx_zoeBKWFAgYFSoDsZn38PbHzUeVR3JIXHO49VhLfv-Tra7vJoHHiLSlAt2Tfffn2DwEm3ptmaCfbtgxIsOceb7Mos9jGPwbUJQ8XSGoeWXyVly3qCjaOd8BOU6mitSgntcX0ZN7_h3olw17QGw"}]}}]

View File

@@ -1 +0,0 @@
1.1eee3e2bc90919b1b754fd95f8f6cb37c378f7227fb724b6ffb5233bcf5c3788

View File

@@ -1,5 +0,0 @@
{
"manifest_version": 2,
"name": "crl-set-9716886282698058642.data",
"version": "5345"
}

View File

@@ -1,8 +0,0 @@
{
"8/RrMmQlCD2Gsp14wUCE1P8r7B2C5+yE0+g79IPyRsc=": {
"expiry": 1597868021.744813,
"mode": "force-https",
"sts_include_subdomains": false,
"sts_observed": 1566332021.744818
}
}

View File

@@ -1,8 +0,0 @@
{
"8/RrMmQlCD2Gsp14wUCE1P8r7B2C5+yE0+g79IPyRsc=": {
"expiry": 1597866661.90759,
"mode": "force-https",
"sts_include_subdomains": false,
"sts_observed": 1566330661.907595
}
}

View File

@@ -1,8 +0,0 @@
{
"8/RrMmQlCD2Gsp14wUCE1P8r7B2C5+yE0+g79IPyRsc=": {
"expiry": 1597879473.799381,
"mode": "force-https",
"sts_include_subdomains": false,
"sts_observed": 1566343473.799385
}
}

View File

@@ -1 +0,0 @@
MANIFEST-000001

View File

@@ -1,3 +0,0 @@
2019/08/23-20:02:50.028 7bf Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/AutofillStrikeDatabase/MANIFEST-000001
2019/08/23-20:02:50.028 7bf Recovering log #3
2019/08/23-20:02:50.028 7bf Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/AutofillStrikeDatabase/000003.log

View File

@@ -1,3 +0,0 @@
2019/08/20-19:24:33.126 40bb Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/AutofillStrikeDatabase/MANIFEST-000001
2019/08/20-19:24:33.127 40bb Recovering log #3
2019/08/20-19:24:33.127 40bb Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/AutofillStrikeDatabase/000003.log

View File

@@ -1 +0,0 @@
MANIFEST-000001

View File

@@ -1,3 +0,0 @@
2019/08/23-20:02:50.020 7bf Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/BudgetDatabase/MANIFEST-000001
2019/08/23-20:02:50.020 7bf Recovering log #3
2019/08/23-20:02:50.020 7bf Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/BudgetDatabase/000003.log

View File

@@ -1,3 +0,0 @@
2019/08/20-19:24:33.112 40bb Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/BudgetDatabase/MANIFEST-000001
2019/08/20-19:24:33.112 40bb Recovering log #3
2019/08/20-19:24:33.112 40bb Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/BudgetDatabase/000003.log

Binary file not shown.

View File

@@ -1 +0,0 @@
MANIFEST-000001

View File

@@ -1,3 +0,0 @@
2019/08/23-20:02:51.766 7be Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Extension State/MANIFEST-000001
2019/08/23-20:02:51.766 7be Recovering log #3
2019/08/23-20:02:51.767 7be Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Extension State/000003.log

View File

@@ -1,3 +0,0 @@
2019/08/20-19:24:35.492 40b9 Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Extension State/MANIFEST-000001
2019/08/20-19:24:35.492 40b9 Recovering log #3
2019/08/20-19:24:35.493 40b9 Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Extension State/000003.log

Binary file not shown.

View File

@@ -1,3 +0,0 @@
2019/08/23-20:02:49.913 7bf Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Feature Engagement Tracker/AvailabilityDB/MANIFEST-000001
2019/08/23-20:02:49.914 7bf Recovering log #3
2019/08/23-20:02:49.918 7bf Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Feature Engagement Tracker/AvailabilityDB/000003.log

View File

@@ -1,3 +0,0 @@
2019/08/20-19:24:32.932 40bb Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Feature Engagement Tracker/AvailabilityDB/MANIFEST-000001
2019/08/20-19:24:32.932 40bb Recovering log #3
2019/08/20-19:24:32.933 40bb Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Feature Engagement Tracker/AvailabilityDB/000003.log

View File

@@ -1,3 +0,0 @@
2019/08/23-20:02:49.902 7bf Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Feature Engagement Tracker/EventDB/MANIFEST-000001
2019/08/23-20:02:49.902 7bf Recovering log #3
2019/08/23-20:02:49.902 7bf Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Feature Engagement Tracker/EventDB/000003.log

View File

@@ -1,3 +0,0 @@
2019/08/20-19:24:32.928 40bb Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Feature Engagement Tracker/EventDB/MANIFEST-000001
2019/08/20-19:24:32.928 40bb Recovering log #3
2019/08/20-19:24:32.929 40bb Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Feature Engagement Tracker/EventDB/000003.log

Binary file not shown.

View File

@@ -1 +0,0 @@
{"net":{"http_server_properties":{"servers":[{"https://accounts.google.com":{"supports_spdy":true}}],"version":5},"network_qualities":{"CAISE21lc2hhYmxlX21haW5fbm9tYXAYgICAgPj/////AQ==":"4G"}}}

View File

@@ -1 +0,0 @@
MANIFEST-000001

View File

@@ -1,3 +0,0 @@
2019/08/23-20:02:50.356 701 Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Platform Notifications/MANIFEST-000001
2019/08/23-20:02:50.356 701 Recovering log #3
2019/08/23-20:02:50.356 701 Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Platform Notifications/000003.log

View File

@@ -1,3 +0,0 @@
2019/08/20-19:24:33.517 40b9 Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Platform Notifications/MANIFEST-000001
2019/08/20-19:24:33.519 40b9 Recovering log #3
2019/08/20-19:24:33.519 40b9 Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Platform Notifications/000003.log

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
Chromium settings and storage represent user-selected preferences and information and MUST not be extracted, overwritten or modified except through Chromium defined APIs.

View File

@@ -1 +0,0 @@
{"protection":{"super_mac":"B613679A0814D9EC772F95D778C35FC5FF1697C493715653C6C712144292C5AD"}}

View File

@@ -1 +0,0 @@
MANIFEST-000001

View File

@@ -1,3 +0,0 @@
2019/08/23-20:02:49.686 709 Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Site Characteristics Database/MANIFEST-000001
2019/08/23-20:02:49.686 709 Recovering log #3
2019/08/23-20:02:49.687 709 Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Site Characteristics Database/000003.log

View File

@@ -1,3 +0,0 @@
2019/08/20-19:24:32.667 4005 Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Site Characteristics Database/MANIFEST-000001
2019/08/20-19:24:32.673 4005 Recovering log #3
2019/08/20-19:24:32.677 4005 Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Site Characteristics Database/000003.log

View File

@@ -1 +0,0 @@
MANIFEST-000001

View File

@@ -1,3 +0,0 @@
2019/08/23-20:02:49.717 709 Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Sync Data/LevelDB/MANIFEST-000001
2019/08/23-20:02:49.718 709 Recovering log #3
2019/08/23-20:02:49.718 709 Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Sync Data/LevelDB/000003.log

View File

@@ -1,3 +0,0 @@
2019/08/20-19:24:32.754 4005 Reusing MANIFEST /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Sync Data/LevelDB/MANIFEST-000001
2019/08/20-19:24:32.755 4005 Recovering log #3
2019/08/20-19:24:32.757 4005 Reusing old log /media/longterm/go/src/github.com/eyedeekay/sam-forwarder/etc/samcatd/samcatd/Default/Sync Data/LevelDB/000003.log

Some files were not shown because too many files have changed in this diff Show More