Commit Graph

272 Commits

Author SHA1 Message Date
Lucas Berger 3ca89c3815 docs(09): research phase domain
Phase 9: Batch Operations
- Standard stack identified (Loop Over Items, If Error node, editMessageText)
- Sequential execution patterns documented
- Error handling with continue-on-failure
- Multi-select keyboard toggle pattern
- Rate limiting and callback_data constraints
- Fuzzy matching with exact match priority
2026-02-03 20:52:50 -05:00
Lucas Berger 13d27fd2d1 docs(09): capture phase context
Phase 09: Batch Operations
- Implementation decisions documented
- Phase boundary established
2026-02-03 20:44:58 -05:00
Lucas Berger 03e56503de docs(08): complete Phase 8 with verification summary
- Update STATE.md with Phase 8 completion status
- Add 08-03-SUMMARY.md documenting bug fixes and verification
- Remove .continue-here checkpoint file
- Record key decisions from verification session

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:32:15 -05:00
Lucas Berger d1da276aa4 fix(08): resolve n8n deployment issues and clean up orphan nodes
Bug fixes:
- Fix array handling in Code nodes ($input.all() vs $input.item.json)
  - Build Logs Action Command
  - Build Confirmed Stop Command
  - Build Immediate Action Command
  - Find Container For Update
- Add timestamp to logs refresh to avoid "message not modified" error
- Add :latest tag protection to callback update flow
- Add image cleanup after callback updates

Cleanup:
- Remove orphan nodes: Parse and Match, Format Response, Send Docker Response
- Rename duplicate "Inspect New Image" to "Inspect New Image (Text)"
- Restore Compare Digests to fix text update command flow
- Add callback image cleanup nodes (Build Callback Remove Image, Callback Remove Old Image)

Both text commands and inline keyboard buttons now work correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:31:20 -05:00
Lucas Berger 1331ee1331 wip(08): paused at verification checkpoint - workflow fixes in progress 2026-02-03 17:04:12 -05:00
Lucas Berger 127f176056 feat(08-03): enhance update progress with explicit button removal
- Update progress message uses upward arrow icon for update
- Add "This may take a few minutes" notice
- Explicitly pass empty inline_keyboard to remove buttons
- Prevents accidental duplicate action triggers during update

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:34:53 -05:00
Lucas Berger 3e11dea2ed feat(08-03): simplify completion messages to back-only button
- Update Format Immediate Result for start/restart actions
- Update Format Confirmed Stop Result for stop action
- Update Format Update Complete for update action
- Update Format No Update Needed for already-up-to-date case
- Success shows only "Back to Containers" button
- Errors show "Try Again" + "Back to Containers" buttons
- Removes action buttons from completion state per UX spec

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:34:10 -05:00
Lucas Berger a6548b300f docs(08-02): complete action execution plan
Tasks completed: 2/2
- Task 1: Route Action Callbacks to Container Operations
- Task 2: Add Confirmation Flow for Dangerous Actions

SUMMARY: .planning/phases/08-inline-keyboard-infrastructure/08-02-SUMMARY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:29:42 -05:00
Lucas Berger ab7ce88792 feat(08-02): add confirmation flow for dangerous actions
- Update Parse Callback Data to handle confirm: and cancel: callbacks
- Add isConfirm and isCancelConfirm outputs to Route Callback switch
- Add 30-second timeout check for confirmations (timestamp in callback_data)
- Wire confirmed stop action to container stop flow with result display
- Wire confirmed update action to full update flow (pull, recreate, start)
- Handle cancel by returning to container submenu
- Show expired message when confirmation times out
- Progress indicator during update: "Updating..."

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:28:33 -05:00
Lucas Berger d1584197f8 feat(08-02): route action callbacks to container operations
- Add Answer Action Callback node to answer query immediately
- Add Route Action Type switch with start/restart/stop/update/logs outputs
- Wire start/restart to immediate action flow (Get Container, Build Command, Execute, Format Result)
- Wire logs to logs action flow with 30-line display
- Wire stop/update to confirmation dialog builders with 30s timeout
- All action results update message in-place with editMessageText

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:24:21 -05:00
Lucas Berger 1a3feecd91 docs(08-01): complete container list keyboard plan
Tasks completed: 3/3
- Task 1: Add Container List Inline Keyboard
- Task 2: Add Container Submenu with Action Buttons
- Task 3: Handle List Pagination Callbacks

SUMMARY: .planning/phases/08-inline-keyboard-infrastructure/08-01-SUMMARY.md
2026-02-03 16:19:51 -05:00
Lucas Berger 393d368dec feat(08-01): handle list pagination callbacks
- Add Answer List Callback HTTP node (prevents loading indicator)
- Add Prepare List Fetch code node
- Add Get Containers For List HTTP Request node
- Add Build Paginated List code node (reuses keyboard logic)
- Add Edit Container List HTTP node (editMessageText for in-place updates)
- Wire Route Callback list output to pagination flow
- All page transitions use message edits (no new messages)
2026-02-03 16:18:50 -05:00
Lucas Berger 01482827fb feat(08-01): add container submenu with action buttons
- Update Parse Callback Data to recognize select:, list:, action:, noop formats
- Add Route Callback outputs: select, list, action, noop
- Add Answer Select Callback HTTP node (prevents loading indicator)
- Add Prepare Container Fetch code node
- Add Get Single Container HTTP Request node
- Add Build Container Submenu code node with state-based action buttons
- Add Send Container Submenu HTTP node (editMessageText for in-place updates)
- Add Answer Noop Callback for page indicator button
- Wire complete select flow: Route -> Answer -> Fetch -> Submenu -> Send
2026-02-03 16:17:38 -05:00
Lucas Berger f8d616e26d feat(08-01): add container list inline keyboard
- Add Build Container List Keyboard code node
- Add Send Container List HTTP Request node
- Add Check Single Container IF node for direct access routing
- Add Build Container Submenu Direct for /status <name> flow
- Add Send Container Submenu Direct HTTP Request
- Wire Keyword Router status -> Docker List -> Build Keyboard flow
- Running containers shown first with green icon
- Pagination support for >6 containers
2026-02-03 16:15:29 -05:00
Lucas Berger ebd6eab479 removing backup 2026-02-03 11:47:09 -05:00
Lucas Berger ecd02a4b0e docs(08): create inline keyboard infrastructure plans
Phase 8: Inline Keyboard Infrastructure
- 3 plans in 3 waves (sequential dependency)
- Plan 01: Container list keyboard and submenu navigation
- Plan 02: Action execution and confirmation flow
- Plan 03: Progress feedback and completion messages

Covers KEY-01 through KEY-05 requirements.
Ready for execution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:44:46 -05:00
Lucas Berger fe4c19c7c6 docs(08): research phase domain
Phase 8: Inline Keyboard Infrastructure
- Standard stack identified (HTTP Request + Telegram API)
- Architecture patterns documented (5 core patterns)
- Pitfalls catalogued (5 critical issues)
- n8n-specific workarounds for dynamic keyboards
2026-02-03 11:39:09 -05:00
Lucas Berger 6679fb7cf4 docs(08): capture phase context
Phase 08: Inline Keyboard Infrastructure
- Implementation decisions documented
- Phase boundary established

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:32:08 -05:00
Lucas Berger d933663bf5 test(07): complete UAT - 9 passed, 0 issues
All Socket Security phase tests verified:
- Proxy container running
- All 6 bot commands work through proxy
- Socket mount removed from n8n
- Dangerous APIs blocked by default

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:21:36 -05:00
Lucas Berger 24cc41b9fa docs(07): complete Socket Security phase
- SEC-01 through SEC-04 requirements verified and marked complete
- Phase 7 marked complete in ROADMAP.md
- 3/3 plans executed successfully

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:12:07 -05:00
Lucas Berger b02819434f fix(07-02): remove duplicate timeout on image pull
- Image pull had --max-time 600 --max-time 5 (second wins = 5s timeout)
- Removed duplicate, keeping 600s for large image pulls
- Added WEB-01 requirement for webhook fix in Phase 10
- Created 07-02-SUMMARY.md and 07-VERIFICATION.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:11:39 -05:00
Lucas Berger 5471feec25 fix(07-02): correct Telegram credential name and ID
- Change credential name from "Telegram API" to "Telegram account"
- Update credential ID from placeholder to actual n8n ID (I0xTTiASl7C1NZhJ)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 09:18:13 -05:00
Lucas Berger 26aacff444 docs(07-03): complete API blocking verification plan
Tasks completed: 2/2
- Test blocked endpoints return 403
- Document security configuration

SUMMARY: .planning/phases/07-socket-security/07-03-SUMMARY.md
2026-02-03 09:11:08 -05:00
Lucas Berger 78968569c7 chore(07-02): push updated workflow to n8n via API
- Updated workflow HmiXBlJefBRPMS0m4iNYc via PUT to /api/v1/workflows
- Confirmed updatedAt timestamp: 2026-02-03T14:10:47.677Z
- All Docker commands now route through proxy instead of direct socket
2026-02-03 09:10:55 -05:00
Lucas Berger 12bdd9802b refactor(07-02): migrate n8n workflow from Docker socket to proxy
- Replace all --unix-socket /var/run/docker.sock with docker-socket-proxy:2375
- Add --max-time 5 timeout to all commands (except image pull which keeps 600s)
- Update 16 curl commands across all bot operations (status, start, stop, restart, update, logs)
- No functional changes, all commands routed through security proxy
2026-02-03 09:09:48 -05:00
Lucas Berger 208591dea8 docs(07-01): complete proxy deployment plan
Tasks completed: 2/2
- Install and Configure docker-socket-proxy (user action)
- Verify Proxy Connectivity (network config validation)

SUMMARY: .planning/phases/07-socket-security/07-01-SUMMARY.md
2026-02-03 09:06:48 -05:00
Lucas Berger 1a8749cceb test(06): complete UAT - 4 passed, 0 issues
Verified all n8n API capabilities:
- Authentication with X-N8N-API-KEY header
- Read workflow JSON (96 nodes)
- Update workflow via PUT
- View execution history

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 08:55:31 -05:00
Lucas Berger fef21fd39a fix(07): revise plans based on checker feedback
- Plan 02: Added Task 4 (checkpoint:human-action) to remove docker.sock
  volume mount from n8n container after verifying proxy works
- Plan 02: Added must_have truth for docker.sock removal (SEC-02 complete)
- Plan 03: Removed "Create API returns 403" from must_haves - container
  create is intentionally ALLOWED for update command functionality
- Plan 03: Added rationale explaining why container create is needed
- Clarified that blocked APIs are: exec, build, commit (not create)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 08:48:37 -05:00
Lucas Berger f539bcbba4 docs(07): create phase plan for Socket Security
Phase 07: Socket Security
- 3 plan(s) in 2 wave(s)
- Wave 1: 07-01 (deploy proxy - checkpoint)
- Wave 2: 07-02 (migrate workflow), 07-03 (verify blocking) - parallel
- Ready for execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 08:45:04 -05:00
Lucas Berger 1432d4feb2 docs(07): research phase domain
Phase 07: socket-security
- Standard stack identified
- Architecture patterns documented
- Pitfalls catalogued

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 08:40:04 -05:00
Lucas Berger e17c5bf0d4 docs(07): capture phase context
Phase 07: Socket Security
- Implementation decisions documented
- Phase boundary established
2026-02-03 08:33:57 -05:00
Lucas Berger 5aa07e8dfa docs(phase-6): complete n8n API Access phase
- All 4 API requirements verified (API-01 through API-04)
- Phase goal achieved: Claude Code can programmatically read, update, and test workflows
- Verification passed: 4/4 must-haves confirmed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 08:21:34 -05:00
Lucas Berger 45e0cd9a0f docs(06-01): complete n8n API access plan
Tasks completed: 2/2
- Task 1: Create n8n API Key (checkpoint:human-action - user provided credentials)
- Task 2: Verify API Access and Document Commands

All 4 API requirements verified:
- API-01: Authentication (200 OK)
- API-02: Read workflow (96 nodes)
- API-03: Update workflow (PUT successful)
- API-04: Execution history (5 recent runs)

SUMMARY: .planning/phases/06-n8n-api-access/06-01-SUMMARY.md
2026-02-03 08:17:22 -05:00
Lucas Berger 7e85697899 feat(06-01): verify n8n API access and configure credentials
All 4 API requirements verified successfully:
- API-01: Authentication works (200 response from /api/v1/workflows)
- API-02: Can read workflow (Docker Manager Bot - 96 nodes)
- API-03: Can update workflow (PUT successful, updatedAt: 2026-02-03T13:15:35.015Z)
- API-04: Can view execution history (5 recent executions retrieved)

Created .env.n8n-api with N8N_HOST and N8N_API_KEY (gitignored)
Created .gitignore to protect API credentials

Workflow ID: HmiXBlJefBRPMS0m4iNYc
n8n Instance: https://api.bergerhouse.net
2026-02-03 08:16:05 -05:00
Lucas Berger c15c5e3892 docs(06): create phase plan for n8n API access
Phase 6: n8n API Access
- 1 plan in 1 wave
- Covers API-01 through API-04 requirements
- Human checkpoint for API key creation + automated verification
- Fixed: Use PUT (not PATCH) per current n8n docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 08:10:13 -05:00
Lucas Berger 3d5c8392d7 docs(06): create phase plan
Phase 06: n8n API Access
- 1 plan in 1 wave
- 0 parallel (sequential due to human checkpoint)
- Ready for execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 08:07:41 -05:00
Lucas Berger bc26a7bc88 docs(phase-6): research n8n API access
Phase 6: n8n API Access
- n8n REST API capabilities identified
- Authentication patterns documented (X-N8N-API-KEY header)
- Workflow CRUD operations researched
- Execution history access patterns found
- Common pitfalls catalogued (activation timeout, public vs private endpoints)
- No official SDK exists - raw HTTP client required

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 08:04:36 -05:00
Lucas Berger c6abf62021 docs: create v1.1 roadmap (5 phases)
Phases:
6. n8n API Access: Claude Code workflow management
7. Socket Security: Docker socket proxy migration
8. Inline Keyboard Infrastructure: Telegram buttons
9. Batch Operations: Multi-container updates
10. Polish & Audit: Unraid sync, env var verification

22 requirements mapped across 5 phases.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 22:20:01 -05:00
Lucas Berger a970f8d6fc docs: define v1.1 requirements + research
22 requirements across 6 categories:
- Security: Socket proxy migration (4)
- n8n API: Claude Code workflow access (4)
- Telegram Keyboards: Inline buttons + confirmations (5)
- Batch Operations: Multi-container updates (6)
- Unraid Sync: Clear update badge (1)
- Environment Audit: Verify container vars (2)

Research: Stack, Features, Architecture, Pitfalls

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 22:16:45 -05:00
Lucas Berger 811030cee4 docs: complete v1.1 research (4 researchers + synthesis)
Files:
- STACK.md: Socket proxy, n8n API, Telegram keyboards
- FEATURES.md: Table stakes, differentiators, MVP scope
- ARCHITECTURE.md: Integration points, data flow changes
- PITFALLS.md: Top 5 risks with prevention strategies
- SUMMARY.md: Executive summary, build order, confidence

Key findings:
- Stack: LinuxServer socket-proxy, HTTP Request nodes for keyboards
- Architecture: TCP curl migration (~15 nodes), new callback routes
- Critical pitfall: Socket proxy breaks existing curl commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 22:09:06 -05:00
Lucas Berger ff289677ab docs: start milestone v1.1 n8n Integration & Polish
Target features:
- n8n API for Claude Code (programmatic workflow access)
- Telegram inline keyboard buttons
- Batch container updates
- Docker socket security
- Environment variable audit
- Unraid update sync

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 22:01:37 -05:00
Lucas Berger 9b0e5fd8a5 chore: archive v1.0 milestone
Archived:
- milestones/v1.0-ROADMAP.md (full phase details)

Updated:
- MILESTONES.md (new entry for v1.0)
- PROJECT.md (requirements → Validated, Current State added)
- ROADMAP.md (collapsed to one-line with archive link)
- STATE.md (reset for next milestone)

v1.0 Docker Control via Telegram shipped:
- 5 phases, 12 plans, 5 days
- Telegram bot with keyword commands
- Docker socket integration via n8n

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:50:39 -05:00
Lucas Berger e5c02f9a21 docs: complete v1.0 milestone - Phase 5 Plan 3 approved
- Add 05-03-SUMMARY.md documenting testing session and bug fixes
- Update STATE.md to 100% complete
- Update ROADMAP.md marking all Phase 5 plans complete
- Remove .continue-here checkpoint

v1.0 Docker Manager Bot is production-ready:
- All 6 commands working (status, start, stop, restart, update, logs)
- Keyword routing (no Claude API dependency)
- Single-user Telegram auth
- Terse error messages
- Complete deployment README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:48:22 -05:00
Lucas Berger c979a7fe7b feat(update): notify user when container is already up to date
Previously the "no update needed" branch was empty, leaving users
with no feedback after the update check completed.

Added Format No Update and Send No Update nodes to display
"<container> is already up to date" message.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:39:08 -05:00
Lucas Berger 808d1afe21 fix(logs): correct property name for line count parameter
Parse Logs Command returned 'lineCount' but Match Logs Container
expected 'lines', causing the line count to always be undefined
and Docker to return its default.

Renamed to 'lines' for consistency throughout the logs flow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:33:39 -05:00
Lucas Berger 287c7220cb fix(logs): escape HTML entities in log output
Log content may contain <, >, & characters (like "<computed>") which
Telegram interprets as HTML tags when using parse_mode=HTML.

Added escapeHtml() function to convert:
- & → &amp;
- < → &lt;
- > → &gt;

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:31:22 -05:00
Lucas Berger 74dd8f1a94 fix(update): ensure image tag is specified to prevent pulling all tags
When Config.Image has no tag (e.g., "nitnelave/lldap" instead of
"nitnelave/lldap:latest"), Docker's API pulls ALL tags for that image.
This caused massive downloads and rate limit hits.

Now appends ":latest" if no tag or digest is present in the image name.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:21:57 -05:00
Lucas Berger 3e3b9ae47f fix(update): pipe pull output through tail to prevent memory exhaustion
Docker's /images/create API streams progress JSON for every layer.
For large images, this can be gigabytes of output that was being
buffered by curl and n8n, causing hangs and disk usage spikes.

Now pipes through `tail -c 10000` to only keep the last 10KB where
error/success messages appear. Discards the streaming progress data.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:14:25 -05:00
Lucas Berger 88830a8b61 fix(update): correct image removal node data reference
- Reference $('Format Update Result') instead of $json for currentImageId
- The Telegram node doesn't pass through input data, it returns API response
- Also add no-op command fallback when currentImageId is missing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 20:56:00 -05:00
Lucas Berger 4f85e00dc4 fix(update): add timeout to prevent pull command from hanging
- Add --max-time 600 (10 min) to curl pull command
- Add timeout: 660 to n8n executeCommand node

Docker's /images/create API streams progress until complete.
Without timeout, large image pulls could hang indefinitely.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 20:50:22 -05:00