mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
chore: make default workspace proxy editable (#7903)
* chore: add editing the default workspace proxy
This commit is contained in:
@ -72,6 +72,11 @@ func New(ctx context.Context, options *Options) (*API, error) {
|
||||
RedirectToLogin: false,
|
||||
})
|
||||
|
||||
deploymentID, err := options.Database.GetDeploymentID(ctx)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to get deployment ID: %w", err)
|
||||
}
|
||||
|
||||
api.AGPL.APIHandler.Group(func(r chi.Router) {
|
||||
r.Get("/entitlements", api.serveEntitlements)
|
||||
// /regions overrides the AGPL /regions endpoint
|
||||
@ -118,7 +123,7 @@ func New(ctx context.Context, options *Options) (*API, error) {
|
||||
r.Route("/{workspaceproxy}", func(r chi.Router) {
|
||||
r.Use(
|
||||
apiKeyMiddleware,
|
||||
httpmw.ExtractWorkspaceProxyParam(api.Database),
|
||||
httpmw.ExtractWorkspaceProxyParam(api.Database, deploymentID, api.AGPL.PrimaryWorkspaceProxy),
|
||||
)
|
||||
|
||||
r.Get("/", api.workspaceProxy)
|
||||
@ -225,7 +230,6 @@ func New(ctx context.Context, options *Options) (*API, error) {
|
||||
RootCAs: meshRootCA,
|
||||
ServerName: options.AccessURL.Hostname(),
|
||||
}
|
||||
var err error
|
||||
api.replicaManager, err = replicasync.New(ctx, options.Logger, options.Database, options.Pubsub, &replicasync.Options{
|
||||
ID: api.AGPL.ID,
|
||||
RelayAddress: options.DERPServerRelayAddress,
|
||||
|
Reference in New Issue
Block a user