- Box JWT + Gemini integration for image and video metadata tagging - Description format includes search-keyword tail to address synonym gaps (e.g. "Food" search now hits assets tagged "Dining") - Skip videos exceeding 5GB source or 400MB proxy (~60min runtime, beyond Gemini context budget) — counted as skipped, not errored - Hardened None-response handling in Gemini JSON parser - Per-run limiter: 200 newly-tagged files / 4 hour wall-clock cap, with clean exit and resumable progress on next run - systemd service + timer for daily 2am tagging passes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
49 lines
1.8 KiB
Desktop File
49 lines
1.8 KiB
Desktop File
[Unit]
|
|
Description=Marriott Box Asset Tagger - one-shot tagging pass
|
|
Documentation=https://bitbucket.org/zlalani/marriott-box-image-video-tagging
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
User=marriott-tagger
|
|
Group=marriott-tagger
|
|
|
|
# Working directory and venv-aware Python
|
|
WorkingDirectory=/opt/marriott-box-image-video-tagging
|
|
ExecStart=/opt/marriott-box-image-video-tagging/env/bin/python -u /opt/marriott-box-image-video-tagging/main.py
|
|
|
|
# Credentials live outside the code directory; main.py reads box_config.json
|
|
# from its own dir and .env via dotenv. Symlink or bind-mount these in place,
|
|
# or adjust paths in main.py if you prefer /etc/marriott-tagger/.
|
|
# Example: ln -s /etc/marriott-tagger/box_config.json /opt/marriott-box-image-video-tagging/box_config.json
|
|
|
|
# Output goes to the systemd journal — view with: journalctl -u marriott-tagger
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
|
|
# A full tagging pass on a large folder can take a long time (rate limits +
|
|
# video processing). Allow up to 6 hours before systemd kills it.
|
|
TimeoutStartSec=6h
|
|
|
|
# Don't restart on failure for a one-shot run — the timer will pick it up next cycle.
|
|
Restart=no
|
|
|
|
# ── Hardening ─────────────────────────────────────────────────────────────────
|
|
NoNewPrivileges=true
|
|
PrivateTmp=true
|
|
ProtectSystem=strict
|
|
ProtectHome=true
|
|
ProtectKernelTunables=true
|
|
ProtectKernelModules=true
|
|
ProtectControlGroups=true
|
|
RestrictNamespaces=true
|
|
RestrictRealtime=true
|
|
RestrictSUIDSGID=true
|
|
LockPersonality=true
|
|
MemoryDenyWriteExecute=false
|
|
# Allow writes only to the app's own directory (for any temp files / caches)
|
|
ReadWritePaths=/opt/marriott-box-image-video-tagging
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|