cloudron/cloudron-headscale/start.sh

51 lines
1.2 KiB
Bash
Raw Normal View History

#!/bin/sh
set -x
random_string() {
LC_CTYPE=C tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c32
}
if [ ! -e /app/data/config.yaml ]; then
cat <<-EOF > "/app/data/config.yaml"
---
server_url: $CLOUDRON_APP_ORIGIN
listen_addr: 0.0.0.0:8000
disable_check_updates: true
db_type: sqlite3
db_path: /app/data/db.sqlite
## Use already defined certificates:
tls_cert_path: ""
tls_key_path: ""
# Path to a file containg ACL policies.
# ACLs can be defined as YAML or HUJSON.
# https://tailscale.com/kb/1018/acls/
acl_policy_path: ""
private_key_path: /app/data/private.key
noise:
private_key_path: /app/data/noise_private.key
EOF
fi
if [ ! -e /app/data/README.md ]; then
cat <<-'EOF' > "/app/data/README.md"
# Hey there!
Configuration for headscale is stored in the file called ``. After you have made changes to it you can restart just drone-server by running `supervisorctl restart drone-server`.
To work with drone you need to configure a provider in your `.env` file. See https://docs.drone.io/server/overview/ for instructions.
EOF
fi
echo "=> Ensure permissions"
chown -R cloudron:cloudron /run /app/data
exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i headscale-server