chore: add derpserver to wsproxy, add proxies to derpmap (#7311)

This commit is contained in:
Dean Sheather
2023-07-27 02:21:04 +10:00
committed by GitHub
parent 70692c2e4e
commit 2f0a9996e7
58 changed files with 3001 additions and 386 deletions
+85 -9
View File
@@ -530,6 +530,25 @@ const docTemplate = `{
}
}
},
"/derp-map": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"tags": [
"Agents"
],
"summary": "Get DERP map updates",
"operationId": "get-derp-map-updates",
"responses": {
"101": {
"description": "Switching Protocols"
}
}
}
},
"/entitlements": {
"get": {
"security": [
@@ -5381,28 +5400,36 @@ const docTemplate = `{
}
}
},
"/workspaceproxies/me/goingaway": {
"/workspaceproxies/me/deregister": {
"post": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"consumes": [
"application/json"
],
"tags": [
"Enterprise"
],
"summary": "Workspace proxy going away",
"operationId": "workspace-proxy-going-away",
"responses": {
"201": {
"description": "Created",
"summary": "Deregister workspace proxy",
"operationId": "deregister-workspace-proxy",
"parameters": [
{
"description": "Deregister workspace proxy request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/codersdk.Response"
"$ref": "#/definitions/wsproxysdk.DeregisterWorkspaceProxyRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
}
},
"x-apidocgen": {
"skip": true
@@ -5471,7 +5498,7 @@ const docTemplate = `{
"operationId": "register-workspace-proxy",
"parameters": [
{
"description": "Issue signed app token request",
"description": "Register workspace proxy request",
"name": "request",
"in": "body",
"required": true,
@@ -10770,6 +10797,9 @@ const docTemplate = `{
"deleted": {
"type": "boolean"
},
"derp_enabled": {
"type": "boolean"
},
"display_name": {
"type": "string"
},
@@ -11469,6 +11499,15 @@ const docTemplate = `{
}
}
},
"wsproxysdk.DeregisterWorkspaceProxyRequest": {
"type": "object",
"properties": {
"replica_id": {
"description": "ReplicaID is a unique identifier for the replica of the proxy that is\nderegistering. It should be generated by the client on startup and\nshould've already been passed to the register endpoint.",
"type": "string"
}
}
},
"wsproxysdk.IssueSignedAppTokenResponse": {
"type": "object",
"properties": {
@@ -11485,6 +11524,30 @@ const docTemplate = `{
"description": "AccessURL that hits the workspace proxy api.",
"type": "string"
},
"derp_enabled": {
"description": "DerpEnabled indicates whether the proxy should be included in the DERP\nmap or not.",
"type": "boolean"
},
"hostname": {
"description": "ReplicaHostname is the OS hostname of the machine that the proxy is running\non. This is only used for tracking purposes in the replicas table.",
"type": "string"
},
"replica_error": {
"description": "ReplicaError is the error that the replica encountered when trying to\ndial it's peers. This is stored in the replicas table for debugging\npurposes but does not affect the proxy's ability to register.\n\nThis value is only stored on subsequent requests to the register\nendpoint, not the first request.",
"type": "string"
},
"replica_id": {
"description": "ReplicaID is a unique identifier for the replica of the proxy that is\nregistering. It should be generated by the client on startup and\npersisted (in memory only) until the process is restarted.",
"type": "string"
},
"replica_relay_address": {
"description": "ReplicaRelayAddress is the DERP address of the replica that other\nreplicas may use to connect internally for DERP meshing.",
"type": "string"
},
"version": {
"description": "Version is the Coder version of the proxy.",
"type": "string"
},
"wildcard_hostname": {
"description": "WildcardHostname that the workspace proxy api is serving for subdomain apps.",
"type": "string"
@@ -11496,6 +11559,19 @@ const docTemplate = `{
"properties": {
"app_security_key": {
"type": "string"
},
"derp_mesh_key": {
"type": "string"
},
"derp_region_id": {
"type": "integer"
},
"sibling_replicas": {
"description": "SiblingReplicas is a list of all other replicas of the proxy that have\nnot timed out.",
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.Replica"
}
}
}
}
+83 -9
View File
@@ -450,6 +450,23 @@
}
}
},
"/derp-map": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"tags": ["Agents"],
"summary": "Get DERP map updates",
"operationId": "get-derp-map-updates",
"responses": {
"101": {
"description": "Switching Protocols"
}
}
}
},
"/entitlements": {
"get": {
"security": [
@@ -4743,24 +4760,32 @@
}
}
},
"/workspaceproxies/me/goingaway": {
"/workspaceproxies/me/deregister": {
"post": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": ["application/json"],
"consumes": ["application/json"],
"tags": ["Enterprise"],
"summary": "Workspace proxy going away",
"operationId": "workspace-proxy-going-away",
"responses": {
"201": {
"description": "Created",
"summary": "Deregister workspace proxy",
"operationId": "deregister-workspace-proxy",
"parameters": [
{
"description": "Deregister workspace proxy request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/codersdk.Response"
"$ref": "#/definitions/wsproxysdk.DeregisterWorkspaceProxyRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
}
},
"x-apidocgen": {
"skip": true
@@ -4817,7 +4842,7 @@
"operationId": "register-workspace-proxy",
"parameters": [
{
"description": "Issue signed app token request",
"description": "Register workspace proxy request",
"name": "request",
"in": "body",
"required": true,
@@ -9772,6 +9797,9 @@
"deleted": {
"type": "boolean"
},
"derp_enabled": {
"type": "boolean"
},
"display_name": {
"type": "string"
},
@@ -10459,6 +10487,15 @@
}
}
},
"wsproxysdk.DeregisterWorkspaceProxyRequest": {
"type": "object",
"properties": {
"replica_id": {
"description": "ReplicaID is a unique identifier for the replica of the proxy that is\nderegistering. It should be generated by the client on startup and\nshould've already been passed to the register endpoint.",
"type": "string"
}
}
},
"wsproxysdk.IssueSignedAppTokenResponse": {
"type": "object",
"properties": {
@@ -10475,6 +10512,30 @@
"description": "AccessURL that hits the workspace proxy api.",
"type": "string"
},
"derp_enabled": {
"description": "DerpEnabled indicates whether the proxy should be included in the DERP\nmap or not.",
"type": "boolean"
},
"hostname": {
"description": "ReplicaHostname is the OS hostname of the machine that the proxy is running\non. This is only used for tracking purposes in the replicas table.",
"type": "string"
},
"replica_error": {
"description": "ReplicaError is the error that the replica encountered when trying to\ndial it's peers. This is stored in the replicas table for debugging\npurposes but does not affect the proxy's ability to register.\n\nThis value is only stored on subsequent requests to the register\nendpoint, not the first request.",
"type": "string"
},
"replica_id": {
"description": "ReplicaID is a unique identifier for the replica of the proxy that is\nregistering. It should be generated by the client on startup and\npersisted (in memory only) until the process is restarted.",
"type": "string"
},
"replica_relay_address": {
"description": "ReplicaRelayAddress is the DERP address of the replica that other\nreplicas may use to connect internally for DERP meshing.",
"type": "string"
},
"version": {
"description": "Version is the Coder version of the proxy.",
"type": "string"
},
"wildcard_hostname": {
"description": "WildcardHostname that the workspace proxy api is serving for subdomain apps.",
"type": "string"
@@ -10486,6 +10547,19 @@
"properties": {
"app_security_key": {
"type": "string"
},
"derp_mesh_key": {
"type": "string"
},
"derp_region_id": {
"type": "integer"
},
"sibling_replicas": {
"description": "SiblingReplicas is a list of all other replicas of the proxy that have\nnot timed out.",
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.Replica"
}
}
}
}