Statistics
| Branch: | Tag: | Revision:

root / docs / scale / i-astakos.rst @ 075b91de

History | View | Annotate | Download (5.9 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/astakos/api/get_services'
43
    CLOUDBAR_MENU_URL = 'https://accounts.example.com/astakos/api/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
    ASTAKOS_QUOTAHOLDER_TOKEN = '1234'
74
    ASTAKOS_QUOTAHOLDER_URL = 'https://qh.example.com/quotaholder/v'
75

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

    
122

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

    
127
.. code-block:: console
128

    
129
   MIDDLEWARE_CLASSES.remove('django.middleware.csrf.CsrfViewMiddleware')
130

    
131
Then initialize the Database and register services with:
132

    
133
.. code-block:: console
134

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

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

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

    
157
Now we need to activate that user. Return to a command prompt aand run:
158

    
159
.. code-block:: console
160

    
161
   # snf-manage user-list
162
   # snf-manage user-modify --set-active 1
163

    
164
where 1 should be the id of the user you previously created.
165

    
166
All this can be done with one command:
167

    
168
.. code-block:: console
169

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

    
172

    
173
Test your Setup:
174
++++++++++++++++
175

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