Files
devdesk/debian/devdesk.postinst
T
jaredandClaude Opus 5.5 74927a7640
build-deb / Lint, test, package (push) Successful in 3m53s
build-deb / Deploy to CT 126 (push) Successful in 10s
build-deb / Notify on failure (push) Skipped
fix: v0.9.1 robustness cleanups
- run_resume falls back to a new conversation only when the transcript file
  is gone; other failures end at the menu with the recorded id intact.
- The SessionStart hook resolves the session name under the registry lock;
  rename holds it across tmux rename-session and the registry move
  (dd_registry_locked, nestable).
- dd_load_env parses KEY=value like systemd instead of sourcing the files.
- devdesk-deploy: DPkg::Lock::Timeout, explicit FAILED lines on stdout and in
  the log; the hook answers synchronously and CI checks the HTTP status.
  logrotate for the deploy log.
- postinst drops duplicate terminal-features entries; hooks sweep stale
  temp files.

Closes #12

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 01:01:51 -04:00

30 lines
1.1 KiB
Bash

#!/bin/sh
set -e
case "$1" in
configure)
# Credential ttyd requires; NPM injects it as an Authorization header.
if [ ! -s /etc/devdesk/secret.env ]; then
umask 077
secret=$(od -An -tx1 -N24 /dev/urandom | tr -d ' \n')
printf 'DEVDESK_CREDENTIAL=devdesk:%s\n' "$secret" >/etc/devdesk/secret.env
fi
chmod 600 /etc/devdesk/secret.env
# Apply tmux.conf changes to a running server without restarting it.
if [ -S /run/devdesk/tmux.sock ]; then
tmux -N -S /run/devdesk/tmux.sock source-file /usr/share/devdesk/tmux.conf >/dev/null 2>&1 || true
# Before 0.3.1 every upgrade appended another copy of DevDesk's
# terminal-features entry; tmux.conf now sets index 90. Drop the copies.
tmux -N -S /run/devdesk/tmux.sock show -s terminal-features 2>/dev/null |
awk '$2 == "xterm-256color:RGB" && $1 != "terminal-features[90]" { print $1 }' |
while read -r opt; do
tmux -N -S /run/devdesk/tmux.sock set -su "$opt" >/dev/null 2>&1 || true
done
fi
;;
esac
#DEBHELPER#
exit 0