瀏覽代碼

refactor: correct typo

Mustafa Arici 8 年之前
父節點
當前提交
707e209b68

+ 50 - 50
api/pb/user.pb.go

@@ -156,7 +156,7 @@ func (*UserListRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, [
 type UserCreateRequest struct {
 	Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"`
 	Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"`
-	NoGW     bool   `protobuf:"varint,3,opt,name=no_gW,json=noGW" json:"no_gW,omitempty"`
+	NoGw     bool   `protobuf:"varint,3,opt,name=no_gw,json=noGw" json:"no_gw,omitempty"`
 	HostId   uint32 `protobuf:"varint,4,opt,name=host_id,json=hostId" json:"host_id,omitempty"`
 	IsAdmin  bool   `protobuf:"varint,5,opt,name=is_admin,json=isAdmin" json:"is_admin,omitempty"`
 }
@@ -180,9 +180,9 @@ func (m *UserCreateRequest) GetPassword() string {
 	return ""
 }
 
-func (m *UserCreateRequest) GetNoGW() bool {
+func (m *UserCreateRequest) GetNoGw() bool {
 	if m != nil {
-		return m.NoGW
+		return m.NoGw
 	}
 	return false
 }
@@ -664,51 +664,51 @@ var _UserService_serviceDesc = grpc.ServiceDesc{
 func init() { proto.RegisterFile("user.proto", fileDescriptor0) }
 
 var fileDescriptor0 = []byte{
-	// 735 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xe1, 0x6e, 0xd3, 0x30,
-	0x10, 0xc7, 0x97, 0xac, 0x4d, 0x9b, 0x6b, 0xc7, 0x32, 0x77, 0x63, 0x59, 0xd9, 0xa0, 0x04, 0x09,
-	0x55, 0x43, 0x6a, 0xa1, 0xec, 0x03, 0x9a, 0x10, 0x52, 0xb5, 0x41, 0x99, 0x04, 0xe9, 0x48, 0x37,
-	0xf5, 0x63, 0x94, 0x36, 0x5e, 0x89, 0xd4, 0x39, 0xc1, 0x4e, 0xd7, 0xef, 0x48, 0x3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0xe4,
-	0xbd, 0x6d, 0x8e, 0x39, 0xe1, 0x03, 0x68, 0xf2, 0x79, 0x42, 0xb3, 0x9b, 0xca, 0x3c, 0x57, 0x0b,
-	0x68, 0xf7, 0x05, 0xcd, 0xb4, 0x2a, 0x19, 0x9a, 0x6c, 0xe5, 0xa1, 0xb2, 0xcf, 0x91, 0x52, 0x65,
-	0x73, 0x64, 0x46, 0x75, 0x4b, 0x23, 0x27, 0x22, 0x2b, 0x41, 0xca, 0xb1, 0x9f, 0x23, 0x33, 0x32,
-	0x58, 0x1a, 0xe9, 0x8b, 0x2c, 0x8e, 0xb4, 0x21, 0x2f, 0x84, 0x81, 0x36, 0xe7, 0xa9, 0x73, 0x9d,
-	0x2c, 0x00, 0xee, 0x09, 0xe0, 0xb6, 0x85, 0x32, 0x40, 0xca, 0x93, 0x38, 0x6f, 0x08, 0xfa, 0xec,
-	0x72, 0x91, 0x99, 0x66, 0xdf, 0xd4, 0x52, 0x75, 0x67, 0x81, 0x27, 0x39, 0xe0, 0xa1, 0x38, 0xe0,
-	0x9e, 0x75, 0x37, 0x73, 0xc0, 0x08, 0x13, 0x39, 0x18, 0x87, 0xca, 0xfe, 0x40, 0x13, 0xff, 0x9a,
-	0xe7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x22, 0x5f, 0xcb, 0x9b, 0x06, 0x00, 0x00,
+	// 731 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x51, 0x6e, 0xd3, 0x4c,
+	0x10, 0xc7, 0x6b, 0x37, 0x76, 0xe2, 0x49, 0xfa, 0xd5, 0xdd, 0xb4, 0x5f, 0xdd, 0xd0, 0x42, 0x30,
+	0x12, 0x8a, 0x8a, 0x94, 0x40, 0xe8, 0x03, 0xaa, 0x10, 0x52, 0xd4, 0x42, 0xa8, 0x04, 0x4e, 0x71,
+	0x5a, 0xf5, 0xd1, 0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xf8, 0xac, 0x56, 0xd1, 0x86, 0x78, 0xbb, 0xae, 0x9f, 0xb4, 0x78, 0x6f, 0x5b, 0x23, 0x4e,
+	0x78, 0x07, 0xba, 0x7c, 0x9e, 0xd0, 0xec, 0xa6, 0x72, 0xcf, 0xd5, 0x02, 0xda, 0x5d, 0x41, 0xb3,
+	0xec, 0x6a, 0x8e, 0x26, 0x5b, 0x79, 0xa8, 0xec, 0x73, 0xa4, 0x54, 0xd9, 0x1c, 0x99, 0x53, 0xdd,
+	0xd2, 0xc8, 0xb1, 0xc8, 0xca, 0x90, 0x72, 0xec, 0xe7, 0xc8, 0x9c, 0x0c, 0x96, 0x46, 0x86, 0x22,
+	0x8b, 0x23, 0x1d, 0xd0, 0x84, 0x30, 0xd0, 0xe6, 0x3c, 0x75, 0xae, 0x93, 0x05, 0xc0, 0x3d, 0x01,
+	0xdc, 0xb6, 0x51, 0x0e, 0x48, 0x79, 0x12, 0xe7, 0x05, 0x60, 0xcc, 0x2e, 0x17, 0x59, 0xd3, 0xec,
+	0x9b, 0x5a, 0xaa, 0xed, 0x2c, 0xf0, 0x64, 0x07, 0xdc, 0x17, 0x07, 0xdc, 0xb1, 0xff, 0xcf, 0x1d,
+	0x30, 0xc4, 0x44, 0x0e, 0xc6, 0xa1, 0xb2, 0x3f, 0xd0, 0xc5, 0xbf, 0xe6, 0xe9, 0xaf, 0x00, 0x00,
+	0x00, 0xff, 0xff, 0x89, 0x27, 0x01, 0x2f, 0x9b, 0x06, 0x00, 0x00,
 }

+ 1 - 1
api/pb/user.proto

@@ -11,7 +11,7 @@ message UserListRequest {
 message UserCreateRequest {
   string username = 1;
   string password = 2;
-  bool no_gW = 3;
+  bool no_gw = 3;
   uint32 host_id = 4;
   bool is_admin = 5;
 }

+ 1 - 1
api/rpc.go

@@ -92,7 +92,7 @@ func (s *UserService) List(ctx context.Context, req *pb.UserListRequest) (*pb.Us
 func (s *UserService) Create(ctx context.Context, req *pb.UserCreateRequest) (*pb.UserResponse, error) {
 	logrus.Debugf("rpc call: user create: %s", req.Username)
 	var ut []*pb.UserResponse_User
-	user, err := ovpm.CreateNewUser(req.Username, req.Password, req.NoGW, req.HostId, req.IsAdmin)
+	user, err := ovpm.CreateNewUser(req.Username, req.Password, req.NoGw, req.HostId, req.IsAdmin)
 	if err != nil {
 		return nil, err
 	}

File diff suppressed because it is too large
+ 1 - 1
bindata/bindata.go


+ 1 - 1
cmd/ovpm/user.go

@@ -122,7 +122,7 @@ var userCreateCommand = cli.Command{
 		userSvc := pb.NewUserServiceClient(conn)
 
 		response, err := userSvc.Create(context.Background(),
-			&pb.UserCreateRequest{Username: username, Password: password, NoGW: noGW, HostId: hostid, IsAdmin: admin},
+			&pb.UserCreateRequest{Username: username, Password: password, NoGw: noGW, HostId: hostid, IsAdmin: admin},
 		)
 		if err != nil {
 			logrus.Errorf("user can not be created '%s': %v", username, err)

+ 14 - 4
cmd/ovpmd/main.go

@@ -37,7 +37,11 @@ func main() {
 		},
 		cli.StringFlag{
 			Name:  "port",
-			Usage: "port number for daemon to listen on",
+			Usage: "port number for gRPC API daemon",
+		},
+		cli.StringFlag{
+			Name:  "web-port",
+			Usage: "port number for the REST API daemon",
 		},
 	}
 	app.Before = func(c *cli.Context) error {
@@ -57,7 +61,13 @@ func main() {
 		if port == "" {
 			port = "9090"
 		}
-		s := newServer(port)
+
+		webPort := c.String("web-port")
+		if webPort == "" {
+			webPort = "8080"
+		}
+
+		s := newServer(port, webPort)
 		s.start()
 		s.waitForInterrupt()
 		s.stop()
@@ -77,7 +87,7 @@ type server struct {
 	done       chan bool
 }
 
-func newServer(port string) *server {
+func newServer(port, webPort string) *server {
 	sigs := make(chan os.Signal, 1)
 	done := make(chan bool, 1)
 
@@ -110,7 +120,7 @@ func newServer(port string) *server {
 			grpcServer: rpcServer,
 			restServer: restServer,
 			restCancel: context.CancelFunc(restCancel),
-			restPort:   increasePort(port),
+			restPort:   webPort,
 			signal:     sigs,
 			done:       done,
 			grpcPort:   port,

File diff suppressed because it is too large
+ 0 - 0
template/bundle.js


+ 1 - 1
template/user.swagger.json

@@ -231,7 +231,7 @@
         "password": {
           "type": "string"
         },
-        "no_gW": {
+        "no_gw": {
           "type": "boolean",
           "format": "boolean"
         },

+ 5 - 0
vpn.go

@@ -50,6 +50,7 @@ type dbServerModel struct {
 // Server represents VPN server.
 type Server struct {
 	dbServerModel
+	webPort string
 }
 
 // CheckSerial takes a serial number and checks it against the current server's serial number.
@@ -816,7 +817,11 @@ func emitIptables() error {
 			if err != nil {
 				return err
 			}
+
+			// Find associated users and emit iptables configs for the users
+			// regarding the network's type and attributes.
 			for _, user := range users {
+				// Find out if the user is associated or not.
 				var found bool
 				for _, auser := range associatedUsernames {
 					if user.Username == auser {

+ 1 - 1
webui/ovpm/app/components/Dashboard/AdminDashboard/UserEdit/index.jsx

@@ -17,7 +17,7 @@ export default class UserEdit extends React.Component {
             password: "",
             staticIP: this.props.staticIP ? this.props.staticIP : "",
             ipAllocationMethod: this.props.ipAllocationMethod ? this.props.ipAllocationMethod : "dynamic",
-            pushGW: this.props.pushGW ? this.props.pushGW : false,
+            pushGW: this.props.pushGW != undefined ? this.props.pushGW : true,
             isAdmin: this.props.isAdmin ? this.props.isAdmin : false,
         }
 

+ 2 - 1
webui/ovpm/app/components/Dashboard/AdminDashboard/index.jsx

@@ -197,7 +197,8 @@ export default class AdminDashboard extends React.Component {
             host_id: 0, // handle this host_id problem
             is_admin: user.isAdmin,
         }
-        userObj.gwpref = user.pushGW ? "GW" : "NOGW"
+        console.log("USER", user)
+        userObj.no_gw = !user.pushGW
         userObj.admin_pref = user.isAdmin ? "ADMIN" : "NOADMIN"
         userObj.host_id = user.ipAllocationMethod === "static" ? dot2num(user.staticIP) : 0
         userObj.static_pref = user.ipAllocationMethod === "static" ? "STATIC" : "NOSTATIC"

+ 8 - 8
webui/ovpm/package-lock.json

@@ -5808,14 +5808,6 @@
       "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
       "dev": true
     },
-    "string_decoder": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
-      "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
-      "requires": {
-        "safe-buffer": "5.1.1"
-      }
-    },
     "string-template": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/string-template/-/string-template-1.0.0.tgz",
@@ -5854,6 +5846,14 @@
         }
       }
     },
+    "string_decoder": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
+      "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
+      "requires": {
+        "safe-buffer": "5.1.1"
+      }
+    },
     "stringstream": {
       "version": "0.0.5",
       "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",

File diff suppressed because it is too large
+ 0 - 0
webui/ovpm/public/bundle.js


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