-
-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1137 from ct-Open-Source/development
Release v2.4.6
- Loading branch information
Showing
17 changed files
with
127 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Attention: "host" means your computer where you are running docker on | ||
|
||
WLAN=wlan0 #must match the name of your wlan-interface on your host, you may find it with ifconfig | ||
AP=vtrust-flash #the name of the created AP, can be anything you want | ||
GATEWAY=10.42.42.1 #gateway address, leave it here | ||
LOCALBACKUPDIR=./data/backups #location on your host where you want to store backuos of the old firmware & logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
FROM phusion/baseimage:master | ||
FROM alpine:3.13 | ||
|
||
RUN apt-get update && apt-get install -y sudo iproute2 iputils-ping | ||
RUN apk add --update bash git iw dnsmasq hostapd screen curl py3-pip py3-wheel python3-dev mosquitto haveged net-tools openssl openssl-dev gcc musl-dev linux-headers sudo coreutils grep iproute2 ncurses | ||
|
||
RUN echo '* libraries/restart-without-asking boolean true' | sudo debconf-set-selections | ||
RUN python3 -m pip install --upgrade paho-mqtt tornado git+https://github.com/drbild/sslpsk.git pycryptodomex | ||
|
||
COPY docker/bin /usr/bin/ | ||
|
||
COPY . /usr/bin/tuya-convert | ||
|
||
RUN cd /usr/bin/tuya-convert && ./install_prereq.sh | ||
WORKDIR "/usr/bin/tuya-convert" | ||
|
||
RUN mkdir -p /etc/service/tuya && cd /etc/service/tuya && ln -s /usr/bin/config.sh run | ||
ENTRYPOINT ["tuya-start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: '3' | ||
services: | ||
tuya: | ||
build: . | ||
privileged: true | ||
network_mode: "host" | ||
environment: | ||
WLAN: ${WLAN} | ||
AP: ${AP} | ||
GATEWAY: ${GATEWAY} | ||
volumes: | ||
- $LOCALBACKUPDIR:/usr/bin/tuya-convert/backups |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
cd /usr/bin/tuya-convert | ||
config-tuya.sh | ||
./start_flash.sh |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,36 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
set -e | ||
debianInstall() { | ||
sudo apt-get update | ||
sudo apt-get install -y git iw dnsmasq rfkill hostapd screen curl build-essential python3-pip python3-setuptools python3-wheel python3-dev mosquitto haveged net-tools libssl-dev iproute2 iputils-ping | ||
sudo python3 -m pip install --user --upgrade paho-mqtt tornado git+https://github.com/drbild/sslpsk.git pycryptodomex | ||
} | ||
|
||
sudo apt-get update | ||
sudo apt-get install -y git iw dnsmasq rfkill hostapd screen curl build-essential python3-pip python3-setuptools python3-wheel python3-dev mosquitto haveged net-tools libssl-dev | ||
archInstall() { | ||
sudo pacman -S --needed git iw dnsmasq hostapd screen curl python-pip python-wheel python-pycryptodomex python-paho-mqtt python-tornado mosquitto haveged net-tools openssl | ||
sudo python -m pip install --user --upgrade git+https://github.com/drbild/sslpsk.git | ||
} | ||
|
||
sudo -H python3 -m pip install --upgrade paho-mqtt tornado git+https://github.com/drbild/sslpsk.git pycryptodomex | ||
if [[ -e /etc/os-release ]]; then | ||
source /etc/os-release | ||
else | ||
echo "/etc/os-release not found! Assuming debian-based system, but this will likely fail!" | ||
ID=debian | ||
fi | ||
|
||
if [[ ${ID} == 'debian' ]] || [[ ${ID_LIKE-} == 'debian' ]]; then | ||
debianInstall | ||
elif [[ ${ID} == 'arch' ]] || [[ ${ID_LIKE-} == 'arch' ]]; then | ||
archInstall | ||
else | ||
if [[ -n ${ID_LIKE-} ]]; then | ||
printID="${ID}/${ID_LIKE}" | ||
else | ||
printID="${ID}" | ||
fi | ||
echo "/etc/os-release found but distribution ${printID} is not explicitly supported. Assuming debian-based system, but this will likely fail!" | ||
debianInstall | ||
fi | ||
|
||
echo "Ready to start upgrade" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
allow_anonymous true | ||
listener 1883 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Run screen with a custom .screenrc that defines the name of "logfile" | ||
|
||
screen_minor=${1} | ||
screen_logfile_name=${2} | ||
screen_other_options=${@:3} | ||
|
||
if [ "$screen_minor" -gt 5 ]; then | ||
echo "Info: you have the modern enough version" \ | ||
"to use the \"-Logfile\" flag of \"screen\"" | ||
elif [ "$screen_minor" -eq 5 ]; then | ||
screen_with_log="sudo screen -L" | ||
else | ||
screen_with_log="sudo screen -L -t" | ||
fi | ||
|
||
echo "logfile ${screen_logfile_name}" > ${screen_logfile_name}.screenrc | ||
|
||
${screen_with_log} ${screen_logfile_name} \ | ||
-c ${screen_logfile_name}.screenrc ${screen_other_options} | ||
|
||
rm ${screen_logfile_name}.screenrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ | |
D4A651 | ||
DC446D | ||
E078A3 | ||
CC8CBF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters