소스 검색

Fix missing home for derp service

世界 4 달 전
부모
커밋
d339f85087
3개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      docs/configuration/service/derp.md
  2. 1 0
      option/tailscale.go
  3. 1 0
      service/derp/service.go

+ 5 - 0
docs/configuration/service/derp.md

@@ -20,6 +20,7 @@ DERP service is a Tailscale DERP server, similar to [derper](https://pkg.go.dev/
   "config_path": "",
   "verify_client_endpoint": [],
   "verify_client_url": [],
+  "home": "",
   "mesh_with": [],
   "mesh_psk": "",
   "mesh_psk_file": "",
@@ -69,6 +70,10 @@ Setting Array value to a string `__URL__` is equivalent to configuring:
 { "url": __URL__ }
 ```
 
+#### home
+
+What to serve at the root path. It may be left empty (the default, for a default homepage), `blank` for a blank page, or a URL to redirect to
+
 #### mesh_with
 
 Mesh with other DERP servers.

+ 1 - 0
option/tailscale.go

@@ -36,6 +36,7 @@ type DERPServiceOptions struct {
 	ConfigPath           string                                          `json:"config_path,omitempty"`
 	VerifyClientEndpoint badoption.Listable[string]                      `json:"verify_client_endpoint,omitempty"`
 	VerifyClientURL      badoption.Listable[*DERPVerifyClientURLOptions] `json:"verify_client_url,omitempty"`
+	Home                 string                                          `json:"home,omitempty"`
 	MeshWith             badoption.Listable[*DERPMeshOptions]            `json:"mesh_with,omitempty"`
 	MeshPSK              string                                          `json:"mesh_psk,omitempty"`
 	MeshPSKFile          string                                          `json:"mesh_psk_file,omitempty"`

+ 1 - 0
service/derp/service.go

@@ -124,6 +124,7 @@ func NewService(ctx context.Context, logger log.ContextLogger, tag string, optio
 		configPath:           configPath,
 		verifyClientEndpoint: options.VerifyClientEndpoint,
 		verifyClientURL:      options.VerifyClientURL,
+		home:                 options.Home,
 		meshKey:              options.MeshPSK,
 		meshKeyPath:          options.MeshPSKFile,
 		meshWith:             options.MeshWith,