Shorter flags for samcatd

This commit is contained in:
idk
2018-09-13 17:30:37 -04:00
parent 4ba85e54c1
commit fe92d3c89e
3 changed files with 113 additions and 87 deletions

View File

@@ -177,12 +177,12 @@ figure I give it a web interface to configure stuff with.
TLS configuration is experimental. TLS configuration is experimental.
-----BEGIN PGP SIGNATURE----- -----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEcNIGBzi++AUjrK/311wDs5teFOEFAluZ4F4ACgkQ11wDs5te iQEzBAEBCAAdFiEEcNIGBzi++AUjrK/311wDs5teFOEFAlua1usACgkQ11wDs5te
FOF3Dwf/S778UJLn92LpLFCzu+2mR5w6QRm+z/XYk4fjm4Vrln79BB5ubgc9l/L1 FOEpaAf+LDscldudy5jnWD/v3zfj8NCQHGzkeRA6/LO5Q4kc5BooNiBVY+V0W1Et
WVyM7c2vaSgif0S9Wx4TLnPAit448nT7bzQGadeOHWBW+cvL/xNWRDjormDl2/XI UnKSCUpWN7v2sQ0TfYb+y9mm8oTcSPSX/8ryv41xZeH/k6ifxnZnDFn0SSqXjoQt
bsaBKshwMETNRS8pliILVbTFJRHGOTePWtauzbcNG6LiIqxoNRlP+N/JZVCjnRAq EJLZ5czL+je+SR3cJMvcGdOnzffn1kneIZjOOIEFjqq3IkcrcJz1m7kEfWupPRUu
FeQ7TweEqJ0UQJy9mFApX8u72Yyvy2lbj45B5/8V0AGGFNbkZvVOe0L9UE/HLu/v xkTHOUMbU3nzdzJx5VtX+6gm5KCOo+42rBz45L7yo8stHbxAzvqOTX+BBU2SZNk8
5S5ghS41jjr3qXJb01B/UB1MIoplAuqgQ/+27h4IvG5dLaGvVmdJLjjtSAieDWlD b7nGao9G4s/f82RISuhwnw9ymtQ8soKp/AxJcGztVO8Bdqq2wM1ZNqGSg6jTrasi
L0FWkASGxn5RWCjHTtZLTsWkXStX3g== SAzJDk1v8jDfzhgzyEA+pGCompnUkw==
=CVmn =9+UQ
-----END PGP SIGNATURE----- -----END PGP SIGNATURE-----

View File

@@ -89,74 +89,67 @@ usage:
------ ------
``` ```
flag needs an argument: -h
Usage of ./bin/samcatd: Usage of ./bin/samcatd:
-access string -a string
Type of access list to use, can be "whitelist" "blacklist" or "none". (default "none") Type of access list to use, can be "whitelist" "blacklist" or "none". (default "none")
-accesslist value -accesslist value
Specify an access list member(can be used multiple times) Specify an access list member(can be used multiple times)
-client -c Client proxy mode(true or false)
Client proxy mode(true or false) -ct int
-close
Close tunnel idle(true or false)
-closetime int
Reduce tunnel quantity after X (milliseconds) (default 600000) Reduce tunnel quantity after X (milliseconds) (default 600000)
-dest string -d string
Destination for client tunnels. Ignored for service tunnels. (default "none")
-dir string
Directory to save tunnel configuration file in. Directory to save tunnel configuration file in.
-encryptlease -f string
Use an encrypted leaseset(true or false) (default true)
-gzip
Uze gzip(true or false)
-headers
Inject X-I2P-DEST headers
-host string
Target host(Host of service to forward to i2p) (default "127.0.0.1")
-inback int
Set inbound tunnel backup quantity(0 to 5) (default 4)
-incount int
Set inbound tunnel quantity(0 to 15) (default 6)
-ini string
Use an ini file for configuration(config file options override passed arguments for now.) (default "none") Use an ini file for configuration(config file options override passed arguments for now.) (default "none")
-inlen int -h string
Target host(Host of service to forward to i2p) (default "127.0.0.1")
-i string
Destination for client tunnels. Ignored for service tunnels. (default "none")
-ib int
Set inbound tunnel backup quantity(0 to 5) (default 4)
-ic int
Set inbound tunnel quantity(0 to 15) (default 6)
-ih
Inject X-I2P-DEST headers
-il int
Set inbound tunnel length(0 to 7) (default 3) Set inbound tunnel length(0 to 7) (default 3)
-invar int -iv int
Set inbound tunnel length variance(-7 to 7) Set inbound tunnel length variance(-7 to 7)
-lsk string -k string
path to saved encrypted leaseset keys (default "none") path to saved encrypted leaseset keys (default "none")
-name string -l Use an encrypted leaseset(true or false) (default true)
-n string
Tunnel name, this must be unique but can be anything. (default "forwarder") Tunnel name, this must be unique but can be anything. (default "forwarder")
-outback int -ob int
Set outbound tunnel backup quantity(0 to 5) (default 4) Set outbound tunnel backup quantity(0 to 5) (default 4)
-outcount int -oc int
Set outbound tunnel quantity(0 to 15) (default 6) Set outbound tunnel quantity(0 to 15) (default 6)
-outlen int -ol int
Set outbound tunnel length(0 to 7) (default 3) Set outbound tunnel length(0 to 7) (default 3)
-outvar int -ov int
Set outbound tunnel length variance(-7 to 7) Set outbound tunnel length variance(-7 to 7)
-port string -p string
Target port(Port of service to forward to i2p) (default "8081") Target port(Port of service to forward to i2p) (default "8081")
-reduce -r Reduce tunnel quantity when idle(true or false)
Reduce tunnel quantity when idle(true or false) -rc int
-reducecount int
Reduce idle tunnel quantity to X (0 to 5) (default 3) Reduce idle tunnel quantity to X (0 to 5) (default 3)
-reducetime int -rt int
Reduce tunnel quantity after X (milliseconds) (default 600000) Reduce tunnel quantity after X (milliseconds) (default 600000)
-samhost string -s Start a tunnel with the passed parameters(Otherwise, they will be treated as default values.)
-sh string
SAM host (default "127.0.0.1") SAM host (default "127.0.0.1")
-samport string -sp string
SAM port (default "7656") SAM port (default "7656")
-save -t Use saved file and persist tunnel(If false, tunnel will not persist after program is stopped.
Use saved file and persist tunnel(If false, tunnel will not persist after program is stopped. -tls string
-start
Start a tunnel with the passed parameters(Otherwise, they will be treated as default values.)
-tlsport string
(Currently inoperative. Target TLS port(HTTPS Port of service to forward to i2p) (Currently inoperative. Target TLS port(HTTPS Port of service to forward to i2p)
-udp -u UDP mode(true or false)
UDP mode(true or false) -x Close tunnel idle(true or false)
-zeroin -z Uze gzip(true or false)
-zi
Allow zero-hop, non-anonymous tunnels in(true or false) Allow zero-hop, non-anonymous tunnels in(true or false)
-zeroout -zo
Allow zero-hop, non-anonymous tunnels out(true or false) Allow zero-hop, non-anonymous tunnels out(true or false)
``` ```

View File

@@ -35,39 +35,72 @@ func (f *flagOpts) StringSlice() []string {
} }
var ( var (
saveFile = flag.Bool("save", false, "Use saved file and persist tunnel(If false, tunnel will not persist after program is stopped.") saveFile = flag.Bool("t", false,
startUp = flag.Bool("start", false, "Start a tunnel with the passed parameters(Otherwise, they will be treated as default values.)") "Use saved file and persist tunnel(If false, tunnel will not persist after program is stopped.")
encryptLeaseSet = flag.Bool("encryptlease", true, "Use an encrypted leaseset(true or false)") startUp = flag.Bool("s", false,
inAllowZeroHop = flag.Bool("zeroin", false, "Allow zero-hop, non-anonymous tunnels in(true or false)") "Start a tunnel with the passed parameters(Otherwise, they will be treated as default values.)")
outAllowZeroHop = flag.Bool("zeroout", false, "Allow zero-hop, non-anonymous tunnels out(true or false)") encryptLeaseSet = flag.Bool("l", true,
useCompression = flag.Bool("gzip", false, "Uze gzip(true or false)") "Use an encrypted leaseset(true or false)")
reduceIdle = flag.Bool("reduce", false, "Reduce tunnel quantity when idle(true or false)") inAllowZeroHop = flag.Bool("zi", false,
closeIdle = flag.Bool("close", false, "Close tunnel idle(true or false)") "Allow zero-hop, non-anonymous tunnels in(true or false)")
udpMode = flag.Bool("udp", false, "UDP mode(true or false)") outAllowZeroHop = flag.Bool("zo", false,
client = flag.Bool("client", false, "Client proxy mode(true or false)") "Allow zero-hop, non-anonymous tunnels out(true or false)")
injectHeaders = flag.Bool("headers", false, "Inject X-I2P-DEST headers") useCompression = flag.Bool("z", false,
encryptedLeasesetKeys = flag.String("lsk", "none", "path to saved encrypted leaseset keys") "Uze gzip(true or false)")
targetDir = flag.String("dir", "", "Directory to save tunnel configuration file in.") reduceIdle = flag.Bool("r", false,
iniFile = flag.String("ini", "none", "Use an ini file for configuration(config file options override passed arguments for now.)") "Reduce tunnel quantity when idle(true or false)")
targetDestination = flag.String("dest", "none", "Destination for client tunnels. Ignored for service tunnels.") closeIdle = flag.Bool("x", false,
targetHost = flag.String("host", "127.0.0.1", "Target host(Host of service to forward to i2p)") "Close tunnel idle(true or false)")
targetPort = flag.String("port", "8081", "Target port(Port of service to forward to i2p)") udpMode = flag.Bool("u", false,
targetPort443 = flag.String("tlsport", "", "(Currently inoperative. Target TLS port(HTTPS Port of service to forward to i2p)") "UDP mode(true or false)")
samHost = flag.String("samhost", "127.0.0.1", "SAM host") client = flag.Bool("c", false,
samPort = flag.String("samport", "7656", "SAM port") "Client proxy mode(true or false)")
tunName = flag.String("name", "forwarder", "Tunnel name, this must be unique but can be anything.") injectHeaders = flag.Bool("ih", false,
accessListType = flag.String("access", "none", "Type of access list to use, can be \"whitelist\" \"blacklist\" or \"none\".") "Inject X-I2P-DEST headers")
inLength = flag.Int("inlen", 3, "Set inbound tunnel length(0 to 7)") encryptedLeasesetKeys = flag.String("k", "none",
outLength = flag.Int("outlen", 3, "Set outbound tunnel length(0 to 7)") "path to saved encrypted leaseset keys")
inQuantity = flag.Int("incount", 6, "Set inbound tunnel quantity(0 to 15)") targetDir = flag.String("d", "",
outQuantity = flag.Int("outcount", 6, "Set outbound tunnel quantity(0 to 15)") "Directory to save tunnel configuration file in.")
inVariance = flag.Int("invar", 0, "Set inbound tunnel length variance(-7 to 7)") iniFile = flag.String("f", "none",
outVariance = flag.Int("outvar", 0, "Set outbound tunnel length variance(-7 to 7)") "Use an ini file for configuration(config file options override passed arguments for now.)")
inBackupQuantity = flag.Int("inback", 4, "Set inbound tunnel backup quantity(0 to 5)") targetDestination = flag.String("i", "none",
outBackupQuantity = flag.Int("outback", 4, "Set outbound tunnel backup quantity(0 to 5)") "Destination for client tunnels. Ignored for service tunnels.")
reduceIdleTime = flag.Int("reducetime", 600000, "Reduce tunnel quantity after X (milliseconds)") targetHost = flag.String("h", "127.0.0.1",
closeIdleTime = flag.Int("closetime", 600000, "Reduce tunnel quantity after X (milliseconds)") "Target host(Host of service to forward to i2p)")
reduceIdleQuantity = flag.Int("reducecount", 3, "Reduce idle tunnel quantity to X (0 to 5)") targetPort = flag.String("p", "8081",
"Target port(Port of service to forward to i2p)")
targetPort443 = flag.String("tls", "",
"(Currently inoperative. Target TLS port(HTTPS Port of service to forward to i2p)")
samHost = flag.String("sh", "127.0.0.1",
"SAM host")
samPort = flag.String("sp", "7656",
"SAM port")
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\".")
inLength = flag.Int("il", 3,
"Set inbound tunnel length(0 to 7)")
outLength = flag.Int("ol", 3,
"Set outbound tunnel length(0 to 7)")
inQuantity = flag.Int("ic", 6,
"Set inbound tunnel quantity(0 to 15)")
outQuantity = flag.Int("oc", 6,
"Set outbound tunnel quantity(0 to 15)")
inVariance = flag.Int("iv", 0,
"Set inbound tunnel length variance(-7 to 7)")
outVariance = flag.Int("ov", 0,
"Set outbound tunnel length variance(-7 to 7)")
inBackupQuantity = flag.Int("ib", 4,
"Set inbound tunnel backup quantity(0 to 5)")
outBackupQuantity = flag.Int("ob", 4,
"Set outbound tunnel backup quantity(0 to 5)")
reduceIdleTime = flag.Int("rt", 600000,
"Reduce tunnel quantity after X (milliseconds)")
closeIdleTime = flag.Int("ct", 600000,
"Reduce tunnel quantity after X (milliseconds)")
reduceIdleQuantity = flag.Int("rc", 3,
"Reduce idle tunnel quantity to X (0 to 5)")
) )
var err error var err error