From a040bcc0cf48e325df953803d64fb7e21dca68e3 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Wed, 18 Jan 2023 15:23:55 -0800 Subject: [PATCH] docs: clarify access URL in install flow (#5626) * fix: TLS disabled copy * clarify default access URL * add docs for coder address --- cli/server.go | 2 +- cli/server_test.go | 2 +- docs/admin/configure.md | 21 ++++++++++++++++++++- docs/install/install.sh.md | 5 +++-- install.sh | 7 +++++-- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/cli/server.go b/cli/server.go index 66970f0031..c01ac903ac 100644 --- a/cli/server.go +++ b/cli/server.go @@ -112,7 +112,7 @@ func Server(vip *viper.Viper, newAPI func(context.Context, *coderd.Options) (*co return xerrors.Errorf("TLS address must be set if TLS is enabled") } if !cfg.TLS.Enable.Value && cfg.HTTPAddress.Value == "" { - return xerrors.Errorf("either HTTP or TLS must be enabled") + return xerrors.Errorf("TLS is disabled. Enable with --tls-enable or specify a HTTP address") } // Disable rate limits if the `--dangerous-disable-rate-limits` flag diff --git a/cli/server_test.go b/cli/server_test.go index 5e77ea113c..75807c8957 100644 --- a/cli/server_test.go +++ b/cli/server_test.go @@ -742,7 +742,7 @@ func TestServer(t *testing.T) { ) err := root.ExecuteContext(ctx) require.Error(t, err) - require.ErrorContains(t, err, "either HTTP or TLS must be enabled") + require.ErrorContains(t, err, "TLS is disabled. Enable with --tls-enable or specify a HTTP address") }) t.Run("NoTLSAddress", func(t *testing.T) { diff --git a/docs/admin/configure.md b/docs/admin/configure.md index bd9c7a1dc0..5b42a04807 100644 --- a/docs/admin/configure.md +++ b/docs/admin/configure.md @@ -14,6 +14,25 @@ should not be localhost. If an access URL is not specified, Coder will create a publicly accessible URL to reverse proxy your deployment for simple setup. +## Address + +You can change which port(s) Coder listens on. + +```sh +# Listen on port 80 +export CODER_HTTP_ADDRESS=0.0.0.0:80 + +# Enable TLS and listen on port 443) +export CODER_TLS_ENABLE=true +export CODER_TLS_ADDRESS=0.0.0.0:443 + +## Redirect from HTTP to HTTPS +export CODER_TLS_REDIRECT_HTTP=true + +# Start the Coder server +coder server +``` + ## Wildcard access URL `CODER_WILDCARD_ACCESS_URL` is necessary for [port forwarding](../networking/port-forwarding.md#dashboard) @@ -55,7 +74,7 @@ configure the server by setting the following variables in `/etc/coder.d/coder.e CODER_ACCESS_URL=https://coder.example.com # String. Address to serve the API and dashboard. -CODER_ADDRESS=127.0.0.1:3000 +CODER_HTTP_ADDRESS=127.0.0.1:3000 # String. The URL of a PostgreSQL database to connect to. If empty, PostgreSQL binaries # will be downloaded from Maven (https://repo1.maven.org/maven2) and store all diff --git a/docs/install/install.sh.md b/docs/install/install.sh.md index 5ed142af48..87e5b3f7d6 100644 --- a/docs/install/install.sh.md +++ b/docs/install/install.sh.md @@ -18,10 +18,11 @@ You can modify the installation process by including flags. Run the help command curl -fsSL https://coder.com/install.sh | sh -s -- --help ``` -After installing, use the instructions in your terminal to start the Coder server and create your first account. +After installing, use the in-terminal instructions to start the Coder server manually via `coder server` or as a system package. + +By default, the Coder server runs on `http://127.0.0.1:3000` and uses a [public tunnel](../admin/configure.md#tunnel) for workspace connections. ## Next steps -- [Quickstart](../quickstart.md) - [Configuring Coder](../admin/configure.md) - [Templates](../templates.md) diff --git a/install.sh b/install.sh index d3163d6d97..d45a881016 100755 --- a/install.sh +++ b/install.sh @@ -128,7 +128,7 @@ echo_systemd_postinstall() { cath <