mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Test (#20)
* change apache_data to apache_user in all * no libapach2 in centos. just php. no php-magick in centos * remove redundant vars entries * do not create apache user * missed one pound sign * soft code all references to apache_user * centos requires older setuptools * revert ansible_lsb.id in xsce.yml * try getting recent pip * move pip download to 2prep so that kalite success is not dependent on iiab coming first * still need to replace setuptools in kalite * add curl -- needed in debian * massivly substitue iiab for xsce, and rename files * completed runansible * centos fixes,install pip * appliance means no iptables rules * change to earlier version of setuptools for centos * delete file duplicate, hopefully unnecessary. generate the offline docs * wiki docs errors * create the admin group -- deleted earlier * use the --yes option with pip uninstall * base of repo moved from schoolserver to iiab, unleashkids.org->iiab.io * network detection broken due to tupo
This commit is contained in:
parent
6ef68cc480
commit
f319afa432
179 changed files with 978 additions and 672 deletions
|
@ -13,4 +13,4 @@ Locations
|
|||
- The ZIM index files are expected to be in directories under /library/zims/index
|
||||
- The URL is /kiwix
|
||||
|
||||
The library.xml file can be recalculated by running xsce-make-kiwix-lib.
|
||||
The library.xml file can be recalculated by running iiab-make-kiwix-lib.
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
kiwix_url: /kiwix
|
||||
kiwix_path: "{{ xsce_base }}/kiwix"
|
||||
kiwix_path: "{{ iiab_base }}/kiwix"
|
||||
kiwix_port: 3000
|
||||
xsce_zim_path: /library/zims
|
||||
kiwix_library_xml: "{{ xsce_zim_path }}/library.xml"
|
||||
kiwix_content_path: "{{ xsce_zim_path }}/content"
|
||||
iiab_zim_path: /library/zims
|
||||
kiwix_library_xml: "{{ iiab_zim_path }}/library.xml"
|
||||
kiwix_content_path: "{{ iiab_zim_path }}/content"
|
||||
kiwix_install: True
|
||||
kiwix_serve_enabled: False
|
||||
kiwix_content_found: False
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
mode=0755
|
||||
state=directory
|
||||
with_items:
|
||||
- "{{ xsce_zim_path }}"
|
||||
- "{{ iiab_zim_path }}"
|
||||
- "{{ kiwix_content_path }}"
|
||||
- "{{ xsce_zim_path }}/index"
|
||||
- "{{ iiab_zim_path }}/index"
|
||||
|
||||
- name: Copy kiwix library file if needed
|
||||
template: src={{ item }}
|
||||
|
@ -40,13 +40,13 @@
|
|||
|
||||
- name: Unarchive it to permanent location - not bin_only
|
||||
unarchive: src="{{ downloads_dir }}/{{ kiwix_src_file }}"
|
||||
dest="{{ xsce_base }}"
|
||||
dest="{{ iiab_base }}"
|
||||
owner=root
|
||||
group=root
|
||||
when: not kiwix_src_bin_only and kiwix_first_pass
|
||||
|
||||
- name: Create directory for kiwix bin
|
||||
file: path="{{ xsce_base }}/kiwix/bin"
|
||||
file: path="{{ iiab_base }}/kiwix/bin"
|
||||
owner=root
|
||||
group=root
|
||||
mode=0755
|
||||
|
@ -62,14 +62,14 @@
|
|||
|
||||
- name: Unarchive it to permanent location - bin only
|
||||
unarchive: src="{{ downloads_dir }}/{{ kiwix_src_file }}"
|
||||
dest="{{ xsce_base }}/kiwix/bin"
|
||||
dest="{{ iiab_base }}/kiwix/bin"
|
||||
owner=root
|
||||
group=root
|
||||
when: kiwix_src_bin_only and kiwix_first_pass
|
||||
|
||||
# workaround because unarchive does not set ownership properly
|
||||
- name: Set kiwix ownership
|
||||
command: "chown -R root:root {{ xsce_base }}"
|
||||
command: "chown -R root:root {{ iiab_base }}"
|
||||
|
||||
# workaround because kiwix-serve does not stay running
|
||||
- name: Make an entry in crontab to restart every hour
|
||||
|
@ -97,9 +97,9 @@
|
|||
- { src: 'kiwix-serve.service.j2', dest: '/etc/systemd/system/kiwix-serve.service', mode: '0655'}
|
||||
|
||||
# - { src: 'kiwix-serve-init.j2', dest: '/usr/libexec/kiwix-serve-init', mode: '0755'}
|
||||
- { src: 'xsce-make-kiwix-lib', dest: '/usr/bin/xsce-make-kiwix-lib', mode: '0755'}
|
||||
- { src: 'xsce-make-kiwix-lib.py', dest: '/usr/bin/xsce-make-kiwix-lib.py', mode: '0755'}
|
||||
- { src: 'xsce-make-apache-config.py', dest: '/usr/bin/xsce-make-apache-config.py', mode: '0755'}
|
||||
- { src: 'iiab-make-kiwix-lib', dest: '/usr/bin/iiab-make-kiwix-lib', mode: '0755'}
|
||||
- { src: 'iiab-make-kiwix-lib.py', dest: '/usr/bin/iiab-make-kiwix-lib.py', mode: '0755'}
|
||||
- { src: 'iiab-make-apache-config.py', dest: '/usr/bin/iiab-make-apache-config.py', mode: '0755'}
|
||||
|
||||
|
||||
- name: add kiwix to service list
|
||||
|
@ -118,8 +118,8 @@
|
|||
value: "{{ kiwix_path }}"
|
||||
- option: kiwix_port
|
||||
value: "{{ kiwix_port }}"
|
||||
- option: xsce_zim_path
|
||||
value: "{{ xsce_zim_path }}"
|
||||
- option: iiab_zim_path
|
||||
value: "{{ iiab_zim_path }}"
|
||||
- option: kiwix_library_xml
|
||||
value: "{{ kiwix_library_xml }}"
|
||||
- option: kiwix_content_path
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
when: ansible_machine == "armv7l"
|
||||
|
||||
- name: Get the kiwix software
|
||||
get_url: url="{{ xsce_download_url }}/{{ kiwix_src_file }}" dest="{{ downloads_dir }}/{{ kiwix_src_file }}"
|
||||
get_url: url="{{ iiab_download_url }}/{{ kiwix_src_file }}" dest="{{ downloads_dir }}/{{ kiwix_src_file }}"
|
||||
when: not {{ use_cache }} and not {{ no_network }}
|
||||
tags:
|
||||
- download2
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
import os, sys, syslog
|
||||
|
||||
xsce_zim_path = "/library/zims"
|
||||
iiab_zim_path = "/library/zims"
|
||||
kiwix_apache_config = "/etc/apache2/sites-available/kiwix.conf"
|
||||
|
||||
def main ():
|
||||
content = xsce_zim_path + "/content/"
|
||||
index = xsce_zim_path + "/index/"
|
||||
content = iiab_zim_path + "/content/"
|
||||
index = iiab_zim_path + "/index/"
|
||||
|
||||
# remove existing file
|
||||
try:
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
{{systemctl_program }} stop kiwix-serve
|
||||
/usr/bin/xsce-make-kiwix-lib.py
|
||||
/usr/bin/xsce-make-apache-config.py
|
||||
/usr/bin/iiab-make-kiwix-lib.py
|
||||
/usr/bin/iiab-make-apache-config.py
|
||||
{{ systemctl_program }} start kiwix-serve
|
||||
|
||||
exit 0
|
|
@ -18,22 +18,22 @@ import re
|
|||
import subprocess
|
||||
import shlex
|
||||
import ConfigParser
|
||||
XSCE_PATH='/etc/xsce'
|
||||
XSCE_PATH='/etc/iiab'
|
||||
if not XSCE_PATH in sys.path:
|
||||
sys.path.append(XSCE_PATH)
|
||||
from xsce_env import get_xsce_env
|
||||
from iiab_env import get_iiab_env
|
||||
|
||||
# Config Files
|
||||
xsce_config_file = "/etc/xsce/xsce.ini"
|
||||
iiab_config_file = "/etc/iiab/iiab.ini"
|
||||
|
||||
# Variables that should be read from config file
|
||||
# All of these variables will be read from config files and recomputed in init()
|
||||
xsce_zim_path = "/library/zims"
|
||||
iiab_zim_path = "/library/zims"
|
||||
kiwix_library_xml = "/library/zims/library.xml"
|
||||
|
||||
xsce_base_path = "/opt/schoolserver"
|
||||
kiwix_manage = xsce_base_path + "/kiwix/bin/kiwix-manage"
|
||||
doc_root = get_xsce_env('WWWROOT')
|
||||
iiab_base_path = "/opt/schoolserver"
|
||||
kiwix_manage = iiab_base_path + "/kiwix/bin/kiwix-manage"
|
||||
doc_root = get_iiab_env('WWWROOT')
|
||||
zim_version_idx = doc_root + "/common/assets/zim_version_idx.json"
|
||||
zim_versions = {}
|
||||
|
||||
|
@ -52,8 +52,8 @@ def main():
|
|||
# only add a single .zim for each .zimxx file
|
||||
|
||||
files_processed = {}
|
||||
content = xsce_zim_path + "/content/"
|
||||
index = xsce_zim_path + "/index/"
|
||||
content = iiab_zim_path + "/content/"
|
||||
index = iiab_zim_path + "/index/"
|
||||
|
||||
flist = os.listdir(content)
|
||||
flist.sort()
|
||||
|
@ -86,17 +86,17 @@ def main():
|
|||
|
||||
def init():
|
||||
|
||||
global xsce_base_path
|
||||
global xsce_zim_path
|
||||
global iiab_base_path
|
||||
global iiab_zim_path
|
||||
global kiwix_library_xml
|
||||
global kiwix_manage
|
||||
|
||||
config = ConfigParser.SafeConfigParser()
|
||||
config.read(xsce_config_file)
|
||||
xsce_base_path = config.get('location','xsce_base')
|
||||
xsce_zim_path = config.get('kiwix-serve','xsce_zim_path')
|
||||
config.read(iiab_config_file)
|
||||
iiab_base_path = config.get('location','iiab_base')
|
||||
iiab_zim_path = config.get('kiwix-serve','iiab_zim_path')
|
||||
kiwix_library_xml = config.get('kiwix-serve','kiwix_library_xml')
|
||||
kiwix_manage = xsce_base_path + "/kiwix/bin/kiwix-manage"
|
||||
kiwix_manage = iiab_base_path + "/kiwix/bin/kiwix-manage"
|
||||
|
||||
# Now start the application
|
||||
|
|
@ -4,7 +4,7 @@ After=syslog.target network.target local-fs.target
|
|||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart={{ xsce_base }}/kiwix/bin/kiwix-serve --daemon --port {{ kiwix_port }} --library {{ kiwix_library_xml }}
|
||||
ExecStart={{ iiab_base }}/kiwix/bin/kiwix-serve --daemon --port {{ kiwix_port }} --library {{ kiwix_library_xml }}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue