blumeops/ansible/roles/kiwix/templates/kiwix-serve.plist.j2
Erich Blume eb2f5b44cd Fix kiwix plist to only include available ZIM archives
The LaunchAgent plist now dynamically includes only ZIM files that
actually exist in the kiwix directory, rather than all configured
archives. This prevents kiwix-serve from crashing when torrents are
still downloading.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 13:17:55 -08:00

25 lines
780 B
Django/Jinja

<?xml version="1.0" encoding="UTF-8"?>
<!-- {{ ansible_managed }} -->
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>mcquack.eblume.kiwix-serve</string>
<key>ProgramArguments</key>
<array>
<string>{{ kiwix_serve_bin }}</string>
<string>--port={{ kiwix_port }}</string>
{% for filename in kiwix_available_archives %}
<string>{{ kiwix_zim_dir }}/{{ filename }}</string>
{% endfor %}
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>{{ kiwix_log_dir }}/mcquack.kiwix-serve.err.log</string>
<key>StandardOutPath</key>
<string>{{ kiwix_log_dir }}/mcquack.kiwix-serve.out.log</string>
</dict>
</plist>