Remove dead MQTT-bridge-era files and stale .gitignore entries
requirements.txt (cbor2/paho-mqtt/pyOpenSSL for the old standalone bridge), .env.example (APPLIANCE_*/MQTT_*/deploy.sh env vars), and deploy.sh (ssh+tar deploy for the old bridge container) all referenced main.py and samsung_appliance/, which no longer exist. Nothing in the current HA integration, its tests, or the README depends on them; config now happens entirely through the HA config flow, and manifest.json/requirements-dev.txt own the Python dependencies. Also dropped the .gitignore exception for ocf_root_ca.pem (that vendored file was deleted along with the rest of the vendored transport) and the now-inapplicable "Bridge runtime" log ignores.
This commit is contained in:
1 parent
4c1497f5ba
commit
ab097ffae2
3 files changed
-151
No files matched your search
@@ -1,62 +0,0 @@
|
|||||||
# SmartThings-Local Bridge config.
|
|
||||||
# Copy to `.env` and fill in. Never commit `.env`.
|
|
||||||
|
|
||||||
# =============================================================
|
|
||||||
# Appliances — one process supervises N appliances over DTLS.
|
|
||||||
# =============================================================
|
|
||||||
# APPLIANCE_COUNT defines how many entries to read. Per-appliance
|
|
||||||
# keys are 1-indexed (APPLIANCE_1_*, APPLIANCE_2_*, …).
|
|
||||||
APPLIANCE_COUNT=1
|
|
||||||
|
|
||||||
# Appliance 1 — Samsung dryer
|
|
||||||
APPLIANCE_1_CLASS=dryer
|
|
||||||
APPLIANCE_1_IP=192.168.1.100
|
|
||||||
# Leave OCF_PORT blank to inherit the descriptor's default
|
|
||||||
# (dryer=49155, oven=49154).
|
|
||||||
APPLIANCE_1_OCF_PORT=
|
|
||||||
APPLIANCE_1_TOPIC=samsung_dryer
|
|
||||||
APPLIANCE_1_NAME=Samsung Dryer
|
|
||||||
|
|
||||||
# Future:
|
|
||||||
# APPLIANCE_2_CLASS=oven
|
|
||||||
# APPLIANCE_2_IP=192.168.1.101
|
|
||||||
# APPLIANCE_2_OCF_PORT=
|
|
||||||
# APPLIANCE_2_TOPIC=samsung_oven
|
|
||||||
# APPLIANCE_2_NAME=Samsung Oven
|
|
||||||
# (Don't forget to bump APPLIANCE_COUNT=2.)
|
|
||||||
|
|
||||||
# --- Cert paths ---
|
|
||||||
# Defaults work for Docker (mount as /config) and bare-metal (drop
|
|
||||||
# into ./certs). The client cert + key are built by setup_cert.py.
|
|
||||||
# CERT_PATH=./certs/client_fullchain.pem
|
|
||||||
# KEY_PATH=./certs/client.key
|
|
||||||
|
|
||||||
# --- MQTT broker (HA Mosquitto add-on or any broker) ---
|
|
||||||
MQTT_BROKER=192.168.1.5
|
|
||||||
MQTT_PORT=1883
|
|
||||||
MQTT_USER=samsung_bridge
|
|
||||||
MQTT_PASS=
|
|
||||||
|
|
||||||
# HA discovery prefix — must match the MQTT integration's setting in HA
|
|
||||||
# (default `homeassistant`).
|
|
||||||
HA_DISCOVERY_PREFIX=homeassistant
|
|
||||||
|
|
||||||
# Bridge timers (seconds).
|
|
||||||
# HEALTH_INTERVAL_S — how often <prefix>/bridge/health republishes.
|
|
||||||
# PING_INTERVAL_S — CoAP empty-CON ping cadence (DTLS-layer
|
|
||||||
# liveness). Three consecutive failures publish
|
|
||||||
# availability=offline.
|
|
||||||
# State freshness itself comes from the in-bridge PollScheduler whose
|
|
||||||
# tier cadences are declared in the appliance descriptor — there is
|
|
||||||
# no top-level heartbeat env var to tune.
|
|
||||||
HEALTH_INTERVAL_S=60
|
|
||||||
PING_INTERVAL_S=25
|
|
||||||
|
|
||||||
# Container TZ.
|
|
||||||
TZ=Europe/London
|
|
||||||
|
|
||||||
|
|
||||||
# --- Deploy (deploy.sh — tar + ssh docker compose) ---
|
|
||||||
SSH_HOST=user@your-server
|
|
||||||
REMOTE_DIR=/mnt/user/compose/smartthings-local
|
|
||||||
APPDATA_DIR=/mnt/user/appdata/smartthings-local
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Sync source + .env to the remote and rebuild the container.
|
|
||||||
#
|
|
||||||
# Two host paths are used:
|
|
||||||
# REMOTE_DIR — compose project (source code, .env, docker-compose.yml)
|
|
||||||
# Convention: /mnt/user/compose/samsung-bridge/
|
|
||||||
# APPDATA_DIR — bind-mount source for /config inside the container
|
|
||||||
# (client cert + key live here).
|
|
||||||
# Convention: /mnt/user/appdata/samsung-bridge/
|
|
||||||
#
|
|
||||||
# The remote must already have the certs in $APPDATA_DIR. Run once
|
|
||||||
# before the first deploy:
|
|
||||||
#
|
|
||||||
# source .env
|
|
||||||
# ssh "$SSH_HOST" mkdir -p "$APPDATA_DIR"
|
|
||||||
# scp certs/client_fullchain.pem certs/client.key \
|
|
||||||
# "$SSH_HOST:$APPDATA_DIR/"
|
|
||||||
#
|
|
||||||
# Subsequent deploys (this script) ship source code + .env only; the
|
|
||||||
# certs in $APPDATA_DIR are preserved.
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [ ! -f .env ]; then
|
|
||||||
echo "Error: .env file not found. Copy .env.example to .env and configure it."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Pull only the keys deploy.sh actually needs, without sourcing .env.
|
|
||||||
# Sourcing would tokenize unquoted spaces in values (e.g.
|
|
||||||
# `APPLIANCE_1_NAME=Samsung Dryer`) as shell commands.
|
|
||||||
get_env() {
|
|
||||||
grep -E "^${1}=" .env | head -1 | cut -d= -f2-
|
|
||||||
}
|
|
||||||
SSH_HOST=$(get_env SSH_HOST)
|
|
||||||
REMOTE_DIR=$(get_env REMOTE_DIR)
|
|
||||||
APPDATA_DIR=$(get_env APPDATA_DIR)
|
|
||||||
|
|
||||||
: "${SSH_HOST:?SSH_HOST not set in .env}"
|
|
||||||
: "${REMOTE_DIR:?REMOTE_DIR not set in .env}"
|
|
||||||
: "${APPDATA_DIR:?APPDATA_DIR not set in .env}"
|
|
||||||
|
|
||||||
echo "Deploying to ${SSH_HOST}:${REMOTE_DIR}…"
|
|
||||||
ssh "${SSH_HOST}" mkdir -p "${REMOTE_DIR}" "${APPDATA_DIR}"
|
|
||||||
|
|
||||||
# Source code — explicit allowlist instead of an excludelist. Anything
|
|
||||||
# else in the repo (research files, certs, logs, the .git dir) stays
|
|
||||||
# local.
|
|
||||||
COPYFILE_DISABLE=1 tar cz \
|
|
||||||
main.py \
|
|
||||||
samsung_appliance/ \
|
|
||||||
Dockerfile \
|
|
||||||
docker-compose.yml \
|
|
||||||
requirements.txt \
|
|
||||||
deploy.sh \
|
|
||||||
README.md \
|
|
||||||
.env.example \
|
|
||||||
.gitignore \
|
|
||||||
| ssh "${SSH_HOST}" "cd ${REMOTE_DIR} && tar xz && find . -name '._*' -delete"
|
|
||||||
|
|
||||||
# Ship .env separately and lock it down on the remote.
|
|
||||||
scp .env "${SSH_HOST}:${REMOTE_DIR}/.env"
|
|
||||||
ssh "${SSH_HOST}" "chmod 600 ${REMOTE_DIR}/.env"
|
|
||||||
|
|
||||||
# Verify certs are present on the remote — they have to be uploaded
|
|
||||||
# once before the first build.
|
|
||||||
if ! ssh "${SSH_HOST}" "test -s ${APPDATA_DIR}/client_fullchain.pem && test -s ${APPDATA_DIR}/client.key"; then
|
|
||||||
echo
|
|
||||||
echo "WARNING: ${APPDATA_DIR}/client_fullchain.pem and client.key not"
|
|
||||||
echo "found on the remote. The container will start but fail to"
|
|
||||||
echo "connect to the appliance until you upload them, e.g.:"
|
|
||||||
echo " ssh ${SSH_HOST} mkdir -p ${APPDATA_DIR}"
|
|
||||||
echo " scp certs/client_fullchain.pem certs/client.key ${SSH_HOST}:${APPDATA_DIR}/"
|
|
||||||
echo
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Rebuilding container…"
|
|
||||||
ssh "${SSH_HOST}" "cd ${REMOTE_DIR} && docker compose up -d --build"
|
|
||||||
|
|
||||||
echo "Done."
|
|
||||||
echo "Logs: ssh ${SSH_HOST} 'cd ${REMOTE_DIR} && docker compose logs -f'"
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
cbor2>=5.6
|
|
||||||
paho-mqtt>=2.0
|
|
||||||
# pyOpenSSL 23.x added the set_ciphertext_mtu API the DTLS handshake
|
|
||||||
# needs; older versions fragment the client cert across two UDP
|
|
||||||
# datagrams and TizenRT drops the second one.
|
|
||||||
pyOpenSSL>=23.0
|
|
||||||
# scapy is only needed for the offline analyze_pcap.py helper; keep
|
|
||||||
# optional to avoid pulling it into the bridge container.
|
|
||||||
# scapy>=2.5
|
|
||||||
Reference in new issue
Block a user