Fix missing home for derp service

This commit is contained in:
世界 2025-06-04 22:12:59 +08:00
parent 09fb897805
commit e0ac459204
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
3 changed files with 7 additions and 0 deletions

View File

@ -20,6 +20,7 @@ DERP service is a Tailscale DERP server, similar to [derper](https://pkg.go.dev/
"config_path": "", "config_path": "",
"verify_client_endpoint": [], "verify_client_endpoint": [],
"verify_client_url": [], "verify_client_url": [],
"home": "",
"mesh_with": [], "mesh_with": [],
"mesh_psk": "", "mesh_psk": "",
"mesh_psk_file": "", "mesh_psk_file": "",
@ -69,6 +70,10 @@ Setting Array value to a string `__URL__` is equivalent to configuring:
{ "url": __URL__ } { "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
Mesh with other DERP servers. Mesh with other DERP servers.

View File

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

View File

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