Skip to content

Commit

Permalink
Bump TheengsGateway to 120 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
1technophile authored Dec 10, 2023
1 parent 134378f commit db7c019
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=1.1.0.1
VERSION=1.2.0.1
NON_INTERACTIVE=false
BUILDX=true
BUILDX_PURGE=false
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM python:3.9-slim-bullseye
FROM python:3.10-slim-bullseye

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

RUN apt update && apt install --no-install-recommends -y bluez build-essential
RUN python3 -m venv /opt/venv && \
source /opt/venv/bin/activate && \
pip install --upgrade --extra-index-url=https://www.piwheels.org/simple pip TheengsGateway==1.1.0
pip install --upgrade --extra-index-url=https://www.piwheels.org/simple pip TheengsGateway==1.2.0

COPY chroot /
CMD source /opt/venv/bin/activate && exec /opt/venv/start.sh
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ services:
ADAPTER: hci0
TIME_SYNC: "[]"
TIME_FORMAT: 0
BINDKEYS: "[]"
ENABLE_TLS: false
ENABLE_WEBSOCKET: false
IDENTITIES: "[]"
volumes:
- /var/run/dbus:/var/run/dbus
```
Expand Down
21 changes: 20 additions & 1 deletion chroot/opt/venv/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,21 @@ if hasvalue $TIME_FORMAT; then
TIME_FORMAT=false
fi
fi

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

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

### Syntax checks - END

cd $VIRTUAL_ENV
Expand Down Expand Up @@ -160,7 +175,11 @@ cat <<EOF> $CONFIG
"scanning_mode": "${SCANNING_MODE:-active}",
"adapter": "${ADAPTER:-hci0}",
"time_sync": "${TIME_SYNC:-[]}",
"time_format": "${TIME_FORMAT:-0}"
"time_format": "${TIME_FORMAT:-0}",
"bindkeys": "${BINDKEYS:-[]}",
"enable_tls": ${ENABLE_TLS:-false},
"enable_websocket": ${ENABLE_WEBSOCKET:-false},
"identities": "${IDENTITIES:-[]}"
}
EOF
cat $CONFIG
Expand Down
5 changes: 5 additions & 0 deletions examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,10 @@ services:
DISCOVERY_FILTER: "[IBEACON]"
SCANNING_MODE: active
ADAPTER: hci0
BINDKEYS: "[]"
ENABLE_TLS: false
ENABLE_WEBSOCKET: false
IDENTITIES: "[]"

volumes:
- /var/run/dbus:/var/run/dbus

0 comments on commit db7c019

Please sign in to comment.