Add l2 implementation

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-07-11 15:05:21 -03:00
parent f7253a79cd
commit d18b11ebd4
6 changed files with 226 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package config
import (
"flag"
"log"
"os"
"regexp"
"time"
@@ -13,14 +14,14 @@ const (
AliasnameRegex = "[0-9|a-z|A-Z|-]*"
AliasSessionRegex = "[0-9|a-z|A-Z]{8}"
AliasGroupRegex = "(" + AliasnameRegex + ")-(" + AliasSessionRegex + ")"
PWDHostPortGroupRegex = "^.*pwd(" + PWDHostnameRegex + ")(?:-?(" + PortRegex + "))?\\..*$"
PWDHostPortGroupRegex = "^.*ip(" + PWDHostnameRegex + ")(?:-?(" + PortRegex + "))?(?:\\..*)?$"
AliasPortGroupRegex = "^.*pwd" + AliasGroupRegex + "(?:-?(" + PortRegex + "))?\\..*$"
)
var NameFilter = regexp.MustCompile(PWDHostPortGroupRegex)
var AliasFilter = regexp.MustCompile(AliasPortGroupRegex)
var SSLPortNumber, PortNumber, Key, Cert, SessionsFile, PWDContainerName, PWDCName, HashKey string
var SSLPortNumber, PortNumber, Key, Cert, SessionsFile, PWDContainerName, PWDCName, HashKey, SSHKeyPath string
var MaxLoadAvg float64
func ParseFlags() {
@@ -33,7 +34,10 @@ func ParseFlags() {
flag.StringVar(&PWDCName, "cname", "host1", "CNAME given to this host")
flag.StringVar(&HashKey, "hash_key", "salmonrosado", "Hash key to use for cookies")
flag.Float64Var(&MaxLoadAvg, "maxload", 100, "Maximum allowed load average before failing ping requests")
flag.StringVar(&SSHKeyPath, "ssh_key_path", "", "SSH Private Key to use")
flag.Parse()
log.Println("*****************************", SSHKeyPath)
}
func GetDindImageName() string {
dindImage := os.Getenv("DIND_IMAGE")