Statistics
| Branch: | Tag: | Revision:

root / docs / scale / i-astakos.rst @ 48646327

History | View | Annotate | Download (5.8 kB)

1
.. _i-astakos:
2

    
3
Synnefo
4
-------
5

    
6
:ref:`synnefo <i-synnefo>` ||
7
:ref:`ns <i-ns>` ||
8
:ref:`apt <i-apt>` ||
9
:ref:`mq <i-mq>` ||
10
:ref:`db <i-db>` ||
11
:ref:`gunicorn <i-gunicorn>` ||
12
:ref:`apache <i-apache>` ||
13
:ref:`webproject <i-webproject>` ||
14
astakos ||
15
:ref:`cms <i-cms>` ||
16
:ref:`pithos <i-pithos>` ||
17
:ref:`cyclades <i-cyclades>` ||
18
:ref:`kamaki <i-kamaki>` ||
19
:ref:`backends <i-backends>`
20

    
21
Astakos Setup
22
+++++++++++++
23

    
24
The following apply to ``astakos`` node. In the following sections
25
we will refer to its IP as ``accounts.example.com`` . Make sure
26
you have db, mq, apache and gunicorn setup already.
27

    
28
IMPORTANT: Currently if astakos coexists with cyclades/pithos roles, your setup is prone to csrf attacks.
29
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30

    
31
First install the corresponding package:
32

    
33
.. code-block:: console
34

    
35
   # apt-get install snf-astakos-app
36

    
37
In `/etc/synnefo/astakos.conf` add:
38

    
39
.. code-block:: console
40

    
41
    CLOUDBAR_LOCATION = 'https://accounts.example.com/static/im/cloudbar/'
42
    CLOUDBAR_SERVICES_URL = 'https://accounts.example.com/im/get_services'
43
    CLOUDBAR_MENU_URL = 'https://accounts.example.com/im/get_menu'
44

    
45
    ASTAKOS_IM_MODULES = ['local']
46

    
47
    ASTAKOS_BASEURL = 'https://accounts.example.com'
48

    
49
    ASTAKOS_SITENAME = '~okeanos @ example.com'
50
    ASTAKOS_RECAPTCHA_PUBLIC_KEY = '6LeFidMSAAAAAM7Px7a96YQzsBcKYeXCI_sFz0Gk'
51
    ASTAKOS_RECAPTCHA_PRIVATE_KEY = '6LeFidMSAAAAAFv5U5NSayJJJhr0roludAidPd2M'
52

    
53
    ASTAKOS_RECAPTCHA_USE_SSL = True
54
    ASTAKOS_RECAPTCHA_ENABLED = True
55

    
56
    ASTAKOS_COOKIE_DOMAIN = 'example.com'
57

    
58
    ASTAKOS_LOGIN_MESSAGES = []
59
    ASTAKOS_SIGNUP_MESSAGES = []
60
    ASTAKOS_PROFILE_MESSAGES = []
61
    ASTAKOS_GLOBAL_MESSAGES = []
62

    
63
    ASTAKOS_PROFILE_EXTRA_LINKS = []
64
    ASTAKOS_INVITATION_EMAIL_SUBJECT = 'Invitation to %s' % ASTAKOS_SITENAME
65
    ASTAKOS_GREETING_EMAIL_SUBJECT = 'Welcome to %s' % ASTAKOS_SITENAME
66
    ASTAKOS_FEEDBACK_EMAIL_SUBJECT = 'Feedback from %s' % ASTAKOS_SITENAME
67
    ASTAKOS_VERIFICATION_EMAIL_SUBJECT = '%s account activation is needed' % ASTAKOS_SITENAME
68
    ASTAKOS_ADMIN_NOTIFICATION_EMAIL_SUBJECT = '%s account created (%%(user)s)' % ASTAKOS_SITENAME
69
    ASTAKOS_HELPDESK_NOTIFICATION_EMAIL_SUBJECT = '%s account activated (%%(user)s)' % ASTAKOS_SITENAME
70
    ASTAKOS_EMAIL_CHANGE_EMAIL_SUBJECT = 'Email change on %s' % ASTAKOS_SITENAME
71
    ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT = 'Password reset on %s' % ASTAKOS_SITENAME
72

    
73
    EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
74
    ASTAKOS_SERVICES = {
75
        'cyclades': {
76
            'url': 'https://cyclades.example.com/ui/',
77
            'resources': [{
78
                'name':'disk',
79
                'group':'compute',
80
                'uplimit':30*1024*1024*1024,
81
                'unit':'bytes',
82
                'desc': 'Virtual machine disk size'
83
                },{
84
                'name':'cpu',
85
                'group':'compute',
86
                'uplimit':6,
87
                'desc': 'Number of virtual machine processors'
88
                },{
89
                'name':'ram',
90
                'group':'compute',
91
                'uplimit':6*1024*1024*1024,
92
                'unit':'bytes',
93
                'desc': 'Virtual machines'
94
                },{
95
                'name':'vm',
96
                'group':'compute',
97
                'uplimit':2,
98
                'desc': 'Number of virtual machines'
99
                },{
100
                'name':'network.private',
101
                'group':'network',
102
                'uplimit':1,
103
                'desc': 'Private networks'
104
                }
105
            ]
106
        },
107
        'pithos+': {
108
            'url': 'https://pithos.example.com/ui/',
109
            'resources':[{
110
                'name':'diskspace',
111
                'group':'storage',
112
                'uplimit':5 * 1024 * 1024 * 1024,
113
                'unit':'bytes',
114
                'desc': 'Pithos account diskspace'
115
                }]
116
        }
117
    }
118

    
119

    
120
If ``astakos`` is on the same node with ``cyclades`` or ``pithos``, add the following
121
line in `/etc/synnefo/astakos.conf` but please note that your setup will be prone to
122
csrf attacks:
123

    
124
.. code-block:: console
125

    
126
   MIDDLEWARE_CLASSES.remove('django.middleware.csrf.CsrfViewMiddleware')
127

    
128
Then initialize the Database and register services with:
129

    
130
.. code-block:: console
131

    
132
   # /etc/init.d/gunicorn restart
133
   # snf-manage syncdb --noinput
134
   # snf-manage migrate im --delete-ghost-migrations
135
   # snf-manage loaddata groups
136
   # snf-manage service-add "home" https://cms.example.com/ home-icon.png
137
   # snf-manage service-add "cyclades" https://cyclades.example.com/ui/
138
   # snf-manage service-add "pithos+" https://pithos.example.com/ui/
139
   # snf-manage astakos-init --load-service-resources
140
   # snf-manage quota --sync
141
   # /etc/init.d/gunicorn restart
142
   # /etc/init.d/apache2 restart
143

    
144
Please note that in case pithos and cyclades nodes are the same node, the pithos url
145
should be ``https://pithos.example.com/pithos/ui/`` .
146

    
147
Let's create our first user. Go at ``http://accounts.example.com/im/`` and
148
click the "CREATE ACCOUNT" button and fill all your data at the sign up form.
149
Then click "SUBMIT". You should now see a green box on the top, which informs
150
you that you made a successful request and the request has been sent to the
151
administrators. So far so good, let's assume that you created the user with
152
username ``user@example.com``.
153

    
154
Now we need to activate that user. Return to a command prompt aand run:
155

    
156
.. code-block:: console
157

    
158
   # snf-manage user-list
159
   # snf-manage user-modify --set-active 1
160

    
161
where 1 should be the id of the user you previously created.
162

    
163
All this can be done with one command:
164

    
165
.. code-block:: console
166

    
167
   # snf-manage user-add --password=12345 --active user@example.com Name LastName
168

    
169

    
170
Test your Setup:
171
++++++++++++++++
172

    
173
Visit ``http://accounts.example.com/im/`` and login with your credentials.