README.md 2.73 KB
Newer Older
1
# EduGAIN Connectivity Check Service 2
Marco Malavolti's avatar
Marco Malavolti committed
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Requirements Hardware

* OS: Debian 9,10 (tested)
* HDD: 10 GB
* RAM: 4 GB
* CPU: >= 2 vCPU

# Requirements Software

* Apache Server + WSGI
* Python 3.8
* Selenim + Chromium Web Brower

# HOWTO Install and Configure

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Install Python 3.8.x

1. Update the system packages:
   * `sudo apt update ; sudo apt upgrade -y`

2. Install needed packages to build python:
   * `sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev`

3. Download the last version of Python 3.8.x from https://www.python.org/downloads/source/:
   * `sudo wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz -O /usr/local/src/Python-3.8.3.tar.gz`

4. Extract Python source package:
   * `sudo cd /usr/local/src/`
   * `sudo tar xzf Python-3.8.3.tar.gz`

5. Build Python from the source package:
   * `sudo cd /usr/local/src/Python-3.8.3`
   * `sudo ./configure --enable-optimizations`
   * `sudo make -j 4`

6. Install Python 3.8.x (without replacing the system `python3` command) under `/usr/local/bin/python3.8`:
   * `sudo make altinstall`
   * `python3.8 --version`

7. Create link of Python3.8 for scripts:
   * `sudo ln -s /usr/local/bin/python3.8 /usr/bin/python3.8`


46
* `sudo apt install chromium chromium-l10n git jq`
Marco Malavolti's avatar
Marco Malavolti committed
47
48
* `python3 -m pip install --user --upgrade pip virtualenv`
* `python3 -m venv eccs2venv`
49
* `source eccs2venv/bin/activate`   (`deactivate` to exit Virtualenv)
Marco Malavolti's avatar
Marco Malavolti committed
50
51
  * `python3 -m pip install --upgrade wheel setuptools certifi selenium urllib3 flask flask-jsonpify flask-restful`
  * `cd ~ ; git clone https://github.com/malavolti/eccs2.git`
52
53
54
  * `cd eccs2`
  * `cp eccs2properties.py.template eccs2properties.py` (and change it with your needs)
  * `./runEccs2.py`
Marco Malavolti's avatar
Marco Malavolti committed
55

56
57
58
59
60
61
# API Development Server

* `sudo apt install libapache2-mod-wsgi-py3 python3-dev`
* `sudo a2enmod wsgi`
* `cd ~/eccs2 ; ./api.py`

62
63
64
# API

* `/eccs/test` (Trivial Test)
Marco Malavolti's avatar
Marco Malavolti committed
65
* `/eccs/checks` (Return the results of the last checks)
66
67
68
69
70
71
72
73
74
* `/eccs/checks?<parameter>=<value>`:
  * `date=2020-02-20` (select date)
  * `idp=Any%20words%20do%20you%20like%20url%20encoded`
  * `status=`
    * 'OK'
    * 'TIMEOUT'
    * 'No-eduGAIN-Metadata'
    * 'Form-Invalid'
    * 'Excluded'
Marco Malavolti's avatar
Marco Malavolti committed
75
* /eccs/eccsresults (Return the results of the last check ready for ECCS Gui)
76

77
# APACHE CONFIGURATION
78

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
* `sudo vim /etc/apache2/sites-availabled/eccs2.conf

  ```apache
  <IfModule mod_alias.c>
     Alias /eccs2 /opt/eccs2/web
     Alias /eccs2html /opt/eccs2/html

     <Directory /opt/eccs2/web>
        DirectoryIndex index.php
        Require all granted
     </Directory>

     <Directory /opt/eccs2/html>
        Require all granted
     </Directory>
  </IfModule>
  ```

* `sudo a2ensite eccs2.conf`
* `sudo systemctl reload apache2.service`