Skip to content

Commit f2521c8

Browse files
committed
Allow setting local.conf content from Docker environment variable
1 parent d353e0c commit f2521c8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Diff for: README.docker.md

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ You can control a few settings including the identity used and the authtoken use
6464
- `ZEROTIER_API_SECRET`: replaces the `authtoken.secret` before booting and allows you to manage the control socket's authentication key.
6565
- `ZEROTIER_IDENTITY_PUBLIC`: the `identity.public` file for zerotier-one. Use `zerotier-idtool` to generate one of these for you.
6666
- `ZEROTIER_IDENTITY_SECRET`: the `identity.secret` file for zerotier-one. Use `zerotier-idtool` to generate one of these for you.
67+
- `ZEROTIER_LOCAL_CONF`: Sets the the `local.conf` file content for zerotier-one
6768

6869
### Tips
6970

Diff for: entrypoint.sh.release

+8-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ mkztfile() {
99
file=$1
1010
mode=$2
1111
content=$3
12-
12+
echo "creating $file"
1313
mkdir -p /var/lib/zerotier-one
14-
echo "$content" > "/var/lib/zerotier-one/$file"
14+
echo -n "$content" > "/var/lib/zerotier-one/$file"
1515
chmod "$mode" "/var/lib/zerotier-one/$file"
1616
}
1717

1818
if [ "x$ZEROTIER_API_SECRET" != "x" ]
1919
then
2020
mkztfile authtoken.secret 0600 "$ZEROTIER_API_SECRET"
21+
mkztfile metricstoken.secret 0600 "$ZEROTIER_API_SECRET"
2122
fi
2223

2324
if [ "x$ZEROTIER_IDENTITY_PUBLIC" != "x" ]
@@ -30,6 +31,11 @@ then
3031
mkztfile identity.secret 0600 "$ZEROTIER_IDENTITY_SECRET"
3132
fi
3233

34+
if [ "x$ZEROTIER_LOCAL_CONF" != "x" ]
35+
then
36+
mkztfile local.conf 0644 "$ZEROTIER_LOCAL_CONF"
37+
fi
38+
3339
mkztfile zerotier-one.port 0600 "9993"
3440

3541
killzerotier() {

0 commit comments

Comments
 (0)