Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=1.5.0.2
VERSION=1.6.0.1
NON_INTERACTIVE=false
BUILDX=true
BUILDX_PURGE=false
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@ FROM python:3.11-slim

SHELL ["/bin/bash", "-ec"]

RUN apt update && apt install --no-install-recommends -y bluez build-essential
RUN apt update && apt install --no-install-recommends -y \
bluez \
build-essential \
libssl-dev \
libffi-dev \
python3-dev \
cmake

RUN python3 -m venv /opt/venv && \
source /opt/venv/bin/activate && \
pip install --upgrade pip setuptools==70.0.0 && \
pip install --upgrade --extra-index-url=https://www.piwheels.org/simple pip TheengsGateway==1.5.0
source /opt/venv/bin/activate && \
pip install --upgrade pip setuptools==70.0.0 && \
pip install --prefer-binary --extra-index-url=https://www.piwheels.org/simple TheengsGateway==1.6.0

COPY chroot /
CMD source /opt/venv/bin/activate && exec /opt/venv/start.sh
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ services:
IDENTITIES: "[]"
WHITELIST: "[11:22:33:44:55:66,AA:BB:CC:DD:EE:FF]"
BLACKLIST: "[11:22:33:44:55:66,AA:BB:CC:DD:EE:FF]"
IGNORE_WBLIST: false
CA_FILE: /etc/ssl/certs/ca.crt

volumes:
- /var/run/dbus:/var/run/dbus
- ./certs/ca.crt:/etc/ssl/certs/ca.crt:ro
```

*MQTT_HOST* is mandatory field, ofcourse.
Expand Down Expand Up @@ -119,7 +122,7 @@ docker run --rm \
-e DISCOVERY_TOPIC=homeassistant \
-e DISCOVERY_DEVICE_NAME=TheengsGateway \
-e DISCOVERY_FILTER="[IBEACON]" \
-e SCANNING_MODE=active
-e SCANNING_MODE=active \
-e ADAPTER=hci0 \
-e TIME_SYNC="[]" \
-e TIME_FORMAT=0 \
Expand All @@ -128,7 +131,10 @@ docker run --rm \
-e BINDKEYS="{\"00:11:22:33:44:55:66\":\"0dc540f3025b474b9ef1085e051b1add\",\"AA:BB:CC:DD:EE:FF\":\"6385424e1b0341109942ad2a6bb42e58\"}" \
-e WHITELIST='"[11:22:33:44:55:66,AA:BB:CC:DD:EE:FF]"' \
-e BLACKLIST='"[11:22:33:44:55:66,AA:BB:CC:DD:EE:FF]"' \
-e IGNORE_WBLIST=false \
-e CA_FILE="/etc/ssl/certs/ca.crt" \
-v /var/run/dbus:/var/run/dbus \
-v ./certs/ca.crt:/etc/ssl/certs/ca.crt:ro \
--name theengsgateway \
theengs/gateway-ARCH:latest
```
Expand Down
18 changes: 17 additions & 1 deletion chroot/opt/venv/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ if hasvalue $LOG_LEVEL; then
fi
fi

if hasvalue $IGNORE_WBLIST; then
if ! [[ $IGNORE_WBLIST =~ (true|false) ]]; then
echo "WARNING : Wrong value for IGNORE_WBLIST environment variable, will use default - false"
IGNORE_WBLIST=false
fi
fi

if hasvalue $CA_FILE; then
if ! [ -f "$CA_FILE" ]; then
echo "WARNING : CA_FILE path '$CA_FILE' does not exist. TLS validation may fail."
fi
fi


if hasvalue $DISCOVERY; then
if ! [[ $DISCOVERY =~ (true|false) ]]; then
echo "WARNING : Wrong value for DISCOVERY environment variable, will use default - true"
Expand Down Expand Up @@ -202,7 +216,9 @@ echo "Creating config at $CONFIG ..."
"time_format": "${TIME_FORMAT:-0}",
"ble": ${BLE:-true},
"enable_tls": ${ENABLE_TLS:-false},
"enable_websocket": ${ENABLE_WEBSOCKET:-false}
"enable_websocket": ${ENABLE_WEBSOCKET:-false},
"ignore_wblist": ${IGNORE_WBLIST:-false},
"ca_file": "${CA_FILE:-}"
EOF
# Conditionally include IDENTITIES if not empty
if [ -n "$IDENTITIES" ]; then
Expand Down
4 changes: 3 additions & 1 deletion examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ services:
IDENTITIES: "{}"
WHITELIST: "[]"
BLACKLIST: "[]"

IGNORE_WBLIST: false
CA_FILE: "/etc/ssl/certs/ca.crt"
volumes:
- /var/run/dbus:/var/run/dbus
- ./certs/ca.crt:/etc/ssl/certs/ca.crt:ro
Loading