Skip to content

Commit 89ab2e7

Browse files
committed
add script
1 parent fa2975a commit 89ab2e7

File tree

4 files changed

+413
-63
lines changed

4 files changed

+413
-63
lines changed

cli/deployment/config.go

Lines changed: 68 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codersdk/config.go

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -11,86 +11,86 @@ import (
1111

1212
type DeploymentConfig struct {
1313
// Usage: External URL to access your deployment. This must be accessible by all provisioned workspaces.
14-
// Flag: "access-url"
14+
// Flag: access-url
1515
AccessURL string `mapstructure:"access_url"`
1616
// Usage: Specifies the wildcard hostname to use for workspace applications in the form "*.example.com".
17-
// Flag: "wildcard-access-url"
17+
// Flag: wildcard-access-url
1818
WildcardAccessURL string `mapstructure:"wildcard_access_url"`
1919
// Usage: Bind address of the server.
20-
// Flag: "address"
21-
// Shorthand: "a"
20+
// Flag: address
21+
// Shorthand: a
2222
// Default: "127.0.0.1:3000"
2323
Address string `mapstructure:"address"`
2424
// Usage: Interval to poll for scheduled workspace builds.
25-
// Flag: "autobuild-poll-interval"
25+
// Flag: autobuild-poll-interval
2626
// Hidden: true
2727
// Default: time.Minute
2828
AutobuildPollInterval time.Duration `mapstructure:"autobuild_poll_interval"`
2929
DERP DERPConfig `mapstructure:"derp"`
3030
Prometheus PrometheusConfig `mapstructure:"prometheus"`
3131
Pprof PprofConfig `mapstructure:"pprof"`
3232
// Usage: The directory to cache temporary files. If unspecified and $CACHE_DIRECTORY is set, it will be used for compatibility with systemd.
33-
// Flag: "cache-dir"
33+
// Flag: cache-dir
3434
// Default: defaultCacheDir()
3535
CacheDir string `mapstructure:"cache_dir"`
3636
// Usage: Controls whether data will be stored in an in-memory database.
37-
// Flag: "in-memory"
37+
// Flag: in-memory
3838
// Hidden: true
3939
InMemoryDatabase bool `mapstructure:"in_memory_database"`
4040
// Usage: Number of provisioner daemons to create on start. If builds are stuck in queued state for a long time, consider increasing this.
41-
// Flag: "provisioner-daemons"
41+
// Flag: provisioner-daemons
4242
// Default: 3
4343
ProvisionerDaemonCount int `mapstructure:"provisioner_daemon_count"`
4444
// 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".
45-
// Flag: "postgres-url"
45+
// Flag: postgres-url
4646
PostgresURL string `mapstructure:"postgres_url"`
4747
OAuth2Github OAuth2GithubConfig `mapstructure:"oauth2_github"`
4848
OIDC OIDCConfig `mapstructure:"oidc"`
4949
Telemetry TelemetryConfig `mapstructure:"telemetry"`
5050
TLS TLSConfig `mapstructure:"tls_config"`
5151
// Usage: Whether application tracing data is collected.
52-
// Flag: "trace"
52+
// Flag: trace
5353
TraceEnable bool `mapstructure:"trace_enable"`
5454
// Usage: Controls if the 'Secure' property is set on browser session cookies.
55-
// Flag: "secure-auth-cookie"
55+
// Flag: secure-auth-cookie
5656
SecureAuthCookie bool `mapstructure:"secure_auth_cookie"`
5757
// Usage: The algorithm to use for generating ssh keys. Accepted values are "ed25519", "ecdsa", or "rsa4096".
58-
// Flag: "ssh-keygen-algorithm"
58+
// Flag: ssh-keygen-algorithm
5959
// Default: "ed25519"
6060
SSHKeygenAlgorithm string `mapstructure:"ssh_keygen_algorithm"`
6161
// Usage: Templates to auto-import. Available auto-importable templates are: kubernetes
62-
// Flag: "auto-import-template"
62+
// Flag: auto-import-template
6363
// Hidden: true
6464
AutoImportTemplates []string `mapstructure:"auto_import_templates"`
6565
// Usage: How frequently metrics are refreshed
66-
// Flag: "metrics-cache-refresh-interval"
66+
// Flag: metrics-cache-refresh-interval
6767
// Hidden: true
6868
// Default: time.Hour
6969
MetricsCacheRefreshInterval time.Duration `mapstructure:"metrics_cache_refresh_interval"`
7070
// Usage: How frequently agent stats are recorded
71-
// Flag: "agent-stats-refresh-interval"
71+
// Flag: agent-stats-refresh-interval
7272
// Hidden: true
7373
// Default: 10 * time.Minute
7474
AgentStatRefreshInterval time.Duration `mapstructure:"agent_stat_refresh_interval"`
7575
// Usage: Enables verbose logging.
76-
// Flag: "verbose"
77-
// Shorthand: "v"
76+
// Flag: verbose
77+
// Shorthand: v
7878
Verbose bool `mapstructure:"verbose"`
7979
// Usage: Specifies whether audit logging is enabled.
80-
// Flag: "audit-logging"
80+
// Flag: audit-logging
8181
// Default: true
8282
// Enterprise: true
8383
AuditLogging bool `mapstructure:"audit_logging"`
8484
// Usage: Whether Coder only allows connections to workspaces via the browser.
85-
// Flag: "browser-only"
85+
// Flag: browser-only
8686
// Enterprise: true
8787
BrowserOnly bool `mapstructure:"browser_only"`
8888
// Usage: Enables SCIM and sets the authentication header for the built-in SCIM server. New users are automatically created with OIDC authentication.
89-
// Flag: "scim-auth-header"
89+
// Flag: scim-auth-header
9090
// Enterprise: true
9191
SCIMAuthHeader string `mapstructure:"scim_auth_header"`
9292
// Usage: Enables and sets a limit on how many workspaces each user can create.
93-
// Flag: "user-workspace-quota"
93+
// Flag: user-workspace-quota
9494
// Enterprise: true
9595
UserWorkspaceQuota int `mapstructure:"user_workspace_quota"`
9696
}
@@ -101,135 +101,135 @@ type DERPConfig struct {
101101
}
102102
type DERPServerConfig struct {
103103
// Usage: Whether to enable or disable the embedded DERP relay server.
104-
// Flag: "derp-server-enable"
104+
// Flag: derp-server-enable
105105
// Default: true
106106
Enable bool `mapstructure:"enabled"`
107107
// Usage: Region ID to use for the embedded DERP server.
108-
// Flag: "derp-server-region-id"
108+
// Flag: derp-server-region-id
109109
// Default: 999
110110
RegionID int `mapstructure:"region_id"`
111111
// Usage: Region code to use for the embedded DERP server.
112-
// Flag: "derp-server-region-code"
112+
// Flag: derp-server-region-code
113113
// Default: "coder"
114114
RegionCode string `mapstructure:"region_code"`
115115
// Usage: Region name that for the embedded DERP server.
116-
// Flag: "derp-server-region-name"
116+
// Flag: derp-server-region-name
117117
// Default: "Coder Embedded Relay"
118118
RegionName string `mapstructure:"region_name"`
119119
// Usage: Addresses for STUN servers to establish P2P connections. Set empty to disable P2P connections.
120-
// Flag: "derp-server-stun-addresses"
120+
// Flag: derp-server-stun-addresses
121121
// Default: []string{"stun.l.google.com:19302"}
122122
STUNAddresses []string `mapstructure:"stun_address"`
123123
}
124124

125125
type DERPConfigConfig struct {
126126
// Usage: URL to fetch a DERP mapping on startup. See: https://tailscale.com/kb/1118/custom-derp-servers/
127-
// Flag: "derp-config-url"
127+
// Flag: derp-config-url
128128
URL string `mapstructure:"url"`
129129
// Usage: Path to read a DERP mapping from. See: https://tailscale.com/kb/1118/custom-derp-servers/
130-
// Flag: "derp-config-path"
130+
// Flag: derp-config-path
131131
Path string `mapstructure:"path"`
132132
}
133133

134134
type PrometheusConfig struct {
135135
// Usage: Serve prometheus metrics on the address defined by prometheus address.
136-
// Flag: "prometheus-enable"
136+
// Flag: prometheus-enable
137137
Enable bool `mapstructure:"enabled"`
138138
// Usage: The bind address to serve prometheus metrics.
139-
// Flag: "prometheus-address"
139+
// Flag: prometheus-address
140140
// Default: "127.0.0.1:2112"
141141
Address string `mapstructure:"address"`
142142
}
143143

144144
type PprofConfig struct {
145145
// Usage: Serve pprof metrics on the address defined by pprof address.
146-
// Flag: "pprof-enable"
146+
// Flag: pprof-enable
147147
Enable bool `mapstructure:"enabled"`
148148
// Usage: The bind address to serve pprof.
149-
// Flag: "pprof-address"
149+
// Flag: pprof-address
150150
// Default: "127.0.0.1:6060"
151151
Address string `mapstructure:"address"`
152152
}
153153

154154
type OAuth2GithubConfig struct {
155155
// Usage: Client ID for Login with GitHub.
156-
// Flag: "oauth2-github-client-id"
156+
// Flag: oauth2-github-client-id
157157
ClientID string `mapstructure:"client_id"`
158158
// Usage: Client secret for Login with GitHub.
159-
// Flag: "oauth2-github-client-secret"
159+
// Flag: oauth2-github-client-secret
160160
ClientSecret string `mapstructure:"client_secret"`
161161
// Usage: Organizations the user must be a member of to Login with GitHub.
162-
// Flag: "oauth2-github-allowed-orgs"
162+
// Flag: oauth2-github-allowed-orgs
163163
AllowedOrganizations []string `mapstructure:"allowed_organizations"`
164164
// Usage: Teams inside organizations the user must be a member of to Login with GitHub. Structured as: <organization-name>/<team-slug>.
165-
// Flag: "oauth2-github-allowed-teams"
165+
// Flag: oauth2-github-allowed-teams
166166
AllowedTeams []string `mapstructure:"allowed_teams"`
167167
// Usage: Whether new users can sign up with GitHub.
168-
// Flag: "oauth2-github-allow-signups"
168+
// Flag: oauth2-github-allow-signups
169169
AllowSignups bool `mapstructure:"allow_signups"`
170170
// Usage: Base URL of a GitHub Enterprise deployment to use for Login with GitHub.
171-
// Flag: "oauth2-github-enterprise-base-url"
171+
// Flag: oauth2-github-enterprise-base-url
172172
EnterpriseBaseURL string `mapstructure:"enterprise_base_url"`
173173
}
174174

175175
type OIDCConfig struct {
176176
// Usage: Whether new users can sign up with OIDC.
177-
// Flag: "oidc-allow-signups"
177+
// Flag: oidc-allow-signups
178178
// Default: true
179179
AllowSignups bool `mapstructure:"allow_signups"`
180180
// Usage: Client ID to use for Login with OIDC.
181-
// Flag: "oidc-client-id"
181+
// Flag: oidc-client-id
182182
ClientID string `mapstructure:"client_id"`
183183
// Usage: Client secret to use for Login with OIDC.
184-
// Flag: "oidc-client-secret"
184+
// Flag: oidc-client-secret
185185
ClientSecret string `mapstructure:"cliet_secret"`
186186
// Usage: Email domain that clients logging in with OIDC must match.
187-
// Flag: "oidc-email-domain"
187+
// Flag: oidc-email-domain
188188
EmailDomain string `mapstructure:"email_domain"`
189189
// Usage: Issuer URL to use for Login with OIDC.
190-
// Flag: "oidc-issuer-url"
190+
// Flag: oidc-issuer-url
191191
IssuerURL string `mapstructure:"issuer_url"`
192192
// Usage: Scopes to grant when authenticating with OIDC.
193-
// Flag: "oidc-scopes"
193+
// Flag: oidc-scopes
194194
// Default: []string{oidc.ScopeOpenID, "profile", "email"}
195195
Scopes []string `mapstructure:"scopes"`
196196
}
197197

198198
type TelemetryConfig struct {
199199
// Usage: Whether telemetry is enabled or not. Coder collects anonymized usage data to help improve our product.
200-
// Flag: "telemetry"
200+
// Flag: telemetry
201201
// Default: flag.Lookup("test.v") == nil
202202
Enable bool `mapstructure:"enable"`
203203
// Usage: Whether Opentelemetry traces are sent to Coder. Coder collects anonymized application tracing to help improve our product. Disabling telemetry also disables this option.
204-
// Flag: "telemetry-trace"
204+
// Flag: telemetry-trace
205205
// Default: flag.Lookup("test.v") == nil
206206
TraceEnable bool `mapstructure:"trace_enable"`
207207
// Usage: URL to send telemetry.
208-
// Flag: "telemetry-url"
208+
// Flag: telemetry-url
209209
// Hidden: true
210210
// Default: "https://telemetry.coder.com"
211211
URL string `mapstructure:"url"`
212212
}
213213

214214
type TLSConfig struct {
215215
// Usage: Whether TLS will be enabled.
216-
// Flag: "tls-enable"
216+
// Flag: tls-enable
217217
Enable bool `mapstructure:"tls_enable"`
218218
// 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.
219-
// Flag: "tls-cert-file"
219+
// Flag: tls-cert-file
220220
CertFiles []string `mapstructure:"tls_cert_files"`
221221
// Usage: PEM-encoded Certificate Authority file used for checking the authenticity of client
222-
// Flag: "tls-client-ca-file"
222+
// Flag: tls-client-ca-file
223223
ClientCAFile string `mapstructure:"tls_client_ca_file"`
224224
// Usage: Policy the server will follow for TLS Client Authentication. Accepted values are "none", "request", "require-any", "verify-if-given", or "require-and-verify".
225-
// Flag: "tls-client-auth"
225+
// Flag: tls-client-auth
226226
ClientAuth string `mapstructure:"tls_client_auth"`
227227
// Usage: Paths to the private keys for each of the certificates. It requires a PEM-encoded file.
228-
// Flag: "tls-key-file"
228+
// Flag: tls-key-file
229229
KeyFiles []string `mapstructure:"tls_key_tiles"`
230230
// Usage: Minimum supported version of TLS. Accepted values are "tls10", "tls11", "tls12" or "tls13"
231-
// Flag: "tls-min-version"
232-
// Default: "tls12"
231+
// Flag: tls-min-version
232+
// Default: tls12
233233
MinVersion string `mapstructure:"tls_min_version"`
234234
}
235235

0 commit comments

Comments
 (0)