1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Merge pull request #387 from iiab/master

sync from iiab:master
This commit is contained in:
A Holt 2020-04-14 10:23:53 -04:00 committed by GitHub
commit 751ac948cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 50 additions and 12 deletions

View file

@ -26,9 +26,9 @@ kiwix_library_xml: "{{ iiab_zim_path }}/library.xml"
# http://download.kiwix.org/release/kiwix-tools/ ...or sometimes...
# http://download.kiwix.org/nightly/
kiwix_version_armhf: "kiwix-tools_linux-armhf-3.0.3"
kiwix_version_linux64: "kiwix-tools_linux-x86_64-3.0.3"
kiwix_version_i686: "kiwix-tools_linux-i586-3.0.3"
kiwix_version_armhf: kiwix-tools_linux-armhf-3.1.0
kiwix_version_linux64: kiwix-tools_linux-x86_64-3.1.0
kiwix_version_i686: kiwix-tools_linux-i586-3.1.0
# kiwix_src_file_i686: "kiwix-linux-i686.tar.bz2"
# v0.9 for i686 published May 2014 ("use it to test legacy ZIM content")

View file

@ -11,6 +11,12 @@
url: "{{ iiab_map_url }}/assets/regions.json" # http://download.iiab.io/content/OSM/vector-tiles/maplist/hidden
dest: "{{ vector_map_path }}/maplist/assets/" # /library/www/osm-vector-maps
# handle case where a dummy file is already here and would break the symlink step that follows
- name: Remove {{ doc_root }}/common/assets/regions.json
file:
dest: "{{ doc_root }}/common/assets/regions.json" # /library/www/html
state: absent
- name: Symlink catalog {{ doc_root }}/common/assets/regions.json -> {{ vector_map_path }}/maplist/assets/regions.json
file:
src: "{{ vector_map_path }}/maplist/assets/regions.json" # /library/www/osm-vector-maps

View file

@ -16,6 +16,7 @@
- { src: 'usbmount.rules.j2', dest: '/etc/udev/rules.d/usbmount.rules', mode: '0644' }
- { src: 'iiab-usb_lib-show-all-on', dest: '/usr/bin/', mode: '0755' }
- { src: 'iiab-usb_lib-show-all-off', dest: '/usr/bin/', mode: '0755' }
- { src: 'iiab-clean-usb.sh', dest: '/usr/sbin/', mode: '0755' }
- name: Enable exFAT and NTFS in /etc/usbmount/usbmount.conf
lineinfile:

View file

@ -0,0 +1,14 @@
#!/bin/bash
# Remove symlink in /library/content to automounted usb drive
#
DEVICE=`echo $@ | sed -s 's|-|/|'`
MNT_POINT=`findmnt -n /$DEVICE | awk '{print $1}'`
CONTENT_LINK_USB=`basename $MNT_POINT | awk '{print toupper($0)}'`
CONTENT_LINK="/library/www/html/local_content/$CONTENT_LINK_USB"
logger -p user.notice -t "usbmount" -- "Attempting to remove link $CONTENT_LINK."
if [ -L $CONTENT_LINK ]; then
/bin/rm $CONTENT_LINK
logger -p user.notice -t "usbmount" -- "$CONTENT_LINK removed."
fi

View file

@ -4,10 +4,11 @@ After=%i.device
After=rc-local.service
[Service]
Type=oneshot
#Type=oneshot
TimeoutStartSec=0
Environment=DEVNAME=%I
ExecStart=/usr/share/usbmount/usbmount add
ExecStop=/bin/umount /%I
ExecStop=/usr/sbin/iiab-clean-usb.sh %I
ExecStopPost=/bin/umount /%I
RemainAfterExit=yes

View file

@ -25,7 +25,7 @@
when: nginx_install | bool
- debug:
msg: 'THE 3 ANSIBLE STANZAS BELOW ONLY RUN... when: (moodle_install or nextcloud_install or pbx_install or wordpress_install) and nginx_enabled'
msg: 'THE 3 ANSIBLE STANZAS BELOW ONLY RUN... when: (nginx_high_php_limits or moodle_install or nextcloud_install or pbx_install or wordpress_install) and nginx_enabled'
- block: # 3-STANZA BLOCK BEGINS
@ -71,7 +71,7 @@
name: "php{{ php_version }}-fpm"
state: restarted
when: (moodle_install or nextcloud_install or pbx_install or wordpress_install) and nginx_enabled # 3-STANZA BLOCK ENDS
when: (nginx_high_php_limits or moodle_install or nextcloud_install or pbx_install or wordpress_install) and nginx_enabled # 3-STANZA BLOCK ENDS
# 'Is a "Rapid Power Off" button possible for low-electricity environments?'

View file

@ -87,7 +87,11 @@ function cat_cmd() { # $1 = command + params, $2 = explan
pth=$(which $cmd | sed 's/[^/]*$//') # Keep only path on left; Drop command on right
echo "COMMAND: $pth$1 # $2" >> $outfile
echo >> $outfile
$(echo $1) >> $outfile
if [ -z "$pth" ]; then
echo "COMMAND NOT FOUND: $1" >> $outfile
else
$(echo "eval $1") >> $outfile # eval is nec within backticks, so | (pipes) work: https://stackoverflow.com/a/7184782
fi
echo >> $outfile
}
@ -119,7 +123,7 @@ if [ -f /etc/rpi-issue ]; then
echo >> $outfile
echo "SEE https://github.com/RPi-Distro/pi-gen#stage-anatomy" >> $outfile
else
echo "(This is NOT a Raspberry Pi!)" >> $outfile
echo "(This is NOT Raspbian!)" >> $outfile
fi
echo >> $outfile
cat_file /etc/issue.net
@ -151,6 +155,8 @@ cat_file /etc/iiab/iiab_state.yml
cat_file /etc/iiab/config_vars.yml
cat_file /etc/resolv.conf
cat_file /etc/network/interfaces
cat_file /etc/hostapd/hostapd.conf # Auto-redact password?
#cat_file /etc/wpa_supplicant/wpa_supplicant.conf # Auto-redact password?
# Record all Ansible variables: SLOW! OUTPUT TOO LARGE?
#pushd /opt/iiab/iiab > /dev/null
@ -177,11 +183,19 @@ cat_cmd 'lsblk' 'Partition mount points'
cat_cmd 'blkid' 'Mount point details'
cat_cmd 'ip addr' 'Network interfaces'
cat_cmd 'ifconfig' 'Network interfaces (old view)'
cat_cmd 'ip route' 'Routing table'
cat_cmd 'netstat -rn' 'Routing table (old view)'
cat_cmd 'brctl show' 'Bridge for LAN side'
cat_cmd 'netstat -rn' 'Routing table'
cat_cmd 'sudo netstat -natp' 'Ports/Services in use'
cat_cmd 'systemctl status dnsmasq' 'Is dnsmasq Ok?'
cat_cmd 'sudo journalctl -u dnsmasq' 'dnsmasq log'
cat_cmd 'sudo journalctl -b 0 -u dnsmasq' 'dnsmasq log'
cat_cmd 'networkctl' 'systemd-networkd status'
cat_cmd 'nmcli d' 'NetworkManager status'
cat_cmd 'sudo journalctl -b 0 -u networkd-dispatcher' 'networkd-dispatcher log'
cat_cmd 'iw dev' 'List wireless interfaces'
cat_cmd 'systemctl status hostapd' 'Is hostapd Ok?'
cat_cmd 'ps -AH' 'Process hierarchy: staging of hostapd & wpa_supplicant?'
cat_cmd 'dmesg | grep brcm' 'Diagnostic messages: RPi WiFi firmware'
cat_cmd 'env' 'Environment variables'
#cat_cmd 'ansible localhost -m setup 2>/dev/null' 'All Ansible facts' # For cleaner scraping of Ansible vars, consider "./runrole all-vars /tmp/all-ansible-vars" 27-31 lines above?
@ -196,6 +210,8 @@ cat_tail /opt/iiab/iiab/iiab-install.log 100
cat_tail /opt/iiab/iiab/iiab-network.log 100
cat_tail /opt/iiab/iiab/iiab-debug.log 100
cat_tail /opt/iiab/iiab-admin-console/admin-install.log 100
cat_tail /var/log/messages 100
cat_tail /var/log/syslog 100
linecount=$(wc -l $outfile | sed 's/\s.*$//')
sizecount=$(du -h $outfile | sed 's/\s.*$//')

View file

@ -60,4 +60,4 @@ But first off, the file is compiled by harvesting 1 + 6 kinds of things:
## Source Code
Please look over the bottom of [iiab-diagnostics](iiab-diagnostics) (lines 100-198 especially) to learn more about which common IIAB files and commands make this rapid troubleshooting possible.
Please look over the bottom of [iiab-diagnostics](iiab-diagnostics) (lines 104-214 especially) to learn more about which common IIAB files and commands make this rapid troubleshooting possible.