Skip to content

Commit c7cf9cc

Browse files
committed
more fix
1 parent c92cc65 commit c7cf9cc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

enterprise/cli/server.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ import (
2323

2424
func server() *cobra.Command {
2525
vip := deployment.DefaultViper()
26-
cmd := agpl.Server(dflags, func(ctx context.Context, options *agplcoderd.Options) (*agplcoderd.API, io.Closer, error) {
27-
if dflags.DerpServerRelayAddress.Value != "" {
28-
_, err := url.Parse(dflags.DerpServerRelayAddress.Value)
26+
cmd := agpl.Server(vip, func(ctx context.Context, options *agplcoderd.Options) (*agplcoderd.API, io.Closer, error) {
27+
cfg, err := deployment.Config(vip)
28+
if err != nil {
29+
return nil, nil, xerrors.Errorf("failed to read config: %w", err)
30+
}
31+
32+
if cfg.DerpServerRelayAddress != "" {
33+
_, err := url.Parse(cfg.DerpServerRelayAddress)
2934
if err != nil {
3035
return nil, nil, xerrors.Errorf("derp-server-relay-address must be a valid HTTP URL: %w", err)
3136
}
@@ -53,7 +58,7 @@ func server() *cobra.Command {
5358
BrowserOnly: options.DeploymentConfig.BrowserOnly,
5459
SCIMAPIKey: []byte(options.DeploymentConfig.SCIMAuthHeader),
5560
UserWorkspaceQuota: options.DeploymentConfig.UserWorkspaceQuota,
56-
RBACEnabled: true,
61+
RBAC: true,
5762
DERPServerRelayAddress: options.DeploymentConfig.DerpServerRelayAddress,
5863
DERPServerRegionID: options.DeploymentConfig.DerpServerRegionID,
5964

0 commit comments

Comments
 (0)