Added docker environment way to join networks (#1871)

This commit is contained in:
Leonardo Amaral 2023-03-02 07:18:11 -03:00 committed by GitHub
parent 672c58be01
commit c6adfd9d67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -60,6 +60,7 @@ To ensure you have a network available before trying to listen on it. Without pr
You can control a few settings including the identity used and the authtoken used to interact with the control socket (which you can forward and access through `localhost:9993`).
- `ZEROTIER_JOIN_NETWORKS`: additional way to set networks to join.
- `ZEROTIER_API_SECRET`: replaces the `authtoken.secret` before booting and allows you to manage the control socket's authentication key.
- `ZEROTIER_IDENTITY_PUBLIC`: the `identity.public` file for zerotier-one. Use `zerotier-idtool` to generate one of these for you.
- `ZEROTIER_IDENTITY_SECRET`: the `identity.secret` file for zerotier-one. Use `zerotier-idtool` to generate one of these for you.

View File

@ -71,13 +71,23 @@ trap killzerotier INT TERM
log "Configuring networks to join"
mkdir -p /var/lib/zerotier-one/networks.d
log_params "Joining networks:" $@
log_params "Joining networks from command line:" $@
for i in "$@"
do
log_detail_params "Configuring join:" "$i"
touch "/var/lib/zerotier-one/networks.d/${i}.conf"
done
if [ "x$ZEROTIER_JOIN_NETWORKS" != "x" ]
then
log_params "Joining networks from environment:" $ZEROTIER_JOIN_NETWORKS
for i in "$ZEROTIER_JOIN_NETWORKS"
do
log_detail_params "Configuring join:" "$i"
touch "/var/lib/zerotier-one/networks.d/${i}.conf"
done
fi
log "Starting ZeroTier"
nohup /usr/sbin/zerotier-one &