Skip to content

Commit

Permalink
custom css, rework server-setup and concept pic
Browse files Browse the repository at this point in the history
  • Loading branch information
muckelba committed Jan 11, 2020
1 parent facf7d3 commit 38cc217
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 111 deletions.
Binary file removed _static/concept.jpg
Binary file not shown.
Binary file added _static/concept.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions _static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
h1, h2, h3, h4, h5, h6 {
color: black;
font-weight: normal;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

img {
vertical-align: middle;
max-width: 100%;
}
8 changes: 7 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import guzzle_sphinx_theme

project = u'MAD'
copyright = u'2019, MADdev Team'
copyright = u'2020, MADdev Team'
version = u''
templates_path = ['_templates']
master_doc = 'index'
Expand Down Expand Up @@ -32,3 +32,9 @@
html_sidebars = {
'**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']
}

html_logo = "_static/mad_banner_trans.png"
logo_only = True

def setup(app):
app.add_stylesheet("css/custom.css")
2 changes: 1 addition & 1 deletion extras/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This script will take care of the database schema installation automatically so

## Migrate to Rocketmap (migrate_to_rocketmap.sh)

This script will migrate your data from a RDM or Monocle database to a Rocketmap database. Before you run this you should run [OSM-rocketmap](https://github.com/cecpk/OSM-Rocketmap) or `databasesetup.py` and let it configure its database. After it has built its empty database you can run this script. If you were using Monocle with MAD spawnpoints do not change, so I dump that table from your monocle db and import it to your rocketmap db for you. If you have old spawnpoint info from before MAD then you want to use import_allspawns.sh as well. This script does not import things like controlling team/mons, or ex status, because MAD will fill this in after 1 scan.
This script will migrate your data from a RDM or Monocle database to a Rocketmap database. Before you run this you should run [OSM-Rocketmad](https://github.com/cecpk/OSM-Rocketmad) or `databasesetup.py` and let it configure its database. After it has built its empty database you can run this script. If you were using Monocle with MAD spawnpoints do not change, so I dump that table from your monocle db and import it to your rocketmap db for you. If you have old spawnpoint info from before MAD then you want to use import_allspawns.sh as well. This script does not import things like controlling team/mons, or ex status, because MAD will fill this in after 1 scan.

If you were already scanning in MAD using your Monocle database, be sure to remove version.json so MAD will update your new rocketmap schema.

Expand Down
3 changes: 2 additions & 1 deletion index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PogoDroid (PD)
^^^^^^^^^^^^^^
This app injects into the running game process and relays the data being sent to the game to the MAD server. A valid token is required to use it, you can purchase it on `the MAD website <https://www.maddev.eu>`_.

.. image:: _static/concept.jpg
.. image:: _static/concept.png

Guide
=====
Expand All @@ -39,5 +39,6 @@ Guide
device-setup
mad-jobs
integrations
extras/*
faq
api/*
4 changes: 2 additions & 2 deletions integrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Integrations
Maps
====

OSM-RocketMap
OSM-Rocketmad
-------------

A powerful frontend maintained by MAD's core developers and the MAD community. Written in Python.

`OSM-RocketMap on Github <https://github.com/cecpk/OSM-Rocketmap>`_
`OSM-Rocketmad on Github <https://github.com/cecpk/OSM-Rocketmad>`_

PMSF
----
Expand Down
2 changes: 1 addition & 1 deletion mad-jobs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Example:

MAD starts the top most job and will schedule the memory usage readout with a delay of 3 minutes. Eventually, the game will start.

.. code-block:: none
.. code-block:: json
{
"Stop/Start Pogo and readout Memory Usage":
Expand Down
4 changes: 2 additions & 2 deletions requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Requirements

MAD requires the following things to be installed available on your server:

- a server/computer running Linux. RaspberryPis do work, but aren't recommended
- A server/computer running Linux. RaspberryPis do work, but aren't recommended
- MariaDB server (MySQL has some issues and is not recommended)
- Python 3.6 (or higher) + Python's package manager command line tool :code:`pip`
- a rooted Android device being able to run the game. See `this list <https://github.com/Map-A-Droid/MAD-device-list>`_ of tested devices
- A rooted Android device being able to run the game. See `this list <https://github.com/Map-A-Droid/MAD-device-list>`_ of tested devices
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
recommonmark
sphinx-markdown-tables
git+https://github.com/guzzle/guzzle_sphinx_theme.git@eefd45b79383b1b4aab1607444e41366fd1348a6
guzzle_sphinx_theme
142 changes: 40 additions & 102 deletions server-setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,6 @@ System preparation

This whole article assumes a fresh installed `Ubuntu 18.04 Server <https://www.ubuntu.com/download/server>`_. If you're running another Linux distribution - that's totally fine, but keep in mind there may be some difference to your setup.

If you're already running a Ubuntu 18.04 setup, you can skip this part.

Edit the file /etc/update-manager/release-upgrades:

.. code-block:: bash
sudo nano /etc/update-manager/release-upgrades
On the line that says :code:`Prompt=..` change it to :code:`Prompt=normal`. Save with :kbd:`ctrl` + :kbd:`o` and exit with :kbd:`ctrl` + :kbd:`x`

Now, make sure LXD is removed:

.. code-block:: bash
sudo dpkg --force depends -P lxd; sudo dpkg --force depends -P lxd-client
Next, we need to make everything nice and updated

.. code-block:: bash
sudo apt update
sudo apt upgrade
Now look for and update Ubuntu.

.. code-block:: bash
sudo do-release-upgrade
Simply follow the prompts and agree to anything it asks (pretty much anyhow) until it asks to reboot. Decline to restart, then exit WSL by typing `exit`. Do not close your terminal window.

Back in the terminal window, type bash once more.

Now, let's install openCV

.. code-block:: bash
sudo apt-get install python3-opencv

MySQL / MariaDB
===============
Expand All @@ -73,28 +35,24 @@ Create a new database and grant permissions for your dedicated MAD database user
.. TODO fix internan links
MAD is using the RocketMap database schema, you can either install it using `OSM-Rocketmap <https://github.com/cecpk/OSM-Rocketmap>`_ or, if you just want the database and not the complete frontend of RM, use the [databasesetup.py](../extras/scripts#databasesetup-databasesetup-py) script.
MAD is using the RocketMap database schema, you can either install it using `OSM-Rocketmad <https://github.com/cecpk/RocketMAD/>`_ or, if you just want the database and not the complete frontend of RM, use the `databasesetup.py <extras/scripts/#databasesetup-databasesetup-py>`_ script.

If you want to use OSM-Rocketmap, set it up and launch it for the first time. It will create the the tables automatically. Follow the guide from the `official Rocketmap documentation <https://osm-rocketmap.readthedocs.io/>`_, but make sure to clone the `OSM-Rocketmap <https://github.com/cecpk/OSM-Rocketmap>`_ fork instead of the normal one.
If you want to use OSM-Rocketmad, set it up and launch it for the first time. It will create the the tables automatically. Follow the guide from the `documentation <https://OSM-Rocketmap.readthedocs.io/>`_.

.. code-block:: bash
python3 runserver.py
.. TODO update this reference
Rocketmap will only act as a webfrontend. See [webfrontends](/extras/webfrontends) for more informations.
RocketMAD will only act as a webfrontend. See `webfrontends <integrations#maps>`_ for more informations.

Install client libraries
------------------------
.. code-block:: bash
sudo apt install default-libmysqlclient-dev
After all this is over, follow the Linux part about installing, scroll down to header MAD/PIP-Packages. Some parts might be repeated, don't worry about it.

Running MAD is now exactly the same as running it on Linux, except that your mariadb is running on Windows, and you're going a bit slower than if you would have just listened and installed on Linux directly in the first place.

Python
======

Expand All @@ -108,7 +66,7 @@ Make sure you have the right version installed, since even if python3.6 is insta
Check if `pip` and `python` is installed correctly by running:

- :code:`python3 --version` - should return 3.6.x
- :code:`pip3 --version` - If it returns a version, it is working.
- :code:`pip3 --version` - If it returns a version that is related to your python version, it is working.

MAD
===
Expand All @@ -131,8 +89,6 @@ MAD will also check the screen on your phone every now and then to check for err
sudo apt-get install tesseract-ocr python3-opencv
If you are encountering the error :code:`OSError: mysql_config not found`, make sure you have the apt package :code:`default-libmysqlclient-dev` installed.

Configuration
=============

Expand All @@ -144,13 +100,35 @@ Copy the example config file and rename it to "config.ini":
and edit the config file accordingly.

The next step is to configure the so-called "mappings.json" (located in configs/mappings.json). This file is responsible to "map" your phones to walkers etc. The easiest way to configure MAD is through MADmin - the web frontend:
The next step is to configure MAD via MADmin - the web frontend:

.. code-block:: bash
python3 configmode.py
By default MADmin will be available on http://your_server_ip:5000. Go to "Settings" and start with adding an area. The type is depending on what do you want to scan. Every type and option of it has a description explaining itself.
By default MADmin will be available on http://your_server_ip:5000.

Geofences
---------

First you want to add a geofence. You can do that by either drawing a fence on the map (use the icon on the top right corner) or pasting a list of coordinates (Settings --> Geofences).

Areas
-----

Next step is to create an area. Go to Settings --> Areas and click on the green plus. Choose a mode you want to scan (Have a look at the different `scanning modes <faq#what-s-the-difference-betwen-these-scanning-modes>`_) and fill in the settings.

Walkers
-------

Walkers are responsible for the assignment of the areas to the devices. If you just want a device on one area the whole time, create a walker and add that area with :code:`coords` set as walker mode.

Devices
-------

Add your device and assign it to the walker.

Every other setting like :code:`Auth`, :code:`IV Lists` and :code:`Shared Settings` are optional.

Running
=======
Expand All @@ -165,14 +143,15 @@ Deploying behind a Reverse Proxy
================================

MAD supports being run behind a Reverse Proxy. The reverse proxy relies on the header, `X-Script-Name`, to inform MADmin on how to construct the URIs. For our examples we will use the following:
* Using NGINX as our reverse proxy
* MADmin runs on localhost
* MADmin uses port 5000
* We wish to access the site at '/madmin'
* The FQDN we are using to access MADmin is 'mapadroid.local'
* We only want files 100MB or less to be uploaded
* SSL Ceritificate is located at /etc/ssl_cert.crt
* SSL Certificate Key is located at /etc/ssl_key.pem

- Using NGINX as our reverse proxy
- MADmin runs on localhost
- MADmin uses port 5000
- We wish to access the site at '/madmin'
- The FQDN we are using to access MADmin is 'mapadroid.local'
- We only want files 100MB or less to be uploaded
- SSL Ceritificate is located at /etc/ssl_cert.crt
- SSL Certificate Key is located at /etc/ssl_key.pem

Configuring HTTP
----------------
Expand Down Expand Up @@ -238,7 +217,7 @@ Preparations

You can just copy & paste this to do what is written below:

.. code-block:: none
.. code-block:: bash
mkdir MAD-docker && \
cd MAD-docker && \
Expand All @@ -248,7 +227,6 @@ You can just copy & paste this to do what is written below:
mkdir docker-entrypoint-initdb && \
wget -O docker-entrypoint-initdb/rocketmap.sql https://raw.githubusercontent.com/Map-A-Droid/MAD/master/scripts/SQL/rocketmap.sql && \
cd mad/configs/ && \
touch mappings.json && \
wget -O config.ini https://raw.githubusercontent.com/Map-A-Droid/MAD/master/configs/config.ini.example && \
mkdir geofences && cd ../../
Expand All @@ -257,7 +235,7 @@ This will:
#. Create a directory `MAD-docker`.
#. Create a file `docker-compose.yml`.
#. Create a directory `MAD-docker/mad`. (here we store MAD related stuff)
#. Create a directory `MAD-docker/mad/configs`. (here we store config files for MAD). Here you store your `config.ini`, `mappings.json` and a directory `geofences` (which contains your geofences). Examples for these files can be found @github https://github.com/Map-A-Droid/MAD/tree/master/configs
#. Create a directory `MAD-docker/mad/configs`. (here we store config files for MAD). Here you store your `config.ini` and a directory `geofences`. Examples for these files can be found @github https://github.com/Map-A-Droid/MAD/tree/master/configs
#. Create a directory `MAD-docker/docker-entrypoint-initdb`
#. Download the Rocketmap Database Schema: https://raw.githubusercontent.com/Map-A-Droid/MAD/master/SQL/rocketmap.sql and store it in the directory `docker-entrypoint-initdb`.

Expand All @@ -272,47 +250,8 @@ Your directory should now look like this:
mad/
configs/
config.ini
mappings.json
geofences/
If you start from scratch, add the following content to `mad/configs/mappings.json`:

.. code-block:: json
{
"areas": {
"entries": {},
"index": 0
},
"auth": {
"entries": {},
"index": 0
},
"devices": {
"entries": {},
"index": 0
},
"devicesettings": {
"entries": {},
"index": 0
},
"migrated": true,
"monivlist": {
"entries": {},
"index": 0
},
"walker": {
"entries": {},
"index": 0
},
"walkerarea": {
"entries": {},
"index": 0
}
}
If you have an existing mappings.json, because you used MAD before, then just copy it over.

Writing the docker-compose file
-------------------------------

Expand All @@ -333,7 +272,6 @@ Fill docker-compose.yml with the following content. Below we explain the details
- /etc/localtime:/etc/localtime:ro
- ./mad/configs/geofences:/usr/src/app/configs/geofences
- ./mad/configs/config.ini:/usr/src/app/configs/config.ini
- ./mad/configs/mappings.json:/usr/src/app/configs/mappings.json
- ./volumes/mad/files:/usr/src/app/files
- ./volumes/mad/logs:/usr/src/app/logs
depends_on:
Expand Down Expand Up @@ -374,7 +312,7 @@ In the docker image, the whole MAD repository is located in "/usr/src/app".
**Volumes:**

* The volumes define what is mounted into the docker-container.
* On one hand we mount the **configuration files (config.ini, mappings.json)** and the **geofences** we need.
* On one hand we mount the **configuration file (config.ini)** and the **geofences** we need.
* On the other hand we "mount out" the **files/directories produced by MAD**, such as the directory "logs" and also the "files" directory, which contains all calculated routes, position files and stats. As usual, volumes are needed for everything **you do not want to loose** after you take the docker-container down. Without these volumes, MAD would have to recalculate the routes everytime you take your container up.

**Ports:**
Expand Down

0 comments on commit 38cc217

Please sign in to comment.