Skip to content

Commit c16b0b4

Browse files
authored
Fix no publication when there is no whitelist specified (#23)
Co-authored-by: Florian <[email protected]>
1 parent 53f98fc commit c16b0b4

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ docker run --rm \
126126
-e BLE=true \
127127
-e IDENTITIES="{\"00:11:22:33:44:55:66\":\"0dc540f3025b474b9ef1085e051b1add\",\"AA:BB:CC:DD:EE:FF\":\"6385424e1b0341109942ad2a6bb42e58\"}" \
128128
-e BINDKEYS="{\"00:11:22:33:44:55:66\":\"0dc540f3025b474b9ef1085e051b1add\",\"AA:BB:CC:DD:EE:FF\":\"6385424e1b0341109942ad2a6bb42e58\"}" \
129-
-e WHITELIST="[11:22:33:44:55:66,AA:BB:CC:DD:EE:FF]" \
130-
-e BLACKLIST="[11:22:33:44:55:66,AA:BB:CC:DD:EE:FF]" \
129+
-e WHITELIST='"[11:22:33:44:55:66,AA:BB:CC:DD:EE:FF]"' \
130+
-e BLACKLIST='"[11:22:33:44:55:66,AA:BB:CC:DD:EE:FF]"' \
131131
-v /var/run/dbus:/var/run/dbus \
132132
--name theengsgateway \
133133
theengs/gateway-ARCH:latest

chroot/opt/venv/start.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,7 @@ echo "Creating config at $CONFIG ..."
202202
"time_format": "${TIME_FORMAT:-0}",
203203
"ble": ${BLE:-true},
204204
"enable_tls": ${ENABLE_TLS:-false},
205-
"enable_websocket": ${ENABLE_WEBSOCKET:-false},
206-
"whitelist": "${WHITELIST:-[]}",
207-
"blacklist": "${BLACKLIST:-[]}"
205+
"enable_websocket": ${ENABLE_WEBSOCKET:-false}
208206
EOF
209207
# Conditionally include IDENTITIES if not empty
210208
if [ -n "$IDENTITIES" ]; then
@@ -216,6 +214,16 @@ EOF
216214
echo ", \"bindkeys\": $BINDKEYS"
217215
fi
218216

217+
# Conditionally include WHITELIST if not empty
218+
if [ -n "$WHITELIST" ]; then
219+
echo ", \"whitelist\": $WHITELIST"
220+
fi
221+
222+
# Conditionally include BLACKLIST if not empty
223+
if [ -n "$BLACKLIST" ]; then
224+
echo ", \"blacklist\": $BLACKLIST"
225+
fi
226+
219227
echo "}"
220228
} > $CONFIG
221229

0 commit comments

Comments
 (0)