Revision 054dc0a6

b/README.md
35 35

  
36 36

  
37 37
You can find the installation instructions for Debian Wheezy (64)
38
with Django 1.4.x at [Flowspy documentation](http://flowspy.readthedocs.org). 
39
If upgrading from a previous version bear in mind the changes introduced in Django 1.4. 
38
with Django 1.4.x at [Flowspy documentation](http://flowspy.readthedocs.org).
39
If upgrading from a previous version bear in mind the changes introduced in Django 1.4.
40 40

  
41 41
##Contact##
42 42

  
43 43
You can find more about FoD or raise your issues at GRNET FoD
44
repository: [GRNET repo](https://code.grnet.gr/fod) or [Github repo](https://github.com/leopoul/flowspy).
44
repository: [GRNET repo](https://code.grnet.gr/fod) or [Github repo](https://github.com/grnet/flowspy).
45 45

  
46
You can contact us directly at leopoul{at}noc[dot]grnet(.)gr
46
You can contact us directly at staurosk{at}noc[dot]grnet(.)gr
/dev/null
1
# Sphinx build info version 1
2
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3
config: 2ba9e6f9e1c0e16069f01cae0578101a
4
tags: fbb0d17656682115ca4d033fb2f83ba1
/dev/null
1
.. fod documentation master file, created by
2
   sphinx-quickstart on Wed Oct 16 17:20:20 2013.
3
   You can adapt this file completely to your liking, but it should at least
4
   contain the root `toctree` directive.
5

  
6
******************
7
Firewall on Demand
8
******************
9

  
10
Description
11
===========
12
Firewall on Demand applies, via Netconf, flow rules to a network device. These rules are then propagated via e-bgp to peering routers. Each user is authenticated against shibboleth. Authorization is performed via a combination of a Shibboleth attribute and the peer network address range that the user originates from.
13
FoD is meant to operate over this architecture::
14

  
15
          +-----------+          +------------+        +------------+
16
          |   FoD     | NETCONF  | flowspec   | ebgp   |   router   |
17
          | web app   +----------> device     +-------->            |
18
          +-----------+          +------+-----+        +------------+
19
                                        | ebgp
20
                                        |
21
                                 +------v-----+
22
                                 |   router   |
23
                                 |            |
24
                                 +------------+
25

  
26
NETCONF is chosen as the mgmt protocol to apply rules to a single flowspec capable device. Rules are then propagated via igbp to all flowspec capable routers. Of course FoD could apply rules directly (via NETCONF always) to a router and then ibgp would do the rest.
27
In GRNET's case the flowspec capable device is an EX4200.
28

  
29
.. attention::
30
	Make sure your FoD server has ssh access to your flowspec device.
31

  
32
.. attention::
33
   Installation instructions assume a clean Debian Wheezy with Django 1.4
34
   
35
Contact
36
=======
37
You can find more about FoD or raise your issues at `GRNET FoD repository <https://code.grnet.gr/projects/flowspy>`_.
38

  
39
You can contact us directly at leopoul{at}noc[dot]grnet(.)gr
40

  
41
Install
42
=======
43

  
44
.. toctree::
45
   :maxdepth: 2
46

  
47
   install
48

  
49

  
/dev/null
1
************
2
Installation
3
************
4

  
5
.. toctree::
6
    :maxdepth: 2
7

  
8
Debian Wheezy (x64) - Django 1.4.x
9
==================================
10
This guide assumes that installation is carried out in /srv/flowspy directory. If other directory is to be used, please change the corresponding configuration files. It is also assumed that the root user will perform every action.
11

  
12

  
13
Upgrading from v<1.1.x
14
----------------------
15

  
16
.. note::
17
    If PEER\_\*\_TABLE tables are set to FALSE in settings.py, you need to perform the south migrations per application:: 
18
    
19
        ./manage.py migrate longerusername
20
        ./manage.py migrate flowspec
21
        ./manage.py migrate accounts
22
        
23
        
24

  
25
If upgrading from flowspy version <1.1.x pay attention to settings.py changes. Also, do not forget to run if PEER\_\*\_TABLE tables are set to TRUE in settings.py::
26
    
27
    ./manage.py migrate 
28
    
29
to catch-up with latest database changes. 
30

  
31
Upgrading from v<1.0.x
32
----------------------
33
If upgrading from flowspy version <1.0.x pay attention to settings.py changes. Also, do not forget to run::
34
    
35
    ./manage.py migrate
36
    
37
to catch-up with latest database changes.
38

  
39
Required system packages
40
------------------------
41
Update and install the required packages::
42

  
43
    apt-get update
44
    apt-get upgrade
45
    apt-get install mysql-server apache2 memcached libapache2-mod-proxy-html gunicorn beanstalkd python-django python-django-south python-django-tinymce tinymce python-mysqldb python-yaml python-memcache python-django-registration python-ipaddr python-lxml mysql-client git python-django-celery python-paramiko python-gevent vim
46

  
47
.. note::
48
    Set username and password for mysql if used
49

  
50
.. note::
51
    If you wish to deploy an outgoing mail server, now it is time to do it. Otherwise you could set FoD to send out mails via a third party account
52

  
53
Create a database
54
-----------------
55
If you are using mysql, you should create a database::
56

  
57
    mysql -u root -p -e 'create database fod'
58

  
59
Required application packages
60
-----------------------------
61
Get the required packages and their dependencies and install them::
62

  
63
    apt-get install libxml2-dev libxslt-dev gcc python-dev
64

  
65
- ncclient: NETCONF python client::
66

  
67
    cd ~
68
    git clone https://github.com/leopoul/ncclient.git
69
    cd ncclient
70
    python setup.py install
71

  
72
- nxpy: Python Objects from/to XML proxy::
73

  
74
    cd ~
75
    git clone https://code.grnet.gr/git/nxpy
76
    cd nxpy
77
    python setup.py install
78

  
79
- flowspy: core application. Installation is done at /srv/flowspy::
80

  
81
    cd /srv
82
    git clone https://code.grnet.gr/git/flowspy
83
    cd flowspy
84

  
85
Application configuration
86
=========================
87
Copy settings.py.dist to settings.py::
88
    
89
    cd flowspy
90
    cp settings.py.dist settings.py
91

  
92
Edit settings.py file and set the following according to your configuration::
93

  
94
    ADMINS: set your admin name and email (assuming that your server can send notifications)
95
    DATABASES (to point to your local database). You could use views instead of tables for models: peer, peercontacts, peernetworks. For this to work we suggest MySQL with MyISAM db engine
96
    SECRET_KEY : Make this unique, and don't share it with anybody
97
    STATIC_ROOT: /srv/flowspy/static (or your installation directory)
98
    STATIC_URL (static media directory) . If you have followed the above this should be: /srv/flowspy/static
99
    TEMPLATE_DIRS : If you have followed the above this should be: /srv/flowspy/templates
100
    CACHE_BACKEND:  Enable Memcached for production or leave to DummyCache for development environments
101
    Alternatively you could go for redis with the corresponding Django client lib.
102
    NETCONF_DEVICE (tested with Juniper EX4200 but any BGP enabled Juniper should work). This is the flowspec capable device
103
    NETCONF_USER (enable ssh and netconf on device)
104
    NETCONF_PASS
105
    If beanstalk is selected the following should be left intact.
106
    BROKER_HOST (beanstalk host)
107
    BROKER_PORT (beanstalk port)
108
    SERVER_EMAIL
109
    EMAIL_SUBJECT_PREFIX
110
    If beanstalk is selected the following should be left intact.
111
    BROKER_URL (beanstalk url)
112
    SHIB_AUTH_ENTITLEMENT (if you go for Shibboleth authentication)
113
    NOTIFY_ADMIN_MAILS (bcc mail addresses)
114
    PROTECTED_SUBNETS (subnets for which source or destination address will prevent rule creation and notify the NOTIFY_ADMIN_MAILS)
115
    The whois client is meant to be used in case you have inserted peers with their ASes in the peers table and wish to get network info for each one in an automated manner.
116
    PRIMARY_WHOIS
117
    ALTERNATE_WHOIS
118
    If you wish to deploy FoD with Shibboleth change the following attributes according to your setup:
119
    SHIB_AUTH_ENTITLEMENT = 'urn:mace'
120
    SHIB_ADMIN_DOMAIN = 'example.com'
121
    SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'
122
    SHIB_USERNAME = ['HTTP_EPPN']
123
    SHIB_MAIL = ['mail', 'HTTP_MAIL', 'HTTP_SHIB_INETORGPERSON_MAIL']
124
    SHIB_FIRSTNAME = ['HTTP_SHIB_INETORGPERSON_GIVENNAME']
125
    SHIB_LASTNAME = ['HTTP_SHIB_PERSON_SURNAME']
126
    SHIB_ENTITLEMENT = ['HTTP_SHIB_EP_ENTITLEMENT']
127

  
128
If you have not installed an outgoing mail server you can always use your own account (either corporate or gmail, hotmail ,etc) by adding the following lines in settings.py::
129

  
130
    EMAIL_USE_TLS = True #(or False)
131
    EMAIL_HOST = 'smtp.example.com'
132
    EMAIL_HOST_USER = 'username'
133
    EMAIL_HOST_PASSWORD = 'yourpassword'
134
    EMAIL_PORT = 587 #(outgoing)
135

  
136
It is strongly advised that you do not change the following to False values unless, you want to integrate FoD with you CRM or members database. This implies that you are able/have the rights to create database views between the two databases::
137

  
138
    PEER_MANAGED_TABLE = True
139
    PEER_RANGE_MANAGED_TABLE = True
140
    PEER_TECHC_MANAGED_TABLE = True   
141

  
142
By doing that the corresponding tables as defined in peers/models will not be created. As noted above, you have to create the views that the tables will rely on. 
143

  
144
.. note::
145
    Soon we will release a version with django-registration as a means to add users and Shibboleth will become an alternative
146

  
147
Let's move on with some copies and dir creations::
148

  
149
    mkdir /var/log/fod
150
    chown www-data.www-data /var/log/fod
151
    cp urls.py.dist urls.py
152
    cd ..
153

  
154
.. note::
155
    LOG_FILE_LOCATION in settings.py is set to **/var/log/fod**. Adjust the chown command above to your selected dir.
156

  
157
System configuration
158
====================
159
Apache operates as a gunicorn Proxy with WSGI and Shibboleth modules enabled.
160
Depending on the setup the apache configuration may vary::
161

  
162
    a2enmod rewrite
163
    a2enmod proxy
164
    a2enmod ssl
165
    a2enmod proxy_http
166

  
167
If shibboleth is to be used::
168

  
169
    apt-get install libapache2-mod-shib2
170
    a2enmod shib2
171

  
172
Now it is time to configure beanstalk, gunicorn, celery and apache.
173

  
174
beanstalkd
175
----------
176
Enable beanstalk by editting /etc/default/beanstalkd::
177

  
178
    vim /etc/default/beanstalkd
179

  
180
Uncomment the line **START=yes** to enable beanstalk
181

  
182
Start beanstalkd::
183

  
184
    service beanstalkd start
185

  
186
gunicorn.d
187
----------
188
Create and edit /etc/gunicorn.d/fod::
189

  
190
    vim /etc/gunicorn.d/fod
191

  
192
FoD is served via gunicorn and is then proxied by Apache. If the above directory conventions have been followed so far, then your configuration should be::
193

  
194
    CONFIG = {
195
          'mode': 'django',
196
          'working_dir': '/srv/flowspy',
197
          'args': (
198
               '--bind=127.0.0.1:8081',
199
               '--workers=1',
200
               '--worker-class=egg:gunicorn#gevent',
201
               '--timeout=30',
202
               '--debug',
203
               '--log-level=debug',
204
               '--log-file=/var/log/gunicorn/fod.log',
205
          ),
206
    }
207

  
208

  
209
celeryd
210
-------
211
Celery is used over beanstalkd to apply firewall rules in a serial manner so that locks are avoided on the flowspec capable device. In our setup celery runs via django. That is why the python-django-celery package was installed.
212

  
213
Create the celeryd daemon at /etc/init.d/celeryd **if it does not already exist**::
214

  
215
    vim /etc/init.d/celeryd
216

  
217
The configuration should be::
218

  
219
    #!/bin/sh -e
220
    # ============================================
221
    #  celeryd - Starts the Celery worker daemon.
222
    # ============================================
223
    #
224
    # :Usage: /etc/init.d/celeryd {start|stop|force-reload|restart|try-restart|status}
225
    # :Configuration file: /etc/default/celeryd
226
    #
227
    # See http://docs.celeryq.org/en/latest/cookbook/daemonizing.html#init-script-celeryd
228
    
229
    
230
    ### BEGIN INIT INFO
231
    # Provides:              celeryd
232
    # Required-Start:     $network $local_fs $remote_fs
233
    # Required-Stop:       $network $local_fs $remote_fs
234
    # Default-Start:       2 3 4 5
235
    # Default-Stop:        0 1 6
236
    # Short-Description: celery task worker daemon
237
    # Description:          Starts the Celery worker daemon for a single project.
238
    ### END INIT INFO
239
    
240
    #set -e
241
    
242
    DEFAULT_PID_FILE="/var/run/celery/%n.pid"
243
    DEFAULT_LOG_FILE="/var/log/celery/%n.log"
244
    DEFAULT_LOG_LEVEL="INFO"
245
    DEFAULT_NODES="celery"
246
    DEFAULT_CELERYD="-m celery.bin.celeryd_detach"
247
    ENABLED="false"
248
    
249
    [ -r "$CELERY_DEFAULTS" ] && . "$CELERY_DEFAULTS"
250
    
251
    [ -r /etc/default/celeryd ] && . /etc/default/celeryd
252
    
253
    if [ "$ENABLED" != "true" ]; then
254
          echo "celery daemon disabled - see /etc/default/celeryd."
255
          exit 0
256
    fi
257
    
258
    
259
    CELERYD_PID_FILE=${CELERYD_PID_FILE:-${CELERYD_PIDFILE:-$DEFAULT_PID_FILE}}
260
    CELERYD_LOG_FILE=${CELERYD_LOG_FILE:-${CELERYD_LOGFILE:-$DEFAULT_LOG_FILE}}
261
    CELERYD_LOG_LEVEL=${CELERYD_LOG_LEVEL:-${CELERYD_LOGLEVEL:-$DEFAULT_LOG_LEVEL}}
262
    CELERYD_MULTI=${CELERYD_MULTI:-"celeryd-multi"}
263
    CELERYD=${CELERYD:-$DEFAULT_CELERYD}
264
    CELERYCTL=${CELERYCTL:="celeryctl"}
265
    CELERYD_NODES=${CELERYD_NODES:-$DEFAULT_NODES}
266
    
267
    export CELERY_LOADER
268
    
269
    if [ -n "$2" ]; then
270
          CELERYD_OPTS="$CELERYD_OPTS $2"
271
    fi
272
    
273
    CELERYD_LOG_DIR=`dirname $CELERYD_LOG_FILE`
274
    CELERYD_PID_DIR=`dirname $CELERYD_PID_FILE`
275
    if [ ! -d "$CELERYD_LOG_DIR" ]; then
276
          mkdir -p $CELERYD_LOG_DIR
277
    fi
278
    if [ ! -d "$CELERYD_PID_DIR" ]; then
279
          mkdir -p $CELERYD_PID_DIR
280
    fi
281
    
282
    # Extra start-stop-daemon options, like user/group.
283
    if [ -n "$CELERYD_USER" ]; then
284
          DAEMON_OPTS="$DAEMON_OPTS --uid=$CELERYD_USER"
285
          chown "$CELERYD_USER" $CELERYD_LOG_DIR $CELERYD_PID_DIR
286
    fi
287
    if [ -n "$CELERYD_GROUP" ]; then
288
          DAEMON_OPTS="$DAEMON_OPTS --gid=$CELERYD_GROUP"
289
          chgrp "$CELERYD_GROUP" $CELERYD_LOG_DIR $CELERYD_PID_DIR
290
    fi
291
    
292
    if [ -n "$CELERYD_CHDIR" ]; then
293
          DAEMON_OPTS="$DAEMON_OPTS --workdir=\"$CELERYD_CHDIR\""
294
    fi
295
    
296
    
297
    check_dev_null() {
298
          if [ ! -c /dev/null ]; then
299
               echo "/dev/null is not a character device!"
300
               exit 1
301
          fi
302
    }
303
    
304
    
305
    export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
306
    
307
    
308
    stop_workers () {
309
          $CELERYD_MULTI stop $CELERYD_NODES --pidfile="$CELERYD_PID_FILE"
310
    }
311
    
312
    
313
    start_workers () {
314
          $CELERYD_MULTI start $CELERYD_NODES $DAEMON_OPTS           \
315
                                        --pidfile="$CELERYD_PID_FILE"        \
316
                                        --logfile="$CELERYD_LOG_FILE"        \
317
                                        --loglevel="$CELERYD_LOG_LEVEL"     \
318
                                        --cmd="$CELERYD"                           \
319
                                        $CELERYD_OPTS
320
    }
321
    
322
    
323
    restart_workers () {
324
          $CELERYD_MULTI restart $CELERYD_NODES $DAEMON_OPTS        \
325
                                           --pidfile="$CELERYD_PID_FILE"     \
326
                                           --logfile="$CELERYD_LOG_FILE"     \
327
                                           --loglevel="$CELERYD_LOG_LEVEL"  \
328
                                           --cmd="$CELERYD"                        \
329
                                           $CELERYD_OPTS
330
    }
331
    
332
    
333
    
334
    case "$1" in
335
          start)
336
               check_dev_null
337
               start_workers
338
          ;;
339
    
340
          stop)
341
               check_dev_null
342
               stop_workers
343
          ;;
344
    
345
          reload|force-reload)
346
               echo "Use restart"
347
          ;;
348
    
349
          status)
350
               $CELERYCTL status $CELERYCTL_OPTS
351
          ;;
352
    
353
          restart)
354
               check_dev_null
355
               restart_workers
356
          ;;
357
    
358
          try-restart)
359
               check_dev_null
360
               restart_workers
361
          ;;
362
    
363
          *)
364
               echo "Usage: /etc/init.d/celeryd {start|stop|restart|try-restart|kill}"
365
               exit 1
366
          ;;
367
    esac
368
    
369
    exit 0
370

  
371
celeryd configuration
372
---------------------
373
celeryd requires a /etc/default/celeryd file to be in place.
374
Thus we are going to create this file (/etc/default/celeryd)::
375

  
376
    vim /etc/default/celeryd
377

  
378
Again if the directory conventions have been followed the file is (pay attention to the CELERYD_USER, CELERYD_GROUP and change accordingly)  ::
379

  
380
    # Default: false
381
    ENABLED="true"
382
    
383
    # Name of nodes to start, here we have a single node
384
    CELERYD_NODES="w1"
385
    # or we could have three nodes:
386
    #CELERYD_NODES="w1 w2 w3"
387
    
388
    # Where to chdir at start.
389
    CELERYD_CHDIR="/srv/flowspy"
390
    # How to call "manage.py celeryd_multi"
391
    CELERYD_MULTI="python $CELERYD_CHDIR/manage.py celeryd_multi"
392
    
393
    # How to call "manage.py celeryctl"
394
    CELERYCTL="python $CELERYD_CHDIR/manage.py celeryctl"
395
    
396
    # Extra arguments to celeryd
397
    #CELERYD_OPTS="--time-limit=300 --concurrency=8"
398
    CELERYD_OPTS="-E -B --schedule=/var/run/celery/celerybeat-schedule --concurrency=1 --soft-time-limit=180 --time-limit=1800"
399
    # Name of the celery config module.
400
    CELERY_CONFIG_MODULE="celeryconfig"
401
    
402
    # %n will be replaced with the nodename.
403
    CELERYD_LOG_FILE="/var/log/celery/fod_%n.log"
404
    CELERYD_PID_FILE="/var/run/celery/%n.pid"
405
    
406
    CELERYD_USER="root"
407
    CELERYD_GROUP="root"
408
    
409
    # Name of the projects settings module.
410
    export DJANGO_SETTINGS_MODULE="flowspy.settings"
411

  
412
Apache
413
------
414
Apache proxies gunicorn. Things are more flexible here as you may follow your own configuration and conventions. Create and edit /etc/apache2/sites-available/fod. You should set <server_name> and <admin_mail> along with your certificates. If under testing environment, you can use the provided snakeoil certs. If you do not intent to use Shibboleth delete or comment the corresponding configuration parts inside **Shibboleth configuration** ::
415

  
416
    vim /etc/apache2/sites-available/fod
417

  
418
Again if the directory conventions have been followed the file should be::
419

  
420
    <VirtualHost *:80>
421
        ServerAdmin webmaster@localhost
422
        ServerName  fod.example.com
423
        DocumentRoot /var/www
424
    
425
        ErrorLog ${APACHE_LOG_DIR}/fod_error.log
426
    
427
        # Possible values include: debug, info, notice, warn, error, crit,
428
        # alert, emerg.
429
        LogLevel debug
430
        
431
        CustomLog ${APACHE_LOG_DIR}/fod_access.log combined
432
    
433
        Alias /static       /srv/flowspy/static
434
          RewriteEngine On
435
          RewriteCond %{HTTPS} off
436
          RewriteRule ^/(.*) https://fod.example.com/$1 [L,R]
437
    </VirtualHost>
438
    
439
    <VirtualHost *:443>
440
        ServerName    fod.example.com
441
        ServerAdmin     webmaster@localhost
442
        ServerSignature        On
443
        
444
        SSLEngine on
445
        SSLCertificateFile    /etc/ssl/certs/fod.example.com.crt
446
        SSLCertificateChainFile /etc/ssl/certs/example-chain.pem
447
        SSLCertificateKeyFile    /etc/ssl/private/fod.example.com.key
448
    
449
        AddDefaultCharset UTF-8
450
        IndexOptions        +Charset=UTF-8
451
    
452
        ShibConfig       /etc/shibboleth/shibboleth2.xml
453
        Alias          /shibboleth-sp /usr/share/shibboleth
454
    
455
    
456
        <Location /login>
457
             AuthType shibboleth
458
             ShibRequireSession On
459
             ShibUseHeaders On
460
             ShibRequestSetting entityID https://idp.example.com/idp/shibboleth
461
             require valid-user
462
        </Location>
463
        
464
        # Shibboleth debugging CGI script
465
        ScriptAlias /shibboleth/test /usr/lib/cgi-bin/shibtest.cgi
466
        <Location /shibboleth/test>
467
             AuthType shibboleth
468
             ShibRequireSession On
469
             ShibUseHeaders On
470
             require valid-user
471
        </Location>
472
    
473
        <Location /Shibboleth.sso>
474
             SetHandler shib
475
        </Location>
476
    
477
        # Shibboleth SP configuration
478
    
479
        #SetEnv                       proxy-sendchunked
480
        
481
              <Proxy *>
482
               Order allow,deny
483
               Allow from all
484
               </Proxy>
485
    
486
               SSLProxyEngine           off
487
               ProxyErrorOverride     off
488
          ProxyTimeout     28800
489
             ProxyPass        /static !
490
             ProxyPass          /shibboleth !
491
             ProxyPass        /Shibboleth.sso !
492
             
493
               ProxyPass           / http://localhost:8081/ retry=0
494
               ProxyPassReverse / http://localhost:8081/
495
    
496
          Alias /static          /srv/flowspy/static
497
    
498
        LogLevel warn
499
        
500
        ErrorLog ${APACHE_LOG_DIR}/fod_error.log
501
          CustomLog ${APACHE_LOG_DIR}/fod_access.log combined
502
    
503
    </VirtualHost>
504

  
505
Now, enable your site. You might want to disable the default site if fod is the only site you host on your server::
506

  
507
    a2dissite default
508
    a2ensite fod
509

  
510
You are not far away from deploying FoD. When asked for a super user, create one::
511

  
512
    cd /srv/flowspy
513
    python manage.py syncdb
514
    python manage.py migrate longerusername
515
    python manage.py migrate flowspec
516
    python manage.py migrate djcelery
517
    python manage.py migrate accounts
518

  
519
If you have not changed the values of the PEER\_\*\_TABLE variables to False and thus you are going for a default installation (that is PEER\_\*\_TABLE variables are set to True) , then run::
520
    
521
    python manage.py migrate peers
522

  
523
If however you have set the PEER\_\*\_TABLE variables to False and by accident you have ran the command above, then you have to cleanup you database manually by dropping the peer\* tables plus the techc_email table. For MySQL the command is::
524
    
525
    DROP TABLE `peer`, `peer_networks`, `peer_range`, `peer_techc_emails`, techc_email;  
526

  
527
Restart, gunicorn and apache::
528

  
529
    service gunicorn restart && service apache2 restart
530

  
531

  
532
Propagate the flatpages
533
=======================
534
Inside the initial_data/fixtures_manual.xml file we have placed 4 flatpages (2 for Greek, 2 for English) with Information and Terms of Service about the service. 
535
To import the flatpages, run from root folder::
536

  
537
    python manage.py loaddata initial_data/fixtures_manual.xml
538

  
539

  
540

  
541
Testing the platform
542
====================
543
Log in to the admin interface via https:\/\/<hostname>\/admin. Go to Peer ranges and add a new range (part of/or a complete subnet), eg. 10.20.0.0/19
544
Go to Peers and add a new peer, eg. id: 1, name: Test, AS: 16503, tag: TEST and move the network you have created from Avalable to Chosen. From the admin front, go to User, and edit your user. From the bottom of the page, select the TEST peer and save.
545
Last but not least, modify as required the existing (example.com) Site instance (admin home->Sites). You are done. As you are logged-in via the admin, there is no need to go through Shibboleth at this time. Go to https:\/\/<hostname>\/ and create a new rule. Your rule should be applied on the flowspec capable device after aprox. 10 seconds. If no Shibboleth authentication is available, a https:\/\/<hostname>\/altlogin is provided.
546

  
547
Branding
548
========
549
Via the admin interface you can modify flatpages to suit your needs
550

  
551
Footer
552
------
553
Under the templates folder (templates), you can alter the footer.html file to include your own footer messages, badges, etc.
554

  
555
Welcome Page
556
------------
557
Under the templates folder (templates), you can alter the welcome page - welcome.html with your own images, carousel, videos, etc.
/dev/null
1
/*
2
 * basic.css
3
 * ~~~~~~~~~
4
 *
5
 * Sphinx stylesheet -- basic theme.
6
 *
7
 * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
8
 * :license: BSD, see LICENSE for details.
9
 *
10
 */
11

  
12
/* -- main layout ----------------------------------------------------------- */
13

  
14
div.clearer {
15
    clear: both;
16
}
17

  
18
/* -- relbar ---------------------------------------------------------------- */
19

  
20
div.related {
21
    width: 100%;
22
    font-size: 90%;
23
}
24

  
25
div.related h3 {
26
    display: none;
27
}
28

  
29
div.related ul {
30
    margin: 0;
31
    padding: 0 0 0 10px;
32
    list-style: none;
33
}
34

  
35
div.related li {
36
    display: inline;
37
}
38

  
39
div.related li.right {
40
    float: right;
41
    margin-right: 5px;
42
}
43

  
44
/* -- sidebar --------------------------------------------------------------- */
45

  
46
div.sphinxsidebarwrapper {
47
    padding: 10px 5px 0 10px;
48
}
49

  
50
div.sphinxsidebar {
51
    float: left;
52
    width: 230px;
53
    margin-left: -100%;
54
    font-size: 90%;
55
}
56

  
57
div.sphinxsidebar ul {
58
    list-style: none;
59
}
60

  
61
div.sphinxsidebar ul ul,
62
div.sphinxsidebar ul.want-points {
63
    margin-left: 20px;
64
    list-style: square;
65
}
66

  
67
div.sphinxsidebar ul ul {
68
    margin-top: 0;
69
    margin-bottom: 0;
70
}
71

  
72
div.sphinxsidebar form {
73
    margin-top: 10px;
74
}
75

  
76
div.sphinxsidebar input {
77
    border: 1px solid #98dbcc;
78
    font-family: sans-serif;
79
    font-size: 1em;
80
}
81

  
82
div.sphinxsidebar #searchbox input[type="text"] {
83
    width: 170px;
84
}
85

  
86
div.sphinxsidebar #searchbox input[type="submit"] {
87
    width: 30px;
88
}
89

  
90
img {
91
    border: 0;
92
}
93

  
94
/* -- search page ----------------------------------------------------------- */
95

  
96
ul.search {
97
    margin: 10px 0 0 20px;
98
    padding: 0;
99
}
100

  
101
ul.search li {
102
    padding: 5px 0 5px 20px;
103
    background-image: url(file.png);
104
    background-repeat: no-repeat;
105
    background-position: 0 7px;
106
}
107

  
108
ul.search li a {
109
    font-weight: bold;
110
}
111

  
112
ul.search li div.context {
113
    color: #888;
114
    margin: 2px 0 0 30px;
115
    text-align: left;
116
}
117

  
118
ul.keywordmatches li.goodmatch a {
119
    font-weight: bold;
120
}
121

  
122
/* -- index page ------------------------------------------------------------ */
123

  
124
table.contentstable {
125
    width: 90%;
126
}
127

  
128
table.contentstable p.biglink {
129
    line-height: 150%;
130
}
131

  
132
a.biglink {
133
    font-size: 1.3em;
134
}
135

  
136
span.linkdescr {
137
    font-style: italic;
138
    padding-top: 5px;
139
    font-size: 90%;
140
}
141

  
142
/* -- general index --------------------------------------------------------- */
143

  
144
table.indextable {
145
    width: 100%;
146
}
147

  
148
table.indextable td {
149
    text-align: left;
150
    vertical-align: top;
151
}
152

  
153
table.indextable dl, table.indextable dd {
154
    margin-top: 0;
155
    margin-bottom: 0;
156
}
157

  
158
table.indextable tr.pcap {
159
    height: 10px;
160
}
161

  
162
table.indextable tr.cap {
163
    margin-top: 10px;
164
    background-color: #f2f2f2;
165
}
166

  
167
img.toggler {
168
    margin-right: 3px;
169
    margin-top: 3px;
170
    cursor: pointer;
171
}
172

  
173
div.modindex-jumpbox {
174
    border-top: 1px solid #ddd;
175
    border-bottom: 1px solid #ddd;
176
    margin: 1em 0 1em 0;
177
    padding: 0.4em;
178
}
179

  
180
div.genindex-jumpbox {
181
    border-top: 1px solid #ddd;
182
    border-bottom: 1px solid #ddd;
183
    margin: 1em 0 1em 0;
184
    padding: 0.4em;
185
}
186

  
187
/* -- general body styles --------------------------------------------------- */
188

  
189
a.headerlink {
190
    visibility: hidden;
191
}
192

  
193
h1:hover > a.headerlink,
194
h2:hover > a.headerlink,
195
h3:hover > a.headerlink,
196
h4:hover > a.headerlink,
197
h5:hover > a.headerlink,
198
h6:hover > a.headerlink,
199
dt:hover > a.headerlink {
200
    visibility: visible;
201
}
202

  
203
div.body p.caption {
204
    text-align: inherit;
205
}
206

  
207
div.body td {
208
    text-align: left;
209
}
210

  
211
.field-list ul {
212
    padding-left: 1em;
213
}
214

  
215
.first {
216
    margin-top: 0 !important;
217
}
218

  
219
p.rubric {
220
    margin-top: 30px;
221
    font-weight: bold;
222
}
223

  
224
img.align-left, .figure.align-left, object.align-left {
225
    clear: left;
226
    float: left;
227
    margin-right: 1em;
228
}
229

  
230
img.align-right, .figure.align-right, object.align-right {
231
    clear: right;
232
    float: right;
233
    margin-left: 1em;
234
}
235

  
236
img.align-center, .figure.align-center, object.align-center {
237
  display: block;
238
  margin-left: auto;
239
  margin-right: auto;
240
}
241

  
242
.align-left {
243
    text-align: left;
244
}
245

  
246
.align-center {
247
    text-align: center;
248
}
249

  
250
.align-right {
251
    text-align: right;
252
}
253

  
254
/* -- sidebars -------------------------------------------------------------- */
255

  
256
div.sidebar {
257
    margin: 0 0 0.5em 1em;
258
    border: 1px solid #ddb;
259
    padding: 7px 7px 0 7px;
260
    background-color: #ffe;
261
    width: 40%;
262
    float: right;
263
}
264

  
265
p.sidebar-title {
266
    font-weight: bold;
267
}
268

  
269
/* -- topics ---------------------------------------------------------------- */
270

  
271
div.topic {
272
    border: 1px solid #ccc;
273
    padding: 7px 7px 0 7px;
274
    margin: 10px 0 10px 0;
275
}
276

  
277
p.topic-title {
278
    font-size: 1.1em;
279
    font-weight: bold;
280
    margin-top: 10px;
281
}
282

  
283
/* -- admonitions ----------------------------------------------------------- */
284

  
285
div.admonition {
286
    margin-top: 10px;
287
    margin-bottom: 10px;
288
    padding: 7px;
289
}
290

  
291
div.admonition dt {
292
    font-weight: bold;
293
}
294

  
295
div.admonition dl {
296
    margin-bottom: 0;
297
}
298

  
299
p.admonition-title {
300
    margin: 0px 10px 5px 0px;
301
    font-weight: bold;
302
}
303

  
304
div.body p.centered {
305
    text-align: center;
306
    margin-top: 25px;
307
}
308

  
309
/* -- tables ---------------------------------------------------------------- */
310

  
311
table.docutils {
312
    border: 0;
313
    border-collapse: collapse;
314
}
315

  
316
table.docutils td, table.docutils th {
317
    padding: 1px 8px 1px 5px;
318
    border-top: 0;
319
    border-left: 0;
320
    border-right: 0;
321
    border-bottom: 1px solid #aaa;
322
}
323

  
324
table.field-list td, table.field-list th {
325
    border: 0 !important;
326
}
327

  
328
table.footnote td, table.footnote th {
329
    border: 0 !important;
330
}
331

  
332
th {
333
    text-align: left;
334
    padding-right: 5px;
335
}
336

  
337
table.citation {
338
    border-left: solid 1px gray;
339
    margin-left: 1px;
340
}
341

  
342
table.citation td {
343
    border-bottom: none;
344
}
345

  
346
/* -- other body styles ----------------------------------------------------- */
347

  
348
ol.arabic {
349
    list-style: decimal;
350
}
351

  
352
ol.loweralpha {
353
    list-style: lower-alpha;
354
}
355

  
356
ol.upperalpha {
357
    list-style: upper-alpha;
358
}
359

  
360
ol.lowerroman {
361
    list-style: lower-roman;
362
}
363

  
364
ol.upperroman {
365
    list-style: upper-roman;
366
}
367

  
368
dl {
369
    margin-bottom: 15px;
370
}
371

  
372
dd p {
373
    margin-top: 0px;
374
}
375

  
376
dd ul, dd table {
377
    margin-bottom: 10px;
378
}
379

  
380
dd {
381
    margin-top: 3px;
382
    margin-bottom: 10px;
383
    margin-left: 30px;
384
}
385

  
386
dt:target, .highlighted {
387
    background-color: #fbe54e;
388
}
389

  
390
dl.glossary dt {
391
    font-weight: bold;
392
    font-size: 1.1em;
393
}
394

  
395
.field-list ul {
396
    margin: 0;
397
    padding-left: 1em;
398
}
399

  
400
.field-list p {
401
    margin: 0;
402
}
403

  
404
.refcount {
405
    color: #060;
406
}
407

  
408
.optional {
409
    font-size: 1.3em;
410
}
411

  
412
.versionmodified {
413
    font-style: italic;
414
}
415

  
416
.system-message {
417
    background-color: #fda;
418
    padding: 5px;
419
    border: 3px solid red;
420
}
421

  
422
.footnote:target  {
423
    background-color: #ffa;
424
}
425

  
426
.line-block {
427
    display: block;
428
    margin-top: 1em;
429
    margin-bottom: 1em;
430
}
431

  
432
.line-block .line-block {
433
    margin-top: 0;
434
    margin-bottom: 0;
435
    margin-left: 1.5em;
436
}
437

  
438
.guilabel, .menuselection {
439
    font-family: sans-serif;
440
}
441

  
442
.accelerator {
443
    text-decoration: underline;
444
}
445

  
446
.classifier {
447
    font-style: oblique;
448
}
449

  
450
abbr, acronym {
451
    border-bottom: dotted 1px;
452
    cursor: help;
453
}
454

  
455
/* -- code displays --------------------------------------------------------- */
456

  
457
pre {
458
    overflow: auto;
459
    overflow-y: hidden;  /* fixes display issues on Chrome browsers */
460
}
461

  
462
td.linenos pre {
463
    padding: 5px 0px;
464
    border: 0;
465
    background-color: transparent;
466
    color: #aaa;
467
}
468

  
469
table.highlighttable {
470
    margin-left: 0.5em;
471
}
472

  
473
table.highlighttable td {
474
    padding: 0 0.5em 0 0.5em;
475
}
476

  
477
tt.descname {
478
    background-color: transparent;
479
    font-weight: bold;
480
    font-size: 1.2em;
481
}
482

  
483
tt.descclassname {
484
    background-color: transparent;
485
}
486

  
487
tt.xref, a tt {
488
    background-color: transparent;
489
    font-weight: bold;
490
}
491

  
492
h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
493
    background-color: transparent;
494
}
495

  
496
.viewcode-link {
497
    float: right;
498
}
499

  
500
.viewcode-back {
501
    float: right;
502
    font-family: sans-serif;
503
}
504

  
505
div.viewcode-block:target {
506
    margin: -1px -10px;
507
    padding: 0 10px;
508
}
509

  
510
/* -- math display ---------------------------------------------------------- */
511

  
512
img.math {
513
    vertical-align: middle;
514
}
515

  
516
div.body div.math p {
517
    text-align: center;
518
}
519

  
520
span.eqno {
521
    float: right;
522
}
523

  
524
/* -- printout stylesheet --------------------------------------------------- */
525

  
526
@media print {
527
    div.document,
528
    div.documentwrapper,
529
    div.bodywrapper {
530
        margin: 0 !important;
531
        width: 100%;
532
    }
533

  
534
    div.sphinxsidebar,
535
    div.related,
536
    div.footer,
537
    #top-link {
538
        display: none;
539
    }
540
}
/dev/null
1
/*
2
 * default.css_t
3
 * ~~~~~~~~~~~~~
4
 *
5
 * Sphinx stylesheet -- default theme.
6
 *
7
 * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
8
 * :license: BSD, see LICENSE for details.
9
 *
10
 */
11

  
12
@import url("basic.css");
13

  
14
/* -- page layout ----------------------------------------------------------- */
15

  
16
body {
17
    font-family: sans-serif;
18
    font-size: 100%;
19
    background-color: #11303d;
20
    color: #000;
21
    margin: 0;
22
    padding: 0;
23
}
24

  
25
div.document {
26
    background-color: #1c4e63;
27
}
28

  
29
div.documentwrapper {
30
    float: left;
31
    width: 100%;
32
}
33

  
34
div.bodywrapper {
35
    margin: 0 0 0 230px;
36
}
37

  
38
div.body {
39
    background-color: #ffffff;
40
    color: #000000;
41
    padding: 0 20px 30px 20px;
42
}
43

  
44
div.footer {
45
    color: #ffffff;
46
    width: 100%;
47
    padding: 9px 0 9px 0;
48
    text-align: center;
49
    font-size: 75%;
50
}
51

  
52
div.footer a {
53
    color: #ffffff;
54
    text-decoration: underline;
55
}
56

  
57
div.related {
58
    background-color: #133f52;
59
    line-height: 30px;
60
    color: #ffffff;
61
}
62

  
63
div.related a {
64
    color: #ffffff;
65
}
66

  
67
div.sphinxsidebar {
68
}
69

  
70
div.sphinxsidebar h3 {
71
    font-family: 'Trebuchet MS', sans-serif;
72
    color: #ffffff;
73
    font-size: 1.4em;
74
    font-weight: normal;
75
    margin: 0;
76
    padding: 0;
77
}
78

  
79
div.sphinxsidebar h3 a {
80
    color: #ffffff;
81
}
82

  
83
div.sphinxsidebar h4 {
84
    font-family: 'Trebuchet MS', sans-serif;
85
    color: #ffffff;
86
    font-size: 1.3em;
87
    font-weight: normal;
88
    margin: 5px 0 0 0;
89
    padding: 0;
90
}
91

  
92
div.sphinxsidebar p {
93
    color: #ffffff;
94
}
95

  
96
div.sphinxsidebar p.topless {
97
    margin: 5px 10px 10px 10px;
98
}
99

  
100
div.sphinxsidebar ul {
101
    margin: 10px;
102
    padding: 0;
103
    color: #ffffff;
104
}
105

  
106
div.sphinxsidebar a {
107
    color: #98dbcc;
108
}
109

  
110
div.sphinxsidebar input {
111
    border: 1px solid #98dbcc;
112
    font-family: sans-serif;
113
    font-size: 1em;
114
}
115

  
116

  
117

  
118
/* -- hyperlink styles ------------------------------------------------------ */
119

  
120
a {
121
    color: #355f7c;
122
    text-decoration: none;
123
}
124

  
125
a:visited {
126
    color: #355f7c;
127
    text-decoration: none;
128
}
129

  
130
a:hover {
131
    text-decoration: underline;
132
}
133

  
134

  
135

  
136
/* -- body styles ----------------------------------------------------------- */
137

  
138
div.body h1,
139
div.body h2,
140
div.body h3,
141
div.body h4,
142
div.body h5,
143
div.body h6 {
144
    font-family: 'Trebuchet MS', sans-serif;
145
    background-color: #f2f2f2;
146
    font-weight: normal;
147
    color: #20435c;
148
    border-bottom: 1px solid #ccc;
149
    margin: 20px -20px 10px -20px;
150
    padding: 3px 0 3px 10px;
151
}
152

  
153
div.body h1 { margin-top: 0; font-size: 200%; }
154
div.body h2 { font-size: 160%; }
155
div.body h3 { font-size: 140%; }
156
div.body h4 { font-size: 120%; }
157
div.body h5 { font-size: 110%; }
158
div.body h6 { font-size: 100%; }
159

  
160
a.headerlink {
161
    color: #c60f0f;
162
    font-size: 0.8em;
163
    padding: 0 4px 0 4px;
164
    text-decoration: none;
165
}
166

  
167
a.headerlink:hover {
168
    background-color: #c60f0f;
169
    color: white;
170
}
171

  
172
div.body p, div.body dd, div.body li {
173
    text-align: justify;
174
    line-height: 130%;
175
}
176

  
177
div.admonition p.admonition-title + p {
178
    display: inline;
179
}
180

  
181
div.admonition p {
182
    margin-bottom: 5px;
183
}
184

  
185
div.admonition pre {
186
    margin-bottom: 5px;
187
}
188

  
189
div.admonition ul, div.admonition ol {
190
    margin-bottom: 5px;
191
}
192

  
193
div.note {
194
    background-color: #eee;
195
    border: 1px solid #ccc;
196
}
197

  
198
div.seealso {
199
    background-color: #ffc;
200
    border: 1px solid #ff6;
201
}
202

  
203
div.topic {
204
    background-color: #eee;
205
}
206

  
207
div.warning {
208
    background-color: #ffe4e4;
209
    border: 1px solid #f66;
210
}
211

  
212
p.admonition-title {
213
    display: inline;
214
}
215

  
216
p.admonition-title:after {
217
    content: ":";
218
}
219

  
220
pre {
221
    padding: 5px;
222
    background-color: #eeffcc;
223
    color: #333333;
224
    line-height: 120%;
225
    border: 1px solid #ac9;
226
    border-left: none;
227
    border-right: none;
228
}
229

  
230
tt {
231
    background-color: #ecf0f3;
232
    padding: 0 1px 0 1px;
233
    font-size: 0.95em;
234
}
235

  
236
th {
237
    background-color: #ede;
238
}
239

  
240
.warning tt {
241
    background: #efc2c2;
242
}
243

  
244
.note tt {
245
    background: #d6d6d6;
246
}
247

  
248
.viewcode-back {
249
    font-family: sans-serif;
250
}
251

  
252
div.viewcode-block:target {
253
    background-color: #f4debf;
254
    border-top: 1px solid #ac9;
255
    border-bottom: 1px solid #ac9;
256
}
/dev/null
1
/*
2
 * doctools.js
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff