Anurag commited on
Commit
53c5a7d
·
unverified ·
2 Parent(s): 2ef439f61ba0b8

Merge branch 'edit' into codex/update-start.sh-and-env-builder.js

Browse files
Files changed (1) hide show
  1. start.sh +15 -3
start.sh CHANGED
@@ -326,7 +326,7 @@ CONFIG_JSON=$(cat <<'CONFIGEOF'
326
  {
327
  "gateway": {
328
  "mode": "local",
329
- "port": 7860,
330
  "bind": "lan",
331
  "auth": {
332
  "token": ""
@@ -523,8 +523,10 @@ for candidate in \
523
  /usr/bin/chromium-browser \
524
  /snap/bin/chromium; do
525
  if [ -x "$candidate" ]; then
526
- BROWSER_EXECUTABLE_PATH="$candidate"
527
- break
 
 
528
  fi
529
  done
530
  if [ -z "$BROWSER_EXECUTABLE_PATH" ]; then
@@ -1688,6 +1690,16 @@ while true; do
1688
  # 11. Start WhatsApp Guardian after the gateway is accepting connections
1689
  start_guardian_once
1690
 
 
 
 
 
 
 
 
 
 
 
1691
  # 11.5 Warm up the managed browser so first browser actions have a live tab
1692
  warmup_browser
1693
 
 
326
  {
327
  "gateway": {
328
  "mode": "local",
329
+ "port": "${GATEWAY_PORT}",
330
  "bind": "lan",
331
  "auth": {
332
  "token": ""
 
523
  /usr/bin/chromium-browser \
524
  /snap/bin/chromium; do
525
  if [ -x "$candidate" ]; then
526
+ if file "$candidate" 2>/dev/null | grep -q "ELF"; then
527
+ BROWSER_EXECUTABLE_PATH="$candidate"
528
+ break
529
+ fi
530
  fi
531
  done
532
  if [ -z "$BROWSER_EXECUTABLE_PATH" ]; then
 
1690
  # 11. Start WhatsApp Guardian after the gateway is accepting connections
1691
  start_guardian_once
1692
 
1693
+ # ── Silence D-Bus errors for headless Chromium ──
1694
+ if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ]; then
1695
+ if command -v dbus-launch >/dev/null 2>&1; then
1696
+ eval "$(dbus-launch --sh-syntax 2>/dev/null)" || true
1697
+ export DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS:-disabled:}"
1698
+ else
1699
+ export DBUS_SESSION_BUS_ADDRESS="disabled:"
1700
+ fi
1701
+ fi
1702
+
1703
  # 11.5 Warm up the managed browser so first browser actions have a live tab
1704
  warmup_browser
1705