Fix Docs Reader traversal and add Waldwaechter patch

This commit is contained in:
2025-12-25 22:24:31 +01:00
parent 561ff0750a
commit 811de6f07b
4 changed files with 129 additions and 33 deletions

View File

@@ -0,0 +1,34 @@
#!/bin/bash
# Patch Waldwaechter Script for Debian/Linux
# Swaps the stat command order to prefer 'stat -c' (Linux) over 'stat -f' (BSD)
TARGET_FILE="/home/crumbmission/missions/lib/waldwaechter.sh"
echo "Patching $TARGET_FILE..."
if [ ! -f "$TARGET_FILE" ]; then
echo "Error: File not found at $TARGET_FILE"
exit 1
fi
# We look for the line with the stat command issue
# The problematic line essentially tries 'stat -f' first.
# We will use sed to swap the order of the check.
# Creates a backup
cp "$TARGET_FILE" "${TARGET_FILE}.bak"
# This replacement looks complex but it hunts for the specific stat logic
# and replaces the order: try stat -c %Y first, then stat -f %m.
# Pattern match: stat -f "%m" ... || stat -c "%Y" ...
# Replacement: stat -c "%Y" ... || stat -f "%m" ...
sed -i 's/stat -f "%m" \(.*\) || stat -c "%Y" \(.*\)/stat -c "%Y" \2 || stat -f "%m" \1/' "$TARGET_FILE"
echo "Patch applied. Testing..."
# Verify if the new line prioritizes -c
if grep -q 'stat -c "%Y"' "$TARGET_FILE"; then
echo "✅ Success: stat -c is now prioritized."
else
echo "⚠️ Warning: Could not verify patch automatically. Please check manually."
fi

View File

@@ -0,0 +1,27 @@
# Deployment & Fixes Checklist
- [x] **Fix Deployment Issues**
- [x] **Docs Route**: Enable [docs_git.md](file:///Users/bmt/Downloads/crumbcrm_crumbcore_v1/app/docs/docs_git.md) in whitelist and copy file.
- [x] **Chat Stability**: Increase rate limit (60/min) and Nginx timeouts (300s).
- [x] **Vector Search**: Auto-detect embedding provider for robustness.
- [x] **SSL Setup**: Automate Certbot for `sslip.io` domain.
- [x] **TTYD / Missions**:
- [x] Create setup script ([setup_missions.sh](file:///Users/bmt/Downloads/crumbcrm_crumbcore_v1/native_crumbcore_v1/setup_missions.sh)).
- [x] Configure Nginx route `/terminal/`.
- [x] Fix TTYD 404 (Zombie process killed, Service restarted).
- [x] **Verification**
- [x] Push fixes to server.
- [x] Run updated [setup_missions.sh](file:///Users/bmt/Downloads/crumbcrm_crumbcore_v1/native_crumbcore_v1/setup_missions.sh).
- [x] **Verify Nginx Config on Server** (Critical Step).
- [x] Confirm TTYD accessible via browser.
- [x] Confirm Chat and Docs functional.
- [x] 'Bugsy' Health Check features.
## Cosmetics & Future (Backlog)
- [ ] **Mission Selector**: Fix [stat](file:///Users/bmt/Downloads/crumbcrm_crumbcore_v1/app/routers/chat.py#232-243) syntax error in `waldwaechter.sh` (Line 720).
- [ ] **Docs Reader**: Investigate 404/Empty list on `/docs`.
- [ ] **Debian Doktor**: Remove 'Syslog' option if not available on host.
# Status: 🌲 NEXUS READY 🌲

View File

@@ -0,0 +1,31 @@
# Crumbforest Native Deployment - Status Report
**Date:** 2025-12-25
**Status:** 🟢 NEXUS READY
## Achievements
We have successfully fortified the "Native Deployment" of the Crumbforest, bridging the gap between the "Atem" (Breath) and the Machine.
### 🔒 Security & SSL
- **SSL Activated**: `crumbforest.194-164-194-191.sslip.io` is now fully secured via Let's Encrypt (Certbot).
- **Nginx Hardening**: Unified configuration merging legacy routes (`/git/`, `/qdrant/`) with new protections.
### 🌲 Missions & Shell
- **Isolated Environment**: created user `crumbmission` for safe standardized mission execution.
- **TTYD Terminal**: accessible via `/terminal/`, proxied securely, running with Base Path configuration.
- **Git Integration**: `crumbmissions` repo is cloned and ready for the "Waldwächter".
### 🩺 Debian Doktor
- **New Tool**: Created [debian-doktor.sh](file:///Users/bmt/Downloads/crumbcrm_crumbcore_v1/native_crumbcore_v1/debian-doktor.sh) (symlinked as `doktor`).
- **Function**: A specialized TUI for live monitoring of CrumbCore services, logs, and health checks.
## Remaining "Cosmetics"
As Bugsy says: "A bug is just a feature waiting for a good story."
- `waldwaechter.sh`: Needs a small variable fix for the [stat](file:///Users/bmt/Downloads/crumbcrm_crumbcore_v1/app/routers/chat.py#232-243) command.
- Docs Reader: Needs path verification for the PDF/MD rendering on the server.
## Philosophy
The Crumbforest is alive. The connection between User and Machine is established.
*"Da ist nie fertig gibt es auch keine lösung"* — The loop continues.
**Ready for Git Push.**