Skip to content

Commit 03b08fa

Browse files
committed
Server boots
1 parent 63159a6 commit 03b08fa

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

cli/bigcli/option.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (a Annotations) Mark(key string, value string) Annotations {
2828
} else {
2929
aa = make(Annotations)
3030
}
31-
a[key] = value
31+
aa[key] = value
3232
return aa
3333
}
3434

@@ -178,7 +178,11 @@ func (os *OptionSet) SetDefaults() error {
178178
}
179179
if opt.Value == nil {
180180
merr = multierror.Append(
181-
merr, xerrors.Errorf("parse %q: no Value field set", opt.Name),
181+
merr,
182+
xerrors.Errorf(
183+
"parse %q: no Value field set\nFull opt: %+v",
184+
opt.Name, opt,
185+
),
182186
)
183187
continue
184188
}

cli/bigcli/value.go renamed to cli/bigcli/values.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ func (Int64) Type() string {
3434
type Bool bool
3535

3636
func (b *Bool) Set(s string) error {
37+
if s == "" {
38+
*b = Bool(false)
39+
return nil
40+
}
3741
bb, err := strconv.ParseBool(s)
3842
*b = Bool(bb)
3943
return err

cli/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func Core() []*cobra.Command {
109109
}
110110

111111
func AGPL() []*cobra.Command {
112-
all := append(Core(), Server(deployment.NewViper(), func(_ context.Context, o *coderd.Options) (*coderd.API, io.Closer, error) {
112+
all := append(Core(), Server(func(_ context.Context, o *coderd.Options) (*coderd.API, io.Closer, error) {
113113
api := coderd.New(o)
114114
return api, api, nil
115115
}))

cli/server.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ func serverOptions(c *codersdk.DeploymentConfig) *bigcli.OptionSet {
172172
Flag: "tls-redirect-http-to-https",
173173
Default: "true",
174174
Hidden: true,
175+
Value: &c.TLS.RedirectHTTP,
175176
UseInstead: []bigcli.Option{redirectToAccessURL},
176177
},
177178
{
@@ -723,7 +724,24 @@ func Server(newAPI func(context.Context, *coderd.Options) (*coderd.API, io.Close
723724
defer cancel()
724725

725726
cfg := &codersdk.DeploymentConfig{
726-
TLS: &codersdk.TLSConfig{},
727+
TLS: &codersdk.TLSConfig{},
728+
Logging: &codersdk.LoggingConfig{},
729+
Provisioner: &codersdk.ProvisionerConfig{},
730+
RateLimit: &codersdk.RateLimitConfig{},
731+
Dangerous: &codersdk.DangerousConfig{},
732+
Trace: &codersdk.TraceConfig{},
733+
Telemetry: &codersdk.TelemetryConfig{},
734+
OIDC: &codersdk.OIDCConfig{},
735+
OAuth2: &codersdk.OAuth2Config{
736+
Github: &codersdk.OAuth2GithubConfig{},
737+
},
738+
Pprof: &codersdk.PprofConfig{},
739+
Prometheus: &codersdk.PrometheusConfig{},
740+
DERP: &codersdk.DERP{
741+
Server: &codersdk.DERPServerConfig{},
742+
Config: &codersdk.DERPConfig{},
743+
},
744+
Swagger: &codersdk.SwaggerConfig{},
727745
}
728746
cliOpts := serverOptions(cfg)
729747

0 commit comments

Comments
 (0)