1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

Merge pull request #468 from iiab/master

Sync from iiab/iiab:master
This commit is contained in:
A Holt 2021-03-07 16:30:02 -05:00 committed by GitHub
commit 405db11ce4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 15 deletions

View file

@ -9,7 +9,7 @@
# Info needed to install Gitea:
gitea_version: 1.13.4
gitea_version: 1.13 # 2021-03-07: Had been fine-grained, e.g. 1.13.4
iset_suffixes:
i386: 386
x86_64: amd64

View file

@ -7,7 +7,7 @@ This role installs KA Lite, an offline version of Khan Academy (https://www.khan
KA Lite downloads Khan Academy videos to your Internet-in-a-Box for offline use, with exercises and accounts if students want to track their own progress.
[Originally KA Lite had two servers, a light httpd server that serves Khan Academy videos, and a cron server that sets up cron jobs to download language packs and KA videos from the internet. There were separate flags to enable these two servers.]
[Originally KA Lite had two servers, a light httpd server that served Khan Academy videos, and a cron server that set up cron jobs to download language packs and KA videos from the internet. There were separate flags to enable these two servers.]
Using It
--------
@ -36,11 +36,13 @@ Look at `role/kalite/defaults/main.yml <https://github.com/iiab/iiab/blob/master
Troubleshooting
---------------
*In late 2017, Internet-in-a-Box added a virtual environment (/usr/local/kalite/venv/) to keep KA Lite's Python package/dependency risks under control. As such the command* `/usr/bin/kalite <https://github.com/iiab/iiab/blob/master/roles/kalite/templates/kalite.sh.j2>`_ *is a wrapper to this virtualenv*. **Consequently, the following steps are no longer needed:**
Starting with KA Lite 0.15 (October 2015) you could run the server manually with the following commands:
* systemctl stop kalite-serve (make sure the systemd service is not running)
* export KALITE_HOME=/library/ka-lite (point kalite to the right environment)
* kalite start (start the server; can take more than 10 minutes in some environments)
* kalite start (start the server; took several minutes on older environments)
To return to using the systemd unit:
@ -48,8 +50,6 @@ To return to using the systemd unit:
* kalite stop
* systemctl start kalite-serve
*In late 2017, Internet-in-a-Box added a virtual environment (/usr/local/kalite/venv/) to keep KA Lite's Python package/dependency risks under control. As such the command* `/usr/bin/kalite <https://github.com/iiab/iiab/blob/master/roles/kalite/templates/kalite.sh.j2>`_ *is a wrapper to this virtualenv.*
More Tips & Tricks
------------------

View file

@ -14,16 +14,15 @@
- name: Install python2, if Raspbian/Debian > 10 or Ubuntu > 19
package:
name:
- python2
- python-setuptools # provides setuptools-44 last version compatible with python2
- python2
- python-setuptools # provides setuptools-44 last version compatible with python2
state: present
when: not (is_debian_9 or is_debian_10 or is_ubuntu_16 or is_ubuntu_17 or is_ubuntu_18 or is_ubuntu_19)
# 2020-03-31: Testing for {is_raspbian_9, is_raspbian_10} is not currently nec, as testing for {is_debian_9, is_debian_10} covers that already.
- name: Use pip to pin setuptools to 44 in {{ kalite_venv }} if Raspbian/Debian > 10 or Ubuntu > 19
pip:
name:
- setuptools==44
name: setuptools==44
virtualenv: "{{ kalite_venv }}" # /usr/local/kalite/venv
virtualenv_site_packages: no
virtualenv_command: /usr/bin/virtualenv
@ -43,7 +42,7 @@
extra_args: "--no-cache-dir"
when: internet_available
- name: "Install from templates: venv wrapper /usr/bin/kalite, systemd unit file kalite-serve.service"
- name: "Install from templates: venv wrapper /usr/bin/kalite, unit file /etc/systemd/system/kalite-serve.service"
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
@ -52,13 +51,15 @@
- { src: 'kalite.sh.j2', dest: '/usr/bin/kalite', mode: '0755' }
- { src: 'kalite-serve.service.j2', dest: '/etc/systemd/system/kalite-serve.service', mode: '0644' }
- name: "Install from template: /etc/{{ apache_conf_dir }}/kalite.conf"
# Useless stanza, for 2 reasons: (1) http://box/kalite was never made to work
# (2) /etc/apache2/sites-available does not exist on many IIAB's w/o Apache
- name: "Install from template: /etc/{{ apache_conf_dir }}/kalite.conf (useless, as http://box/kalite was never made to work)"
template:
src: kalite.conf
dest: "/etc/{{ apache_conf_dir }}" # apache2/sites-available on debuntu
when: apache_installed is defined
- name: Fix KA Lite bug in regex parsing ifconfig output, for @m-anish's network names that contain dashes, if Raspbian/Debian < 11 or Ubuntu < 20
- name: Fix KA Lite bug in regex parsing ifconfig output (ifcfg/parser.py) for @m-anish's network names that contain dashes, if Raspbian/Debian < 11 or Ubuntu < 20
replace:
path: /usr/local/kalite/venv/local/lib/python2.7/site-packages/kalite/packages/dist/ifcfg/parser.py
regexp: 'a-zA-Z0-9'
@ -66,21 +67,21 @@
when: is_debian_9 or is_debian_10 or is_ubuntu_16 or is_ubuntu_17 or is_ubuntu_18 or is_ubuntu_19
# 2020-03-31: Testing for {is_raspbian_9, is_raspbian_10} is not currently nec, as testing for {is_debian_9, is_debian_10} covers that already.
- name: Fix KA Lite bug in regex parsing ifconfig output, for @m-anish's network names that contain dashes, if Raspbian/Debian > 10 or Ubuntu > 19
- name: Fix KA Lite bug in regex parsing ifconfig output (ifcfg/parser.py) for @m-anish's network names that contain dashes, if Raspbian/Debian > 10 or Ubuntu > 19
replace:
path: /usr/local/kalite/venv/lib/python2.7/site-packages/kalite/packages/dist/ifcfg/parser.py
regexp: 'a-zA-Z0-9'
replace: 'a-zA-Z0-9\-'
when: not (is_debian_9 or is_debian_10 or is_ubuntu_16 or is_ubuntu_17 or is_ubuntu_18 or is_ubuntu_19)
# 2020-03-31: Testing for {is_raspbian_9, is_raspbian_10} is not currently nec, as testing for {is_debian_9, is_debian_10} covers that already.
# JV why not just is_ubuntu_20?
# JV: why not just is_ubuntu_20? AH: to make this work on Ubuntu 21+ and ideally Debian/RaspiOS 11+ too?
- name: Create dir {{ kalite_root }}
file:
state: directory
path: "{{ kalite_root }}/httpsrv/static" # /library/ka-lite
- name: Run 'kalite manage setup ...'
- name: Run '{{ kalite_program }} manage setup ...'
command: "{{ kalite_program }} manage setup --username={{ kalite_admin_user }} --password={{ kalite_admin_password }} --noinput" # Runs /usr/local/kalite/venv/bin/kalite
environment:
KALITE_HOME: "{{ kalite_root }}" # /library/ka-lite