xoxys.freshrss_docker/templates/services/freshrss_compose.yml.j2

151 lines
6.2 KiB
Django/Jinja

#jinja2:lstrip_blocks: True
{{ ansible_managed | comment }}
version: "2.4"
services:
freshrss:
container_name: {{ freshrss_container_name }}
image: {{ freshrss_image }}
restart: {{ freshrss_restart_policy }}
{% if freshrss_exposed_ports | default([]) %}
ports:
{% for port in freshrss_exposed_ports %}
- {{ port | quote }}
{% endfor %}
{% endif %}
{% if freshrss_volumes | default([]) %}
volumes:
{% for volume in freshrss_volumes %}
- "{{ volume.name }}:{{ volume.dest }}"
{% endfor %}
{% endif %}
{% if freshrss_networks_applied | default([]) %}
networks:
{% for network in freshrss_networks_applied %}
- {{ network }}
{% endfor %}
{% endif %}
{% if freshrss_extra_hosts | default([]) %}
extra_hosts:
{% for host in freshrss_extra_hosts %}
- {{ host | quote }}
{% endfor %}
{% endif %}
environment:
- FRESHRSS_ENVIRONMENT=production
{% if freshrss_salt is defined and freshrss_salt %}
- FRESHRSS_SALT={{ freshrss_salt }}
{% endif %}
- FRESHRSS_BASE_URL={{ freshrss_base_url }}
- FRESHRSS_LANGUAGE={{ freshrss_language }}
- FRESHRSS_TITLE={{ freshrss_title }}
{% if freshrss_meta_description is defined and freshrss_meta_description %}
- FRESHRSS_META_DESCRIPTION={{ freshrss_meta_description }}
{% endif %}
- FRESHRSS_DEFAULT_USER={{ freshrss_default_user }}
- FRESHRSS_DEFAULT_PASSWORD={{ freshrss_default_password }}
- FRESHRSS_ALLOW_ANONYMOUS={{ freshrss_allow_anonymous | bool | lower }}
- FRESHRSS_ALLOW_ANONYMOUS_REFRESH={{ freshrss_allow_anonymous_refresh | bool | lower }}
- FRESHRSS_AUTH_TYPE={{ freshrss_auth_type }}
- FRESHRSS_API_ENABLED={{ freshrss_api_enabled | bool | lower }}
- FRESHRSS_UNSAFE_AUTOLOGIN_ENABLED={{ freshrss_unsafe_autologin_enabled | bool | lower }}
- FRESHRSS_SIMPLEPIE_SYSLOG_ENABLED={{ freshrss_simplepie_syslog_enabled | bool | lower }}
- FRESHRSS_PUBSUBHUBBUB_ENABLED={{ freshrss_pubsubhubbub_enabled | bool | lower }}
- FRESHRSS_ALLOW_ROBOTS={{ freshrss_allow_robots | bool | lower }}
- FRESHRSS_ALLOW_REFERRER={{ freshrss_allow_referrer | bool | lower }}
- FRESHRSS_LIMITS_COOKIE_DURATION={{ freshrss_limits_cookie_duration }}
- FRESHRSS_LIMITS_CACHE_DURATION={{ freshrss_limits_cache_duration }}
- FRESHRSS_LIMITS_TIMEOUT={{ freshrss_limits_timeout }}
- FRESHRSS_LIMITS_MAX_INACTIVITY={{ freshrss_limits_max_inactivity }}
- FRESHRSS_LIMITS_MAX_FEEDS={{ freshrss_limits_max_feeds }}
- FRESHRSS_LIMITS_MAX_CATEGORIES={{ freshrss_limits_max_categories }}
- FRESHRSS_LIMITS_MAX_REGISTRATIONS={{ freshrss_limits_max_registrations }}
{% if freshrss_curlopt_ssl_verifyhost is defined and freshrss_curlopt_ssl_verifyhost %}
- FRESHRSS_CURLOPT_SSL_VERIFYHOST={{ freshrss_curlopt_ssl_verifyhost }}
{% endif %}
{% if freshrss_curlopt_ssl_verifypeer is defined and freshrss_curlopt_ssl_verifypeer %}
- FRESHRSS_CURLOPT_SSL_VERIFYPEER={{ freshrss_curlopt_ssl_verifypeer }}
{% endif %}
{% if freshrss_curlopt_proxytype is defined and freshrss_curlopt_proxytype %}
- FRESHRSS_CURLOPT_PROXYTYPE={{ freshrss_curlopt_proxytype }}
{% endif %}
{% if freshrss_curlopt_proxy is defined and freshrss_curlopt_proxy %}
- FRESHRSS_CURLOPT_PROXY={{ freshrss_curlopt_proxy }}
{% endif %}
{% if freshrss_curlopt_proxyport is defined and freshrss_curlopt_proxyport %}
- FRESHRSS_CURLOPT_PROXYPORT={{ freshrss_curlopt_proxyport }}
{% endif %}
{% if freshrss_curlopt_proxyauth is defined and freshrss_curlopt_proxyauth %}
- FRESHRSS_CURLOPT_PROXYAUTH={{ freshrss_curlopt_proxyauth }}
{% endif %}
{% if freshrss_curlopt_proxyuserpwd is defined and freshrss_curlopt_proxyuserpwd %}
- FRESHRSS_CURLOPT_PROXYUSERPWD={{ freshrss_curlopt_proxyuserpwd }}
{% endif %}
- FRESHRSS_DB_TYPE={{ freshrss_db_type }}
{% if freshrss_db_type != "sqlite" %}
{% if freshrss_db_type == "pgsql" %}
- FRESHRSS_DB_HOST={{ freshrss_db_server }};sslmode={{ freshrss_db_ssl_mode }}
- FRESHRSS_POSTGRES_SSL_ROOTCERT={{ freshrss_db_ssl_rootcert }}
{% else %}
- FRESHRSS_DB_HOST={{ freshrss_db_server }}
{% endif %}
- FRESHRSS_DB_PORT={{ freshrss_db_port }}
- FRESHRSS_DB_USER={{ freshrss_db_user }}
- FRESHRSS_DB_PASSWORD={{ freshrss_db_password }}
- FRESHRSS_DB_BASE={{ freshrss_db_name }}
- FRESHRSS_DB_PREFIX=freshrss_
{% endif %}
- FRESHRSS_EXTENSIONS_ENABLED={{ freshrss_extensions_enabled | join(',') }}
- FRESHRSS_TRUSTED_SOURCES={{ freshrss_trusted_sources | join(',') }}
{% if freshrss_memory_limit is defined %}
mem_limit: {{ freshrss_memory_limit }}
{% endif %}
{% if freshrss_memory_reservation is defined %}
mem_reservation: {{ freshrss_memory_reservation }}
{% endif %}
{% if freshrss_cpu_shares is defined %}
cpu_shares: {{ freshrss_cpu_shares }}
{% endif %}
{% if not freshrss_cap_add | length == 0 %}
cap_add:
{% for item in freshrss_cap_add %}
- {{ item }}
{% endfor %}
{% endif %}
{% if not freshrss_cap_drop | length == 0 %}
cap_drop:
{% for item in freshrss_cap_drop %}
- {{ item }}
{% endfor %}
{% endif %}
{% if not freshrss_security_opt | length == 0 %}
security_opt:
{% for item in freshrss_security_opt %}
- {{ item }}
{% endfor %}
{% endif %}
{% if freshrss_healthcheck is defined %}
healthcheck:
{% for key, value in freshrss_healthcheck.items() %}
{{ key }}: {{ value }}
{% endfor %}
{% endif %}
{% if freshrss_pids_limit is defined %}
pids_limit: {{ freshrss_pids_limit }}
{% endif %}
{% if freshrss_volumes | default([]) | rejectattr("bind") | list | length > 0 %}
volumes:
{% for volume in freshrss_volumes | rejectattr("bind") %}
{{ volume.name }}:
{% endfor %}
{% endif %}
{% if freshrss_networks | default([]) | length > 0 %}
networks:
{% for network in freshrss_networks %}
{{ network.name }}:
driver: {{ network.backend | default("bridge") }}
{% endfor %}
{% endif %}