-
- Internet-in-a-Box (formerly known as XSCE School Server) includes a variety of educational content and applications which are attributed as follows:
-
- All Wikipedia content is available for free at www.wikipedia.org.
- All other Wikimedia content is available for free via links at www.wikimedia.org.
- All Khan Academy content is available for free at www.khanacademy.org.
- All CK-12 content is available for free at www.ck12.org.
- All PhET Interactive Simulations content is available for free at phet.colorado.edu.
- All MedLine content is available for free at medlineplus.gov.
- All Hesperian content is available for free at hesperian.org.
- Arabic translations of Hesperian content were done by Arab Resource Collective and are available for free at mawared.org.
- All Gutenberg content is available for free at www.gutenberg.org.
- All OLPC content is available for free at wiki.laptop.org.
- All MIT Scratch content is available for free at scratch.mit.edu.
- All UNESCO's IICBA content is available for free at www.iicba.unesco.org/.
- All Math Expression content is available for free at www.mathexpression.com.
- All Music Theory content is available for free at www.musictheory.net.
- All HealthPhone content is available for free at www.healthphone.org.
- All Centers for Disease Control content is available for free at www.cdc.gov.
- All Global Emergency Medicine Wiki content is available for free at wikem.org/wiki/Main_Page.
-
- Internet-in-a-Box also includes the work of content aggregators which we gratefully acknowledge:
-
- RACHEL is a curation of selected offline content at oer2go.org.
- Kiwix is a ZIM server and repository of Wikimedia and other content in a compressed ZIM file format at www.kiwix.org.
- KA Lite is a server and repository of Khan Academy content in various languages at learningequality.org/ka-lite.
-
- Internet-in-a-Box also contains a number of applications each of which has its own attribution information, which is included.
-
- This Internet-in-a-Box distribution resides at github.com/iiab.
-
- It is licensed under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
-
- Licensing information may be found at github.com/iiab/iiab/blob/master/LICENSE.md.
-
-
-
-
diff --git a/roles/httpd/files/html/html/credits.html b/roles/httpd/files/html/html/credits.html
index c1cef0e8b..c6e0b9ce0 100755
--- a/roles/httpd/files/html/html/credits.html
+++ b/roles/httpd/files/html/html/credits.html
@@ -3,6 +3,10 @@
+
+
Credits
diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml
index 43f506c2e..ff1ffe6c6 100644
--- a/roles/sugarizer/tasks/main.yml
+++ b/roles/sugarizer/tasks/main.yml
@@ -160,6 +160,13 @@
# chdir: "{{ sugarizer_location }}/sugarizer/server"
# when: internet_available and is_F18 and not node_modules_exists
+# Add a nodejs express function that appends a prefix to urls
+- name: Install path prefix proxy
+ command: npm install --allow-root --unsafe-perm=true path-prefix-proxy
+ args:
+ chdir: "{{ sugarizer_location }}/{{ sugarizer_server_version }}"
+ when: internet_available
+
# 5. PLACE CONFIG FILES
- name: Configure sugarizer.service (systemd), sugarizer.conf (Apache) and sugarizer.ini
@@ -173,6 +180,7 @@
- { src: 'sugarizer.ini', dest: '{{ sugarizer_location }}/{{ sugarizer_server_version }}/env/sugarizer.ini', mode: '0644' }
- { src: 'sugarizer.conf', dest: '/etc/apache2/sites-available', mode: '0644' }
- { src: 'sugarizer.service.j2', dest: '/etc/systemd/system/sugarizer.service', mode: '0644' }
+ - { src: 'sugarizer.js', dest: '/opt/iiab/sugarizer-server', mode: '0644' }
- name: Create symlink for short URL http://box/sugarizer
file:
@@ -189,6 +197,12 @@
state: restarted
daemon_reload: yes
when: sugarizer_enabled
+
+- name: Restart Apache so http://box/sugarizer works (not just http://box:8089)
+ systemd:
+ name: apache2
+ state: restarted
+ when: sugarizer_enabled
- name: 'Disable+stop systemd service if sugarizer_enabled: False'
systemd:
diff --git a/roles/sugarizer/templates/sugarizer.conf b/roles/sugarizer/templates/sugarizer.conf
index ff1fe7508..7f90d01ce 100644
--- a/roles/sugarizer/templates/sugarizer.conf
+++ b/roles/sugarizer/templates/sugarizer.conf
@@ -1,2 +1,2 @@
-RewriteEngine on
-RewriteRule ^/sugarizer(.*)$ http://localhost:8089$1 [PT]
+ProxyPass /sugarizer http://localhost:8089/sugarizer
+ProxyPassReverse /sugarizer http://localhost:8089/sugarizer
diff --git a/roles/sugarizer/templates/sugarizer.js b/roles/sugarizer/templates/sugarizer.js
new file mode 100644
index 000000000..1fe914071
--- /dev/null
+++ b/roles/sugarizer/templates/sugarizer.js
@@ -0,0 +1,43 @@
+// require files
+var express = require('express'),
+ http = require('http'),
+ https = require('https'),
+ settings = require('./config/settings'),
+ common = require('./dashboard/helper/common');
+ ini = settings.load(),
+ app = express(),
+ server = null;
+
+// init common
+common.init(ini);
+
+//configure app setting
+require('./config/main')(app, ini);
+
+// include api routes
+require('./api/route')(app, ini);
+
+// include dashboard routes
+require('./dashboard/route')(app, ini);
+
+// Handle https
+if (ini.security.https) {
+ var credentials = common.loadCredentials(ini);
+ if (!credentials) {
+ console.log("Error reading HTTPS credentials");
+ process.exit(-1);
+ }
+ server = https.createServer(credentials, app);
+} else {
+ server = http.createServer(app);
+}
+
+var pathPrefix = '/sugarizer';
+app.use(pathPrefix, require('path-prefix-proxy')(pathPrefix));
+
+// Start listening
+server.listen(ini.web.port,"0.0.0.0");
+console.log("Sugarizer Server is listening on"+(ini.security.https ? " secure":"")+" port " + ini.web.port + "...");
+
+//export app for testing
+module.exports = app;
diff --git a/scripts/calibre-install-latest-rpi-plus.sh b/scripts/calibre-install-latest-rpi-plus.sh
index 7237f2b2b..3164d9e35 100755
--- a/scripts/calibre-install-latest-rpi-plus.sh
+++ b/scripts/calibre-install-latest-rpi-plus.sh
@@ -29,5 +29,5 @@ echo "deb http://raspbian.raspberrypi.org/raspbian/ testing main" > /etc/apt/sou
apt update
apt -y install calibre calibre-bin
rm /etc/apt/sources.list.d/rpi-testing.list
-# Clears the cache of testing
+# Clears the cache of rpi/testing
apt update
diff --git a/scripts/calibre-install-latest-rpi.sh b/scripts/calibre-install-latest-rpi.sh
index 607592bbb..32ab0588a 100755
--- a/scripts/calibre-install-latest-rpi.sh
+++ b/scripts/calibre-install-latest-rpi.sh
@@ -11,8 +11,7 @@ export DEBIAN_FRONTEND=noninteractive
echo "deb http://raspbian.raspberrypi.org/raspbian/ testing main" > /etc/apt/sources.list.d/rpi-testing.list
apt update
apt -y install calibre calibre-bin
-## Removes last line, safer than: rm /etc/apt/sources.list.d/rpi-testing.list
-#sed -i '$ d' /etc/apt/sources.list.d/rpi-testing.list
+#sed -i '$ d' /etc/apt/sources.list.d/rpi-testing.list # Removes last line
rm /etc/apt/sources.list.d/rpi-testing.list
-# Clears the cache of testing
+# Clears the cache of rpi/testing
apt update
diff --git a/scripts/calibre-install-latest.sh b/scripts/calibre-install-latest.sh
index 363866335..b440bab7f 100755
--- a/scripts/calibre-install-latest.sh
+++ b/scripts/calibre-install-latest.sh
@@ -20,11 +20,11 @@ export DEBIAN_FRONTEND=noninteractive
apt -y install dirmngr
# Prepares to update to latest from debian testing
apt-key adv --recv-key --keyserver keyserver.ubuntu.com 7638D0442B90D010
-echo "deb http://deb.debian.org/debian testing main" >> /etc/apt/sources.list.d/debian-testing.list
+echo "deb http://deb.debian.org/debian testing main" > /etc/apt/sources.list.d/debian-testing.list
apt update
-apt -y install libqt5core5a python-lxml calibre calibre-bin
-## Removes last line, safer than: rm /etc/apt/sources.list.d/debian-testing.list
-#sed -i '$ d' /etc/apt/sources.list.d/debian-testing.list
+#apt -y install libqt5core5a python-lxml calibre calibre-bin
+apt -y install calibre calibre-bin
+#sed -i '$ d' /etc/apt/sources.list.d/debian-testing.list # Removes last line
rm /etc/apt/sources.list.d/debian-testing.list
-# Clears the cache of testing
+# Clears the cache of debian/testing
apt update
diff --git a/scripts/calibre-install-packages.sh b/scripts/calibre-install-packages.sh
index ba99b882a..811345435 100755
--- a/scripts/calibre-install-packages.sh
+++ b/scripts/calibre-install-packages.sh
@@ -47,8 +47,8 @@ echo "deb http://raspbian.raspberrypi.org/raspbian/ testing main" > /etc/apt/sou
apt update
# Packages below cribbed from Calibre 3.23 installation on 2018-05-22, as recorded in /var/log/apt/history.log*
apt -y install libegl1 libegl-mesa0 libqt5sensors5 libbrotli1 libwoff1 libpodofo0.9.5 libjs-coffeescript python-regex libhyphen0 libqt5webchannel5 python-msgpack python-html5-parser libqt5positioning5 libpcre2-16-0 libglvnd0 libdrm-common python-sip libqt5svg5 libnih-dbus1 qt5-gtk-platformtheme libc6-dbg libqt5help5 libc6-dev libqt5dbus5 libqt5sql5-sqlite libc6 libqt5widgets5 locales libegl1-mesa python-pyqt5.qtsvg python-lxml fontconfig-config libqt5xml5 libgbm1 libqt5printsupport5 libqt5qml5 libc-l10n libqt5gui5 libc-bin libnih1 libqt5webkit5 python-pyqt5.qtwebkit libdrm2 libqt5core5a libfontconfig1 libqt5opengl5 libc-dev-bin python-pyqt5 libqt5network5 libqt5designer5 libqt5quick5 libqt5sql5
-# BUT DO NOT DO "apt -y install calibre calibre-bin" UNTIL calibre-install-latest.sh
-# Removes last line, safer than: rm /etc/apt/sources.list.d/rpi-testing.list
-sed -i '$ d' /etc/apt/sources.list.d/rpi-testing.list
-# Clears the cache of testing
+# BUT DO NOT DO "apt -y install calibre calibre-bin" UNTIL calibre-install-latest.sh ?
+#sed -i '$ d' /etc/apt/sources.list.d/rpi-testing.list # Removes last line
+rm /etc/apt/sources.list.d/rpi-testing.list
+# Clears the cache of rpi/testing
apt update
diff --git a/scripts/calibre-install-unstable.sh b/scripts/calibre-install-unstable.sh
index ab510bc5d..ea10f6563 100755
--- a/scripts/calibre-install-unstable.sh
+++ b/scripts/calibre-install-unstable.sh
@@ -16,10 +16,10 @@
export DEBIAN_FRONTEND=noninteractive
# Prepares to update to latest from unstable
apt-key adv --recv-key --keyserver keyserver.ubuntu.com 7638D0442B90D010
-echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list.d/unstable.list
+echo "deb http://deb.debian.org/debian unstable main" > /etc/apt/sources.list.d/debian-unstable.list
apt update
apt -y install calibre calibre-bin
-# Removes last line, safer than: rm /etc/apt/sources.list.d/unstable.list
-sed -i '$ d' /etc/apt/sources.list.d/unstable.list
-# Clears the cache of testing and unstable
+#sed -i '$ d' /etc/apt/sources.list.d/debian-unstable.list # Removes last line
+rm /etc/apt/sources.list.d/debian-unstable.list
+# Clears the cache of debian/unstable
apt update