# kiwix_install: True
# kiwix_enabled: True

# kiwix_port: 3000
# iiab_zim_path: "{{ content_base }}/zims"    # /library/zims

# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!


# INSTRUCTIONS TO REINSTALL Kiwix:
# (1) VERIFY THESE VARS IN /etc/iiab/local_vars.yml
#     kiwix_install: True
#     kiwix_enabled: True
# (2) RUN: cd /opt/iiab/iiab; ./runrole --reinstall kiwix


# FYI /library/zims contains 3 important things:
# - library.xml
# - content = directory for all *.zim's
# - index = directory for legacy *.zim.idx's
kiwix_library_xml: "{{ iiab_zim_path }}/library.xml"

kiwix_base_url: https://download.kiwix.org/release/kiwix-tools/
#kiwix_base_url: https://download.kiwix.org/nightly/2022-10-04/
#kiwix_base_url: "{{ iiab_download_url }}/"    # e.g. https://download.iiab.io/packages/

kiwix_arch_dict:
  #i386:
  i686: i586
  x86_64: x86_64
  armv6l: armhf
  armv7l: armhf
  aarch64: armhf

# ansible_architecture might also work, if not quite as well:
# https://stackoverflow.com/questions/66828315/what-is-the-difference-between-ansible-architecture-and-ansible-machine-on-a/66828837#66828837
# CLAIM: 'ansible_machine might be "i686", whereas ansible_architecture on the same host would be "i386"'
# https://stackoverflow.com/questions/44713880/how-do-i-make-decision-based-on-arch-in-ansible-playbooks/44714226#44714226
kiwix_arch: "{{ kiwix_arch_dict[ansible_machine] | default('unsupported') }}"

# Latest official kiwix-tools release, per Kiwix permalink redirects:
# https://www.kiwix.org/en/downloads/kiwix-serve/
# https://github.com/kiwix/container-images/issues/236
kiwix_tar_gz: "kiwix-tools_linux-{{ kiwix_arch }}.tar.gz"
#kiwix_tar_gz: "kiwix-tools_linux-{{ kiwix_arch }}-3.3.0-1.tar.gz"    # Version can be hard-coded if you prefer (as was done til 2022-10-04)

# kiwix_src_file_i686: "kiwix-linux-i686.tar.bz2"
# v0.9 for i686 published May 2014 ("use it to test legacy ZIM content")
# v0.10 for i686 published Oct 2016 ("experimental") REPLACED IN EARLY 2018,
# thx to @mgautierfr / Matthieu Gautier:
# https://github.com/kiwix/kiwix-build/issues/94
# https://github.com/kiwix/kiwix-tools/issues/170

# Used for Kiwix proxy http://box/kiwix/
kiwix_url: /kiwix
kiwix_url_plus_slash: "{{ kiwix_url }}/"    # /kiwix/
kiwix_path: "{{ iiab_base }}/kiwix"         # /opt/iiab/kiwix

kiwix_nginx_timeout: 600
kiwix_threads: 4
