Revision 7fb619a0

b/runtests-venvs.sh
42 42
source env/bin/activate
43 43
export PIP_DOWNLOAD_CACHE=/tmp/.pip_cache
44 44
pip install -r requirements.pip
45
rm -rf build dist
46
python setup.py sdist
47
pip install dist/synnefo-*.tar.gz
48
cd env
49
# avoid vncauthproxy errors
50
rm bin/vncauthproxy.py
51
echo "running django tests..." >&2
52
snf-manage test aai admin api db helpdesk invitations logic userdata --settings=synnefo.settings.test
53
cd ..
54
deactivate
55 45

  
56
rm -rf env
57
virtualenv --no-site-packages -ppython2.7 env
58
source env/bin/activate
59
export PIP_DOWNLOAD_CACHE=/tmp/.pip_cache
60
pip install -r requirements.pip
46
cd snf-common
47
rm -rf build dist
48
python setup.py install
49
cd ../snf-app
50
rm -rf build dist
51
python setup.py install
52
cd ../snf-ganeti-tools
61 53
rm -rf build dist
62
python setup.py sdist
63
pip install dist/synnefo-*.tar.gz
64
cd env
54
python setup.py install
55

  
56

  
57
cd ../env
65 58
# avoid vncauthproxy errors
66 59
rm bin/vncauthproxy.py
67 60
echo "running django tests..." >&2
61
export SYNNEFO_SETTINGS_DIR=/etc/lala
68 62
snf-manage test aai admin api db helpdesk invitations logic userdata --settings=synnefo.settings.test
69 63
cd ..
70 64
deactivate
71
rm -rf env
65

  
66
#rm -rf env
67
#virtualenv --no-site-packages -ppython2.7 env
68
#source env/bin/activate
69
#export PIP_DOWNLOAD_CACHE=/tmp/.pip_cache
70
#pip install -r requirements.pip
71

  
72
#cd snf-common
73
#rm -rf build dist
74
#python setup.py install
75
#cd ../snf-app
76
#rm -rf build dist
77
#python setup.py install
78
#cd ../snf-ganeti-tools
79
#rm -rf build dist
80
#python setup.py install
81

  
82
#cd env
83
## avoid vncauthproxy errors
84
#rm bin/vncauthproxy.py
85
#echo "running django tests..." >&2
86
#snf-manage test aai admin api db helpdesk invitations logic userdata --settings=synnefo.settings.test
87
#cd ..
88
#deactivate
89
#rm -rf env
b/runtests.sh
38 38
set -e
39 39

  
40 40
echo "Running snf-app tests..." >&2
41
export PYTHONPATH=$PYTHONPATH:./snf-app
42
python snf-app/synnefo/manage.py test aai admin api db helpdesk invitations logic userdata --settings=synnefo.settings.test
41
python snf-manage test aai admin api db helpdesk invitations logic userdata --settings=synnefo.settings.test
43 42

  
44 43
echo "Running snf-ganeti-tools tests..." >&2
45
PYTHONPATH=snf-ganeti-tools:$PYTHONPATH ./snf-ganeti-tools/test/synnefo.ganeti_unittest.py
44
./snf-ganeti-tools/test/synnefo.ganeti_unittest.py
46 45

  
b/snf-app/setup.py
40 40
from distutils.util import convert_path
41 41
from fnmatch import fnmatchcase
42 42
from setuptools import setup, find_packages
43
from synnefo.version import get_version
43
from synnefo.version import vcs_version
44 44

  
45 45
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
46 46

  
47 47
# Package info
48
VERSION = get_version().replace(" ","")
48
VERSION = vcs_version()
49 49
README = open(os.path.join(HERE, 'README')).read()
50 50
CHANGES = open(os.path.join(HERE, 'Changelog')).read()
51 51
SHORT_DESCRIPTION = 'Package short description'
......
171 171
    return out
172 172

  
173 173
setup(
174
    name = 'synnefo',
174
    name = 'snf-app',
175 175
    version = VERSION,
176 176
    license = 'BSD',
177 177
    url = 'http://code.grnet.gr/',
......
202 202
         'snf-admin = synnefo.tools.admin:main',
203 203
         'snf-cloud = synnefo.tools.cloud:main',
204 204
         ],
205
     'synnefo': [
206
         'settings = synnefo.app_settings',
207
         'apps = synnefo.app_settings:getapps',
208
         ]
205 209
      },
206 210
    )
207 211

  
b/snf-app/synnefo/app_settings/__init__.py
1
from synnefo.app_settings.default import *
2

  
3
def getapps():
4
    return INSTALLED_APPS
b/snf-app/synnefo/app_settings/default/__init__.py
1
# Copyright 2011 GRNET S.A. All rights reserved.
2
#
3
# Redistribution and use in source and binary forms, with or
4
# without modification, are permitted provided that the following
5
# conditions are met:
6
#
7
#   1. Redistributions of source code must retain the above
8
#      copyright notice, this list of conditions and the following
9
#      disclaimer.
10
#
11
#   2. Redistributions in binary form must reproduce the above
12
#      copyright notice, this list of conditions and the following
13
#      disclaimer in the documentation and/or other materials
14
#      provided with the distribution.
15
#
16
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
# POSSIBILITY OF SUCH DAMAGE.
28
#
29
# The views and conclusions contained in the software and
30
# documentation are those of the authors and should not be
31
# interpreted as representing official policies, either expressed
32
# or implied, of GRNET S.A.
33

  
34
from synnefo.app_settings.default.admins import *
35
from synnefo.app_settings.default.apps import *
36
from synnefo.app_settings.default.deploy import *
37
from synnefo.app_settings.default.logging import *
38
from synnefo.app_settings.default.site import *
39
from synnefo.app_settings.default.backend import *
40
from synnefo.app_settings.default.database import *
41
from synnefo.app_settings.default.queues import *
42
from synnefo.app_settings.default.api import *
43
from synnefo.app_settings.default.plankton import *
44
from synnefo.app_settings.default.ui import *
45
from synnefo.app_settings.default.userdata import *
46
from synnefo.app_settings.default.aai import *
47
from synnefo.app_settings.default.invitations import *
48
from synnefo.app_settings.default.reconciliation import *
49
from synnefo.app_settings.default.helpdesk import *
50
from synnefo.app_settings.default.tests import *
51

  
b/snf-app/synnefo/app_settings/default/aai.py
1
# -*- coding: utf-8 -*-
2
#
3
# AAI configuration
4
#####################
5

  
6
# Unauthenticated HTTP requests to the UI get redirected to this URL
7
LOGIN_URL = "/login"
8

  
9
# Set the expiration time of newly created auth tokens
10
# to be this many hours after their creation time.
11
AUTH_TOKEN_DURATION = 30 * 24
12

  
13
# Enable receiving a temporary auth token (using the ?test URL parameter) that
14
# bypasses the authentication mechanism.
15
#
16
# Make sure there is an actual user in the db whose token matches
17
# BYPASS_AUTHENTICATION_SECRET_TOKEN.
18
#
19
# WARNING, ACHTUNG, README, etc: DO NOT ENABLE THIS ON DEPLOYED VERSIONS!
20
#
21
BYPASS_AUTHENTICATION = False
22
BYPASS_AUTHENTICATION_SECRET_TOKEN = '5e41595e9e884543fa048e07c1094d74'
23

  
24
# Urls that bypass Shibboleth authentication
25
AAI_SKIP_AUTH_URLS = ['/api', '/plankton', '/invitations/login']
b/snf-app/synnefo/app_settings/default/admins.py
1
# -*- coding: utf-8 -*-
2
#
3
# Admin names and email addresses
4
##################################
5

  
6
ADMINS = (
7
    # ('Your Name', 'your_email@domain.com'),
8
)
9

  
10
MANAGERS = ADMINS
11

  
12
# Email configuration
13
EMAIL_HOST = "127.0.0.1"
14
EMAIL_HOST_USER = ""
15
EMAIL_HOST_PASSWORD = ""
16
EMAIL_SUBJECT_PREFIX = "[email-subject-prefix] "
17
DEFAULT_CHARSET = 'utf-8'
18

  
19
# Address to use for outgoing emails
20
DEFAULT_FROM_EMAIL = "~okeanos <no-reply@grnet.gr>"
b/snf-app/synnefo/app_settings/default/api.py
1
# -*- coding: utf-8 -*-
2
#
3
# API configuration
4
#####################
5

  
6
from deploy import *
7

  
8
# The API implementation needs to accept and return absolute references
9
# to its resources. Thus, it needs to know its public URL.
10
API_ROOT_URL = APP_INSTALL_URL + '/api'
11

  
12
# The API will return HTTP Bad Request if the ?changes-since
13
# parameter refers to a point in time more than POLL_LIMIT seconds ago.
14
POLL_LIMIT = 3600
15

  
16
#
17
# Network Configuration
18
#
19

  
20
# Synnefo assigns this link id to NICs connected on the public network.
21
# An IP pool should be associated with this link by the Ganeti administrator.
22
GANETI_PUBLIC_LINK = 'snf_public'
23
# This link id is assigned to NICs that should be isolated from anything else
24
# (e.g., right before the NIC gets deleted).
25
# This value is also hardcoded in a fixture in db/fixtures/initial_data.json.
26
GANETI_NULL_LINK = 'snf_null'
27

  
28
# The pool of private network links to use is
29
# $GANETI_LINK_PREFIX{1..$GANETI_MAX_LINK_NUMBER}.
30
#
31
# The prefix to use for private network links.
32
GANETI_LINK_PREFIX = 'prv'
33
# The number of private network links to use.
34
GANETI_MAX_LINK_NUMBER = 100
35
# Firewalling
36
GANETI_FIREWALL_ENABLED_TAG = 'synnefo:network:0:protected'
37
GANETI_FIREWALL_DISABLED_TAG = 'synnefo:network:0:unprotected'
38
GANETI_FIREWALL_PROTECTED_TAG = 'synnefo:network:0:limited'
39

  
40
# The default firewall profile that will be in effect if no tags are defined
41
DEFAULT_FIREWALL_PROFILE = 'DISABLED'
42

  
43
# our REST API would prefer to be explicit about trailing slashes
44
APPEND_SLASH = False
45

  
46
# Ignore disk size specified by flavor, always build the
47
# machine with a 4GB (in the case of Windows: 14GB) disk.
48
# This setting is helpful in development setups.
49
#
50
IGNORE_FLAVOR_DISK_SIZES = False
51

  
52
# Quota
53
#
54
# Maximum number of VMs a user is allowed to have
55
MAX_VMS_PER_USER = 3
56

  
57
# URL templates for the stat graphs.
58
# The API implementation replaces '%s' with the encrypted backend id.
59
# FIXME: For now we do not encrypt the backend id.
60
CPU_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-bar.png'
61
CPU_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-ts.png'
62
NET_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-bar.png'
63
NET_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-ts.png'
64

  
65
# Recommended refresh period for server stats
66
STATS_REFRESH_PERIOD = 60
67

  
68
# The maximum number of file path/content pairs that can be supplied on server
69
# build
70
MAX_PERSONALITY = 5
71

  
72
# The maximum size, in bytes, for each personality file
73
MAX_PERSONALITY_SIZE = 10240
74

  
75
# Available storage types to be used as disk templates
76
GANETI_DISK_TEMPLATES = ('blockdev', 'diskless', 'drbd', 'file', 'plain',
77
                         'rbd',  'sharedfile')
78
DEFAULT_GANETI_DISK_TEMPLATE = 'drbd'
b/snf-app/synnefo/app_settings/default/apps.py
1
# -*- coding: utf-8 -*-
2
#
3
# Core Django settings
4
##################################
5

  
6
INSTALLED_APPS = (
7
    'django.contrib.contenttypes',
8
    'django.contrib.sessions',
9
    'django.contrib.sites',
10
    'django.contrib.messages',
11
    'django.contrib.admin',
12
    'synnefo.aai',
13
    'synnefo.admin',
14
    'synnefo.api',
15
    'synnefo.ui',
16
    'synnefo.db',
17
    'synnefo.logic',
18
    'synnefo.invitations',
19
    'synnefo.helpdesk',
20
    'synnefo.plankton',
21
    'synnefo.ui.userdata',
22
    'south'
23
)
24

  
25
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
26

  
27
# List of callables that know how to import templates from various sources.
28
TEMPLATE_LOADERS = (
29
    'django.template.loaders.filesystem.Loader',
30
    'django.template.loaders.app_directories.Loader',
31
#     'django.template.loaders.eggs.Loader',
32
)
33

  
34
TEMPLATE_CONTEXT_PROCESSORS = (
35
    'django.core.context_processors.request',
36
    'django.core.context_processors.i18n',
37
    'django.contrib.auth.context_processors.auth',
38
    'django.core.context_processors.media'
39
)
40

  
41
MIDDLEWARE_CLASSES = (
42
    'django.contrib.sessions.middleware.SessionMiddleware',
43
    'synnefo.aai.middleware.SynnefoAuthMiddleware',
44
    'synnefo.api.middleware.ApiAuthMiddleware',
45
    'synnefo.helpdesk.middleware.HelpdeskMiddleware',
46
    'django.middleware.locale.LocaleMiddleware',
47
    'django.middleware.common.CommonMiddleware',
48
    'django.contrib.messages.middleware.MessageMiddleware'
49
)
50

  
51
ROOT_URLCONF = 'synnefo.urls'
52

  
53
TEMPLATE_DIRS = (
54
    # Put strings here, like "/home/html/django_templates"
55
    # or "C:/www/django/templates".
56
    # Always use forward slashes, even on Windows.
57
    # Don't forget to use absolute paths, not relative paths.
58
)
59

  
60
LANGUAGES = (
61
  #('el', u'Ελληνικά'),
62
  ('en', 'English'),
63
)
64

  
65
# Local time zone for this installation. Choices can be found here:
66
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
67
# although not all choices may be available on all operating systems.
68
# On Unix systems, a value of None will cause Django to use the same
69
# timezone as the operating system.
70
# If running in a Windows environment this must be set to the same as your
71
# system time zone.
72
TIME_ZONE = 'UTC'   # Warning: The API depends on the TIME_ZONE being UTC
73

  
b/snf-app/synnefo/app_settings/default/backend.py
1
# -*- coding: utf-8 -*-
2
#
3
# Ganeti backend configuration
4
###################################
5

  
6
# The RAPI endpoint and associated credentials to use
7
# for talking to the Ganeti backend.
8
GANETI_MASTER_IP = "10.0.0.1"
9
GANETI_CLUSTER_INFO = (GANETI_MASTER_IP, 5080, "username", "password")
10

  
11
# This prefix gets used when determining the instance names
12
# of Synnefo VMs at the Ganeti backend.
13
# The dash must always appear in the name!
14
BACKEND_PREFIX_ID = "snf-"
15

  
16
# The following dictionary defines deployment-specific
17
# arguments to the RAPI CreateInstance call.
18
# At a minimum it should contain the
19
# 'disk_template', 'os_provider', and 'hvparams' keys.
20
#
21
# More specifically:
22
# a) disk_template:
23
#    The disk template to use when creating the instance.
24
#    Suggested values: 'plain', or 'drbd'.
25
# b) os:
26
#    The OS provider to use (customized Ganeti Instance Image)
27
# c) hvparams:
28
#    Hypervisor-specific parameters (serial_console = False, see #785)
29
# d) If using the DRBD disk_template, you may want to include
30
#    wait_for_sync = False (see #835).
31
#
32
GANETI_CREATEINSTANCE_KWARGS = {
33
    'os': 'snf-image+default',
34
    'hvparams': {'serial_console': False},
35
    'wait_for_sync': False}
b/snf-app/synnefo/app_settings/default/database.py
1
# -*- coding: utf-8 -*-
2
#
3
# Database settings
4
####################
5

  
6
import os
7

  
8
DEFAULT_DB_PATH = '/usr/share/synnefo/'
9
DATABASES = {
10
    'default': {
11
        # 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle'
12
        'ENGINE': 'sqlite3',
13
         # ATTENTION: This *must* be the absolute path if using sqlite3.
14
         # See: http://docs.djangoproject.com/en/dev/ref/settings/#name
15
        'NAME': os.path.join(DEFAULT_DB_PATH, 'database.sqlite'),
16
        'USER': '',                      # Not used with sqlite3.
17
        'PASSWORD': '',                  # Not used with sqlite3.
18
        # Set to empty string for localhost. Not used with sqlite3.
19
        'HOST': '',
20
        # Set to empty string for default. Not used with sqlite3.
21
        'PORT': '',
22
    }
23
}
24

  
25
if DATABASES['default']['ENGINE'].endswith('mysql'):
26
    DATABASES['default']['OPTIONS'] = {
27
            'init_command': 'SET storage_engine=INNODB; ' +
28
                'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
29
    }
b/snf-app/synnefo/app_settings/default/deploy.py
1
# -*- coding: utf-8 -*-
2
#
3
# Deployment
4
##################################
5

  
6
DEBUG = True
7
TEMPLATE_DEBUG = DEBUG
8

  
9
# Top-level URL for deployment. Numerous other URLs depend on this.
10
APP_INSTALL_URL = "https://host:port"
11

  
12
# Make this unique, and don't share it with anybody.
13
SECRET_KEY = 'ly6)mw6a7x%n)-e#zzk4jo6f2=uqu!1o%)2-(7lo+f9yd^k^bg'
b/snf-app/synnefo/app_settings/default/helpdesk.py
1
# -*- coding: utf-8 -*-
2
#
3
# Helpdesk application
4
#
5

  
6
# Duration for temporary auth tokens, created for impersonating a registered
7
# user by helpdesk staff.
8
HELPDESK_TOKEN_DURATION_MIN = 30
9

  
10
# IP addresses of the machines allowed to connect as help desk
11
HELPDESK_ALLOWED_IPS = ("127.0.0.1",)
12

  
b/snf-app/synnefo/app_settings/default/invitations.py
1
# -*- coding: utf-8 -*-
2
#
3
# Invitations settings
4
##################################
5

  
6

  
7
# Max number of invitations allowed per level
8
INVITATIONS_PER_LEVEL = {
9
   #Level  #Max Invitations
10
    0   :   10000,
11
    1   :   3,
12
    2   :   2,
13
    3   :   1,
14
    4   :   0
15
}
16

  
17
# Key to encrypt X-Auth-Token with when sending invitations
18
INVITATION_ENCR_KEY = '8d342f6e7a0366c632978a80257019af'
19

  
20
# Days for which an invitation is active
21
INVITATION_VALID_DAYS = 180
b/snf-app/synnefo/app_settings/default/logging.py
1
# -*- coding: utf-8 -*-
2
#
3
# Logging configuration
4
##################################
5

  
6
LOGGING = {
7
    'version': 1,
8
    'disable_existing_loggers': True,
9
    
10
    'formatters': {
11
        'simple': {
12
            'format': '%(message)s'
13
        },
14
        'verbose': {
15
            'format': '%(asctime)s [%(levelname)s] %(message)s'
16
        },
17
        'django': {
18
            'format': '[%(asctime)s] %(levelname)s %(message)s',
19
            'datefmt': '%d/%b/%Y %H:%M:%S'
20
        },
21
    },
22
    
23
    'handlers': {
24
        'null': {
25
            'class': 'logging.NullHandler',
26
        },
27
        'console': {
28
            'class': 'logging.StreamHandler',
29
            'formatter': 'django'
30
        },
31
        'syslog': {
32
            'class': 'logging.handlers.SysLogHandler',
33
            'address': '/dev/log',
34
#            'address': ('localhost', 514),
35
            'facility': 'daemon',
36
            'formatter': 'verbose',
37
            'level': 'INFO',
38
        },
39
    },
40
    
41
    'loggers': {
42
        'synnefo': {
43
            'handlers': ['syslog'],
44
            'level': 'INFO'
45
        },
46
        'synnefo.admin': {
47
            'level': 'INFO',
48
            'propagate': 1
49
        },
50
        'synnefo.api': {
51
            'level': 'INFO',
52
            'propagate': 1
53
        },
54
        'synnefo.db': {
55
            'level': 'INFO',
56
            'propagate': 1
57
        },
58
        'synnefo.logic': {
59
            'level': 'INFO',
60
            'propagate': 1
61
        },
62
    }    
63
}
64

  
65

  
66
DISPATCHER_LOGGING = {
67
    'version': 1,
68
    'disable_existing_loggers': True,
69
    
70
    'formatters': {
71
        'verbose': {
72
            'format': '%(asctime)s [%(levelname)s] %(message)s'
73
        },
74
    },
75
    
76
    'handlers': {
77
        'console': {
78
            'class': 'logging.StreamHandler',
79
            'formatter': 'verbose'
80
        },
81
        'file': {
82
            'class': 'logging.handlers.WatchedFileHandler',
83
            'filename': '/var/log/synnefo/dispatcher.log',
84
            'formatter': 'verbose',
85
            'level': 'DEBUG'
86
        },
87
    },
88
    
89
    'loggers': {
90
        'synnefo': {'propagate': 1}
91
    },
92
    
93
    'root': {
94
        'handlers': ['console', 'file'],
95
        'level': 'DEBUG',
96
    }
97
}
98

  
99

  
100
SNFADMIN_LOGGING = {
101
    'version': 1,
102
    'disable_existing_loggers': True,
103
    
104
    'formatters': {
105
        'verbose': {
106
            'format': '%(asctime)s [%(levelname)s] %(message)s'
107
        },
108
    },
109
    
110
    'handlers': {
111
        'console': {
112
            'class': 'logging.StreamHandler',
113
            'formatter': 'verbose'
114
        },
115
    },
116
    
117
    'loggers': {
118
        'synnefo': {'propagate': 1}
119
    },
120
    
121
    'root': {
122
        'handlers': ['console'],
123
        'level': 'DEBUG',
124
    }
125
}
b/snf-app/synnefo/app_settings/default/plankton.py
1
# -*- coding: utf-8 -*-
2
#
3
# Plankton configuration
4
########################
5

  
6
from os.path import join
7

  
8
# Backend settings
9
PITHOS_ROOT = '/usr/share/pithos'
10
BACKEND_DB_MODULE = 'pithos.backends.lib.sqlalchemy'
11
BACKEND_DB_CONNECTION = 'sqlite:///' + join(PITHOS_ROOT, 'backend.db')
12
BACKEND_BLOCK_MODULE = 'pithos.backends.lib.hashfiler'
13
BACKEND_BLOCK_PATH = join(PITHOS_ROOT, 'data/')
14

  
15
# Default settings for new accounts.
16
DEFAULT_QUOTA = 50 * 1024**3
17
DEFAULT_VERSIONING = 'auto'
18

  
19
# The Pithos container where all images are stored
20
PITHOS_IMAGE_CONTAINER = 'images'
21

  
22
ALLOWED_DISK_FORMATS = ('diskdump', 'dump', 'extdump', 'lvm', 'ntfsclone',
23
        'ntfsdump')
24
ALLOWED_CONTAINER_FORMATS = ('aki', 'ari', 'ami', 'bare', 'ovf')
25

  
26
DEFAULT_DISK_FORMAT = 'dump'
27
DEFAULT_CONTAINER_FORMAT = 'bare'
28

  
29
# The owner of the images that will be marked as "system images" by the UI
30
SYSTEM_IMAGES_OWNER = 'okeanos'
b/snf-app/synnefo/app_settings/default/queues.py
1
# -*- coding: utf-8 -*-
2
#
3
# Queues, exchanges and bindings for AMQP
4
###########################################
5

  
6
# Rabbit work queue endpoint
7
RABBIT_HOST = "10.0.0.1:5672"
8
RABBIT_USERNAME = "username"
9
RABBIT_PASSWORD = "password"
10
RABBIT_VHOST = "/"
11

  
12
EXCHANGE_GANETI = "ganeti"  # Messages from Ganeti
13
EXCHANGE_CRON = "cron"      # Messages from periodically triggered tasks
14
EXCHANGE_API = "api"        # Messages from the REST API
15
EXCHANGES = (EXCHANGE_GANETI, EXCHANGE_CRON, EXCHANGE_API)
b/snf-app/synnefo/app_settings/default/reconciliation.py
1
# -*- coding: utf-8 -*-
2
#
3
# Reconciliations
4
###################
5

  
6
# Minutes between reconciliations
7
RECONCILIATION_MIN = 30
8

  
b/snf-app/synnefo/app_settings/default/site.py
1
# -*- coding: utf-8 -*-
2
#
3
# Site-specific Django conf
4
##################################
5

  
6
# Language code for this installation. All choices can be found here:
7
# http://www.i18nguy.com/unicode/language-identifiers.html
8
LANGUAGE_CODE = 'en-us'
9

  
10
# FIXME?
11
SITE_ID = 1
12

  
13
# If you set this to False, Django will make some optimizations so as not
14
# to load the internationalization machinery.
15
USE_I18N = True
16

  
17
# If you set this to False, Django will not format dates, numbers and
18
# calendars according to the current locale
19
USE_L10N = True
20

  
21
# Absolute path to the directory that holds media.
22
# Example: "/home/media/media.lawrence.com/"
23
MEDIA_ROOT = ''
24

  
25
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
26
# trailing slash if there is a path component (optional in other cases).
27
# Examples: "http://media.lawrence.com", "http://example.com/media/"
28
MEDIA_URL = '/static/'
29

  
30
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
31
# trailing slash.
32
# Examples: "http://foo.com/media/", "/media/".
33
ADMIN_MEDIA_PREFIX = '/media/'
34

  
35
# app/directory static files map, used by link_static command to create
36
# appropriate symlinks for static files
37
STATIC_FILES = {
38
    'synnefo.ui': '',
39
    'synnefo.admin': 'admin',
40
}
b/snf-app/synnefo/app_settings/default/tests.py
1
# -*- coding: utf-8 -*-
2
#
3
# Special unit test mode
4
#########################
5

  
6
# A quick-n-dirty way which sets settings.TEST
7
# if we're running unit tests.
8
import sys, os
9
TEST = False
10
if len(sys.argv) >= 2:
11
    if os.path.basename(sys.argv[0]) == 'manage.py' and \
12
        (sys.argv[1] == 'test' or sys.argv[1] == 'hudson'):
13
            TEST = True
b/snf-app/synnefo/app_settings/default/ui.py
1
# -*- coding: utf-8 -*-
2
#
3
# UI settings
4
###################
5

  
6
from admins import *
7
from site import *
8

  
9
# base url for ui static files
10
# if not set, defaults to MEDIA_URL + 'snf-<latest_ui_version>/'
11
UI_MEDIA_URL = MEDIA_URL + 'snf/'
12

  
13
# UI requests to the API layer time out after that many milliseconds
14
TIMEOUT = 10 * 1000
15

  
16
# A list of suggested server tags (server metadata keys)
17
DEFAULT_KEYWORDS = ["OS", "Role", "Location", "Owner"]
18

  
19
# A list of allowed icons for OS Images
20
IMAGE_ICONS = ["redhat", "ubuntu", "debian", "windows", "gentoo", "archlinux",
21
               "centos", "fedora", "freebsd", "netbsd", "openbsd", "slackware",
22
               "suse", "kubuntu"]
23

  
24
# How often should the UI request changes from the API
25
UI_UPDATE_INTERVAL = 5000
26

  
27
# Milieconds to increase the interval after UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT calls
28
# of recurrent api requests
29
UI_UPDATE_INTERVAL_INCREASE = UI_UPDATE_INTERVAL / 4
30
UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT = 4
31

  
32
# Maximum update interval
33
UI_UPDATE_INTERVAL_MAX = UI_UPDATE_INTERVAL * 3
34

  
35
# Fast update interval
36
UI_UPDATE_INTERVAL_FAST = UI_UPDATE_INTERVAL / 2
37

  
38
# List of emails used for sending the feedback messages to (following the ADMINS format)
39
FEEDBACK_CONTACTS = (
40
    # ('Contact Name', 'contact_email@domain.com'),
41
)
42

  
43
# Email from which the feedback emails will be sent from
44
FEEDBACK_EMAIL_FROM = DEFAULT_FROM_EMAIL
45

  
46
# URL to redirect user to when he logs out from the ui (if not set
47
# settings.LOGIN_URL will be used)
48
#LOGOUT_URL = ""
49

  
50
# Flavor options that we provide to the user as predefined
51
# cpu/ram/disk combinations on vm create wizard
52
VM_CREATE_SUGGESTED_FLAVORS = {
53
    'small': {
54
        'cpu': 1,
55
        'ram': 1024,
56
        'disk': 20,
57
        'disk_template': 'drbd'
58
    },
59
    'medium': {
60
        'cpu': 2,
61
        'ram': 2048,
62
        'disk': 30,
63
        'disk_template': 'drbd'
64

  
65
    },
66
    'large': {
67
        'cpu': 4,
68
        'ram': 4096,
69
        'disk': 40,
70
        'disk_template': 'drbd'
71

  
72
    }
73
}
74

  
75
# A list of metadata keys to clone from image
76
# to the virtual machine on its creation.
77
VM_IMAGE_COMMON_METADATA = ["OS", "loginname", "logindomain"]
78

  
79
# A list of suggested vm roles to display to user on create wizard
80
VM_CREATE_SUGGESTED_ROLES = ["Database server", "File server", "Mail server", "Web server", "Proxy"]
81

  
82
# Template to be used for suggesting the user a default name for newly created
83
# vms. {0} gets replaced by the image OS value
84
VM_CREATE_NAME_TPL = "My {0} server"
85

  
86
# Name/description metadata for the available flavor disk templates
87
# Dict key is the disk_template value as stored in database
88
UI_FLAVORS_DISK_TEMPLATES_INFO = {
89
    'drbd': {'name': 'DRBD',
90
             'description': 'DRBD storage.'},
91
}
92

  
93
#######################
94
# UI BEHAVIOUR SETTINGS
95
#######################
96

  
97
# Whether to increase the time of recurrent requests (networks/vms update) if
98
# window loses its focus
99
UI_DELAY_ON_BLUR = False
100

  
101
# Whether not visible vm views will update their content if vm changes
102
UI_UPDATE_HIDDEN_VIEWS = False
103

  
104
# After how many timeouts of reccurent ajax requests to display the timeout
105
# error overlay
106
UI_SKIP_TIMEOUTS = 1
107

  
108
# Whether UI should display error overlay for all Javascript exceptions
109
UI_HANDLE_WINDOW_EXCEPTIONS = True
110

  
111
# A list of os names that support ssh public key assignment
112
UI_SUPPORT_SSH_OS_LIST = ['debian', 'fedora', 'okeanos', 'ubuntu', 'kubuntu', 'centos']
113

  
114
# OS/username map to identify default user name for the specified os
115
UI_OS_DEFAULT_USER_MAP = {
116
    'debian':'root', 'fedora': 'root', 'okeanos': 'root',
117
    'ubuntu': 'root', 'kubuntu': 'root', 'centos': 'root',
118
    'windows': 'Administrator'
119
}
b/snf-app/synnefo/app_settings/default/userdata.py
1
# -*- coding: utf-8 -*-
2
#
3
# Userdata settings
4
###################
5

  
6
# Genetared SSH key bits length
7
USERDATA_SSH_KEY_LENGTH = 2048
8

  
9
# Generated SSH key exponent
10
USERDATA_SSH_KEY_EXPONENT = 65537
11

  
12
# Maximum number of ssh keys a user is allowed to have
13
USERDATA_MAX_SSH_KEYS_PER_USER = 10
b/snf-app/synnefo/manage.py
4 4
BaseCommand, LaxOptionParser, handle_default_options
5 5

  
6 6
from optparse import Option, make_option
7
from synnefo import get_version
7
from synnefo.version import get_component_version
8 8

  
9 9
import sys
10 10
import os
......
36 36
        # These options could affect the commands that are available, so they
37 37
        # must be processed early.
38 38
        parser = LaxOptionParser(usage="%prog subcommand [options] [args]",
39
                                 version=get_version(),
39
                                 version=get_component_version('synnefo.manage'),
40 40
                                 option_list=option_list)
41 41
        self.autocomplete()
42 42
        try:
/dev/null
1
# Copyright 2011 GRNET S.A. All rights reserved.
2
#
3
# Redistribution and use in source and binary forms, with or
4
# without modification, are permitted provided that the following
5
# conditions are met:
6
#
7
#   1. Redistributions of source code must retain the above
8
#      copyright notice, this list of conditions and the following
9
#      disclaimer.
10
#
11
#   2. Redistributions in binary form must reproduce the above
12
#      copyright notice, this list of conditions and the following
13
#      disclaimer in the documentation and/or other materials
14
#      provided with the distribution.
15
#
16
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
# POSSIBILITY OF SUCH DAMAGE.
28
#
29
# The views and conclusions contained in the software and
30
# documentation are those of the authors and should not be
31
# interpreted as representing official policies, either expressed
32
# or implied, of GRNET S.A.
33

  
34
import os
35
import sys
36
import glob
37

  
38
# import common settings
39
from synnefo.settings.common import *
40

  
41
SYNNEFO_SETTINGS_DIR = os.environ.get('SYNNEFO_SETTINGS_DIR', "/etc/synnefo/")
42

  
43
if os.path.exists(SYNNEFO_SETTINGS_DIR):
44
    # extend common settings with settings set in /etc/synnefo dir
45
    conffiles = glob.glob(os.path.join(SYNNEFO_SETTINGS_DIR, '*.conf'))
46
    conffiles.sort()
47
    for f in conffiles:
48
        try:
49
            execfile(os.path.abspath(f))
50
        except Exception as e:
51
            print >>sys.stderr, "Failed to read settings file: %s" % \
52
                                os.path.abspath(f)
/dev/null
1
# Copyright 2011 GRNET S.A. All rights reserved.
2
#
3
# Redistribution and use in source and binary forms, with or
4
# without modification, are permitted provided that the following
5
# conditions are met:
6
#
7
#   1. Redistributions of source code must retain the above
8
#      copyright notice, this list of conditions and the following
9
#      disclaimer.
10
#
11
#   2. Redistributions in binary form must reproduce the above
12
#      copyright notice, this list of conditions and the following
13
#      disclaimer in the documentation and/or other materials
14
#      provided with the distribution.
15
#
16
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
# POSSIBILITY OF SUCH DAMAGE.
28
#
29
# The views and conclusions contained in the software and
30
# documentation are those of the authors and should not be
31
# interpreted as representing official policies, either expressed
32
# or implied, of GRNET S.A.
33

  
34
from synnefo.settings.common.admins import *
35
from synnefo.settings.common.apps import *
36
from synnefo.settings.common.deploy import *
37
from synnefo.settings.common.logging import *
38
from synnefo.settings.common.site import *
39
from synnefo.settings.common.backend import *
40
from synnefo.settings.common.database import *
41
from synnefo.settings.common.queues import *
42
from synnefo.settings.common.api import *
43
from synnefo.settings.common.plankton import *
44
from synnefo.settings.common.ui import *
45
from synnefo.settings.common.userdata import *
46
from synnefo.settings.common.aai import *
47
from synnefo.settings.common.invitations import *
48
from synnefo.settings.common.reconciliation import *
49
from synnefo.settings.common.helpdesk import *
50
from synnefo.settings.common.tests import *
51

  
/dev/null
1
# -*- coding: utf-8 -*-
2
#
3
# AAI configuration
4
#####################
5

  
6
# Unauthenticated HTTP requests to the UI get redirected to this URL
7
LOGIN_URL = "/login"
8

  
9
# Set the expiration time of newly created auth tokens
10
# to be this many hours after their creation time.
11
AUTH_TOKEN_DURATION = 30 * 24
12

  
13
# Enable receiving a temporary auth token (using the ?test URL parameter) that
14
# bypasses the authentication mechanism.
15
#
16
# Make sure there is an actual user in the db whose token matches
17
# BYPASS_AUTHENTICATION_SECRET_TOKEN.
18
#
19
# WARNING, ACHTUNG, README, etc: DO NOT ENABLE THIS ON DEPLOYED VERSIONS!
20
#
21
BYPASS_AUTHENTICATION = False
22
BYPASS_AUTHENTICATION_SECRET_TOKEN = '5e41595e9e884543fa048e07c1094d74'
23

  
24
# Urls that bypass Shibboleth authentication
25
AAI_SKIP_AUTH_URLS = ['/api', '/plankton', '/invitations/login']
/dev/null
1
# -*- coding: utf-8 -*-
2
#
3
# Admin names and email addresses
4
##################################
5

  
6
ADMINS = (
7
    # ('Your Name', 'your_email@domain.com'),
8
)
9

  
10
MANAGERS = ADMINS
11

  
12
# Email configuration
13
EMAIL_HOST = "127.0.0.1"
14
EMAIL_HOST_USER = ""
15
EMAIL_HOST_PASSWORD = ""
16
EMAIL_SUBJECT_PREFIX = "[email-subject-prefix] "
17
DEFAULT_CHARSET = 'utf-8'
18

  
19
# Address to use for outgoing emails
20
DEFAULT_FROM_EMAIL = "~okeanos <no-reply@grnet.gr>"
/dev/null
1
# -*- coding: utf-8 -*-
2
#
3
# API configuration
4
#####################
5

  
6
from deploy import *
7

  
8
# The API implementation needs to accept and return absolute references
9
# to its resources. Thus, it needs to know its public URL.
10
API_ROOT_URL = APP_INSTALL_URL + '/api'
11

  
12
# The API will return HTTP Bad Request if the ?changes-since
13
# parameter refers to a point in time more than POLL_LIMIT seconds ago.
14
POLL_LIMIT = 3600
15

  
16
#
17
# Network Configuration
18
#
19

  
20
# Synnefo assigns this link id to NICs connected on the public network.
21
# An IP pool should be associated with this link by the Ganeti administrator.
22
GANETI_PUBLIC_LINK = 'snf_public'
23
# This link id is assigned to NICs that should be isolated from anything else
24
# (e.g., right before the NIC gets deleted).
25
# This value is also hardcoded in a fixture in db/fixtures/initial_data.json.
26
GANETI_NULL_LINK = 'snf_null'
27

  
28
# The pool of private network links to use is
29
# $GANETI_LINK_PREFIX{1..$GANETI_MAX_LINK_NUMBER}.
30
#
31
# The prefix to use for private network links.
32
GANETI_LINK_PREFIX = 'prv'
33
# The number of private network links to use.
34
GANETI_MAX_LINK_NUMBER = 100
35
# Firewalling
36
GANETI_FIREWALL_ENABLED_TAG = 'synnefo:network:0:protected'
37
GANETI_FIREWALL_DISABLED_TAG = 'synnefo:network:0:unprotected'
38
GANETI_FIREWALL_PROTECTED_TAG = 'synnefo:network:0:limited'
39

  
40
# The default firewall profile that will be in effect if no tags are defined
41
DEFAULT_FIREWALL_PROFILE = 'DISABLED'
42

  
43
# our REST API would prefer to be explicit about trailing slashes
44
APPEND_SLASH = False
45

  
46
# Ignore disk size specified by flavor, always build the
47
# machine with a 4GB (in the case of Windows: 14GB) disk.
48
# This setting is helpful in development setups.
49
#
50
IGNORE_FLAVOR_DISK_SIZES = False
51

  
52
# Quota
53
#
54
# Maximum number of VMs a user is allowed to have
55
MAX_VMS_PER_USER = 3
56

  
57
# URL templates for the stat graphs.
58
# The API implementation replaces '%s' with the encrypted backend id.
59
# FIXME: For now we do not encrypt the backend id.
60
CPU_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-bar.png'
61
CPU_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-ts.png'
62
NET_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-bar.png'
63
NET_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-ts.png'
64

  
65
# Recommended refresh period for server stats
66
STATS_REFRESH_PERIOD = 60
67

  
68
# The maximum number of file path/content pairs that can be supplied on server
69
# build
70
MAX_PERSONALITY = 5
71

  
72
# The maximum size, in bytes, for each personality file
73
MAX_PERSONALITY_SIZE = 10240
74

  
75
# Available storage types to be used as disk templates
76
GANETI_DISK_TEMPLATES = ('blockdev', 'diskless', 'drbd', 'file', 'plain',
77
                         'rbd',  'sharedfile')
78
DEFAULT_GANETI_DISK_TEMPLATE = 'drbd'
/dev/null
1
# -*- coding: utf-8 -*-
2
#
3
# Core Django settings
4
##################################
5

  
6
INSTALLED_APPS = (
7
    'django.contrib.contenttypes',
8
    'django.contrib.sessions',
9
    'django.contrib.sites',
10
    'django.contrib.messages',
11
    'django.contrib.admin',
12
    'synnefo.aai',
13
    'synnefo.admin',
14
    'synnefo.api',
15
    'synnefo.ui',
16
    'synnefo.db',
17
    'synnefo.logic',
18
    'synnefo.invitations',
19
    'synnefo.helpdesk',
20
    'synnefo.plankton',
21
    'synnefo.ui.userdata',
22
    'south'
23
)
24

  
25
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
26

  
27
# List of callables that know how to import templates from various sources.
28
TEMPLATE_LOADERS = (
29
    'django.template.loaders.filesystem.Loader',
30
    'django.template.loaders.app_directories.Loader',
31
#     'django.template.loaders.eggs.Loader',
32
)
33

  
34
TEMPLATE_CONTEXT_PROCESSORS = (
35
    'django.core.context_processors.request',
36
    'django.core.context_processors.i18n',
37
    'django.contrib.auth.context_processors.auth',
38
    'django.core.context_processors.media'
39
)
40

  
41
MIDDLEWARE_CLASSES = (
42
    'django.contrib.sessions.middleware.SessionMiddleware',
43
    'synnefo.aai.middleware.SynnefoAuthMiddleware',
44
    'synnefo.api.middleware.ApiAuthMiddleware',
45
    'synnefo.helpdesk.middleware.HelpdeskMiddleware',
46
    'django.middleware.locale.LocaleMiddleware',
47
    'django.middleware.common.CommonMiddleware',
48
    'django.contrib.messages.middleware.MessageMiddleware'
49
)
50

  
51
ROOT_URLCONF = 'synnefo.urls'
52

  
53
TEMPLATE_DIRS = (
54
    # Put strings here, like "/home/html/django_templates"
55
    # or "C:/www/django/templates".
56
    # Always use forward slashes, even on Windows.
57
    # Don't forget to use absolute paths, not relative paths.
58
)
59

  
60
LANGUAGES = (
61
  #('el', u'Ελληνικά'),
62
  ('en', 'English'),
63
)
64

  
65
# Local time zone for this installation. Choices can be found here:
66
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
67
# although not all choices may be available on all operating systems.
68
# On Unix systems, a value of None will cause Django to use the same
69
# timezone as the operating system.
70
# If running in a Windows environment this must be set to the same as your
71
# system time zone.
72
TIME_ZONE = 'UTC'   # Warning: The API depends on the TIME_ZONE being UTC
73

  
/dev/null
1
# -*- coding: utf-8 -*-
2
#
3
# Ganeti backend configuration
4
###################################
5

  
6
# The RAPI endpoint and associated credentials to use
7
# for talking to the Ganeti backend.
8
GANETI_MASTER_IP = "10.0.0.1"
9
GANETI_CLUSTER_INFO = (GANETI_MASTER_IP, 5080, "username", "password")
10

  
11
# This prefix gets used when determining the instance names
12
# of Synnefo VMs at the Ganeti backend.
13
# The dash must always appear in the name!
14
BACKEND_PREFIX_ID = "snf-"
15

  
16
# The following dictionary defines deployment-specific
17
# arguments to the RAPI CreateInstance call.
18
# At a minimum it should contain the
19
# 'disk_template', 'os_provider', and 'hvparams' keys.
20
#
21
# More specifically:
22
# a) disk_template:
23
#    The disk template to use when creating the instance.
24
#    Suggested values: 'plain', or 'drbd'.
25
# b) os:
26
#    The OS provider to use (customized Ganeti Instance Image)
27
# c) hvparams:
28
#    Hypervisor-specific parameters (serial_console = False, see #785)
29
# d) If using the DRBD disk_template, you may want to include
30
#    wait_for_sync = False (see #835).
31
#
32
GANETI_CREATEINSTANCE_KWARGS = {
33
    'os': 'snf-image+default',
34
    'hvparams': {'serial_console': False},
35
    'wait_for_sync': False}
/dev/null
1
# -*- coding: utf-8 -*-
2
#
3
# Database settings
4
####################
5

  
6
import os
7

  
8
DEFAULT_DB_PATH = '/usr/share/synnefo/'
9
DATABASES = {
10
    'default': {
11
        # 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle'
12
        'ENGINE': 'sqlite3',
13
         # ATTENTION: This *must* be the absolute path if using sqlite3.
14
         # See: http://docs.djangoproject.com/en/dev/ref/settings/#name
15
        'NAME': os.path.join(DEFAULT_DB_PATH, 'database.sqlite'),
16
        'USER': '',                      # Not used with sqlite3.
17
        'PASSWORD': '',                  # Not used with sqlite3.
18
        # Set to empty string for localhost. Not used with sqlite3.
19
        'HOST': '',
20
        # Set to empty string for default. Not used with sqlite3.
21
        'PORT': '',
22
    }
23
}
24

  
25
if DATABASES['default']['ENGINE'].endswith('mysql'):
26
    DATABASES['default']['OPTIONS'] = {
27
            'init_command': 'SET storage_engine=INNODB; ' +
28
                'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
29
    }
/dev/null
1
# -*- coding: utf-8 -*-
2
#
3
# Deployment
4
##################################
5

  
6
DEBUG = True
7
TEMPLATE_DEBUG = DEBUG
8

  
9
# Top-level URL for deployment. Numerous other URLs depend on this.
10
APP_INSTALL_URL = "https://host:port"
11

  
12
# Make this unique, and don't share it with anybody.
13
SECRET_KEY = 'ly6)mw6a7x%n)-e#zzk4jo6f2=uqu!1o%)2-(7lo+f9yd^k^bg'
/dev/null
1
# -*- coding: utf-8 -*-
2
#
3
# Helpdesk application
4
#
5

  
6
# Duration for temporary auth tokens, created for impersonating a registered
7
# user by helpdesk staff.
8
HELPDESK_TOKEN_DURATION_MIN = 30
9

  
10
# IP addresses of the machines allowed to connect as help desk
11
HELPDESK_ALLOWED_IPS = ("127.0.0.1",)
12

  
/dev/null
1
# -*- coding: utf-8 -*-
2
#
3
# Invitations settings
4
##################################
5

  
6

  
7
# Max number of invitations allowed per level
8
INVITATIONS_PER_LEVEL = {
9
   #Level  #Max Invitations
10
    0   :   10000,
11
    1   :   3,
12
    2   :   2,
13
    3   :   1,
14
    4   :   0
15
}
16

  
17
# Key to encrypt X-Auth-Token with when sending invitations
18
INVITATION_ENCR_KEY = '8d342f6e7a0366c632978a80257019af'
19

  
20
# Days for which an invitation is active
21
INVITATION_VALID_DAYS = 180
/dev/null
1
# -*- coding: utf-8 -*-
2
#
3
# Logging configuration
4
##################################
5

  
6
LOGGING = {
7
    'version': 1,
8
    'disable_existing_loggers': True,
9
    
10
    'formatters': {
11
        'simple': {
12
            'format': '%(message)s'
13
        },
14
        'verbose': {
15
            'format': '%(asctime)s [%(levelname)s] %(message)s'
16
        },
17
        'django': {
18
            'format': '[%(asctime)s] %(levelname)s %(message)s',
19
            'datefmt': '%d/%b/%Y %H:%M:%S'
20
        },
21
    },
22
    
23
    'handlers': {
24
        'null': {
25
            'class': 'logging.NullHandler',
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff