2020-06-29 08:43:46 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
|
2020-07-06 09:59:05 +00:00
|
|
|
#go generate -mod=vendor ./...
|
2020-06-29 08:43:46 +00:00
|
|
|
go build -mod=vendor -o telebit cmd/telebit/*.go
|
|
|
|
|
|
|
|
source .env
|
|
|
|
|
|
|
|
ADMIN_HOSTNAME=${ADMIN_HOSTNAME:-"devices.example.com"}
|
|
|
|
AUTH_BASEURL=${AUTH_BASEURL:-"https://devices.example.com"}
|
2020-07-06 09:59:05 +00:00
|
|
|
AUTH_URL=${AUTH_URL:-"$AUTH_BASEURL/api"}
|
2020-06-29 08:43:46 +00:00
|
|
|
SECRET=${SECRET:-"xxxxxxxxxxxxxxxx"}
|
2020-07-06 09:59:05 +00:00
|
|
|
ACME_EMAIL="${ACME_EMAIL:-}"
|
2020-06-29 08:43:46 +00:00
|
|
|
|
|
|
|
./telebit --acme-agree=true \
|
|
|
|
--admin-hostname $ADMIN_HOSTNAME \
|
2020-07-06 09:59:05 +00:00
|
|
|
--auth-url $AUTH_URL/api \
|
|
|
|
--acme-email "$ACME_EMAIL" \
|
2020-06-29 08:43:46 +00:00
|
|
|
--secret "$SECRET" \
|
|
|
|
--listen 3020,3030
|