feat(projekt-matching): systemd timer, webhook trigger, inbox baseline script
This commit is contained in:
6
projekt-matching/deploy/projekt-matching.service
Normal file
6
projekt-matching/deploy/projekt-matching.service
Normal file
@@ -0,0 +1,6 @@
|
||||
[Unit]
|
||||
Description=Trigger PM Ingest Langflow webhook
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=%h/bin/projekt-matching/deploy/trigger_webhook.sh
|
||||
9
projekt-matching/deploy/projekt-matching.timer
Normal file
9
projekt-matching/deploy/projekt-matching.timer
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Poll chancen@ inbox via PM Ingest every 5 minutes
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*:00/5
|
||||
Persistent=false
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
9
projekt-matching/deploy/trigger_webhook.sh
Executable file
9
projekt-matching/deploy/trigger_webhook.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
# Fire the PM Ingest webhook. Carries no logic; failures are harmless
|
||||
# (state lives in the IMAP inbox, next tick retries).
|
||||
set -u
|
||||
source "$HOME/.config/projekt-matching/env"
|
||||
curl -sS -m 15 -X POST "$FLOW1_WEBHOOK" \
|
||||
-H "x-api-key: $LANGFLOW_API_KEY" -H 'Content-Type: application/json' \
|
||||
-d '{"source": "systemd-timer"}' || true
|
||||
echo
|
||||
13
projekt-matching/tests/e2e/flag_inbox.py
Normal file
13
projekt-matching/tests/e2e/flag_inbox.py
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||
from projektmatch import mailer # noqa: E402
|
||||
|
||||
box = mailer.MailBox("chancen@destengs.com", os.environ["PM_IMAP_PASSWORD"])
|
||||
uids = box.unchecked_uids()
|
||||
for uid in uids:
|
||||
box.flag_checked(uid)
|
||||
print(f"flagged {len(uids)} mails as checked")
|
||||
box.close()
|
||||
Reference in New Issue
Block a user