Revision 390c7730

b/.gitignore
1
settings.py
2 1
docs/build
3 2
pithos/data
4 3
*.db
b/pithos/settings.d/00-apps.conf
1
# List of callables that know how to import templates from various sources.
2
TEMPLATE_LOADERS = (
3
    'django.template.loaders.filesystem.Loader',
4
    'django.template.loaders.app_directories.Loader',
5
)
6

  
7
MIDDLEWARE_CLASSES = (
8
    'django.middleware.common.CommonMiddleware',
9
    'pithos.middleware.LoggingConfigMiddleware',
10
    'pithos.middleware.AuthMiddleware'
11
)
12

  
13
ROOT_URLCONF = 'pithos.urls'
14

  
15
TEMPLATE_DIRS = (
16
    # Put strings here, like "/home/html/django_templates".
17
    # Always use forward slashes, even on Windows.
18
    # Don't forget to use absolute paths, not relative paths.
19
)
20

  
21
INSTALLED_APPS = (
22
    'pithos.api',
23
    'pithos.im',
24
    'pithos.public',
25
    'pithos.ui'
26
)
b/pithos/settings.d/00-deploy.conf
1
DEBUG = True
2
TEMPLATE_DEBUG = DEBUG
3

  
4
TEST = False
5

  
6
# Bypass authentication for user administration.
7
BYPASS_ADMIN_AUTH = False
8

  
9
ADMINS = (
10
    # ('Your Name', 'your_email@domain.com'),
11
)
12

  
13
MANAGERS = ADMINS
14

  
15
# Make this unique, and don't share it with anybody.
16
SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si'
17

  
18
# Address to use for outgoing emails
19
DEFAULT_FROM_EMAIL = 'Pithos <no-reply@grnet.gr>'
20
DEFAULT_CONTACT_EMAIL = 'support@pithos.grnet.gr'
21

  
22
FEEDBACK_FROM_EMAIL = DEFAULT_FROM_EMAIL
23
FEEDBACK_CONTACT_EMAIL = DEFAULT_CONTACT_EMAIL
24

  
25
# Use to log to a file.
26
LOGFILE = None
27

  
28
# The server is behind a proxy (apache and gunicorn setup).
29
USE_X_FORWARDED_HOST = False
30

  
31
# Set umask (needed for gunicorn setup).
32
#os.umask(0077)
b/pithos/settings.d/00-site.conf
1
# Local time zone for this installation. Choices can be found here:
2
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
3
# although not all choices may be available on all operating systems.
4
# On Unix systems, a value of None will cause Django to use the same
5
# timezone as the operating system.
6
# If running in a Windows environment this must be set to the same as your
7
# system time zone.
8
TIME_ZONE = 'UTC'
9

  
10
# Language code for this installation. All choices can be found here:
11
# http://www.i18nguy.com/unicode/language-identifiers.html
12
LANGUAGE_CODE = 'en-us'
13

  
14
SITE_ID = 1
15

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

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

  
24
# Absolute filesystem path to the directory that will hold user-uploaded files.
25
# Example: "/home/media/media.lawrence.com/"
26
MEDIA_ROOT = ''
27

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

  
33
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
34
# trailing slash.
35
# Examples: "http://foo.com/media/", "/media/".
36
ADMIN_MEDIA_PREFIX = '/media/'
b/pithos/settings.d/10-backend.conf
1
# The backend modules to use and their initilization options.
2

  
3
# SQLite.
4
#BACKEND_DB_MODULE = 'pithos.backends.lib.sqlite'
5
#BACKEND_DB_CONNECTION = join(PROJECT_PATH, 'backend.db')
6

  
7
# SQLAlchemy (choose SQLite/MySQL/PostgreSQL).
8
BACKEND_DB_MODULE = 'pithos.backends.lib.sqlalchemy'
9
BACKEND_DB_CONNECTION = 'sqlite:///' + join(PROJECT_PATH, 'backend.db')
10
#BACKEND_DB_CONNECTION = 'mysql://user:pass@host/db'
11
#BACKEND_DB_CONNECTION = 'postgresql://user:pass@host/db'
12

  
13
# Block storage.
14
BACKEND_BLOCK_MODULE = 'pithos.backends.lib.hashfiler'
15
BACKEND_BLOCK_PATH = join(PROJECT_PATH, 'data/')
b/pithos/settings.d/10-database.conf
1
DATABASES = {
2
    'default': {
3
        'ENGINE': 'django.db.backends.sqlite3',
4
        'NAME': join(PROJECT_PATH, 'pithos.db')
5
    }
6
}
b/pithos/settings.d/20-api.conf
1
# Default setting for new accounts.
2
DEFAULT_QUOTA = 50 * 1024 * 1024 * 1024
3
DEFAULT_VERSIONING = 'auto'
b/pithos/settings.d/20-im.conf
1
# Set the expiration time of newly created auth tokens
2
# to be this many hours after their creation time.
3
AUTH_TOKEN_DURATION = 30 * 24
4

  
5
# Authenticate via Twitter.
6
TWITTER_KEY = ''
7
TWITTER_SECRET = ''
8

  
9
INVITATIONS_PER_LEVEL = {
10
    0   :   100,
11
    1   :   2,
12
    2   :   0,
13
    3   :   0,
14
    4   :   0
15
}
16

  
17
SERVICE_NAME = 'Pithos'
18

  
19
# Where users should login with their invitation code
20
INVITATION_LOGIN_TARGET = '%s/im/login/invitation?code=%d&next=%s'
21

  
22
# Where users should activate their local account
23
ACTIVATION_LOGIN_TARGET = '%s/im/local/activate/?auth=%s&next=%s'
24

  
25
# Where users should reset their local password
26
PASSWORD_RESET_TARGET = '%s/im/local/reset/?username=%s&next=%s'
27

  
28
# Identity Management enabled modules
29
IM_STANDARD_MODULES = ['local', 'invitation']
30
IM_OTHER_MODULES = ['twitter', 'shibboleth']
31

  
32
# Force user profile verification
33
FORCE_PROFILE_UPDATE = False
b/pithos/settings.d/30-admin.conf
1
# Show these many users per page in admin interface.
2
ADMIN_PAGE_LIMIT = 100
b/pithos/settings.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 glob import glob
35
from os.path import abspath, dirname, join
36

  
37

  
38
PROJECT_PATH = dirname(abspath(__file__))
39

  
40

  
41
conffiles = glob(join(PROJECT_PATH, 'settings.d', '*.conf'))
42

  
43
for conf in sorted(conffiles):
44
    execfile(conf)
/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
# Django settings for pithos project.
35
import os
36

  
37
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
38

  
39
DEBUG = True
40
TEMPLATE_DEBUG = DEBUG
41

  
42
TEST = False
43

  
44
ADMINS = (
45
    # ('Your Name', 'your_email@domain.com'),
46
)
47

  
48
MANAGERS = ADMINS
49

  
50
DATABASES = {
51
    'default': {
52
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
53
        'NAME': PROJECT_PATH + 'pithos.db',		# Or path to database file if using sqlite3.
54
        'USER': '',                      # Not used with sqlite3.
55
        'PASSWORD': '',                  # Not used with sqlite3.
56
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
57
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
58
    }
59
}
60

  
61
# The backend modules to use and their initilization options.
62

  
63
# SQLite.
64
#BACKEND_DB_MODULE = 'pithos.backends.lib.sqlite'
65
#BACKEND_DB_CONNECTION = os.path.join(PROJECT_PATH, 'backend.db')
66

  
67
# SQLAlchemy (choose SQLite/MySQL/PostgreSQL).
68
BACKEND_DB_MODULE = 'pithos.backends.lib.sqlalchemy'
69
BACKEND_DB_CONNECTION = 'sqlite:///' + os.path.join(PROJECT_PATH, 'backend.db')
70
#BACKEND_DB_CONNECTION = 'mysql://user:pass@host/db'
71
#BACKEND_DB_CONNECTION = 'postgresql://user:pass@host/db'
72

  
73
# Block storage.
74
BACKEND_BLOCK_MODULE = 'pithos.backends.lib.hashfiler'
75
BACKEND_BLOCK_PATH = os.path.join(PROJECT_PATH, 'data/')
76

  
77
# Bypass authentication for user administration.
78
BYPASS_ADMIN_AUTH = False
79

  
80
# Local time zone for this installation. Choices can be found here:
81
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
82
# although not all choices may be available on all operating systems.
83
# On Unix systems, a value of None will cause Django to use the same
84
# timezone as the operating system.
85
# If running in a Windows environment this must be set to the same as your
86
# system time zone.
87
TIME_ZONE = 'UTC'
88

  
89
# Language code for this installation. All choices can be found here:
90
# http://www.i18nguy.com/unicode/language-identifiers.html
91
LANGUAGE_CODE = 'en-us'
92

  
93
SITE_ID = 1
94

  
95
# If you set this to False, Django will make some optimizations so as not
96
# to load the internationalization machinery.
97
USE_I18N = True
98

  
99
# If you set this to False, Django will not format dates, numbers and
100
# calendars according to the current locale
101
USE_L10N = True
102

  
103
# Absolute filesystem path to the directory that will hold user-uploaded files.
104
# Example: "/home/media/media.lawrence.com/"
105
MEDIA_ROOT = ''
106

  
107
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
108
# trailing slash if there is a path component (optional in other cases).
109
# Examples: "http://media.lawrence.com", "http://example.com/media/"
110
MEDIA_URL = ''
111

  
112
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
113
# trailing slash.
114
# Examples: "http://foo.com/media/", "/media/".
115
ADMIN_MEDIA_PREFIX = '/media/'
116

  
117
# Make this unique, and don't share it with anybody.
118
SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si'
119

  
120
# List of callables that know how to import templates from various sources.
121
TEMPLATE_LOADERS = (
122
    'django.template.loaders.filesystem.Loader',
123
    'django.template.loaders.app_directories.Loader',
124
#     'django.template.loaders.eggs.Loader',
125
)
126

  
127
MIDDLEWARE_CLASSES = (
128
    'django.middleware.common.CommonMiddleware',
129
#    'django.contrib.sessions.middleware.SessionMiddleware',
130
#    'django.middleware.csrf.CsrfViewMiddleware',
131
#    'django.contrib.auth.middleware.AuthenticationMiddleware',
132
#    'django.contrib.messages.middleware.MessageMiddleware',
133
    'pithos.middleware.URLEncodedHeadersMiddleware',
134
    'pithos.middleware.LoggingConfigMiddleware',
135
    'pithos.middleware.AuthMiddleware'
136
)
137

  
138
ROOT_URLCONF = 'pithos.urls'
139

  
140
TEMPLATE_DIRS = (
141
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
142
    # Always use forward slashes, even on Windows.
143
    # Don't forget to use absolute paths, not relative paths.
144
)
145

  
146
INSTALLED_APPS = (
147
#    'django.contrib.auth',
148
#    'django.contrib.contenttypes',
149
#    'django.contrib.sessions',
150
#    'django.contrib.sites',
151
#    'django.contrib.messages',
152
#    'django.contrib.admin',
153
#    'django.contrib.admindocs',
154
    'pithos.im',
155
    'pithos.api',
156
    'pithos.ui',
157
    'south'
158
)
159

  
160
# Set the expiration time of newly created auth tokens
161
# to be this many hours after their creation time.
162
AUTH_TOKEN_DURATION = 30 * 24
163

  
164
# Default setting for new accounts.
165
DEFAULT_QUOTA = 50 * 1024 * 1024 * 1024
166
DEFAULT_VERSIONING = 'auto'
167

  
168
# Show these many users per page in admin interface.
169
ADMIN_PAGE_LIMIT = 100
170

  
171
# Authenticate via Twitter.
172
TWITTER_KEY = ''
173
TWITTER_SECRET = ''
174

  
175
# Address to use for outgoing emails
176
DEFAULT_FROM_EMAIL = 'Pithos <no-reply@grnet.gr>'
177
DEFAULT_CONTACT_EMAIL = 'support@pithos.grnet.gr'
178

  
179
FEEDBACK_FROM_EMAIL = DEFAULT_FROM_EMAIL
180
FEEDBACK_CONTACT_EMAIL = DEFAULT_CONTACT_EMAIL
181

  
182
INVITATIONS_PER_LEVEL = {
183
    0   :   100,
184
    1   :   2,
185
    2   :   0,
186
    3   :   0,
187
    4   :   0
188
}
189

  
190
SERVICE_NAME = 'Pithos'
191

  
192
# Where users should login with their invitation code
193
INVITATION_LOGIN_TARGET = '%s/im/login/invitation' \
194
                            '?code=%d' \
195
                            '&next=%s'
196

  
197
# Where users should activate their local account
198
ACTIVATION_LOGIN_TARGET = '%s/im/local/activate/' \
199
                            '?auth=%s' \
200
                            '&next=%s'
201

  
202
# Where users should reset their local password
203
PASSWORD_RESET_TARGET = '%s/im/local/reset/' \
204
                            '?username=%s' \
205
                            '&next=%s'
206

  
207
# Force user profile verification
208
FORCE_PROFILE_UPDATE = False
209

  
210
# The server is behind a proy (apache and gunicorn setup).
211
USE_X_FORWARDED_HOST = False
212

  
213
# Set umask (needed for gunicorn setup).
214
#os.umask(0077)
215

  
216
# Use to log to a file.
217
LOGFILE = None
218

  
219
# Identity Management enabled modules
220
IM_STANDARD_MODULES = ['local', 'invitation']
221
IM_OTHER_MODULES = ['twitter', 'shibboleth']

Also available in: Unified diff