set enough defaults to validate new config

This commit is contained in:
idk
2020-09-20 16:58:04 -04:00
parent 87e663ed3d
commit 8be5dfbee0
18 changed files with 74 additions and 74 deletions

View File

@ -58,12 +58,12 @@ key:
[*] - i2cp.tcp.port 1-65535 7654 Router I2CP port. If the client is running in the same JVM as a router, this option is ignored, and the client connects to that router internally.
Default Description
[C] - i2cp.accessList null Comma- or space-separated list of Base64 peer Hashes used for either access list or blacklist. As of release 0.7.13.
[U] - i2cp.destination.sigType DSA_SHA1 Use the access list as a whitelist for incoming connections. The name or number of the signature type for a transient destination. As of release 0.9.12.
[C] - i2cp.enableAccessList false Use the access list as a whitelist for incoming connections. As of release 0.7.13.
[C] - i2cp.enableBlackList false Use the access list as a blacklist for incoming connections. As of release 0.7.13.
[C] - i2cp.accessList null Comma- or space-separated list of Base64 peer Hashes used for either access list or blocklist. As of release 0.7.13.
[U] - i2cp.destination.sigType DSA_SHA1 Use the access list as a allowlist for incoming connections. The name or number of the signature type for a transient destination. As of release 0.9.12.
[C] - i2cp.enableAccessList false Use the access list as a allowlist for incoming connections. As of release 0.7.13.
[C] - i2cp.enableBlackList false Use the access list as a blocklist for incoming connections. As of release 0.7.13.
[U] - i2p.streaming.answerPings true Whether to respond to incoming pings
[U] - i2p.streaming.blacklist null Comma- or space-separated list of Base64 peer Hashes to be blacklisted for incoming connections to ALL destinations in the context. This option must be set in the context properties, NOT in the createManager() options argument. Note that setting this in the router context will not affect clients outside the router in a separate JVM and context. As of release 0.9.3.
[U] - i2p.streaming.blocklist null Comma- or space-separated list of Base64 peer Hashes to be blocklisted for incoming connections to ALL destinations in the context. This option must be set in the context properties, NOT in the createManager() options argument. Note that setting this in the router context will not affect clients outside the router in a separate JVM and context. As of release 0.9.3.
[U] - i2p.streaming.bufferSize 64K How much transmit data (in bytes) will be accepted that hasn't been written out yet.
[U] - i2p.streaming.congestionAvoidanceGrowthRateFactor 1 When we're in congestion avoidance, we grow the window size at the rate of 1/(windowSize*factor). In standard TCP, window sizes are in bytes, while in I2P, window sizes are in messages. A higher number means slower growth.
[U] - i2p.streaming.connectDelay -1 How long to wait after instantiating a new con before actually attempting to connect. If this is <= 0, connect immediately with no initial data. If greater than 0, wait until the output stream is flushed, the buffer fills, or that many milliseconds pass, and include any initial data with the SYN.

View File

@ -55,12 +55,12 @@ key:
[U] - i2cp.tcp.port 1-65535 7654 Router I2CP port. If the client is running in the same JVM as a router, this option is ignored, and the client connects to that router internally.
Default Description
[U] - i2cp.accessList null Comma- or space-separated list of Base64 peer Hashes used for either access list or blacklist. As of release 0.7.13.
[U] - i2cp.destination.sigType DSA_SHA1 Use the access list as a whitelist for incoming connections. The name or number of the signature type for a transient destination. As of release 0.9.12.
[U] - i2cp.enableAccessList false Use the access list as a whitelist for incoming connections. As of release 0.7.13.
[U] - i2cp.enableBlackList false Use the access list as a blacklist for incoming connections. As of release 0.7.13.
[U] - i2cp.accessList null Comma- or space-separated list of Base64 peer Hashes used for either access list or blocklist. As of release 0.7.13.
[U] - i2cp.destination.sigType DSA_SHA1 Use the access list as a allowlist for incoming connections. The name or number of the signature type for a transient destination. As of release 0.9.12.
[U] - i2cp.enableAccessList false Use the access list as a allowlist for incoming connections. As of release 0.7.13.
[U] - i2cp.enableBlackList false Use the access list as a blocklist for incoming connections. As of release 0.7.13.
[U] - i2p.streaming.answerPings true Whether to respond to incoming pings
[U] - i2p.streaming.blacklist null Comma- or space-separated list of Base64 peer Hashes to be blacklisted for incoming connections to ALL destinations in the context. This option must be set in the context properties, NOT in the createManager() options argument. Note that setting this in the router context will not affect clients outside the router in a separate JVM and context. As of release 0.9.3.
[U] - i2p.streaming.blocklist null Comma- or space-separated list of Base64 peer Hashes to be blocklisted for incoming connections to ALL destinations in the context. This option must be set in the context properties, NOT in the createManager() options argument. Note that setting this in the router context will not affect clients outside the router in a separate JVM and context. As of release 0.9.3.
[U] - i2p.streaming.bufferSize 64K How much transmit data (in bytes) will be accepted that hasn't been written out yet.
[U] - i2p.streaming.congestionAvoidanceGrowthRateFactor 1 When we're in congestion avoidance, we grow the window size at the rate of 1/(windowSize*factor). In standard TCP, window sizes are in bytes, while in I2P, window sizes are in messages. A higher number means slower growth.
[U] - i2p.streaming.connectDelay -1 How long to wait after instantiating a new con before actually attempting to connect. If this is <= 0, connect immediately with no initial data. If greater than 0, wait until the output stream is flushed, the buffer fills, or that many milliseconds pass, and include any initial data with the SYN.

View File

@ -22,20 +22,20 @@ func (c *Conf) GetAccessListType(arg, def string, label ...string) string {
func (c *Conf) SetAccessListType(label ...string) {
if v, ok := c.GetBool("i2cp.enableBlackList", label...); ok {
if v {
c.AccessListType = "blacklist"
c.AccessListType = "blocklist"
}
}
if v, ok := c.GetBool("i2cp.enableAccessList", label...); ok {
if v {
c.AccessListType = "whitelist"
c.AccessListType = "allowlist"
}
}
if c.AccessListType != "whitelist" && c.AccessListType != "blacklist" {
if c.AccessListType != "allowlist" && c.AccessListType != "blocklist" {
c.AccessListType = "none"
}
}
// AddAccessListMember adds a member to either the blacklist or the whitelist
// AddAccessListMember adds a member to either the blocklist or the allowlist
func (c *Conf) AddAccessListMember(key string) {
for _, item := range c.AccessList {
if item == key {
@ -46,9 +46,9 @@ func (c *Conf) AddAccessListMember(key string) {
}
func (c *Conf) accesslisttype() string {
if c.AccessListType == "whitelist" {
if c.AccessListType == "allowlist" {
return "i2cp.enableAccessList=true"
} else if c.AccessListType == "blacklist" {
} else if c.AccessListType == "blocklist" {
return "i2cp.enableBlackList=true"
} else if c.AccessListType == "none" {
return ""

View File

@ -108,9 +108,9 @@ func (f *Conf) Search(search string) string {
/*
func (f *Conf) accesslisttype() string {
if f.accessListType == "whitelist" {
if f.accessListType == "allowlist" {
return "i2cp.enableAccessList=true"
} else if f.accessListType == "blacklist" {
} else if f.accessListType == "blocklist" {
return "i2cp.enableBlackList=true"
} else if f.accessListType == "none" {
return ""

View File

@ -13,7 +13,7 @@ usage:
flag needs an argument: -h
Usage of ./bin/samcatd:
-a string
Type of access list to use, can be "whitelist" "blacklist" or "none". (default "none")
Type of access list to use, can be "allowlist" "blocklist" or "none". (default "none")
-c Client proxy mode(true or false)
-conv string
Display the base32 and base64 values of a specified .i2pkeys file

View File

@ -53,12 +53,12 @@
[*] - i2cp.tcp.port 1-65535 7654 Router I2CP port. If the client is running in the same JVM as a router, this option is ignored, and the client connects to that router internally.
Default Description
[C] - i2cp.accessList null Comma- or space-separated list of Base64 peer Hashes used for either access list or blacklist. As of release 0.7.13.
[U] - i2cp.destination.sigType DSA_SHA1 Use the access list as a whitelist for incoming connections. The name or number of the signature type for a transient destination. As of release 0.9.12.
[C] - i2cp.enableAccessList false Use the access list as a whitelist for incoming connections. As of release 0.7.13.
[C] - i2cp.enableBlackList false Use the access list as a blacklist for incoming connections. As of release 0.7.13.
[C] - i2cp.accessList null Comma- or space-separated list of Base64 peer Hashes used for either access list or blocklist. As of release 0.7.13.
[U] - i2cp.destination.sigType DSA_SHA1 Use the access list as a allowlist for incoming connections. The name or number of the signature type for a transient destination. As of release 0.9.12.
[C] - i2cp.enableAccessList false Use the access list as a allowlist for incoming connections. As of release 0.7.13.
[C] - i2cp.enableBlackList false Use the access list as a blocklist for incoming connections. As of release 0.7.13.
[U] - i2p.streaming.answerPings true Whether to respond to incoming pings
[U] - i2p.streaming.blacklist null Comma- or space-separated list of Base64 peer Hashes to be blacklisted for incoming connections to ALL destinations in the context. This option must be set in the context properties, NOT in the createManager() options argument. Note that setting this in the router context will not affect clients outside the router in a separate JVM and context. As of release 0.9.3.
[U] - i2p.streaming.blocklist null Comma- or space-separated list of Base64 peer Hashes to be blocklisted for incoming connections to ALL destinations in the context. This option must be set in the context properties, NOT in the createManager() options argument. Note that setting this in the router context will not affect clients outside the router in a separate JVM and context. As of release 0.9.3.
[U] - i2p.streaming.bufferSize 64K How much transmit data (in bytes) will be accepted that hasn&#39;t been written out yet.
[U] - i2p.streaming.congestionAvoidanceGrowthRateFactor 1 When we&#39;re in congestion avoidance, we grow the window size at the rate of 1/(windowSize*factor). In standard TCP, window sizes are in bytes, while in I2P, window sizes are in messages. A higher number means slower growth.
[U] - i2p.streaming.connectDelay -1 How long to wait after instantiating a new con before actually attempting to connect. If this is &lt;= 0, connect immediately with no initial data. If greater than 0, wait until the output stream is flushed, the buffer fills, or that many milliseconds pass, and include any initial data with the SYN.

View File

@ -58,12 +58,12 @@ key:
[*] - i2cp.tcp.port 1-65535 7654 Router I2CP port. If the client is running in the same JVM as a router, this option is ignored, and the client connects to that router internally.
Default Description
[C] - i2cp.accessList null Comma- or space-separated list of Base64 peer Hashes used for either access list or blacklist. As of release 0.7.13.
[U] - i2cp.destination.sigType DSA_SHA1 Use the access list as a whitelist for incoming connections. The name or number of the signature type for a transient destination. As of release 0.9.12.
[C] - i2cp.enableAccessList false Use the access list as a whitelist for incoming connections. As of release 0.7.13.
[C] - i2cp.enableBlackList false Use the access list as a blacklist for incoming connections. As of release 0.7.13.
[C] - i2cp.accessList null Comma- or space-separated list of Base64 peer Hashes used for either access list or blocklist. As of release 0.7.13.
[U] - i2cp.destination.sigType DSA_SHA1 Use the access list as a allowlist for incoming connections. The name or number of the signature type for a transient destination. As of release 0.9.12.
[C] - i2cp.enableAccessList false Use the access list as a allowlist for incoming connections. As of release 0.7.13.
[C] - i2cp.enableBlackList false Use the access list as a blocklist for incoming connections. As of release 0.7.13.
[U] - i2p.streaming.answerPings true Whether to respond to incoming pings
[U] - i2p.streaming.blacklist null Comma- or space-separated list of Base64 peer Hashes to be blacklisted for incoming connections to ALL destinations in the context. This option must be set in the context properties, NOT in the createManager() options argument. Note that setting this in the router context will not affect clients outside the router in a separate JVM and context. As of release 0.9.3.
[U] - i2p.streaming.blocklist null Comma- or space-separated list of Base64 peer Hashes to be blocklisted for incoming connections to ALL destinations in the context. This option must be set in the context properties, NOT in the createManager() options argument. Note that setting this in the router context will not affect clients outside the router in a separate JVM and context. As of release 0.9.3.
[U] - i2p.streaming.bufferSize 64K How much transmit data (in bytes) will be accepted that hasn't been written out yet.
[U] - i2p.streaming.congestionAvoidanceGrowthRateFactor 1 When we're in congestion avoidance, we grow the window size at the rate of 1/(windowSize*factor). In standard TCP, window sizes are in bytes, while in I2P, window sizes are in messages. A higher number means slower growth.
[U] - i2p.streaming.connectDelay -1 How long to wait after instantiating a new con before actually attempting to connect. If this is <= 0, connect immediately with no initial data. If greater than 0, wait until the output stream is flushed, the buffer fills, or that many milliseconds pass, and include any initial data with the SYN.

View File

@ -4,7 +4,7 @@
<pre><code>flag needs an argument: -h
Usage of ./bin/samcatd:
-a string
Type of access list to use, can be &quot;whitelist&quot; &quot;blacklist&quot; or &quot;none&quot;. (default &quot;none&quot;)
Type of access list to use, can be &quot;allowlist&quot; &quot;blocklist&quot; or &quot;none&quot;. (default &quot;none&quot;)
-c Client proxy mode(true or false)
-conv string
Display the base32 and base64 values of a specified .i2pkeys file

View File

@ -5,14 +5,14 @@ import (
"strconv"
)
//SetAccessListType tells the system to treat the accessList as a whitelist
//SetAccessListType tells the system to treat the accessList as a allowlist
func SetAccessListType(s string) func(SAMTunnel) error {
return func(c SAMTunnel) error {
if s == "whitelist" {
c.Config().AccessListType = "whitelist"
if s == "allowlist" {
c.Config().AccessListType = "allowlist"
return nil
} else if s == "blacklist" {
c.Config().AccessListType = "blacklist"
} else if s == "blocklist" {
c.Config().AccessListType = "blocklist"
return nil
} else if s == "none" {
c.Config().AccessListType = ""
@ -21,11 +21,11 @@ func SetAccessListType(s string) func(SAMTunnel) error {
c.Config().AccessListType = ""
return nil
}
return fmt.Errorf("Invalid Access list type(whitelist, blacklist, none)")
return fmt.Errorf("Invalid Access list type(allowlist, blocklist, none)")
}
}
//SetAccessList tells the system to treat the accessList as a whitelist
//SetAccessList tells the system to treat the accessList as a allowlist
func SetAccessList(s []string) func(SAMTunnel) error {
return func(c SAMTunnel) error {
if len(s) > 0 {

View File

@ -110,7 +110,7 @@ var (
tunName = flag.String("n", "forwarder",
"Tunnel name, this must be unique but can be anything.")
accessListType = flag.String("a", "none",
"Type of access list to use, can be \"whitelist\" \"blacklist\" or \"none\".")
"Type of access list to use, can be \"allowlist\" \"blocklist\" or \"none\".")
inLength = flag.Int("il", 3,
"Set inbound tunnel length(0 to 7)")
outLength = flag.Int("ol", 3,

View File

@ -371,14 +371,14 @@ func SetClientCloseIdleTimeMs(u int) func(*SAMClientForwarder) error {
}
}
//SetClientAccessListType tells the system to treat the accessList as a whitelist
//SetClientAccessListType tells the system to treat the accessList as a allowlist
func SetClientAccessListType(s string) func(*SAMClientForwarder) error {
return func(c *SAMClientForwarder) error {
if s == "whitelist" {
c.Conf.AccessListType = "whitelist"
if s == "allowlist" {
c.Conf.AccessListType = "allowlist"
return nil
} else if s == "blacklist" {
c.Conf.AccessListType = "blacklist"
} else if s == "blocklist" {
c.Conf.AccessListType = "blocklist"
return nil
} else if s == "none" {
c.Conf.AccessListType = ""
@ -387,11 +387,11 @@ func SetClientAccessListType(s string) func(*SAMClientForwarder) error {
c.Conf.AccessListType = ""
return nil
}
return fmt.Errorf("Invalid Access list type(whitelist, blacklist, none)")
return fmt.Errorf("Invalid Access list type(allowlist, blocklist, none)")
}
}
//SetClientAccessList tells the system to treat the accessList as a whitelist
//SetClientAccessList tells the system to treat the accessList as a allowlist
func SetClientAccessList(s []string) func(*SAMClientForwarder) error {
return func(c *SAMClientForwarder) error {
if len(s) > 0 {

View File

@ -108,9 +108,9 @@ func (f *SAMClientForwarder) Search(search string) string {
}
func (f *SAMClientForwarder) accesslisttype() string {
if f.Config().AccessListType == "whitelist" {
if f.Config().AccessListType == "allowlist" {
return "i2cp.enableAccessList=true"
} else if f.Config().AccessListType == "blacklist" {
} else if f.Config().AccessListType == "blocklist" {
return "i2cp.enableBlackList=true"
} else if f.Config().AccessListType == "none" {
return ""

View File

@ -376,14 +376,14 @@ func SetCloseIdleTimeMs(u int) func(*SAMForwarder) error {
}
}
//SetAccessListType tells the system to treat the AccessList as a whitelist
//SetAccessListType tells the system to treat the AccessList as a allowlist
func SetAccessListType(s string) func(*SAMForwarder) error {
return func(c *SAMForwarder) error {
if s == "whitelist" {
c.Conf.AccessListType = "whitelist"
if s == "allowlist" {
c.Conf.AccessListType = "allowlist"
return nil
} else if s == "blacklist" {
c.Conf.AccessListType = "blacklist"
} else if s == "blocklist" {
c.Conf.AccessListType = "blocklist"
return nil
} else if s == "none" {
c.Conf.AccessListType = ""
@ -392,11 +392,11 @@ func SetAccessListType(s string) func(*SAMForwarder) error {
c.Conf.AccessListType = ""
return nil
}
return fmt.Errorf("Invalid Access list type(whitelist, blacklist, none)")
return fmt.Errorf("Invalid Access list type(allowlist, blocklist, none)")
}
}
//SetAccessList tells the system to treat the AccessList as a whitelist
//SetAccessList tells the system to treat the AccessList as a allowlist
func SetAccessList(s []string) func(*SAMForwarder) error {
return func(c *SAMForwarder) error {
if len(s) > 0 {

View File

@ -154,9 +154,9 @@ func (f *SAMForwarder) Search(search string) string {
}
func (f *SAMForwarder) accesslisttype() string {
if f.Config().AccessListType == "whitelist" {
if f.Config().AccessListType == "allowlist" {
return "i2cp.enableAccessList=true"
} else if f.Config().AccessListType == "blacklist" {
} else if f.Config().AccessListType == "blocklist" {
return "i2cp.enableBlackList=true"
} else if f.Config().AccessListType == "none" {
return ""

View File

@ -371,14 +371,14 @@ func SetClientCloseIdleTimeMs(u int) func(*SAMDGClientForwarder) error {
}
}
//SetClientAccessListType tells the system to treat the accessList as a whitelist
//SetClientAccessListType tells the system to treat the accessList as a allowlist
func SetClientAccessListType(s string) func(*SAMDGClientForwarder) error {
return func(c *SAMDGClientForwarder) error {
if s == "whitelist" {
c.Conf.AccessListType = "whitelist"
if s == "allowlist" {
c.Conf.AccessListType = "allowlist"
return nil
} else if s == "blacklist" {
c.Conf.AccessListType = "blacklist"
} else if s == "blocklist" {
c.Conf.AccessListType = "blocklist"
return nil
} else if s == "none" {
c.Conf.AccessListType = ""
@ -387,11 +387,11 @@ func SetClientAccessListType(s string) func(*SAMDGClientForwarder) error {
c.Conf.AccessListType = ""
return nil
}
return fmt.Errorf("Invalid Access list type(whitelist, blacklist, none)")
return fmt.Errorf("Invalid Access list type(allowlist, blocklist, none)")
}
}
//SetClientAccessList tells the system to treat the accessList as a whitelist
//SetClientAccessList tells the system to treat the accessList as a allowlist
func SetClientAccessList(s []string) func(*SAMDGClientForwarder) error {
return func(c *SAMDGClientForwarder) error {
if len(s) > 0 {

View File

@ -112,9 +112,9 @@ func (f *SAMDGClientForwarder) Search(search string) string {
}
func (f *SAMDGClientForwarder) accesslisttype() string {
if f.Config().AccessListType == "whitelist" {
if f.Config().AccessListType == "allowlist" {
return "i2cp.enableAccessList=true"
} else if f.Config().AccessListType == "blacklist" {
} else if f.Config().AccessListType == "blocklist" {
return "i2cp.enableBlackList=true"
} else if f.Config().AccessListType == "none" {
return ""

View File

@ -363,14 +363,14 @@ func SetCloseIdleTimeMs(u int) func(*SAMDGForwarder) error {
}
}
//SetAccessListType tells the system to treat the accessList as a whitelist
//SetAccessListType tells the system to treat the accessList as a allowlist
func SetAccessListType(s string) func(*SAMDGForwarder) error {
return func(c *SAMDGForwarder) error {
if s == "whitelist" {
c.Conf.AccessListType = "whitelist"
if s == "allowlist" {
c.Conf.AccessListType = "allowlist"
return nil
} else if s == "blacklist" {
c.Conf.AccessListType = "blacklist"
} else if s == "blocklist" {
c.Conf.AccessListType = "blocklist"
return nil
} else if s == "none" {
c.Conf.AccessListType = ""
@ -379,11 +379,11 @@ func SetAccessListType(s string) func(*SAMDGForwarder) error {
c.Conf.AccessListType = ""
return nil
}
return fmt.Errorf("Invalid Access list type(whitelist, blacklist, none)")
return fmt.Errorf("Invalid Access list type(allowlist, blocklist, none)")
}
}
//SetAccessList tells the system to treat the accessList as a whitelist
//SetAccessList tells the system to treat the accessList as a allowlist
func SetAccessList(s []string) func(*SAMDGForwarder) error {
return func(c *SAMDGForwarder) error {
if len(s) > 0 {

View File

@ -136,9 +136,9 @@ func (f *SAMDGForwarder) Search(search string) string {
}
func (f *SAMDGForwarder) accesslisttype() string {
if f.Config().AccessListType == "whitelist" {
if f.Config().AccessListType == "allowlist" {
return "i2cp.enableAccessList=true"
} else if f.Config().AccessListType == "blacklist" {
} else if f.Config().AccessListType == "blocklist" {
return "i2cp.enableBlackList=true"
} else if f.Config().AccessListType == "none" {
return ""