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

Rename distweb to internetarchive

This commit is contained in:
Mitra Ardron 2019-04-23 10:59:57 +10:00
parent b506187ace
commit 6bd2575f51
8 changed files with 50 additions and 50 deletions

View file

@ -21,11 +21,11 @@
when: minetest_install
tags: minetest
- name: DISTWEB
- name: INTERNETARCHIVE
include_role:
name: distweb
when: distweb_install
tags: distweb
name: internetarchive
when: internetarchive_install
tags: internetarchive
- name: Recording STAGE 9 HAS COMPLETED ====================
lineinfile:

View file

@ -1,7 +1,7 @@
distweb_port: 4244
distweb_dir: '{{ iiab_base }}/distweb'
internetarchive_port: 4244
internetarchive_dir: '{{ iiab_base }}/internetarchive'
# for testing purposes, install and enable
distweb_install: True
distweb_enabled: True
#distweb_install: False
#distweb_enabled: False
internetarchive_install: True
internetarchive_enabled: True
#internetarchive_install: False
#internetarchive_enabled: False

View file

@ -1,2 +1,2 @@
dependencies:
- { role: nodejs, tags: ['nodejs'], when: distweb_install }
- { role: nodejs, tags: ['nodejs'], when: internetarchive_install }

View file

@ -3,12 +3,12 @@
- name: FAIL (STOP INSTALLING) IF nodejs_version is not set to 10.x
fail:
msg: "Archorg install cannot proceeed, as it currently requires Node.js 10.x, and your nodejs_version is set to {{ nodejs_version }}. Please check the value of nodejs_version in /opt/iiab/iiab/vars/default_vars.yml and possibly also /etc/iiab/local_vars.yml"
when: distweb_install and (nodejs_version != "10.x")
when: internetarchive_install and (nodejs_version != "10.x")
- name: Clone distributed web mirror supported by Internet Archive
git:
repo: https://github.com/internetarchive/dweb-mirror
dest: "{{ distweb_dir }}"
dest: "{{ internetarchive_dir }}"
force: yes
depth: 1
when: internet_available
@ -20,16 +20,16 @@
- cmake
state: present
- name: Run 'sudo npm install --allow-root --unsafe-perm=true' to create /opt/iiab/distweb/node_modules (CAN TAKE ~5 MINUTES)
- name: Run 'sudo npm install --allow-root --unsafe-perm=true' to create /opt/iiab/internetarchive/node_modules (CAN TAKE ~5 MINUTES)
command: sudo npm install --allow-root --unsafe-perm=true
args:
chdir: "{{ distweb_dir }}"
chdir: "{{ internetarchive_dir }}"
# CONFIG FILES
- name: "Install from templates: distweb.service (systemd), distweb.conf (Apache)"
- name: "Install from templates: internetarchive.service (systemd), internetarchive.conf (Apache)"
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
@ -37,53 +37,53 @@
owner: root
group: root
with_items:
- { src: 'distweb.service.j2', dest: '/etc/systemd/system/distweb.service' }
- { src: 'distweb.conf', dest: '/etc/apache2/sites-available/distweb.conf' }
- { src: 'internetarchive.service.j2', dest: '/etc/systemd/system/internetarchive.service' }
- { src: 'internetarchive.conf', dest: '/etc/apache2/sites-available/internetarchive.conf' }
- name: Create symlink distweb.conf from sites-enabled to sites-available, for short URLs http://box/sugar & http://box/distweb (if distweb_enabled)
- name: Create symlink internetarchive.conf from sites-enabled to sites-available, for short URLs http://box/sugar & http://box/internetarchive (if internetarchive_enabled)
file:
src: /etc/apache2/sites-available/distweb.conf
path: /etc/apache2/sites-enabled/distweb.conf
src: /etc/apache2/sites-available/internetarchive.conf
path: /etc/apache2/sites-enabled/internetarchive.conf
state: link
when: distweb_enabled and is_debuntu
when: internetarchive_enabled and is_debuntu
- name: Remove symlink /etc/apache2/sites-enabled/distweb.conf (if not distweb_enabled)
- name: Remove symlink /etc/apache2/sites-enabled/internetarchive.conf (if not internetarchive_enabled)
file:
path: /etc/apache2/sites-enabled/distweb.conf
path: /etc/apache2/sites-enabled/internetarchive.conf
state: absent
when: not distweb_enabled and is_debuntu
when: not internetarchive_enabled and is_debuntu
# RESTART/STOP SYSTEMD SERVICE
# with "systemctl daemon-reload" in case mongodb.service changed, etc
- name: Enable & Restart 'distweb' systemd service (if distweb_enabled)
- name: Enable & Restart 'internetarchive' systemd service (if internetarchive_enabled)
systemd:
name: distweb
name: internetarchive
daemon_reload: yes
enabled: yes
state: restarted
when: distweb_enabled
when: internetarchive_enabled
- name: Disable & Stop 'distweb' systemd service (if not distweb_enabled)
- name: Disable & Stop 'internetarchive' systemd service (if not internetarchive_enabled)
systemd:
name: distweb
name: internetarchive
daemon_reload: yes
enabled: no
state: stopped
when: not distweb_enabled
when: not internetarchive_enabled
- name: Restart Apache service ({{ apache_service }}) to enable/disable http://box/distweb (not just http://box:{{ distweb_port }})
- name: Restart Apache service ({{ apache_service }}) to enable/disable http://box/internetarchive (not just http://box:{{ internetarchive_port }})
systemd:
name: "{{ apache_service }}" # httpd or apache2
state: restarted
when: distweb_enabled
when: internetarchive_enabled
- name: Add 'distweb' variable values to {{ iiab_ini_file }}
- name: Add 'internetarchive' variable values to {{ iiab_ini_file }}
ini_file:
path: "{{ iiab_ini_file }}"
section: distweb
section: internetarchive
option: "{{ item.option }}"
value: "{{ item.value }}"
with_items:
@ -91,5 +91,5 @@
value: Archive Org Distributed Web
- option: description
value: '"Dweb-mirror is intended to make the Internet Archive experience and UI available offline."'
- option: distweb_enabled
value: "{{ distweb_enabled }}"
- option: internetarchive_enabled
value: "{{ internetarchive_enabled }}"

View file

@ -1,8 +1,8 @@
# distweb_port is set to 4244 in /roles/archoeg/defaults/main.yml
# internetarchive_port is set to 4244 in /roles/archoeg/defaults/main.yml
# If you need to change this, edit /etc/iiab/local_vars.yml prior to installing
RedirectMatch ^/archive.org$ /distweb
RedirectMatch ^/archive$ /distweb
RedirectMatch ^/archive.org$ /internetarchive
RedirectMatch ^/archive$ /internetarchive
ProxyPass /distweb http://localhost:{{ distweb_port }}/distweb
ProxyPassReverse /distweb http://localhost:{{ distweb_port }}/distweb
ProxyPass /internetarchive http://localhost:{{ internetarchive_port }}/internetarchive
ProxyPassReverse /internetarchive http://localhost:{{ internetarchive_port }}/internetarchive

View file

@ -4,13 +4,13 @@ After=network-online.target
[Service]
Type=simple
WorkingDirectory={{ distweb_dir }}
ExecStart=/usr/bin/node {{ distweb_dir }}/internetarchive -s
WorkingDirectory={{ internetarchive_dir }}
ExecStart=/usr/bin/node {{ internetarchive_dir }}/internetarchive -s
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=distweb
SyslogIdentifier=internetarchive
[Install]
WantedBy=multi-user.target

View file

@ -63,7 +63,7 @@ cups_port={{ cups_port }}
transmission_http_port={{ transmission_http_port }}
transmission_peer_port={{ transmission_peer_port }}
sugarizer_port={{ sugarizer_port }}
distweb_port={{ distweb_port }}
internetarchive_port={{ internetarchive_port }}
nodered_port={{ nodered_port }}
mosquitto_port={{ mosquitto_port }}
minetest_port={{ minetest_port }}
@ -106,7 +106,7 @@ if [ "$services_externally_visible" == "True" ]; then
$IPTABLES -A INPUT -p tcp --dport $calibreweb_port -m state --state NEW -i $wan -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport $cups_port -m state --state NEW -i $wan -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport $sugarizer_port -m state --state NEW -i $wan -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport $distweb_port -m state --state NEW -i $wan -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport internetarchive_port -m state --state NEW -i $wan -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport $nodered_port -m state --state NEW -i $wan -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport $mosquitto_port -m state --state NEW -i $wan -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport $transmission_http_port -m state --state NEW -i $wan -j ACCEPT

View file

@ -453,6 +453,9 @@ calibreweb_port: 8083 # PORT VARIABLE HAS NO EFFECT (as of January 2019)
calibreweb_url: /books
calibreweb_home: "{{ content_base }}/calibre-web" # /library/calibre-web
#InternetArchive Dweb service - port needs wider scope
internetarchive_port: 4244
# Minetest is an open source clone of the Minecraft building blocks game
minetest_install: False
minetest_enabled: False
@ -461,9 +464,6 @@ minetest_server_admin: Admin
minetest_default_game: carbone-ng # only carbone-ng and minetest are supported
minetest_flat_world: False
#Distweb service from archive.org - port needs wider scope
distweb_port: 4244
# CONSIDER THESE 2 NEW OPENSTREETMAP (OSM) APPROACHES INSTEAD, AS OF 2018:
# - http://download.iiab.io/content/OSM/vector-tiles/
# - http://oer2go.org/viewmod/en-worldmap-10