Trying to get python bridge to work.
This commit is contained in:
+13
-9
@@ -334,7 +334,9 @@ launch_gui() {
|
|||||||
echo -e "\n ➡️ You will now proceed to the configuration of your device through your browser"
|
echo -e "\n ➡️ You will now proceed to the configuration of your device through your browser"
|
||||||
echo -e "\n 🚀 Launching Numbus Configurator..."
|
echo -e "\n 🚀 Launching Numbus Configurator..."
|
||||||
|
|
||||||
python3 "${BRIDGE_SCRIPT}" > /dev/null 2>&1 &
|
cd "${BRIDGE_SCRIPT_DIR}"
|
||||||
|
python3 "${BRIDGE_SCRIPT_FILE}" > /dev/null 2>&1 &
|
||||||
|
cd ../../
|
||||||
export BRIDGE_PID=$!
|
export BRIDGE_PID=$!
|
||||||
xdg-open "http://localhost:${WEBSERVER_PORT}" 2>/dev/null || open "http://localhost:${WEBSERVER_PORT}" 2>/dev/null || true
|
xdg-open "http://localhost:${WEBSERVER_PORT}" 2>/dev/null || open "http://localhost:${WEBSERVER_PORT}" 2>/dev/null || true
|
||||||
|
|
||||||
@@ -711,15 +713,16 @@ securely on a hidden sheet of paper or add it to your password manager (locally
|
|||||||
# --- DEFAULT VARIABLES --->
|
# --- DEFAULT VARIABLES --->
|
||||||
WEBSERVER_PORT=${WEBSERVER_PORT:-8088}
|
WEBSERVER_PORT=${WEBSERVER_PORT:-8088}
|
||||||
|
|
||||||
LIVE_DATA_FILE="../config/live.yaml"
|
LIVE_DATA_FILE="config/live.yaml"
|
||||||
HW_DATA_FILE="../config/hardware.yaml"
|
HW_DATA_FILE="config/hardware.yaml"
|
||||||
CONFIG_FILE="../config/numbus.yaml"
|
CONFIG_FILE="config/numbus.yaml"
|
||||||
|
|
||||||
BRIDGE_SCRIPT="../web/logic/interactive.py"
|
BRIDGE_SCRIPT_FILE="interactive.py"
|
||||||
|
BRIDGE_SCRIPT_DIR="web/logic"
|
||||||
|
|
||||||
TARGET_USER="nixos"
|
TARGET_USER="nixos"
|
||||||
|
|
||||||
TMP_EXTRA_PATH="../extra"
|
TMP_EXTRA_PATH="extra"
|
||||||
|
|
||||||
if [[ ${DEBUG-0} -eq 1 ]]; then
|
if [[ ${DEBUG-0} -eq 1 ]]; then
|
||||||
FILES_CP_FLAGS="vau"
|
FILES_CP_FLAGS="vau"
|
||||||
@@ -755,6 +758,7 @@ GUM_INPUT_TIMEOUT="3600"
|
|||||||
# --- PRE MAIN LOGIC --->
|
# --- PRE MAIN LOGIC --->
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
clear
|
clear
|
||||||
|
cd ../
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
# --- PRE MAIN LOGIC ---<
|
# --- PRE MAIN LOGIC ---<
|
||||||
|
|
||||||
@@ -770,15 +774,15 @@ echo """
|
|||||||
|
|
||||||
launch_gui
|
launch_gui
|
||||||
hierarchy_preparation
|
hierarchy_preparation
|
||||||
until [[ -e ../web/signals/hw_detection_ready ]]; do
|
until [[ -e web/signals/hw_detection_ready ]]; do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
LIVE_TARGET_IP="$(yq -r '.live_target_ip' ${LIVE_DATA_FILE})"
|
LIVE_TARGET_IP="$(yq -r '.live_target_ip' ${LIVE_DATA_FILE})"
|
||||||
LIVE_TARGET_PASSWORD="$(yq -r '.live_target_password' ${LIVE_DATA_FILE})"
|
LIVE_TARGET_PASSWORD="$(yq -r '.live_target_password' ${LIVE_DATA_FILE})"
|
||||||
until [[ -e ../web/signals/configuration_ready ]]; do
|
until [[ -e web/signals/configuration_ready ]]; do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
until [[ -e ../web/signals/deployment_ready ]]; do
|
until [[ -e web/signals/deployment_ready ]]; do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
# --- MAIN LOGIC ---<
|
# --- MAIN LOGIC ---<
|
||||||
@@ -51,5 +51,5 @@ class BridgeHandler(http.server.SimpleHTTPRequestHandler):
|
|||||||
self.end_headers()
|
self.end_headers()
|
||||||
with open(os.path.join(SIGNALS_DIR, ".deploy_signal"), "w") as f: f.write("1")
|
with open(os.path.join(SIGNALS_DIR, ".deploy_signal"), "w") as f: f.write("1")
|
||||||
|
|
||||||
os.chdir(PAGES_DIR)
|
os.chdir(../)
|
||||||
http.server.HTTPServer(('localhost', 8088), BridgeHandler).serve_forever()
|
http.server.HTTPServer(('localhost', 8088), BridgeHandler).serve_forever()
|
||||||
Reference in New Issue
Block a user