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 🚀 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=$!
|
||||
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 --->
|
||||
WEBSERVER_PORT=${WEBSERVER_PORT:-8088}
|
||||
|
||||
LIVE_DATA_FILE="../config/live.yaml"
|
||||
HW_DATA_FILE="../config/hardware.yaml"
|
||||
CONFIG_FILE="../config/numbus.yaml"
|
||||
LIVE_DATA_FILE="config/live.yaml"
|
||||
HW_DATA_FILE="config/hardware.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"
|
||||
|
||||
TMP_EXTRA_PATH="../extra"
|
||||
TMP_EXTRA_PATH="extra"
|
||||
|
||||
if [[ ${DEBUG-0} -eq 1 ]]; then
|
||||
FILES_CP_FLAGS="vau"
|
||||
@@ -755,6 +758,7 @@ GUM_INPUT_TIMEOUT="3600"
|
||||
# --- PRE MAIN LOGIC --->
|
||||
set -euo pipefail
|
||||
clear
|
||||
cd ../
|
||||
trap cleanup EXIT
|
||||
# --- PRE MAIN LOGIC ---<
|
||||
|
||||
@@ -770,15 +774,15 @@ echo """
|
||||
|
||||
launch_gui
|
||||
hierarchy_preparation
|
||||
until [[ -e ../web/signals/hw_detection_ready ]]; do
|
||||
until [[ -e web/signals/hw_detection_ready ]]; do
|
||||
sleep 5
|
||||
done
|
||||
LIVE_TARGET_IP="$(yq -r '.live_target_ip' ${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
|
||||
done
|
||||
until [[ -e ../web/signals/deployment_ready ]]; do
|
||||
until [[ -e web/signals/deployment_ready ]]; do
|
||||
sleep 5
|
||||
done
|
||||
# --- MAIN LOGIC ---<
|
||||
@@ -51,5 +51,5 @@ class BridgeHandler(http.server.SimpleHTTPRequestHandler):
|
||||
self.end_headers()
|
||||
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()
|
||||
Reference in New Issue
Block a user