From 27dd386e54520cfe7ce8c54157b64400bed04796 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 5 Jan 2023 16:41:29 +0000 Subject: [PATCH 1/5] fix: TLS disabled copy --- cli/server.go | 2 +- cli/server_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/server.go b/cli/server.go index bcb1e41492f27..8e1ff4aae26e9 100644 --- a/cli/server.go +++ b/cli/server.go @@ -101,7 +101,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") } printLogo(cmd) diff --git a/cli/server_test.go b/cli/server_test.go index 5a1f6ed3fa9e0..1e564a35a24f8 100644 --- a/cli/server_test.go +++ b/cli/server_test.go @@ -685,7 +685,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) { From 235721e6785897c5c6324d84896a8632b2250354 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 9 Jan 2023 15:00:53 +0000 Subject: [PATCH 2/5] clarify default access URL --- docs/install/install.sh.md | 5 +++-- install.sh | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/install/install.sh.md b/docs/install/install.sh.md index 5ed142af48710..3050e1606abe4 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 [127.0.0.1:3000](https://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 d015ecb820e27..5cafe8c9f10a5 100755 --- a/install.sh +++ b/install.sh @@ -119,7 +119,7 @@ echo_systemd_postinstall() { cath < From 35db327f731be87ddd30f971a16273a4d22393b9 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 9 Jan 2023 15:13:00 +0000 Subject: [PATCH 3/5] add docs for coder address --- docs/admin/configure.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/admin/configure.md b/docs/admin/configure.md index bd9c7a1dc09ca..eff682391076b 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 From bd1095deb0b2fa6108f8f24680bf68c9bcc1566d Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 18 Jan 2023 23:17:40 +0000 Subject: [PATCH 4/5] fmt --- docs/admin/configure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/admin/configure.md b/docs/admin/configure.md index eff682391076b..5b42a048075c0 100644 --- a/docs/admin/configure.md +++ b/docs/admin/configure.md @@ -16,7 +16,7 @@ a publicly accessible URL to reverse proxy your deployment for simple setup. ## Address -You can change which port(s) Coder listens on. +You can change which port(s) Coder listens on. ```sh # Listen on port 80 From 3592e37895dd905b8f1ab4af78bb620136c7ea00 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 18 Jan 2023 23:18:18 +0000 Subject: [PATCH 5/5] avoid markdown link check --- docs/install/install.sh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/install.sh.md b/docs/install/install.sh.md index 3050e1606abe4..87e5b3f7d62bf 100644 --- a/docs/install/install.sh.md +++ b/docs/install/install.sh.md @@ -20,7 +20,7 @@ curl -fsSL https://coder.com/install.sh | sh -s -- --help 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 [127.0.0.1:3000](https://127.0.0.1:3000) and uses a [public tunnel](../admin/configure.md#tunnel) for workspace connections. +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