11 lines
564 B
Bash
11 lines
564 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
test "$#" -eq 1 || { echo 'Usage: bash scripts/bootstrap.sh relay.your-domain'; exit 1; }
|
|
test ! -f .env || { echo '.env exists; refusing to overwrite credentials'; exit 1; }
|
|
docker build -t hainuo-relay:0.1.0 .
|
|
docker run --rm --user "$(id -u):$(id -g)" \
|
|
-v "$PWD:/work" -w /work hainuo-relay:0.1.0 init --hostname "$1"
|
|
echo 'Initialized. Configure .env and replace runtime/tls/server.pem + server.key before acceptance.'
|
|
echo 'Keep operator/ca.key offline on the certificate-signing workstation.'
|