feat: Add tunnel by default (#4399)

* feat: Add tunnel by default

If an access URL is not specified, we will always tunnel.

This is from community-member feedback who exclaimed that
it's confusing having the default for `coder server` display
a warning message, and I agree.

There is very little (maybe none) in running `coder server`
without tunnel and without an access URL, so this seems like
overall a much better UX.

* Update install.sh

Co-authored-by: Ben Potter <ben@coder.com>

* Update docs/install/packages.md

Co-authored-by: Ben Potter <ben@coder.com>

* Fix reset pass test

* Fix e2e test

Co-authored-by: Ben Potter <ben@coder.com>
This commit is contained in:
Kyle Carberry
2022-10-07 08:05:56 -05:00
committed by GitHub
co-authored by Ben Potter
parent 3049a56355
commit 3cc77d96eb
22 changed files with 60 additions and 88 deletions
+5 -5
View File
@@ -1,11 +1,6 @@
Coder server's primary configuration is done via environment variables. For a full list
of the options, run `coder server --help` on the host.
## Tunnel
For proof-of-concept deployments, you can set `CODER_TUNNEL=true` to run Coder on a unique `*.try.coder.app` URL.
This is a quick way to allow users and workspaces outside your LAN to connect to Coder.
## Access URL
`CODER_ACCESS_URL` is required if you are not using the tunnel. Set this to the external URL
@@ -14,6 +9,11 @@ should not be localhost.
> Access URL should be a external IP address or domain with DNS records pointing to Coder.
### Tunnel
If an access URL is not specified, Coder will create
a publicly accessible URL to reverse proxy your deployment for simple setup.
## Wildcard access URL
`CODER_WILDCARD_ACCESS_URL` is necessary for [port forwarding](../networking/port-forwarding.md#dashboard)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

+1 -1
View File
@@ -15,7 +15,7 @@ Coder publishes self-contained .zip and .tar.gz archives in [GitHub releases](ht
```sh
# Automatically sets up an external access URL on *.try.coder.app
coder server --tunnel
coder server
# Requires a PostgreSQL instance and external access URL
coder server --postgres-url <url> --access-url <url>
+2 -5
View File
@@ -4,7 +4,7 @@ You can install and run Coder using the official Docker images published on [Git
Docker is required. See the [official installation documentation](https://docs.docker.com/install/).
## Run Coder with built-in database and tunnel (quick)
## Run Coder with the built-in database (quick)
For proof-of-concept deployments, you can run a complete Coder instance with
the following command:
@@ -14,7 +14,6 @@ export CODER_DATA=$HOME/.config/coderv2-docker
export DOCKER_GROUP=$(getent group docker | cut -d: -f3)
mkdir -p $CODER_DATA
docker run --rm -it \
-e CODER_TUNNEL=true \
-v $CODER_DATA:/home/coder/.config \
-v /var/run/docker.sock:/var/run/docker.sock \
--group-add $DOCKER_GROUP \
@@ -68,7 +67,7 @@ an PostgreSQL container and volume.
```sh
cd coder
CODER_TUNNEL=true docker-compose up
docker-compose up
```
For production deployments, we recommend setting an [access URL](../admin/configure.md#access-url):
@@ -79,8 +78,6 @@ an PostgreSQL container and volume.
CODER_ACCESS_URL=https://coder.example.com docker-compose up
```
> Without `CODER_ACCESS_URL` or `CODER_TUNNEL` set, Coder will bind to `localhost:7080`. This will only work for Docker-based templates.
4. Visit the web ui via the configured url. You can add `/login` to the base url to create the first user via the ui.
5. Follow the on-screen instructions log in and create your first template and workspace
+1 -1
View File
@@ -7,7 +7,7 @@
1. Run Coder as a system service.
```sh
# Set up an access URL or enable CODER_TUNNEL
# Optional) Set up an access URL
sudo vim /etc/coder.d/coder.env
# To systemd to start Coder now and on reboot
-2
View File
@@ -12,8 +12,6 @@ Please [install Coder](../install) before proceeding with the steps below.
1. Run `coder login <your Access URL>` in a new terminal and follow the
interactive instructions to create your owner user and password.
> If using `coder server --tunnel`, the Access URL appears in the terminal logs.
## Templates
To get started using templates, run the following command to generate a sample template:
+1 -9
View File
@@ -78,15 +78,7 @@ curl -fsSL https://coder.com/install.sh | sh
## Run Coder
First, edit the `coder.env` file to enable `CODER_TUNNEL` by setting the value to true with the following command:
```sh
sudo vim /etc/coder.d/coder.env
```
<img src="../images/quickstart/aws/aws7.png">
Exit vim and run the following command to start Coder as a system level service:
Run the following command to start Coder as a system level service:
```sh
sudo systemctl enable --now coder
+1 -9
View File
@@ -49,15 +49,7 @@ curl -fsSL <https://coder.com/install.sh> | sh
## Run Coder
First, edit the `coder.env` file to enable `CODER_TUNNEL` by setting the value to true with the following command:
```sh
sudo vim /etc/coder.d/coder.env
```
<img src="../images/quickstart/azure/azure7.png">
Exit vim and run the following command to start Coder as a system level service:
Run the following command to start Coder as a system level service:
```sh
sudo systemctl enable --now coder
+4 -10
View File
@@ -15,19 +15,13 @@ Coder with Docker has the following advantages:
1. [Install and launch Coder](../install)
Next, we export the `CODER_ADDRESS` and `CODER_ACCESS_URL` environment
variables. We can use localhost for the Access URL since the workspaces
all run on the same machine. `CODER_ADDRESS` is where coder server binds
while `CODER_ACCESS_URL` is where it's accessed. We use `:7080` to bind
to all interfaces.
The Coder server binds to port 3000 by default. Use `--address :<port>` to customize it!
```bash
$ export CODER_ADDRESS=:7080
$ export CODER_ACCESS_URL=http://localhost:7080
$ coder server --address $CODER_ADDRESS --access-url $CODER_ACCESS_URL
$ coder server
```
1. Run `coder login http://localhost:7080` in a new terminal and follow the
1. Run `coder login http://localhost:3000` in a new terminal and follow the
interactive instructions to create your user.
1. Pull the "Docker" example template using the interactive `coder templates init`:
@@ -38,7 +32,7 @@ Coder with Docker has the following advantages:
```
1. Push up the template with `coder templates create`
1. Open the dashboard in your browser (http://localhost:7080) to create your
1. Open the dashboard in your browser (http://localhost:3000) to create your
first workspace:
<img src="../images/quickstart/docker/login.png">