3008431303
Go-based file automation daemon (~10MB RAM idle) with FSEvents-native file watching, configurable rule/action pipelines, and integrations for Paperless-ngx, Immich, Calibre Web, and n8n webhooks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
139 lines
4.7 KiB
YAML
139 lines
4.7 KiB
YAML
settings:
|
|
state_db: ~/.homeflow/state.db
|
|
log_level: INFO
|
|
file_stability_secs: 2 # segundos sin actividad antes de procesar
|
|
rule_match: first # first | all
|
|
|
|
watches:
|
|
- path: ~/Downloads
|
|
recursive: false
|
|
rules:
|
|
|
|
# ── Archivos comprimidos con contraseña ──────────────────────────────
|
|
- name: "Archivos cifrados a extraer"
|
|
match:
|
|
extensions: [.zip, .7z, .rar]
|
|
name_pattern: "*_enc*"
|
|
actions:
|
|
- type: decompress
|
|
dest: ~/Downloads/extracted/
|
|
password: !pass homelab/archive-password
|
|
remove_archive: true
|
|
- type: macos_notification
|
|
title: "homeflow"
|
|
body: "{filename} extraído"
|
|
|
|
# ── PDFs → Paperless ─────────────────────────────────────────────────
|
|
- name: "PDFs a Paperless"
|
|
match:
|
|
extensions: [.pdf]
|
|
actions:
|
|
- type: paperless_upload
|
|
service: paperless
|
|
tags: ["inbox"]
|
|
- type: delete
|
|
|
|
# ── Facturas → renombrar + Paperless + n8n ────────────────────────────
|
|
- name: "Facturas a Paperless"
|
|
match:
|
|
extensions: [.pdf]
|
|
name_pattern: "factura*"
|
|
actions:
|
|
- type: rename
|
|
template: "factura_{date:2006-01-02}_{seq:04d}_{stem}{ext}"
|
|
- type: paperless_upload
|
|
service: paperless
|
|
tags: ["facturas"]
|
|
title: "{stem}"
|
|
- type: n8n_webhook
|
|
service: n8n
|
|
event: "new_invoice"
|
|
payload:
|
|
filename: "{filename}"
|
|
date: "{date:2006-01-02}"
|
|
- type: delete
|
|
|
|
# ── Libros → Calibre ──────────────────────────────────────────────────
|
|
- name: "Libros a Calibre"
|
|
match:
|
|
extensions: [.epub, .mobi, .cbz, .cbr, .fb2, .azw3]
|
|
actions:
|
|
- type: calibre_copy
|
|
service: calibre
|
|
- type: macos_tag
|
|
tags: ["Green"]
|
|
mode: add
|
|
- type: delete
|
|
|
|
# ── Fotos → Immich ────────────────────────────────────────────────────
|
|
- name: "Fotos a Immich"
|
|
match:
|
|
extensions: [.jpg, .jpeg, .png, .heic, .gif, .webp]
|
|
actions:
|
|
- type: immich_upload
|
|
service: immich
|
|
- type: move
|
|
dest: ~/Pictures/Processed/
|
|
|
|
# ── Vídeos → Immich ───────────────────────────────────────────────────
|
|
- name: "Vídeos a Immich"
|
|
match:
|
|
extensions: [.mp4, .mov, .avi, .mkv, .m4v]
|
|
actions:
|
|
- type: immich_upload
|
|
service: immich
|
|
- type: delete
|
|
|
|
# ── Scripts / procesado custom ────────────────────────────────────────
|
|
- name: "Ejecutar script custom"
|
|
match:
|
|
extensions: [.csv]
|
|
name_pattern: "export_*"
|
|
actions:
|
|
- type: run_script
|
|
script: ~/scripts/process_export.sh
|
|
continue_on_error: true
|
|
- type: move
|
|
dest: ~/Documents/exports/processed/
|
|
|
|
# ── Archivos sospechosos → cuarentena ────────────────────────────────
|
|
- name: "Ejecutables a cuarentena"
|
|
match:
|
|
extensions: [.exe, .dmg, .pkg]
|
|
actions:
|
|
- type: checksum
|
|
algo: sha256
|
|
save_to_sidecar: true
|
|
- type: quarantine
|
|
dest: ~/quarantine/
|
|
|
|
- path: ~/Desktop
|
|
recursive: false
|
|
rules:
|
|
|
|
# ── PDFs en desktop → Paperless ───────────────────────────────────────
|
|
- name: "PDFs desktop a Paperless"
|
|
match:
|
|
extensions: [.pdf]
|
|
min_size_kb: 10
|
|
actions:
|
|
- type: paperless_upload
|
|
service: paperless
|
|
tags: ["desktop", "inbox"]
|
|
- type: delete
|
|
|
|
services:
|
|
paperless:
|
|
url: !pass services/paperless
|
|
token: !pass homelab/paperless-token
|
|
|
|
immich:
|
|
url: !pass services/immich
|
|
api_key: !pass homelab/immich-api-key
|
|
|
|
calibre:
|
|
inbox_path: ~/calibre-inbox/
|
|
|
|
n8n:
|
|
webhook_url: !pass services/n8n
|