feat: Enhance gateway management and add Caddyfile generation support

This commit is contained in:
2026-02-21 01:08:11 -08:00
parent 54ba2ccc62
commit f99c2dad86
16 changed files with 711 additions and 230 deletions

View File

@@ -1,6 +1,28 @@
gateway:
port: 9000
components:
# ── Infrastructure ──────────────────────────────────────
gateway:
description: Caddy reverse proxy gateway
run:
runner: command
cwd: .
argv:
- caddy
- run
- --config
- /home/payne/.castle/generated/Caddyfile
- --adapter
- caddyfile
expose:
http:
internal:
port: 9000
health_path: /
manage:
systemd:
exec_reload: caddy reload --config /home/payne/.castle/generated/Caddyfile --adapter caddyfile
# ── Services ──────────────────────────────────────────────
central-context:
description: Content storage API
@@ -9,7 +31,7 @@ components:
cwd: central-context
env:
CENTRAL_CONTEXT_DATA_DIR: /data/castle/central-context
CENTRAL_CONTEXT_PORT: "9001"
CENTRAL_CONTEXT_PORT: '9001'
tool: central-context
manage:
systemd: {}
@@ -21,7 +43,6 @@ components:
proxy:
caddy:
path_prefix: /central-context
notification-bridge:
description: Desktop notification forwarder
run:
@@ -30,7 +51,7 @@ components:
env:
CENTRAL_CONTEXT_URL: http://localhost:9001
BUCKET_NAME: notifications
PORT: "9002"
PORT: '9002'
tool: notification-bridge
manage:
systemd: {}
@@ -42,7 +63,6 @@ components:
proxy:
caddy:
path_prefix: /notifications
dashboard-api:
description: Castle dashboard API
run:
@@ -61,235 +81,185 @@ components:
proxy:
caddy:
path_prefix: /api
# ── Jobs ──────────────────────────────────────────────────
protonmail:
description: ProtonMail email sync via Bridge
run:
runner: command
argv: ["protonmail", "sync"]
cwd: protonmail
env:
PROTONMAIL_USERNAME: paul@payne.io
PROTONMAIL_API_KEY: ${secret:PROTONMAIL_API_KEY}
tool:
tool_type: python_standalone
category: email
source: protonmail/
argv:
- protonmail
- sync
triggers:
- type: schedule
cron: "*/5 * * * *"
- type: schedule
cron: '*/5 * * * *'
timezone: America/Los_Angeles
manage:
systemd: {}
install:
path:
alias: protonmail
tool:
source: protonmail/
backup-collect:
description: Collect files from various sources into backup directory
run:
runner: command
argv: ["backup-collect"]
env:
DBACKUP: /data/backup
tool:
tool_type: python_standalone
category: system
source: tools/system/
system_dependencies: [rsync]
argv:
- backup-collect
triggers:
- type: schedule
cron: "0 2 * * *"
- type: schedule
cron: 0 2 * * *
timezone: America/Los_Angeles
manage:
systemd: {}
tool:
source: tools/system/
system_dependencies:
- rsync
backup-data:
description: Nightly restic backup of /data to /storage
run:
runner: command
argv: ["backup-data"]
env:
RESTIC_REPOSITORY: /storage/restic-data
RESTIC_PASSWORD_FILE: /home/payne/.config/restic-password
tool:
tool_type: script
category: system
argv:
- backup-data
triggers:
- type: schedule
cron: "30 3 * * *"
- type: schedule
cron: 30 3 * * *
timezone: America/Los_Angeles
manage:
systemd: {}
# ── Frontend ──────────────────────────────────────────────
tool: {}
dashboard:
description: Castle web dashboard
run:
runner: node
cwd: dashboard
script: dev
expose:
http:
internal:
port: 5173
build:
working_dir: dashboard
commands:
- ["pnpm", "build"]
- - pnpm
- build
outputs:
- dist/
# ── Standalone tools ──────────────────────────────────────
- dist/
devbox-connect:
description: SSH tunnel manager with auto-reconnect
tool:
tool_type: python_standalone
category: system
source: devbox-connect/
install:
path:
alias: devbox-connect
tool:
source: devbox-connect/
mboxer:
description: MBOX to EML email converter
tool:
tool_type: python_standalone
category: email
source: mboxer/
install:
path:
alias: mboxer
# ── Category tools (per-category packages) ────────────────
tool:
source: mboxer/
android-backup:
description: Backup Android device using ADB
tool:
tool_type: python_standalone
category: android
source: tools/android/
system_dependencies: [adb]
install:
path:
alias: android-backup
tool:
source: tools/android/
system_dependencies:
- adb
browser:
description: Browse the web using natural language via browser-use
tool:
tool_type: python_standalone
category: browser
source: tools/browser/
install:
path:
alias: browser
tool:
source: tools/browser/
docx-extractor:
description: Extract content and metadata from Word .docx files
tool:
tool_type: python_standalone
category: search
source: tools/search/
system_dependencies: [pandoc]
install:
path:
alias: docx-extractor
tool:
source: tools/search/
system_dependencies:
- pandoc
docx2md:
description: Convert Word .docx files to Markdown
tool:
tool_type: python_standalone
category: document
source: tools/document/
system_dependencies: [pandoc]
install:
path:
alias: docx2md
tool:
source: tools/document/
system_dependencies:
- pandoc
gpt:
description: OpenAI text generation utility
tool:
tool_type: python_standalone
category: gpt
source: tools/gpt/
install:
path:
alias: gpt
tool:
source: tools/gpt/
html2text:
description: Convert HTML content to plain text
tool:
tool_type: python_standalone
category: document
source: tools/document/
install:
path:
alias: html2text
tool:
source: tools/document/
md2pdf:
description: Convert Markdown files to PDF
tool:
tool_type: python_standalone
category: document
source: tools/document/
system_dependencies: [pandoc, texlive-latex-base]
install:
path:
alias: md2pdf
tool:
source: tools/document/
system_dependencies:
- pandoc
- texlive-latex-base
mdscraper:
description: Combine text files into a single markdown document
tool:
tool_type: python_standalone
category: mdscraper
source: tools/mdscraper/
install:
path:
alias: mdscraper
tool:
source: tools/mdscraper/
pdf-extractor:
description: Extract content and metadata from PDF files
tool:
tool_type: python_standalone
category: search
source: tools/search/
install:
path:
alias: pdf-extractor
tool:
source: tools/search/
pdf2md:
description: Convert PDF files to Markdown
tool:
tool_type: python_standalone
category: document
source: tools/document/
system_dependencies: [pandoc, poppler-utils]
install:
path:
alias: pdf2md
tool:
source: tools/document/
system_dependencies:
- pandoc
- poppler-utils
schedule:
description: Manage systemd user timers and scheduled tasks
tool:
tool_type: python_standalone
category: system
source: tools/system/
install:
path:
alias: schedule
tool:
source: tools/system/
search:
description: Manage self-contained searchable collections of files
tool:
tool_type: python_standalone
category: search
source: tools/search/
install:
path:
alias: search
tool:
source: tools/search/
text-extractor:
description: Extract content and metadata from text files
tool:
tool_type: python_standalone
category: search
source: tools/search/
install:
path:
alias: text-extractor
tool:
source: tools/search/