Преглед изворни кода

fix(vpn): ensure client config has the correct proto

Mustafa Arici пре 8 година
родитељ
комит
25a890d07e
3 измењених фајлова са 5 додато и 3 уклоњено
  1. 2 2
      bindata/bindata.go
  2. 1 1
      template/client.ovpn.tmpl
  3. 2 0
      vpn.go

+ 2 - 2
bindata/bindata.go

@@ -92,7 +92,7 @@ func templateCcdFileTmpl() (*asset, error) {
 	return a, nil
 }
 
-var _templateClientOvpnTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x3c\xce\x31\x4b\x04\x31\x10\x05\xe0\x7e\x7e\xc5\x80\x8d\x16\xb9\x2d\xec\x64\x11\xc4\x42\x41\xd4\xab\xb4\x10\x8b\x6c\x76\xee\x36\x5c\x76\x26\x24\x93\x85\x78\xec\x7f\x97\xec\x89\xdd\xcc\xf7\x8a\xf7\xae\x50\x27\x9f\x51\x96\xc8\x78\xf0\x81\xd0\x67\xb4\x45\x65\xb6\xea\x9d\x0d\xa1\xe2\x91\x98\x92\x55\x1a\x71\xa8\xf8\xf5\xfe\xb1\x7f\xfd\xbe\x9e\x54\x63\xbe\xeb\xba\xa3\xd7\xa9\x0c\x3b\x27\x73\xe7\xec\xd8\xc9\x12\xe7\x1b\x00\x17\x3c\xb1\xc2\x48\x0b\x6a\x61\x88\x49\x54\xb0\x8c\x11\x12\xcd\xa2\x84\xe7\x33\xee\x9e\x25\x2b\xdb\x99\x70\x5d\xb7\x7f\x2f\x49\x71\x5d\x21\x51\x96\xb0\x98\x44\x9a\x2a\x7a\x3e\x78\xf6\x4a\xc0\xd9\x38\x4a\x6a\xb4\x46\xc2\x4c\x69\xa1\x04\x2c\x83\xe7\x11\x22\xa5\xec\xb3\x9a\x13\xd5\xff\xbb\xb5\x3a\x99\xa3\x09\x3f\x02\x0b\xa5\x01\x6f\xc1\x16\x9d\x0c\x8b\xb3\x6e\x22\x80\xde\xd9\x7b\x68\xbd\x8f\x0f\xb8\xae\x7d\xd7\xde\xbe\x55\xfc\x29\x6d\x6b\xfa\xee\x42\xfd\x89\xea\x25\x78\xa1\xba\xf9\x06\x4d\xfc\x01\x77\x6f\xf2\xf4\xb9\x6d\x97\xa2\x64\x58\x62\x09\xa1\x65\xc4\x63\xe3\xdf\x00\x00\x00\xff\xff\x1b\xa9\x43\x1f\x63\x01\x00\x00")
+var _templateClientOvpnTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x3c\xce\x31\x4b\xc5\x30\x10\x07\xf0\xfd\x3e\xc5\x81\x8b\x0e\x79\x1d\xdc\xa4\x08\xe2\xa0\x20\xea\x9b\x74\x10\x87\x34\xbd\xbe\x86\x97\xde\x85\xe4\x5a\x88\x8f\x7e\x77\x49\x2b\x6e\x77\xbf\x3b\xf8\xff\xaf\x50\x47\x9f\x51\x96\xc8\x38\xf8\x40\xe8\x33\xda\x59\x65\xb2\xea\x9d\x0d\xa1\xe0\x89\x98\x92\x55\xea\xb1\x2b\xf8\xf5\xfe\x71\x7c\xfd\xbe\x1e\x55\x63\xbe\x6b\x9a\x93\xd7\x71\xee\x0e\x4e\xa6\xc6\xd9\xbe\x91\x25\x4e\x37\x00\x2e\x78\x62\x85\x9e\x16\xd4\x99\x21\x26\x51\xc1\xcb\x05\x0f\xc7\x6d\x5a\x57\x48\x34\x89\xd2\x66\xcf\x92\x95\xed\x44\xb8\xae\xfb\x8f\x24\xdd\x5f\xb2\x84\xc5\x24\xd2\x54\xd0\xf3\xe0\xd9\x2b\x01\x67\xe3\x28\xa9\xd1\x12\x09\x33\xa5\x85\x12\xb0\x74\x9e\x7b\x88\x94\xb2\xcf\x6a\xce\x54\xfe\xe7\x1a\xef\x64\x8a\x26\xfc\x08\x2c\x94\x3a\xbc\x05\x3b\xeb\x68\x58\x9c\x75\x23\x01\xb4\xce\xde\x43\xcd\x7d\x7c\xc0\x75\x6d\x9b\xba\xb6\x35\xe2\x4f\x69\x6b\xd3\x36\x3b\xb5\x67\x2a\xfb\xe1\x85\xca\xe6\x1b\x54\xf1\x03\x1e\xde\xe4\xe9\x73\xeb\x2e\xb3\x92\x61\x89\x73\x08\xf5\x46\xdc\x57\xfe\x0d\x00\x00\xff\xff\x94\xe5\xf3\xfc\x6c\x01\x00\x00")
 
 func templateClientOvpnTmplBytes() ([]byte, error) {
 	return bindataRead(
@@ -107,7 +107,7 @@ func templateClientOvpnTmpl() (*asset, error) {
 		return nil, err
 	}
 
-	info := bindataFileInfo{name: "template/client.ovpn.tmpl", size: 355, mode: os.FileMode(420), modTime: time.Unix(1503944154, 0)}
+	info := bindataFileInfo{name: "template/client.ovpn.tmpl", size: 364, mode: os.FileMode(420), modTime: time.Unix(1504303338, 0)}
 	a := &asset{bytes: bytes, info: info}
 	return a, nil
 }

+ 1 - 1
template/client.ovpn.tmpl

@@ -2,7 +2,7 @@
 
 client
 dev tun
-proto udp
+proto {{ .Proto }}
 remote {{ .Hostname }} {{ .Port }}
 resolv-retry infinite
 ns-cert-type server

+ 2 - 0
vpn.go

@@ -221,6 +221,7 @@ func DumpsClientConfig(username string) (string, error) {
 		Key      string
 		Cert     string
 		NoGW     bool
+		Proto    string
 	}{
 		Hostname: server.Hostname,
 		Port:     server.Port,
@@ -228,6 +229,7 @@ func DumpsClientConfig(username string) (string, error) {
 		Key:      user.Key,
 		Cert:     user.Cert,
 		NoGW:     user.NoGW,
+		Proto:    server.GetProto(),
 	}
 	data, err := bindata.Asset("template/client.ovpn.tmpl")
 	if err != nil {