1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-14 20:22:08 +00:00

Merge branch 'iiab:master' into master

This commit is contained in:
A Holt 2021-07-06 13:10:09 -04:00 committed by GitHub
commit 97afe223e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 50 additions and 68 deletions

View file

@ -2,16 +2,6 @@
# https://github.com/iiab/iiab/blob/master/roles/www_base/templates/iiab-refresh-wiki-docs.sh#L51-L52
#- name: "Set 'apache_install: True' and 'apache_enabled: True'"
# set_fact:
# apache_install: True
# apache_enabled: True
#- name: APACHE - run 'httpd' role
# include_role:
# name: httpd
- name: "Install 8 packages for Lokole: python3, python3-pip, python3-venv, python3-dev, python3-bcrypt, libffi-dev, libssl-dev, libopenjp2-7"
apt:
name:
@ -31,7 +21,6 @@
- mobile-broadband-provider-info
- ppp
- wvdial
state: present
# For development purposes -- To install Lokole from a given commit, add the
@ -140,19 +129,13 @@
- name: Create Lokole admin user with password, for http://box{{ lokole_url }} # http://box/lokole
include_tasks: setup.yml
- name: Install /etc/{{ apache_conf_dir }}/lokole.conf from template, for http://box{{ lokole_url }} via Apache # http://box/lokole
template:
src: lokole.conf.j2
dest: "/etc/{{ apache_conf_dir }}/lokole.conf"
mode: 0644
when: apache_install
# RECORD Lokole AS INSTALLED
- name: "Set 'lokole_installed: True'"
set_fact:
lokole_installed: True
# RECORD Lokole AS INSTALLED
- name: "Add 'lokole_installed: True' to {{ iiab_state_file }}"
lineinfile:
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml

View file

@ -43,13 +43,8 @@
state: stopped
when: not lokole_enabled
- name: Enable/Disable/Restart Apache if primary
include_tasks: apache.yml
when: not nginx_enabled
- name: Enable/Disable/Restart NGINX if primary
- name: Enable/Disable/Restart NGINX
include_tasks: nginx.yml
when: nginx_enabled
- name: Add 'lokole' variable values to {{ iiab_ini_file }}

View file

@ -107,7 +107,7 @@
state: directory
path: "{{ nextcloud_root_dir }}" # /library/www/nextcloud
- name: Unarchive {{ nextcloud_dl_url }} (100+ MB) to {{ nextcloud_root_dir }} (434-450 MB, {{ apache_user }}:{{ apache_user }})
- name: Unarchive {{ nextcloud_dl_url }} (~138 MB) to {{ nextcloud_root_dir }} (~463 MB initially, 485+ MB later, {{ apache_user }}:{{ apache_user }})
unarchive:
remote_src: yes # Overwrite even if "already exists on the target"
src: "{{ nextcloud_dl_url }}"

View file

@ -1,33 +1,37 @@
### Transition to NGINX
1. Initial testing strategy (December 2019 - February 2020) is to move NGINX to [port 80](https://github.com/iiab/iiab/wiki/IIAB-Networking#list-of-ports--services), and proxy everything to Apache on [port 8090](https://github.com/iiab/iiab/wiki/IIAB-Networking#list-of-ports--services) — creating "Shims" for each IIAB App/Service in *Section iii.* below.
1. Initial testing strategy (December 2019 - February 2020) was to move NGINX to [port 80](https://github.com/iiab/iiab/wiki/IIAB-Networking#list-of-ports--services), and proxy everything to Apache on [port 8090](https://github.com/iiab/iiab/wiki/IIAB-Networking#list-of-ports--services) — creating "Shims" for each IIAB App/Service in *Section iii.* below.
Until "Native" NGINX is later implemented for that IIAB App/Service — allowing it to move up to *Section ii.* below.
Until "Native" NGINX is later implemented for each such IIAB App/Service — allowing each to move up to *Section ii.* below.
And potentially later moving each up to *Section i.* if its Apache support is dropped!
And potentially later moving it up to *Section i.* if its Apache support is dropped!
(Background: IIAB Apps/Services are generally [Ansible roles](https://github.com/iiab/iiab/wiki/IIAB-Contributors-Guide#ansible) that live in [/opt/iiab/iiab/roles](https://github.com/iiab/iiab/tree/master/roles))
2. Without PHP available via FastCGI, any function at all for PHP-based applications validates NGINX.
3. Current state of IIAB App/Service migrations as of 2021-05-21: *(SEE ALSO [#2762](https://github.com/iiab/iiab/issues/2762))*
3. Current state of IIAB App/Service migrations as of 2021-07-06: *(SEE ALSO [#2762](https://github.com/iiab/iiab/issues/2762))*
1. These support "Native" NGINX but ***NOT*** Apache
* Admin Console
* captiveportal
* IIAB documentation (http://box/info)
* jupyterhub
* osm-vector-maps
* lokole
* moodle
* nodered
* OER2Go/RACHEL modules
* osm-vector-maps
* usb_lib
2. These support "Native" NGINX ***AND*** Apache, a.k.a. "dual support" for legacy testing (if suitable "Shims" from *Section iii.* below are preserved!) Both "Native" NGINX and "Shim" proxying from NGINX to Apache port 8090 *cannot be enabled simultaneously* for these IIAB Apps/Service:<!--But if you want to attempt their "Shim" proxying legacy testing mode, try setting your *primary web server* to Apache using `apache_install: True` and `apache_enabled: True` (and `nginx_enabled: False` to disable NGINX) in [/etc/iiab/local_vars.yml](http://wiki.laptop.org/go/IIAB/FAQ#What_is_local_vars.yml_and_how_do_I_customize_it.3F) before you install IIAB. You may also need to run `cd /opt/iiab/iiab; ./runrole httpd` since this has been removed from [roles/3-base-server/tasks/main.yml](https://github.com/iiab/iiab/blob/master/roles/3-base-server/tasks/main.yml)-->
* awstats
* calibre-web
* gitea
* kiwix
* kolibri
* lokole
* mediawiki
* munin
* nextcloud
@ -35,11 +39,11 @@
* wordpress
3. These support Apache but ***NOT*** "Native" NGINX. They use a "Shim" to [proxy_pass](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) from NGINX to Apache on port 8090. See [roles/3-base-server/tasks/main.yml#L11](../3-base-server/tasks/main.yml#L11) for a list of ~6 IIAB Apps/Services that auto-enable Apache.
* elgg
* moodle [*, PLEASE HELP IF YOU CAN: [#2785](https://github.com/iiab/iiab/issues/2785)]
* nodered
4. These each run their own web server or non-web / backend services, e.g. off of their own [unique port(s)](https://github.com/iiab/iiab/wiki/IIAB-Networking#list-of-ports--services) (IIAB home pages link directly to these destinations). In future we'd like mnemonic URL's for all of these: (e.g. http://box/calibre, http://box/archive, http://box/kalite)
* bluetooth
* calibre (menu goes directly to port 8080)
* cups (menu goes directly to port 631) [*, shim not yet in place, [PR #2775](https://github.com/iiab/iiab/pull/2775)]
@ -55,4 +59,4 @@
* transmission
* vnstat
[*] The 5 above starred roles could use improvement, as of 2021-05-21.
[*] The 4 above starred roles could use improvement, as of 2021-07-06.

View file

@ -1,15 +1,5 @@
- name: "Set 'apache_install: True' and 'apache_enabled: True'"
set_fact:
apache_install: True
apache_enabled: True
- name: APACHE - run 'httpd' role
include_role:
name: httpd
# 2019-01-16: @jvonau's PR #1403 moved installation of Node.js (8.x for now) &
# npm to roles/nodejs/tasks/main.yml
# 2019-01-16: @jvonau's PR #1403 moved installation of Node.js [8.x at the time]
# and npm to roles/nodejs/tasks/main.yml
- name: "Set 'nodejs_install: True' and 'nodejs_enabled: True'"
set_fact:
@ -48,7 +38,7 @@
state: absent
when: nodered_install
# 2012-02-13: the 6 RPi stanzas below recreate Raspbian Desktop's Node-RED
# 2019-02-13: the 6 RPi stanzas below recreate Raspbian Desktop's Node-RED
# environment, inspired by:
# https://nodered.org/docs/hardware/raspberrypi
# https://github.com/node-red/raspbian-deb-package/blob/master/resources/update-nodejs-and-nodered
@ -112,18 +102,11 @@
dest: /etc/systemd/system/nodered.service
# mode: '0666'
- name: Install /etc/{{ apache_conf_dir }}/nodered.conf from template
template:
backup: yes
src: nodered.conf.j2
dest: "/etc/{{ apache_conf_dir }}/nodered.conf"
# mode: '0666'
# SEE ALSO THE apache2_module SECTION IN roles/httpd/tasks/main.yml
- name: Enable proxy_wstunnel apache2 module
apache2_module:
state: present
name: proxy_wstunnel
#- name: Enable proxy_wstunnel apache2 module
# apache2_module:
# state: present
# name: proxy_wstunnel
# RECORD Node-RED AS INSTALLED

View file

@ -39,14 +39,8 @@
state: stopped
when: not nodered_enabled
#- name: Enable/Disable/Restart Apache if primary
- name: SHIM FOR NOW SO ALWAYS DO THE...Enable/Disable/Restart Apache
include_tasks: apache.yml
#when: not nginx_enabled
- name: Enable/Disable/Restart NGINX if primary
- name: Enable/Disable/Restart NGINX
include_tasks: nginx.yml
when: nginx_enabled
- name: Add 'nodered' variable values to {{ iiab_ini_file }}

View file

@ -1,3 +1,26 @@
# 'nodered_port: 1880' is set in /opt/iiab/iiab/vars/default_vars.yml
# https://github.com/iiab/iiab/wiki/IIAB-Networking#list-of-ports--services
location /nodered/ {
proxy_pass http://127.0.0.1:{{ apache_port }}/nodered/;
proxy_pass http://127.0.0.1:{{ nodered_port }}/nodered/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
#location /nodered/debug/ws/ {
# proxy_pass http://127.0.0.1:{{ nodered_port }}/nodered/debug/ws;
#
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
#}
#location /nodered/comms/ {
# proxy_pass http://127.0.0.1:{{ nodered_port }}/nodered/comms;
#
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
#}