mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-26 19:11:08 +01:00
feat(agent/stream): remove STREAM_PORT and use tcp multiplexing on the same port
This commit is contained in:
@@ -16,7 +16,6 @@ type NewAgentRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Host string `json:"host" binding:"required"`
|
||||
Port int `json:"port" binding:"required,min=1,max=65535"`
|
||||
StreamPort int `json:"stream_port" binding:"omitempty,min=1,max=65535"`
|
||||
Type string `json:"type" binding:"required,oneof=docker system"`
|
||||
Nightly bool `json:"nightly" binding:"omitempty"`
|
||||
ContainerRuntime agent.ContainerRuntime `json:"container_runtime" binding:"omitempty,oneof=docker podman" default:"docker"`
|
||||
@@ -69,18 +68,9 @@ func Create(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if request.StreamPort <= 0 {
|
||||
request.StreamPort = request.Port + 1
|
||||
if request.StreamPort > 65535 {
|
||||
c.JSON(http.StatusBadRequest, apitypes.Error("stream port is out of range"))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
var cfg agent.Generator = &agent.AgentEnvConfig{
|
||||
Name: request.Name,
|
||||
Port: request.Port,
|
||||
StreamPort: request.StreamPort,
|
||||
CACert: ca.String(),
|
||||
SSLCert: srv.String(),
|
||||
ContainerRuntime: request.ContainerRuntime,
|
||||
|
||||
@@ -2356,8 +2356,13 @@
|
||||
"x-nullable": false,
|
||||
"x-omitempty": false
|
||||
},
|
||||
"stream_port": {
|
||||
"type": "integer",
|
||||
"supports_tcp_stream": {
|
||||
"type": "boolean",
|
||||
"x-nullable": false,
|
||||
"x-omitempty": false
|
||||
},
|
||||
"supports_udp_stream": {
|
||||
"type": "boolean",
|
||||
"x-nullable": false,
|
||||
"x-omitempty": false
|
||||
},
|
||||
@@ -3859,11 +3864,6 @@
|
||||
"x-nullable": false,
|
||||
"x-omitempty": false
|
||||
},
|
||||
"stream_port": {
|
||||
"type": "integer",
|
||||
"maximum": 65535,
|
||||
"minimum": 1
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
||||
@@ -8,8 +8,10 @@ definitions:
|
||||
type: string
|
||||
runtime:
|
||||
$ref: '#/definitions/agent.ContainerRuntime'
|
||||
stream_port:
|
||||
type: integer
|
||||
supports_tcp_stream:
|
||||
type: boolean
|
||||
supports_udp_stream:
|
||||
type: boolean
|
||||
version:
|
||||
type: string
|
||||
type: object
|
||||
@@ -724,10 +726,6 @@ definitions:
|
||||
maximum: 65535
|
||||
minimum: 1
|
||||
type: integer
|
||||
stream_port:
|
||||
maximum: 65535
|
||||
minimum: 1
|
||||
type: integer
|
||||
type:
|
||||
enum:
|
||||
- docker
|
||||
|
||||
Reference in New Issue
Block a user