diff --git a/roles/httpd/templates/refresh-wiki-docs.sh b/roles/httpd/templates/refresh-wiki-docs.sh index 46e153bb1..c8d70ce29 100755 --- a/roles/httpd/templates/refresh-wiki-docs.sh +++ b/roles/httpd/templates/refresh-wiki-docs.sh @@ -1,17 +1,26 @@ #!/bin/bash -x -# Pull down repo's entire wiki (and similar) to create offline docs +# This /opt/iiab/iiab/roles/httpd/templates/refresh-wiki-docs.sh becomes +# /usr/bin/iiab-refresh-wiki-docs during IIAB's install. -set -e -source {{ iiab_env_file }} +# This pulls down iiab/iiab repo's entire Tech Docs Wiki (and scrapes/downloads +# other docs!) to create IIAB's offline docs collection: http://box/info + +# TO DO: find more pages to download/scrape and offline links to fix, +# based on "fieldback" from truly remote implementer/operators. + +set -e # Exit on error (avoids snowballing) +source {{ iiab_env_file }} # /etc/iiab/iiab.env INPUT=/tmp/iiab-wiki OUTPUT=/tmp/iiab-wiki.out -DESTPATH=/library/www/html/info +DESTPATH={{ doc_root }}/info # /library/www/html/info +DOCSPATH=$DESTPATH/docs # /library/www/html/info/docs rm -rf $INPUT rm -rf $OUTPUT mkdir -p $INPUT mkdir -p $OUTPUT +mkdir -p $DOCSPATH git clone https://github.com/iiab/iiab.wiki.git $INPUT @@ -23,8 +32,6 @@ done rsync -av $OUTPUT/ $DESTPATH -# To Do: find more pages to d/l and offline links to fix, based on "fieldback" from truly remote implementer/operators - # Download FAQ etc lynx -reload -source http://wiki.laptop.org/go/IIAB/FAQ > $DESTPATH/FAQ.html lynx -reload -source http://wiki.laptop.org/go/IIAB/Security > $DESTPATH/Security.html @@ -38,14 +45,20 @@ lynx -reload -source https://github.com/XSCE/xsce/blob/release-6.2/ReleaseNotes6 lynx -reload -source https://github.com/XSCE/xsce/blob/release-6.2/ReleaseNotes6.1.md > $DESTPATH/ReleaseNotes6.1.html # Download Raspberry Pi guides -wget -nc -P $DESTPATH https://www.raspberrypi.org/magpi-issues/Beginners_Guide_v1.pdf -wget -nc -P $DESTPATH https://dn.odroid.com/IoT/other_doc.pdf +wget -nc https://www.raspberrypi.org/magpi-issues/Beginners_Guide_v1.pdf -O $DOCSPATH/Raspberry_Pi_Beginners_Guide_v1.pdf || true # Overrides set -e +wget -nc https://dn.odroid.com/IoT/other_doc.pdf -O $DOCSPATH/Raspberry_Pi_User_Guide_v4.pdf || true -# Update Raspberry Pi guide links on main page (http://box/info) -sed -i -r "s|https://www.raspberrypi.org/magpi-issues/Beginners_Guide_v1.pdf|Beginners_Guide_v1.pdf|g" $DESTPATH/index.html -sed -i -r "s|https://dn.odroid.com/IoT/other_doc.pdf|other_doc.pdf|g" $DESTPATH/index.html +# Copy PDF from Lokole playbook +cp -p "{{ iiab_dir }}/roles/lokole/Lokole-IIAB_Users_Manual.pdf" $DOCSPATH # From /opt/iiab/iiab -# Make links refer to local items +# MAKE LINKS REFER TO LOCAL ITEMS... + +# ...on main page (http://box/info) +sed -i -r "s|https://www.raspberrypi.org/magpi-issues/Beginners_Guide_v1.pdf|docs/Raspberry_Pi_Beginners_Guide_v1.pdf|g" $DESTPATH/index.html +sed -i -r "s|https://dn.odroid.com/IoT/other_doc.pdf|docs/Raspberry_Pi_User_Guide_v4.pdf|g" $DESTPATH/index.html +sed -i -r "s|https://github.com/iiab/iiab/blob/master/roles/lokole/Lokole-IIAB_Users_Manual.pdf|docs/Lokole-IIAB_Users_Manual.pdf|g" $DESTPATH/index.html + +# ...and within subpages for f in $DESTPATH/*.html; do sed -i -r "s|https://github.com/iiab/iiab/wiki/([-.A-Za-z0-9]*)|\1.html|g" $f diff --git a/roles/lokole/The Lokole-IIAB User's Manual.pdf b/roles/lokole/Lokole-IIAB_Users_Manual.pdf similarity index 100% rename from roles/lokole/The Lokole-IIAB User's Manual.pdf rename to roles/lokole/Lokole-IIAB_Users_Manual.pdf diff --git a/roles/lokole/README.rst b/roles/lokole/README.rst index 6e07ecfd4..cd2267eb8 100644 --- a/roles/lokole/README.rst +++ b/roles/lokole/README.rst @@ -80,7 +80,7 @@ Lokole and Internet-in-a-Box would welcome a business plan (whether volunteer-ba Troubleshooting --------------- -For further usage information and troubleshooting, refer to the `Lokole user manual `_. +For further usage information and troubleshooting, refer to the `Lokole user manual `_. Known Issues ------------ diff --git a/roles/lokole/tasks/install.yml b/roles/lokole/tasks/install.yml index 6b7bac154..c1033b8fe 100644 --- a/roles/lokole/tasks/install.yml +++ b/roles/lokole/tasks/install.yml @@ -1,3 +1,6 @@ +# Lokole PDF (User's Guide) gets copied for offline use (http://box/info) here: +# https://github.com/iiab/iiab/blob/master/roles/httpd/templates/refresh-wiki-docs.sh#L47 + - name: "Install 7 packages for Lokole: python3, python3-pip, python3-venv, python3-dev, libffi-dev, libssl-dev, bcrypt" apt: name: diff --git a/roles/network/tasks/squid.yml b/roles/network/tasks/squid.yml index 55cb28fcd..70af5b876 100644 --- a/roles/network/tasks/squid.yml +++ b/roles/network/tasks/squid.yml @@ -30,6 +30,7 @@ owner: "{{ item.owner }}" group: "{{ item.group }}" mode: "{{ item.mode }}" + force: no with_items: - src: 'roles/network/templates/squid/squid.sysconfig' dest: '/etc/sysconfig/squid' diff --git a/roles/network/templates/squid/squid-iiab.conf.j2 b/roles/network/templates/squid/squid-iiab.conf.j2 index e215cd974..1bce0547d 100644 --- a/roles/network/templates/squid/squid-iiab.conf.j2 +++ b/roles/network/templates/squid/squid-iiab.conf.j2 @@ -35,8 +35,8 @@ acl whitelist dstdomain "/etc/{{ proxy }}/sites.whitelist.txt" acl school src 172.18.0.0/16 -#acl localhost src 127.0.0.1/32 -#acl to_localhost dst 127.0.0.0/8 +acl localhost src 127.0.0.1/32 +acl to_localhost dst 127.0.0.0/8 acl to_schoolserver dst 178.16.0.0/16 # to schoolserver or other local hosts. acl SSL_ports port 443 acl Safe_ports port 80 # http