Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add custom docs URL to deployment config #8590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cli/testdata/coder_server_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ Use a YAML configuration file when your server launch become unwieldy.
--access-url url, $CODER_ACCESS_URL
The URL that users will use to access the Coder deployment.

--docs-url url, $CODER_DOCS_URL
Specifies the custom docs URL.

--proxy-trusted-headers string-array, $CODER_PROXY_TRUSTED_HEADERS
Headers to trust for forwarding IP addresses. e.g. Cf-Connecting-Ip,
True-Client-Ip, X-Forwarded-For.
Expand Down
3 changes: 3 additions & 0 deletions cli/testdata/server-config.yaml.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ networking:
# "*.example.com".
# (default: <unset>, type: url)
wildcardAccessURL:
# Specifies the custom docs URL.
# (default: <unset>, type: url)
docsURL:
# Specifies whether to redirect requests that do not match the access URL host.
# (default: <unset>, type: bool)
redirectToAccessURL: false
Expand Down
3 changes: 3 additions & 0 deletions coderd/apidoc/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions coderd/apidoc/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions codersdk/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ type DeploymentValues struct {
Verbose clibase.Bool `json:"verbose,omitempty"`
AccessURL clibase.URL `json:"access_url,omitempty"`
WildcardAccessURL clibase.URL `json:"wildcard_access_url,omitempty"`
DocsURL clibase.URL `json:"docs_url,omitempty"`
RedirectToAccessURL clibase.Bool `json:"redirect_to_access_url,omitempty"`
// HTTPAddress is a string because it may be set to zero to disable.
HTTPAddress clibase.String `json:"http_address,omitempty" typescript:",notnull"`
Expand Down Expand Up @@ -534,6 +535,16 @@ when required by your organization's security policy.`,
YAML: "wildcardAccessURL",
Annotations: clibase.Annotations{}.Mark(annotationExternalProxies, "true"),
},
{
Name: "Docs URL",
Description: "Specifies the custom docs URL.",
Value: &c.DocsURL,
Flag: "docs-url",
Env: "CODER_DOCS_URL",
Group: &deploymentGroupNetworking,
YAML: "docsURL",
Annotations: clibase.Annotations{}.Mark(annotationExternalProxies, "true"),
},
redirectToAccessURL,
{
Name: "Autobuild Poll Interval",
Expand Down
13 changes: 13 additions & 0 deletions docs/api/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,19 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
"disable_password_auth": true,
"disable_path_apps": true,
"disable_session_expiry_refresh": true,
"docs_url": {
"forceQuery": true,
"fragment": "string",
"host": "string",
"omitHost": true,
"opaque": "string",
"path": "string",
"rawFragment": "string",
"rawPath": "string",
"rawQuery": "string",
"scheme": "string",
"user": {}
},
"enable_terraform_debug_mode": true,
"experiments": ["string"],
"git_auth": {
Expand Down
27 changes: 27 additions & 0 deletions docs/api/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -1902,6 +1902,19 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
"disable_password_auth": true,
"disable_path_apps": true,
"disable_session_expiry_refresh": true,
"docs_url": {
"forceQuery": true,
"fragment": "string",
"host": "string",
"omitHost": true,
"opaque": "string",
"path": "string",
"rawFragment": "string",
"rawPath": "string",
"rawQuery": "string",
"scheme": "string",
"user": {}
},
"enable_terraform_debug_mode": true,
"experiments": ["string"],
"git_auth": {
Expand Down Expand Up @@ -2239,6 +2252,19 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
"disable_password_auth": true,
"disable_path_apps": true,
"disable_session_expiry_refresh": true,
"docs_url": {
"forceQuery": true,
"fragment": "string",
"host": "string",
"omitHost": true,
"opaque": "string",
"path": "string",
"rawFragment": "string",
"rawPath": "string",
"rawQuery": "string",
"scheme": "string",
"user": {}
},
"enable_terraform_debug_mode": true,
"experiments": ["string"],
"git_auth": {
Expand Down Expand Up @@ -2438,6 +2464,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
| `disable_password_auth` | boolean | false | | |
| `disable_path_apps` | boolean | false | | |
| `disable_session_expiry_refresh` | boolean | false | | |
| `docs_url` | [clibase.URL](#clibaseurl) | false | | |
| `enable_terraform_debug_mode` | boolean | false | | |
| `experiments` | array of string | false | | |
| `git_auth` | [clibase.Struct-array_codersdk_GitAuthConfig](#clibasestruct-array_codersdk_gitauthconfig) | false | | |
Expand Down
10 changes: 10 additions & 0 deletions docs/cli/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,16 @@ Disable workspace apps that are not served from subdomains. Path-based apps can

Disable automatic session expiry bumping due to activity. This forces all sessions to become invalid after the session expiry duration has been reached.

### --docs-url

| | |
| ----------- | ------------------------------- |
| Type | <code>url</code> |
| Environment | <code>$CODER_DOCS_URL</code> |
| YAML | <code>networking.docsURL</code> |

Specifies the custom docs URL.

### --enable-terraform-debug-mode

| | |
Expand Down
3 changes: 3 additions & 0 deletions enterprise/cli/testdata/coder_server_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ Use a YAML configuration file when your server launch become unwieldy.
--access-url url, $CODER_ACCESS_URL
The URL that users will use to access the Coder deployment.

--docs-url url, $CODER_DOCS_URL
Specifies the custom docs URL.

--proxy-trusted-headers string-array, $CODER_PROXY_TRUSTED_HEADERS
Headers to trust for forwarding IP addresses. e.g. Cf-Connecting-Ip,
True-Client-Ip, X-Forwarded-For.
Expand Down
1 change: 1 addition & 0 deletions site/src/api/typesGenerated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ export interface DeploymentValues {
readonly verbose?: boolean
readonly access_url?: string
readonly wildcard_access_url?: string
readonly docs_url?: string
readonly redirect_to_access_url?: boolean
readonly http_address?: string
readonly autobuild_poll_interval?: number
Expand Down