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

Merge pull request #216 from iiab/master

sync from iiab/iiab
This commit is contained in:
A Holt 2019-02-10 22:42:55 -05:00 committed by GitHub
commit 275853b8b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 120 additions and 33 deletions

View file

@ -2,9 +2,10 @@
Minetest README
===============
Minetest is an open source clone of `Minecraft <https://en.wikipedia.org/wiki/Minecraft>`_, the creative/explorational building blocks game.
`Minetest <https://www.minetest.net/>`_ is a `Minecraft <https://en.wikipedia.org/wiki/Minecraft>`_-inspired creative/explorational building blocks game, written from scratch and licensed
under the LGPL (version 2.1 or later). It supports both survival and creative modes along with multiplayer support, dynamic lighting, and an "infinite" map generator.
For the first release, the Minetest server can only be installed on a Raspberry Pi.
The Minetest multiplayer server can be installed as part of Internet-in-a-Box (IIAB) on Raspberry Pi (Raspbian), Ubuntu 18.04 and Debian 9 Stretch.
Please note that the initial configuration is for creative mode, and a number of mods are installed (see the list in `tasks/main.yml <tasks/main.yml>`_).
@ -19,8 +20,38 @@ The admin user is the usual: ``Admin``
No password is required.
Configurable Parameters
-----------------------
- ``minetest_install:`` set Minetest up to install; default is False
- ``minetest_enabled:`` set Minetest up to be enabled; default is False
- ``minetest_port:`` port on which client should connect; default is 30000
- ``minetest_server_admin:`` user with all permissions on minetest server; default is Admin
- ``minetest_default_game:`` only carbone-ng and minetest are supported; default is `carbone-ng <https://github.com/Calinou/carbone-ng>`_
- ``minetest_flat_world:`` use a flat mapgen engine to lower computation on client; default is False
File Locations
--------------
- The config file is ``/etc/minetest/minetest.conf``
- The world files are at ``/library/games/minetest/worlds/world``
File Locations on Raspberry Pi
------------------------------
- The config file is: ``/etc/minetest/minetest.conf``
- The rest of the files are a normal layout based in: ``/library/games/minetest``
- The server binary is ``/library/games/minetest/bin/minetestserver``
- The working directory is ``/library/games/minetest``
- mods are in ``/library/games/minetest/games/<game>/mods``
File Locations on Other Platforms
---------------------------------
- The server binary is ``/usr/lib/minetest/minetestserver``
- The working directory is ``/usr/share/games/minetest``
- mods are in ``/usr/share/games/minetest/games/<game>/mods``
To Do
-----
- Add more mods — currently only the default mods are there in carbone-ng
- Add more games
- Minetest client software for Windows and Android, included onboard IIAB for offline communities (`#1465 <https://github.com/iiab/iiab/issues/1465>`_)

View file

@ -2,7 +2,13 @@
# minetest_enabled: False
# minetest_port: 30000
# minetest_server_admin: Admin
# minetest_default_game: carbone-ng # only carbone-ng and minetest are supported
# minetest_flat_world: False
# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!
minetest_default_runas_user: Debian-minetest
minetest_default_runas_group: games
# These should not be touched unless minetest packages change
minetest_config_file: /etc/minetest/minetest.conf
minetest_world_dir: /library/games/minetest/worlds/world

View file

@ -3,11 +3,21 @@
- name: Set some facts for RPi
set_fact:
minetest_server_bin: /library/games/minetest/bin/minetestserver
minetest_world_dir: /library/games/minetest/worlds/world
minetest_game_dir: /library/games/minetest/games/minetest_game
minetest_working_dir: /library/games/minetest
# only works if server run as root
minetest_runas_user: root
minetest_runas_group: root
when: is_rpi
# For other installs TBD
# For other installs
- name: Set some facts for other platforms
set_fact:
minetest_server_bin: /usr/lib/minetest/minetestserver
minetest_working_dir: /usr/share/games/minetest
minetest_runas_user: Debian-minetest
minetest_runas_group: games
when: not is_rpi
- name: Set some facts for all
set_fact:
minetest_game_dir: "{{ minetest_working_dir }}/games/{{ minetest_default_game }}"

View file

@ -1,3 +1,6 @@
# Calculate local variables
- include_tasks: calc_vars.yml
- name: Check for minetest world file ({{ minetest_world_dir }}/world.mt)
stat:
path: "{{ minetest_world_dir }}/world.mt"
@ -12,15 +15,36 @@
mode: 0755
with_items:
- /library/games
when: minetest_install
# rpi only
- include_tasks: rpi_minetest_install.yml
when: minetest_install and not minetest_world.stat.exists and is_rpi
when: not minetest_world.stat.exists and is_rpi
# not rpi
- include_tasks: minetest_install.yml
when: minetest_install and not minetest_world.stat.exists and not is_rpi
when: not minetest_world.stat.exists and not is_rpi
- git:
repo: https://github.com/Calinou/carbone-ng.git
dest: "{{ minetest_game_dir }}"
depth: 1
when: not minetest_world.stat.exists and minetest_default_game == "carbone-ng"
- name: Give minetest user ownership of carbone-ng
file:
state: directory
path: "{{ minetest_game_dir }}"
recurse: yes
owner: "{{ minetest_runas_user }}"
group: "{{ minetest_runas_group }}"
mode: 0755
when: minetest_default_game == "carbone-ng"
# Install games
#- include: minetest_install_games.yml
# with_items:
# - name: carbone-ng
# url: https://github.com/Calinou/carbone-ng
# Install mods
- include: minetest_install_mods.yml
@ -39,7 +63,13 @@
url: https://github.com/minetest-mods/pipeworks/archive/master.zip
- name: Minetest-WorldEdit
url: https://github.com/Uberi/Minetest-WorldEdit/archive/master.zip
when: minetest_install
when: minetest_default_game == "minetest"
- name: Remove mod from carbone-ng that prevents our Admin name
file:
state: absent
path: "{{ minetest_game_dir }}/mods/name_restrictions"
when: minetest_default_game == "carbone-ng"
# enable or disable
- name: Enable & Restart 'minetest-server' service
@ -48,7 +78,7 @@
name: minetest-server
enabled: yes
state: restarted
when: minetest_install and minetest_enabled
when: minetest_enabled
- name: Disable 'minetest-server' service
systemd:
@ -56,7 +86,7 @@
name: minetest-server
enabled: no
state: stopped
when: minetest_install and not minetest_enabled
when: not minetest_enabled
- name: Add 'minetest' variable values to {{ iiab_ini_file }}
ini_file:

View file

@ -1,5 +1,4 @@
# For non-rpi installs
# Still a work in progress
- name: Install Minetest package
package:
@ -16,13 +15,23 @@
- { regexp: '^name = ', line: 'name = Admin' }
- { regexp: '^creative_mode = ', line: 'creative_mode = true' }
- { regexp: '^port = ', line: 'port = {{ minetest_port }}' }
- { regexp: '^default_game = ', line: 'default_game = {{ minetest_default_game }}' }
- name: Set mapgen engine to flat if enabled
lineinfile:
path: /etc/minetest/minetest.conf
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^mg_name = ', line: 'mg_name = flat' }
when: minetest_flat_world
- name: Create /library/games/minetest/worlds/world
file:
state: directory
path: "{{ item }}"
owner: "{{ minetest_default_runas_user }}"
group: "{{ minetest_default_runas_group }}"
owner: "{{ minetest_runas_user }}"
group: "{{ minetest_runas_group }}"
mode: 0755
with_items:
- "{{ minetest_world_dir }}"

View file

@ -11,6 +11,7 @@
dest: "{{ downloads_dir }}/{{ minetest_rpi_src }}"
timeout: "{{ download_timeout }}"
# we need to create these for rpi, but package creates them for other OSes
- name: Create dirs /etc/minetest and /library/games
file:
state: directory

View file

@ -9,7 +9,7 @@ server_name = Internet in a Box Minetest Server
server_announce = false
# Default game (default when creating a new world)
default_game = minetest
default_game = {{ minetest_default_game }}
# Maximum number of players connected simultaneously
max_users = 15
@ -30,3 +30,7 @@ default_privs = interact, shout, teleport, settime, privs
# For mods
spawn_friendly_mobs = true
spawn_hostile_mobs = false
{% if minetest_flat_world %}
mg_name = flat
{% endif %}

View file

@ -79,7 +79,7 @@
- name: Restart Apache service ({{ apache_service }}) to enable/disable http://box/nodered (not just http://box:{{ nodered_port }})
systemd:
daemon_reload: yes
#daemon_reload: yes
name: "{{ apache_service }}" # httpd or apache2
state: restarted
when: nodered_install

View file

@ -25,7 +25,7 @@ Optionally, you may want to enable `chan_dongle <https://github.com/wdoekes/aste
asterisk_chan_dongle: True
After installing PBX as part of IIAB, please visit http://pbx.lan/freepbx and proceed with initial configuration (no login/password is required initially — you will be asked to set this up).
After installing PBX as part of IIAB, please visit http://pbx.lan/freepbx and proceed with initial configuration (no login/password is required initially — you will be asked to set this up). **CAUTION: as of 2019-02-10 it is sometimes necessary to put "[ACTUAL IP ADDRESS] pbx.lan" into the 'hosts' file on the client machine (where the browser is being used) to get http://pbx.lan/freepbx name resolution to work.**
You can monitor the PBX service with command::

View file

@ -2,7 +2,7 @@
usb-lib README
==============
PLEASE SEE "Can teachers display their own content?" WITHIN http://FAQ.IIAB.IO FOR UP-TO-DATE DOCUMENTATION.
**PLEASE SEE "Can teachers display their own content?" WITHIN http://FAQ.IIAB.IO FOR UP-TO-DATE DOCUMENTATION.**
This role implements functionality similar to LibraryBox, to mount "teacher content" from USB drives.

View file

@ -71,7 +71,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \
> /etc/apt/sources.list.d/iiab-ansible.list
echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367"\n'
echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367"\n'
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
echo -e "\napt update; apt install ansible\n"

View file

@ -71,7 +71,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian
echo "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" \
> /etc/apt/sources.list.d/iiab-ansible.list
echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367"\n'
echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367"\n'
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
echo -e "\napt update; apt install ansible\n"

View file

@ -71,7 +71,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian
echo "deb http://ppa.launchpad.net/ansible/ansible-2.7/ubuntu xenial main" \
> /etc/apt/sources.list.d/iiab-ansible.list
echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367"\n'
echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367"\n'
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
echo -e "\napt update; apt install ansible\n"

View file

@ -447,12 +447,8 @@ minetest_install: False
minetest_enabled: False
minetest_port: 30000
minetest_server_admin: Admin
# Should only rarely change these
minetest_server_bin: /usr/games/minetest --server
minetest_world_dir: /library/games/minetest/worlds/world
minetest_working_dir: /usr/share/games/minetest
minetest_game_dir: /usr/share/games/minetest/games/minetest_game
minetest_config_file: /etc/minetest/minetest.conf
minetest_default_game: carbone-ng # only carbone-ng and minetest are supported
minetest_flat_world: False
# CONSIDER THESE 2 NEW OPENSTREETMAP (OSM) APPROACHES INSTEAD, AS OF 2018:

View file

@ -296,8 +296,8 @@ calibreweb_url: /books
calibreweb_home: "{{ content_base }}/calibre-web" # /library/calibre-web
# Minetest is an open source clone of the Minecraft building blocks game
minetest_install: False
minetest_enabled: False
minetest_install: True
minetest_enabled: True
# CONSIDER THESE 2 NEW OPENSTREETMAP (OSM) APPROACHES INSTEAD, AS OF 2018: