Skip to content

Commit 8e17cb9

Browse files
committed
Merge branch 'main' into gitprovider
2 parents b6bfdf1 + 9ea3e96 commit 8e17cb9

29 files changed

+260
-85
lines changed

cli/deployment/config.go

+53
Original file line numberDiff line numberDiff line change
@@ -22,71 +22,83 @@ import (
2222
func newConfig() codersdk.DeploymentConfig {
2323
return codersdk.DeploymentConfig{
2424
AccessURL: codersdk.DeploymentConfigField[string]{
25+
Name: "Access URL",
2526
Key: "access_url",
2627
Usage: "External URL to access your deployment. This must be accessible by all provisioned workspaces.",
2728
Flag: "access-url",
2829
},
2930
WildcardAccessURL: codersdk.DeploymentConfigField[string]{
31+
Name: "Wildcard Access URL",
3032
Key: "wildcard_access_url",
3133
Usage: "Specifies the wildcard hostname to use for workspace applications in the form \"*.example.com\".",
3234
Flag: "wildcard-access-url",
3335
},
3436
Address: codersdk.DeploymentConfigField[string]{
37+
Name: "Address",
3538
Key: "address",
3639
Usage: "Bind address of the server.",
3740
Flag: "address",
3841
Shorthand: "a",
3942
Value: "127.0.0.1:3000",
4043
},
4144
AutobuildPollInterval: codersdk.DeploymentConfigField[time.Duration]{
45+
Name: "Autobuild Poll Interval",
4246
Key: "autobuild_poll_interval",
4347
Usage: "Interval to poll for scheduled workspace builds.",
4448
Flag: "autobuild-poll-interval",
4549
Hidden: true,
4650
Value: time.Minute,
4751
},
4852
DERPServerEnable: codersdk.DeploymentConfigField[bool]{
53+
Name: "DERP Server Enable",
4954
Key: "derp.server.enable",
5055
Usage: "Whether to enable or disable the embedded DERP relay server.",
5156
Flag: "derp-server-enable",
5257
Value: true,
5358
},
5459
DERPServerRegionID: codersdk.DeploymentConfigField[int]{
60+
Name: "DERP Server Region ID",
5561
Key: "derp.server.region_id",
5662
Usage: "Region ID to use for the embedded DERP server.",
5763
Flag: "derp-server-region-id",
5864
Value: 999,
5965
},
6066
DERPServerRegionCode: codersdk.DeploymentConfigField[string]{
67+
Name: "DERP Server Region Code",
6168
Key: "derp.server.region_code",
6269
Usage: "Region code to use for the embedded DERP server.",
6370
Flag: "derp-server-region-code",
6471
Value: "coder",
6572
},
6673
DERPServerRegionName: codersdk.DeploymentConfigField[string]{
74+
Name: "DERP Server Region Name",
6775
Key: "derp.server.region_name",
6876
Usage: "Region name that for the embedded DERP server.",
6977
Flag: "derp-server-region-name",
7078
Value: "Coder Embedded Relay",
7179
},
7280
DERPServerSTUNAddresses: codersdk.DeploymentConfigField[[]string]{
81+
Name: "DERP Server STUN Addresses",
7382
Key: "derp.server.stun_addresses",
7483
Usage: "Addresses for STUN servers to establish P2P connections. Set empty to disable P2P connections.",
7584
Flag: "derp-server-stun-addresses",
7685
Value: []string{"stun.l.google.com:19302"},
7786
},
7887
DERPServerRelayURL: codersdk.DeploymentConfigField[string]{
88+
Name: "DERP Server Relay URL",
7989
Key: "derp.server.relay_url",
8090
Usage: "An HTTP URL that is accessible by other replicas to relay DERP traffic. Required for high availability.",
8191
Flag: "derp-server-relay-url",
8292
Enterprise: true,
8393
},
8494
DERPConfigURL: codersdk.DeploymentConfigField[string]{
95+
Name: "DERP Config URL",
8596
Key: "derp.config.url",
8697
Usage: "URL to fetch a DERP mapping on startup. See: https://tailscale.com/kb/1118/custom-derp-servers/",
8798
Flag: "derp-config-url",
8899
},
89100
DERPConfigPath: codersdk.DeploymentConfigField[string]{
101+
Name: "DERP Config Path",
90102
Key: "derp.config.path",
91103
Usage: "Path to read a DERP mapping from. See: https://tailscale.com/kb/1118/custom-derp-servers/",
92104
Flag: "derp-config-path",
@@ -98,229 +110,270 @@ func newConfig() codersdk.DeploymentConfig {
98110
Value: []codersdk.DeploymentConfigGitAuth{},
99111
},
100112
PrometheusEnable: codersdk.DeploymentConfigField[bool]{
113+
Name: "Prometheus Enable",
101114
Key: "prometheus.enable",
102115
Usage: "Serve prometheus metrics on the address defined by prometheus address.",
103116
Flag: "prometheus-enable",
104117
},
105118
PrometheusAddress: codersdk.DeploymentConfigField[string]{
119+
Name: "Prometheus Address",
106120
Key: "prometheus.address",
107121
Usage: "The bind address to serve prometheus metrics.",
108122
Flag: "prometheus-address",
109123
Value: "127.0.0.1:2112",
110124
},
111125
PprofEnable: codersdk.DeploymentConfigField[bool]{
126+
Name: "Pprof Enable",
112127
Key: "pprof.enable",
113128
Usage: "Serve pprof metrics on the address defined by pprof address.",
114129
Flag: "pprof-enable",
115130
},
116131
PprofAddress: codersdk.DeploymentConfigField[string]{
132+
Name: "Pprof Address",
117133
Key: "pprof.address",
118134
Usage: "The bind address to serve pprof.",
119135
Flag: "pprof-address",
120136
Value: "127.0.0.1:6060",
121137
},
122138
ProxyTrustedHeaders: codersdk.DeploymentConfigField[[]string]{
139+
Name: "Proxy Trusted Headers",
123140
Key: "proxy.trusted_headers",
124141
Flag: "proxy-trusted-headers",
125142
Usage: "Headers to trust for forwarding IP addresses. e.g. Cf-Connecting-IP True-Client-Ip, X-Forwarded-for",
126143
},
127144
ProxyTrustedOrigins: codersdk.DeploymentConfigField[[]string]{
145+
Name: "Proxy Trusted Origins",
128146
Key: "proxy.trusted_origins",
129147
Flag: "proxy-trusted-origins",
130148
Usage: "Origin addresses to respect \"proxy-trusted-headers\". e.g. example.com",
131149
},
132150
CacheDirectory: codersdk.DeploymentConfigField[string]{
151+
Name: "Cache Directory",
133152
Key: "cache_directory",
134153
Usage: "The directory to cache temporary files. If unspecified and $CACHE_DIRECTORY is set, it will be used for compatibility with systemd.",
135154
Flag: "cache-dir",
136155
Value: defaultCacheDir(),
137156
},
138157
InMemoryDatabase: codersdk.DeploymentConfigField[bool]{
158+
Name: "In Memory Database",
139159
Key: "in_memory_database",
140160
Usage: "Controls whether data will be stored in an in-memory database.",
141161
Flag: "in-memory",
142162
Hidden: true,
143163
},
144164
ProvisionerDaemons: codersdk.DeploymentConfigField[int]{
165+
Name: "Provisioner Daemons",
145166
Key: "provisioner.daemons",
146167
Usage: "Number of provisioner daemons to create on start. If builds are stuck in queued state for a long time, consider increasing this.",
147168
Flag: "provisioner-daemons",
148169
Value: 3,
149170
},
150171
PostgresURL: codersdk.DeploymentConfigField[string]{
172+
Name: "Postgres Connection URL",
151173
Key: "pg_connection_url",
152174
Usage: "URL of a PostgreSQL database. If empty, PostgreSQL binaries will be downloaded from Maven (https://repo1.maven.org/maven2) and store all data in the config root. Access the built-in database with \"coder server postgres-builtin-url\".",
153175
Flag: "postgres-url",
154176
},
155177
OAuth2GithubClientID: codersdk.DeploymentConfigField[string]{
178+
Name: "OAuth2 GitHub Client ID",
156179
Key: "oauth2.github.client_id",
157180
Usage: "Client ID for Login with GitHub.",
158181
Flag: "oauth2-github-client-id",
159182
},
160183
OAuth2GithubClientSecret: codersdk.DeploymentConfigField[string]{
184+
Name: "OAuth2 GitHub Client Secret",
161185
Key: "oauth2.github.client_secret",
162186
Usage: "Client secret for Login with GitHub.",
163187
Flag: "oauth2-github-client-secret",
164188
},
165189
OAuth2GithubAllowedOrgs: codersdk.DeploymentConfigField[[]string]{
190+
Name: "OAuth2 GitHub Allowed Orgs",
166191
Key: "oauth2.github.allowed_orgs",
167192
Usage: "Organizations the user must be a member of to Login with GitHub.",
168193
Flag: "oauth2-github-allowed-orgs",
169194
},
170195
OAuth2GithubAllowedTeams: codersdk.DeploymentConfigField[[]string]{
196+
Name: "OAuth2 GitHub Allowed Teams",
171197
Key: "oauth2.github.allowed_teams",
172198
Usage: "Teams inside organizations the user must be a member of to Login with GitHub. Structured as: <organization-name>/<team-slug>.",
173199
Flag: "oauth2-github-allowed-teams",
174200
},
175201
OAuth2GithubAllowSignups: codersdk.DeploymentConfigField[bool]{
202+
Name: "OAuth2 GitHub Allow Signups",
176203
Key: "oauth2.github.allow_signups",
177204
Usage: "Whether new users can sign up with GitHub.",
178205
Flag: "oauth2-github-allow-signups",
179206
},
180207
OAuth2GithubEnterpriseBaseURL: codersdk.DeploymentConfigField[string]{
208+
Name: "OAuth2 GitHub Enterprise Base URL",
181209
Key: "oauth2.github.enterprise_base_url",
182210
Usage: "Base URL of a GitHub Enterprise deployment to use for Login with GitHub.",
183211
Flag: "oauth2-github-enterprise-base-url",
184212
},
185213
OIDCAllowSignups: codersdk.DeploymentConfigField[bool]{
214+
Name: "OIDC Allow Signups",
186215
Key: "oidc.allow_signups",
187216
Usage: "Whether new users can sign up with OIDC.",
188217
Flag: "oidc-allow-signups",
189218
Value: true,
190219
},
191220
OIDCClientID: codersdk.DeploymentConfigField[string]{
221+
Name: "OIDC Client ID",
192222
Key: "oidc.client_id",
193223
Usage: "Client ID to use for Login with OIDC.",
194224
Flag: "oidc-client-id",
195225
},
196226
OIDCClientSecret: codersdk.DeploymentConfigField[string]{
227+
Name: "OIDC Client Secret",
197228
Key: "oidc.client_secret",
198229
Usage: "Client secret to use for Login with OIDC.",
199230
Flag: "oidc-client-secret",
200231
},
201232
OIDCEmailDomain: codersdk.DeploymentConfigField[string]{
233+
Name: "OIDC Email Domain",
202234
Key: "oidc.email_domain",
203235
Usage: "Email domain that clients logging in with OIDC must match.",
204236
Flag: "oidc-email-domain",
205237
},
206238
OIDCIssuerURL: codersdk.DeploymentConfigField[string]{
239+
Name: "OIDC Issuer URL",
207240
Key: "oidc.issuer_url",
208241
Usage: "Issuer URL to use for Login with OIDC.",
209242
Flag: "oidc-issuer-url",
210243
},
211244
OIDCScopes: codersdk.DeploymentConfigField[[]string]{
245+
Name: "OIDC Scopes",
212246
Key: "oidc.scopes",
213247
Usage: "Scopes to grant when authenticating with OIDC.",
214248
Flag: "oidc-scopes",
215249
Value: []string{oidc.ScopeOpenID, "profile", "email"},
216250
},
217251
TelemetryEnable: codersdk.DeploymentConfigField[bool]{
252+
Name: "Telemetry Enable",
218253
Key: "telemetry.enable",
219254
Usage: "Whether telemetry is enabled or not. Coder collects anonymized usage data to help improve our product.",
220255
Flag: "telemetry",
221256
Value: flag.Lookup("test.v") == nil,
222257
},
223258
TelemetryTrace: codersdk.DeploymentConfigField[bool]{
259+
Name: "Telemetry Trace",
224260
Key: "telemetry.trace",
225261
Usage: "Whether Opentelemetry traces are sent to Coder. Coder collects anonymized application tracing to help improve our product. Disabling telemetry also disables this option.",
226262
Flag: "telemetry-trace",
227263
Value: flag.Lookup("test.v") == nil,
228264
},
229265
TelemetryURL: codersdk.DeploymentConfigField[string]{
266+
Name: "Telemetry URL",
230267
Key: "telemetry.url",
231268
Usage: "URL to send telemetry.",
232269
Flag: "telemetry-url",
233270
Hidden: true,
234271
Value: "https://telemetry.coder.com",
235272
},
236273
TLSEnable: codersdk.DeploymentConfigField[bool]{
274+
Name: "TLS Enable",
237275
Key: "tls.enable",
238276
Usage: "Whether TLS will be enabled.",
239277
Flag: "tls-enable",
240278
},
241279
TLSCertFiles: codersdk.DeploymentConfigField[[]string]{
280+
Name: "TLS Certificate Files",
242281
Key: "tls.cert_file",
243282
Usage: "Path to each certificate for TLS. It requires a PEM-encoded file. To configure the listener to use a CA certificate, concatenate the primary certificate and the CA certificate together. The primary certificate should appear first in the combined file.",
244283
Flag: "tls-cert-file",
245284
},
246285
TLSClientCAFile: codersdk.DeploymentConfigField[string]{
286+
Name: "TLS Client CA Files",
247287
Key: "tls.client_ca_file",
248288
Usage: "PEM-encoded Certificate Authority file used for checking the authenticity of client",
249289
Flag: "tls-client-ca-file",
250290
},
251291
TLSClientAuth: codersdk.DeploymentConfigField[string]{
292+
Name: "TLS Client Auth",
252293
Key: "tls.client_auth",
253294
Usage: "Policy the server will follow for TLS Client Authentication. Accepted values are \"none\", \"request\", \"require-any\", \"verify-if-given\", or \"require-and-verify\".",
254295
Flag: "tls-client-auth",
255296
Value: "request",
256297
},
257298
TLSKeyFiles: codersdk.DeploymentConfigField[[]string]{
299+
Name: "TLS Key Files",
258300
Key: "tls.key_file",
259301
Usage: "Paths to the private keys for each of the certificates. It requires a PEM-encoded file.",
260302
Flag: "tls-key-file",
261303
},
262304
TLSMinVersion: codersdk.DeploymentConfigField[string]{
305+
Name: "TLS Minimum Version",
263306
Key: "tls.min_version",
264307
Usage: "Minimum supported version of TLS. Accepted values are \"tls10\", \"tls11\", \"tls12\" or \"tls13\"",
265308
Flag: "tls-min-version",
266309
Value: "tls12",
267310
},
268311
TraceEnable: codersdk.DeploymentConfigField[bool]{
312+
Name: "Trace Enable",
269313
Key: "trace",
270314
Usage: "Whether application tracing data is collected.",
271315
Flag: "trace",
272316
},
273317
SecureAuthCookie: codersdk.DeploymentConfigField[bool]{
318+
Name: "Secure Auth Cookie",
274319
Key: "secure_auth_cookie",
275320
Usage: "Controls if the 'Secure' property is set on browser session cookies.",
276321
Flag: "secure-auth-cookie",
277322
},
278323
SSHKeygenAlgorithm: codersdk.DeploymentConfigField[string]{
324+
Name: "SSH Keygen Algorithm",
279325
Key: "ssh_keygen_algorithm",
280326
Usage: "The algorithm to use for generating ssh keys. Accepted values are \"ed25519\", \"ecdsa\", or \"rsa4096\".",
281327
Flag: "ssh-keygen-algorithm",
282328
Value: "ed25519",
283329
},
284330
AutoImportTemplates: codersdk.DeploymentConfigField[[]string]{
331+
Name: "Auto Import Templates",
285332
Key: "auto_import_templates",
286333
Usage: "Templates to auto-import. Available auto-importable templates are: kubernetes",
287334
Flag: "auto-import-template",
288335
Hidden: true,
289336
},
290337
MetricsCacheRefreshInterval: codersdk.DeploymentConfigField[time.Duration]{
338+
Name: "Metrics Cache Refresh Interval",
291339
Key: "metrics_cache_refresh_interval",
292340
Usage: "How frequently metrics are refreshed",
293341
Flag: "metrics-cache-refresh-interval",
294342
Hidden: true,
295343
Value: time.Hour,
296344
},
297345
AgentStatRefreshInterval: codersdk.DeploymentConfigField[time.Duration]{
346+
Name: "Agent Stat Refresh Interval",
298347
Key: "agent_stat_refresh_interval",
299348
Usage: "How frequently agent stats are recorded",
300349
Flag: "agent-stats-refresh-interval",
301350
Hidden: true,
302351
Value: 10 * time.Minute,
303352
},
304353
AuditLogging: codersdk.DeploymentConfigField[bool]{
354+
Name: "Audit Logging",
305355
Key: "audit_logging",
306356
Usage: "Specifies whether audit logging is enabled.",
307357
Flag: "audit-logging",
308358
Value: true,
309359
Enterprise: true,
310360
},
311361
BrowserOnly: codersdk.DeploymentConfigField[bool]{
362+
Name: "Browser Only",
312363
Key: "browser_only",
313364
Usage: "Whether Coder only allows connections to workspaces via the browser.",
314365
Flag: "browser-only",
315366
Enterprise: true,
316367
},
317368
SCIMAPIKey: codersdk.DeploymentConfigField[string]{
369+
Name: "SCIM API Key",
318370
Key: "scim_api_key",
319371
Usage: "Enables SCIM and sets the authentication header for the built-in SCIM server. New users are automatically created with OIDC authentication.",
320372
Flag: "scim-auth-header",
321373
Enterprise: true,
322374
},
323375
UserWorkspaceQuota: codersdk.DeploymentConfigField[int]{
376+
Name: "User Workspace Quota",
324377
Key: "user_workspace_quota",
325378
Usage: "Enables and sets a limit on how many workspaces each user can create.",
326379
Flag: "user-workspace-quota",

cli/root.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,14 @@ func Root(subcommands []*cobra.Command) *cobra.Command {
116116
// to check if the command was invoked.
117117
isGitAskpass := false
118118

119+
fmtLong := `Coder %s — A tool for provisioning self-hosted development environments with Terraform.
120+
`
119121
cmd := &cobra.Command{
120122
Use: "coder",
121123
SilenceErrors: true,
122124
SilenceUsage: true,
123-
Long: `Coder — A tool for provisioning self-hosted development environments with Terraform.
124-
`, Args: func(cmd *cobra.Command, args []string) error {
125+
Long: fmt.Sprintf(fmtLong, buildinfo.Version()),
126+
Args: func(cmd *cobra.Command, args []string) error {
125127
if gitauth.CheckCommand(args, os.Environ()) {
126128
isGitAskpass = true
127129
return nil

codersdk/deploymentconfig.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ type Flaggable interface {
7373
}
7474

7575
type DeploymentConfigField[T Flaggable] struct {
76-
Key string `json:"key"`
76+
Key string `json:"key"`
77+
// Name appears in the deployment UI.
7778
Name string `json:"name"`
7879
Usage string `json:"usage"`
7980
Flag string `json:"flag"`

0 commit comments

Comments
 (0)