Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Deploying the server

Amal Shaji edited this page Mar 4, 2023 · 3 revisions

Prerequisites

  • Virtual Machine
  • Docker
  • DNS entries for (tunnel.example.com and *.tunnel.example.com)

Deploy config

You need the following files to deploy the beaver server.

beaver_server.yaml

host: 0.0.0.0                  # Address to bind the HTTP server
port: 8080                     # Port to bind the HTTP server
domain: tunnel.example.com     # Domain on which the server will be running (e.g., tunnel.example.com)            
secure: true                   # Whether the server runs under https
timeout: 3000                  # Time to wait before acquiring a WS connection to forward the request (milliseconds)
idletimeout: 60000             # Time to wait before closing the idle connection when there are enough idle connections (milliseconds)

.env

[email protected]
TUNNEL_DOMAIN=tunnel.example.com
DNS_PROVIDER=cloudflare

# DNS specific
CLOUDFLARE_DNS_API_TOKEN=<token>

Check all the supported DNS providers and the required variables here

.env for route53
[email protected]
TUNNEL_DOMAIN=tunnel.example.com
DNS_PROVIDER=cloudflare

# DNS specific
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

Permissions for cloudflare API Token

Permissions for route53 Tokens

docker-compose.yaml

Copy the contents from here

Ensure you pin the docker image to the version you want (and do not use the latest tag).

The server has two volumes.

  • /app/config/ to read the config file. You can map your local config file to /app/config/beaver_server.yaml
  • /app/data/ is where the badger database files exist. You need to map this to a local folder if you don't want to lose data on restart

Create the superuser

To access the admin dashboard, you need to create a superuser.

docker compose run beaver createsuperuser

This will take you through the prompt to create the superuser.

Start the servers

Once the above steps are complete, you are ready to start your server.

Run the beaver server.

docker compose up -d

The first run will take some time as traefik needs to issue SSL certificates. After that, the certificates will be stored locally, and subsequent starts will be faster. Once the certificates are issued (track the logs), navigate to https://tunnel.example.com to access the admin dashboard.

Login using the superuser credentials created in the previous step and create a new tunnel user. Once the user is created, copy the secret key and set it in the client config file.

🥳 🥳 You have now successfully setup your tunnel