feat: rename app to Last Signal

Rename service, UI, storage, and target-path configuration; clarify expiration cleanup behavior.
This commit is contained in:
2026-09-30 11:55:58 +09:00
parent d56c6ea1ac
commit aeaa1b37c2
19 changed files with 115 additions and 85 deletions

View File

@@ -1,20 +1,35 @@
#!/bin/sh
set -eu
TARGET="${COLLECTION_PATH:-/home/zenn/Collection}"
TARGET="${TARGET_PATH:-/home/zenn/Collection}"
case "$TARGET" in
/home/zenn/Collection) ;;
/*) ;;
*)
echo "[collection-keeper] refused unsafe path: $TARGET"
echo "[last-signal] refused non-absolute target path: $TARGET"
exit 1
;;
esac
if [ ! -e "$TARGET" ]; then
echo "[collection-keeper] target not found: $TARGET"
if [ -L "$TARGET" ]; then
echo "[last-signal] refused symbolic-link target: $TARGET"
exit 1
fi
if [ ! -d "$TARGET" ]; then
if [ -e "$TARGET" ]; then
echo "[last-signal] refused non-directory target: $TARGET"
exit 1
fi
echo "[last-signal] target directory not found: $TARGET"
exit 0
fi
rm -rf -- "$TARGET"
echo "[collection-keeper] deleted: $TARGET"
TARGET_REAL="$(CDPATH= cd "$TARGET" && pwd -P)"
if [ "$TARGET_REAL" = "/" ]; then
echo "[last-signal] refused filesystem root"
exit 1
fi
find "$TARGET_REAL" -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +
echo "[last-signal] deleted contents of: $TARGET_REAL"