#!/bin/sh
hostname terminay
export SHELL=/bin/bash
export PATH=/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOME=/root TERM=xterm-256color
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t tmpfs tmpfs /tmp
mount -t tmpfs tmpfs /run
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts
ip link set lo up
ip link set eth0 up
udhcpc -i eth0 -n -q
echo 'DEMO_STAGE preparing sample project'
git -C /workspace init -q
git -C /workspace -c user.name='Terminay Demo' -c user.email='demo@terminay.com' add .
git -C /workspace -c user.name='Terminay Demo' -c user.email='demo@terminay.com' commit -qm 'Welcome to the Terminay demo'
# The demo starts with Pixel visible; normal Terminay defaults stay unchanged.
mkdir -p /tmp/terminay
cat > /tmp/terminay/settings.v1.json <<'SETTINGS'
{"schemaVersion":2,"revision":0,"cursor":"0","settings":{"pixel":{"enabled":true,"provider":"unset"}},"secretReferences":{}}
SETTINGS
echo 'DEMO_STAGE starting server transport'
exec /usr/bin/node --jitless /app/demo-bridge.mjs
