chore: rebrand backone names, add lint gate + agent docs

- CI: build/validate use backone selftest + binary names, add lint.yml
- make-*.mk: emit/install backone binaries, drop zerotier-one paths
- doc/debian/ext.installfiles: backone manpages, service, init, te
- rule-compiler: npm test runs test.js; attic world planet files
- AGENTS.md repository guidelines, tools/lint.sh changed-lines gate
- gitignore: /backone-selftest, *.gcno, *.gcda
This commit is contained in:
dedysutanto committed 2026-09-30 15:08:00 +07:00
1 parent 104d781614
commit c550fe0684
37 files changed
+881 -565

No files matched your search

+12 -12
View File
@@ -1,7 +1,7 @@
#!/bin/sh
grepzt() {
[ -f /var/lib/zerotier-one/zerotier-one.pid -a -n "$(cat /var/lib/zerotier-one/zerotier-one.pid 2>/dev/null)" -a -d "/proc/$(cat /var/lib/zerotier-one/zerotier-one.pid 2>/dev/null)" ]
[ -f "$ZEROTIER_HOME/$ZT_PID_FILE" -a -n "$(cat "$ZEROTIER_HOME/$ZT_PID_FILE" 2>/dev/null)" -a -d "/proc/$(cat "$ZEROTIER_HOME/$ZT_PID_FILE" 2>/dev/null)" ]
return $?
}
@@ -10,9 +10,9 @@ mkztfile() {
mode=$2
content=$3
mkdir -p /var/lib/zerotier-one
echo "$content" > "/var/lib/zerotier-one/$file"
chmod "$mode" "/var/lib/zerotier-one/$file"
mkdir -p "$ZEROTIER_HOME"
echo "$content" > "$ZEROTIER_HOME/$file"
chmod "$mode" "$ZEROTIER_HOME/$file"
}
if [ "x$ZEROTIER_API_SECRET" != "x" ]
@@ -30,11 +30,11 @@ then
mkztfile identity.secret 0600 "$ZEROTIER_IDENTITY_SECRET"
fi
mkztfile zerotier-one.port 0600 "9993"
mkztfile "$ZT_PORT_FILE" 0600 "9993"
killzerotier() {
log "Killing zerotier"
kill $(cat /var/lib/zerotier-one/zerotier-one.pid 2>/dev/null)
kill $(cat "$ZEROTIER_HOME/$ZT_PID_FILE" 2>/dev/null)
exit 0
}
@@ -69,13 +69,13 @@ log_detail_params() {
trap killzerotier INT TERM
log "Configuring networks to join"
mkdir -p /var/lib/zerotier-one/networks.d
mkdir -p "$ZEROTIER_HOME/networks.d"
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"
touch "$ZEROTIER_HOME/networks.d/${i}.conf"
done
if [ "x$ZEROTIER_JOIN_NETWORKS" != "x" ]
@@ -84,12 +84,12 @@ then
for i in $ZEROTIER_JOIN_NETWORKS
do
log_detail_params "Configuring join:" "$i"
touch "/var/lib/zerotier-one/networks.d/${i}.conf"
touch "$ZEROTIER_HOME/networks.d/${i}.conf"
done
fi
log "Starting ZeroTier"
nohup /usr/sbin/zerotier-one &
nohup "$ZT_DAEMON" &
while ! grepzt
do
@@ -109,13 +109,13 @@ cat >/healthcheck.sh <<EOF
#!/bin/bash
for i in $@ $ZEROTIER_JOIN_NETWORKS
do
[ "\$(zerotier-cli get \$i status)" = "OK" ] || exit 1
[ "\$($ZT_CLI get \$i status)" = "OK" ] || exit 1
done
EOF
chmod +x /healthcheck.sh
log_params "zerotier-cli info:" "$(zerotier-cli info)"
log_params "$ZT_CLI info:" "$($ZT_CLI info)"
log "Sleeping infinitely"
while true