- Ask Claude: strip control characters, send as bracketed paste (closes #2) - end: forget before kill, so ending from inside a session leaves no ghost (closes #3) - reconnects use `attach --existing` and never resurrect ended/renamed sessions (closes #4) - repo: git --no-optional-locks, no safe.directory override, refresh on connect/bell/60s (closes #5) - uploads: unique names via mktemp, cleanup trap on hangup (closes #6) - clipboard: write-only OSC 52 provider, tmux allow-passthrough off (closes #7) - uploads: size check up front, streamed slices, idle timeout (closes #9) - --list: path last in TSV rows, tolerant numbers (closes #10) - tokens via curl config on stdin; userinfo stripped from remote URLs (closes #11) - ttyd max clients 32 and at most 2 concurrent side-channel calls (#8; BroadcastChannel polling still open) - tmux: fixed terminal-features index (no duplicates on re-source), no status-right clock Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
1.1 KiB
Bash
Executable File
26 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# ExecStart for devdesk.service: builds the ttyd command line from
|
|
# /etc/devdesk/env and /etc/devdesk/secret.env (loaded by systemd).
|
|
set -euo pipefail
|
|
|
|
if [ -z "${DEVDESK_CREDENTIAL:-}" ]; then
|
|
echo "devdesk-serve: DEVDESK_CREDENTIAL is not set (expected in /etc/devdesk/secret.env)" >&2
|
|
exit 1
|
|
fi
|
|
|
|
args=(
|
|
--port "${DEVDESK_PORT:-7681}"
|
|
--writable # ttyd >= 1.7.4 is read-only by default
|
|
--url-arg # ?arg=<session> becomes `devdesk attach <session>`
|
|
--check-origin # refuse cross-site WebSocket connections
|
|
--max-clients "${DEVDESK_MAX_CLIENTS:-32}"
|
|
--credential "$DEVDESK_CREDENTIAL" # injected by NPM as an Authorization header
|
|
--index "${DEVDESK_INDEX:-/usr/share/devdesk/index.html}"
|
|
--debug "${DEVDESK_TTYD_LOG_LEVEL:-3}" # errors+warnings only: notice level would log the credential
|
|
)
|
|
if [ -n "${DEVDESK_BIND:-}" ]; then
|
|
args+=(--interface "$DEVDESK_BIND")
|
|
fi
|
|
|
|
exec "${DEVDESK_TTYD:-/usr/lib/devdesk/bin/ttyd}" "${args[@]}" "${DEVDESK_BIN:-/usr/bin/devdesk}" attach
|