mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
docs: make it clear the CLI must be downloaded to use templates (#5373)
This commit is contained in:
@@ -6,7 +6,7 @@ We recommend automating Coder deployments through the CLI. Examples include [upd
|
||||
|
||||
Long-lived tokens can be generated to perform actions on behalf of your user account:
|
||||
|
||||
```sh
|
||||
```console
|
||||
coder tokens create
|
||||
```
|
||||
|
||||
@@ -15,7 +15,7 @@ coder tokens create
|
||||
You can use tokens with the CLI by setting the `--token` CLI flag or the `CODER_SESSION_TOKEN`
|
||||
environment variable.
|
||||
|
||||
```sh
|
||||
```console
|
||||
export CODER_URL=https://coder.example.com
|
||||
export CODER_SESSION_TOKEN=*****
|
||||
coder workspaces ls
|
||||
@@ -25,7 +25,7 @@ coder workspaces ls
|
||||
|
||||
You can use tokens with the Coder's REST API using the `Coder-Session-Token` HTTP header.
|
||||
|
||||
```sh
|
||||
```console
|
||||
curl 'https://dev.coder.com/api/v2/workspaces' \
|
||||
-H 'Coder-Session-Token: *****'
|
||||
```
|
||||
|
||||
@@ -40,7 +40,7 @@ downloaded from Maven (https://repo1.maven.org/maven2) and store all data in the
|
||||
If you are using the built-in PostgreSQL deployment and need to use `psql` (aka
|
||||
the PostgreSQL interactive terminal), output the connection URL with the following command:
|
||||
|
||||
```sh
|
||||
```console
|
||||
$ coder server postgres-builtin-url
|
||||
$ psql "postgres://coder@localhost:49627/coder?sslmode=disable&password=feU...yI1"
|
||||
```
|
||||
@@ -50,7 +50,7 @@ $ psql "postgres://coder@localhost:49627/coder?sslmode=disable&password=feU...yI
|
||||
If you've installed Coder via a [system package](../install/packages.md) Coder, you can
|
||||
configure the server by setting the following variables in `/etc/coder.d/coder.env`:
|
||||
|
||||
```sh
|
||||
```console
|
||||
# String. Specifies the external URL (HTTP/S) to access Coder.
|
||||
CODER_ACCESS_URL=https://coder.example.com
|
||||
|
||||
@@ -78,7 +78,7 @@ CODER_TLS_KEY_FILE=
|
||||
|
||||
To run Coder as a system service on the host:
|
||||
|
||||
```sh
|
||||
```console
|
||||
# Use systemd to start Coder now and on reboot
|
||||
sudo systemctl enable --now coder
|
||||
|
||||
@@ -88,7 +88,7 @@ journalctl -u coder.service -b
|
||||
|
||||
To restart Coder after applying system changes:
|
||||
|
||||
```sh
|
||||
```console
|
||||
sudo systemctl restart coder
|
||||
```
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ Example callback URL: `https://coder.example.com/gitauth/primary-github/callback
|
||||
|
||||
Set the following environment variables to [configure the Coder server](./configure.md):
|
||||
|
||||
```sh
|
||||
```console
|
||||
CODER_GITAUTH_0_ID="primary-github"
|
||||
CODER_GITAUTH_0_TYPE=github|gitlab|azure-devops|bitbucket
|
||||
CODER_GITAUTH_0_CLIENT_ID=xxxxxx
|
||||
@@ -36,7 +36,7 @@ CODER_GITAUTH_0_CLIENT_SECRET=xxxxxxx
|
||||
Custom authentication and token URLs should be
|
||||
used for self-managed Git provider deployments.
|
||||
|
||||
```sh
|
||||
```console
|
||||
CODER_GITAUTH_0_AUTH_URL="https://github.example.com/oauth/authorize"
|
||||
CODER_GITAUTH_0_TOKEN_URL="https://github.example.com/oauth/token"
|
||||
```
|
||||
@@ -45,7 +45,7 @@ CODER_GITAUTH_0_TOKEN_URL="https://github.example.com/oauth/token"
|
||||
|
||||
Optionally, you can request custom scopes:
|
||||
|
||||
```sh
|
||||
```console
|
||||
CODER_GITAUTH_0_SCOPES="repo:read repo:write write:gpg_key"
|
||||
```
|
||||
|
||||
@@ -55,7 +55,7 @@ Multiple providers are an Enterprise feature. [Learn more](../enterprise.md).
|
||||
|
||||
A custom regex can be used to match a specific repository or organization to limit auth scope. Here's a sample config:
|
||||
|
||||
```sh
|
||||
```console
|
||||
# Provider 1) github.com
|
||||
CODER_GITAUTH_0_ID=primary-github
|
||||
CODER_GITAUTH_0_TYPE=github
|
||||
@@ -75,6 +75,6 @@ CODER_GITAUTH_1_TOKEN_URL="https://github.example.com/oauth/token"
|
||||
|
||||
To support regex matching for paths (e.g. github.com/orgname), youll need to add this to the [Coder agent startup script](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script):
|
||||
|
||||
```sh
|
||||
```console
|
||||
git config --global credential.useHttpPath true
|
||||
```
|
||||
|
||||
@@ -12,7 +12,7 @@ The Prometheus endpoint address is `http://localhost:2112/` by default. You can
|
||||
|
||||
If `coder server --prometheus-enable` is started locally, you can preview the metrics endpoint in your browser or by using curl: <!-- markdown-link-check-disable -->http://localhost:2112/<!-- markdown-link-check-enable -->.
|
||||
|
||||
```shell
|
||||
```console
|
||||
$ curl http://localhost:2112/
|
||||
# HELP coderd_api_active_users_duration_hour The number of users that have been active within the last hour.
|
||||
# TYPE coderd_api_active_users_duration_hour gauge
|
||||
|
||||
Reference in New Issue
Block a user