Skip to content

Commit 37e42a6

Browse files
author
Anusha Ranganathan
committed
Merge remote branch 'upstream/master'
Conflicts: docs/Databank_VM_Installation.txt production.ini rdfdatabank/controllers/datasets.py rdfdatabank/lib/app_globals.py rdfdatabank/public/static/style.css rdfdatabank/templates/base.html rdfdatabank/templates/create_new_silo.html rdfdatabank/templates/datasetview.html rdfdatabank/templates/embargo_form.html rdfdatabank/templates/file_upload.html rdfdatabank/templates/files_unpack.html rdfdatabank/templates/footer.html rdfdatabank/templates/home.html rdfdatabank/templates/list_of_silos.html rdfdatabank/templates/part_list_display.html rdfdatabank/templates/rdf_manifest_form.html rdfdatabank/templates/search_form.html rdfdatabank/templates/siloview.html
2 parents 87d75c8 + e51cdba commit 37e42a6

File tree

181 files changed

+19258
-6409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+19258
-6409
lines changed

README.txt

Lines changed: 5 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -8,118 +8,11 @@ RDF-enhanced storage API, pairtree-backed.
88
Installation and dependancies
99
=============================
1010

11-
- [I would advise using virtualenv]
11+
The dependancies are listed in the file docs/Dependancies.pdf
12+
The installation instructions are available at docs/Databank_VM_Installation.txt
1213

13-
Dependancies:
14+
For further infromation visit http://www.dataflow.ox.ac.uk/
15+
The project wiki is available at http://dataflow-jira.bodleian.ox.ac.uk/jira/ or
16+
https://damssupport.ouls.ox.ac.uk/trac/databank/wiki/
1417

15-
pylons==0.9.7
16-
pairtree==0.5.6-T
17-
rdfobject
18-
recordsilo
19-
simplejson
20-
solrpy
21-
22-
redis (use the redis client that is compatible with your redis server - http://github.com/andymccurdy/redis-py/)
23-
24-
25-
- Change the settings in development.ini to suit your uses, specifically:
26-
27-
redis.host = localhost
28-
29-
granary.store = silos # Directory to storage directory. Can be absolute: /var/silos
30-
granary.uri_root = http://databank.bodleian.ox.ac.uk/objects/ # URI root - must end with /, # or :
31-
32-
broadcast.to = redis
33-
broadcast.queue = silochanges # redis 'queue' to push audit messages to (create, delete, update or embargo change)
34-
35-
solr.host = http://localhost:8983/solr # Unset this to ignore solr while testing
36-
37-
Setup:
38-
======
39-
40-
Create a file 'passwd' in the root directory of the application using 'htpasswd' or similar:
41-
42-
$ htpasswd -c passwd admin
43-
[enter admin password]
44-
45-
Add any users you wish to access or work with this application.
46-
47-
Edit ./rdfdatabank/lib/ident_md.py - this has a variable _DATA which would best be replaced by a DB lookup or similar. For now, adjust it
48-
to suit your users - the important thing is the 'role'.
49-
50-
Start up the redis-server and confirm that you can access it.
51-
52-
You should be able to start the application now (as long as the application has access to r+w to the aforementioned 'silos' directory.)
53-
54-
paster serve development.ini
55-
56-
Then, go to localhost:5000/admin, and try to log in as the 'admin' account. You should then be able to create and manage silos and assign write-access to them to users.
57-
58-
WGSI deployment:
59-
================
60-
61-
Copy 'development.ini' to a file called 'production.ini' and make sure debug = false and that the 'silos' directory is
62-
owned by the web-server user (www-data for example). Recommendation is to have a separate silo directory for production use.
63-
64-
Create a folder called 'egg-cache' and make sure that is writable by the web-server user too.
65-
66-
Create a folder 'mod_wsgi' in the root of the application.
67-
68-
Create a file within that called 'dispatch.wsgi' and put in the following:
69-
70-
---------------
71-
# Add the virtual Python environment site-packages directory to the path
72-
73-
import pkg_resources
74-
pkg_resources.working_set.add_entry('/opt/rdfdatabank/src') # Path to application root
75-
76-
# Avoid ``[Errno 13] Permission denied: '/var/www/.python-eggs'`` messages
77-
import os
78-
os.environ['PYTHON_EGG_CACHE'] = '/opt/rdfdatabank/src/egg-cache' # Path to writable directory for egg-cache
79-
80-
# Load the Pylons application
81-
from paste.deploy import loadapp
82-
application = loadapp('config:/opt/rdfdatabank/src/production.ini') # Path to production.ini file
83-
84-
---------------
85-
86-
In your apache2 configuration, you need an entry like:
87-
88-
<VirtualHost *:80>
89-
ServerName foo.com
90-
91-
# Logfiles
92-
ErrorLog /opt/rdfdatabank/apachelog/error.log
93-
CustomLog /opt/rdfdatabank/apachelog/access.log combined
94-
95-
# Use only 1 Python sub-interpreter. Multiple sub-interpreters
96-
# play badly with C extensions.
97-
WSGIApplicationGroup %{GLOBAL}
98-
WSGIPassAuthorization On
99-
# Setup mod_wsgi
100-
WSGIScriptAlias / /opt/rdfdatabank/src/mod_wsgi/dispatch.wsgi
101-
102-
<Directory /opt/rdfdatabank/src/mod_wsgi>
103-
Order deny,allow
104-
Allow from all
105-
</Directory>
106-
107-
</VirtualHost>
108-
109-
Note the WSGIScriptAlias points to the dispatch.wsgi file.
110-
111-
---------------
112-
113-
Note about permissions:
114-
src directory and all its files and directories:
115-
Set the owner as admin_user:www-data
116-
Set the permission to 775 on all directories and everything under it
117-
set the owner as www-data:www-data for src/data folder
118-
Set the permission to 644 on all files
119-
apachelog directory and all its files and directories:
120-
Set the owner as admin_user:www-data
121-
Set the persmissions 755 (currently the dir permission is set to 755 and the permission of the files within it is set to 644)
122-
All of other directories:
123-
Set the owner as admin_user:admin_user
124-
Set the permission to 775 on all directories and everything under it
12518

development-jenkins.ini

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ debug = false
88
# Uncomment and replace with the address which should receive any error reports
99
#email_to = [email protected]
1010
smtp_server = localhost
11-
error_email_from = paste@localhost
11+
error_email_from = paste@jenkins
1212

1313
[server:main]
1414
use = egg:Paste#http
@@ -30,14 +30,22 @@ beaker.session.secret = somesecret
3030

3131
who.config_file = %(here)s/who.ini
3232
who.log_level = info
33-
who.log_file = stdout
33+
who.log_file = /var/log/databank/who.log
34+
#who.log_file = %(here)s/logs/who.log
35+
#who.log_file = stdout
3436

3537
redis.host = localhost
3638

3739
granary.store = %(here)s/silos
3840
granary.uri_root = http://dataflow-jenkins.bodleian.ox.ac.uk/
3941
#granary.uri_root = http://163.1.127.173/
4042

43+
auth.file = %(here)s/passwd
44+
auth.info = %(here)s/rdfdatabank/config/users.py
45+
46+
doi.config = %(here)s/rdfdatabank/config/doi_config.py
47+
doi.count = %(here)s/rdfdatabank/config/doi_count
48+
4149
broadcast.to = redis
4250
broadcast.queue = silochanges
4351

@@ -66,24 +74,24 @@ license =
6674
keys = root, routes, rdfdatabank
6775

6876
[handlers]
69-
keys = console
77+
keys = console, logfile
7078

7179
[formatters]
7280
keys = generic
7381

7482
[logger_root]
7583
level = INFO
76-
handlers = console
84+
handlers = logfile
7785

7886
[logger_routes]
7987
level = INFO
80-
handlers =
88+
handlers = logfile
8189
qualname = routes.middleware
8290
# "level = DEBUG" logs the route matched and routing variables.
8391

8492
[logger_rdfdatabank]
8593
level = DEBUG
86-
handlers =
94+
handlers = logfile
8795
qualname = rdfdatabank
8896

8997
[handler_console]
@@ -92,6 +100,12 @@ args = (sys.stderr,)
92100
level = NOTSET
93101
formatter = generic
94102

103+
[handler_logfile]
104+
class = FileHandler
105+
level = INFO
106+
formatter = generic
107+
args = ('/var/log/databank/databank.log', 'w')
108+
95109
[formatter_generic]
96110
format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
97111
datefmt = %H:%M:%S

development.ini

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,43 @@
1+
# Copyright (c) 2012 University of Oxford
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining
4+
# a copy of this software and associated documentation files (the
5+
# "Software"), to deal in the Software without restriction, including
6+
# without limitation the rights to use, copy, modify, merge, publish,
7+
# distribute, sublicense, and/or sell copies of the Software, and to
8+
# permit persons to whom the Software is furnished to do so, subject to
9+
# the following conditions:
10+
#
11+
# The above copyright notice and this permission notice shall be
12+
# included in all copies or substantial portions of the Software.
13+
#
14+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
# EXPRESS OR IMPLIED, --INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
121
#
222
# rdfdatabank - Pylons development environment configuration
323
#
424
# The %(here)s variable will be replaced with the parent directory of this file
525
#
626
[DEFAULT]
7-
debug = false
27+
debug = true
828
# Uncomment and replace with the address which should receive any error reports
929
#email_to = [email protected]
1030
smtp_server = localhost
11-
error_email_from = paste@localhost
31+
error_email_from = paste@databank
1232

1333
[server:main]
1434
use = egg:Paste#http
15-
host = 192.168.23.133
16-
port = 3000
35+
#Use these setings to run pylons using mod_wsgi and apache
36+
#host = 127.0.0.1
37+
#port = 5000
38+
#Use these settings tp run pylons from the commandline
39+
host = 0.0.0.0
40+
port = 80
1741

1842
[app:main]
1943
use = egg:rdfdatabank
@@ -26,24 +50,35 @@ beaker.session.secret = somesecret
2650

2751
who.config_file = %(here)s/who.ini
2852
who.log_level = info
53+
#who.log_file = /var/log/databank/who.log
2954
who.log_file = stdout
55+
#who.log_file = %(here)s/logs/who.log
3056

3157
redis.host = localhost
3258

3359
granary.store = %(here)s/silos
34-
#granary.store = ../silos
35-
#granary.uri_root = http://192.168.13.128/datasets/
36-
granary.uri_root = http://192.168.23.133/
60+
granary.uri_root = http://databank-vm1.oerc.ox.ac.uk/
61+
62+
profile.log_filename = %(here)s/logs/profile.log
63+
profile.path = /__profile__
64+
65+
auth.file = %(here)s/passwd
66+
auth.info = %(here)s/rdfdatabank/config/users.py
67+
68+
doi.config = %(here)s/rdfdatabank/config/doi_config.py
69+
doi.count = %(here)s/rdfdatabank/config/doi_count
3770

3871
broadcast.to = redis
3972
broadcast.queue = silochanges
4073

74+
metadata.embargoed = False
75+
4176
solr.host = http://localhost:8080/solr
4277
naming_rule = [^0-9a-zA-Z_\-\:]
4378
formats_served = text/html,text/xhtml,text/plain,application/json,application/rdf+xml,text/xml,text/rdf+n3,application/x-turtle,text/rdf+ntriples,text/rdf+nt
4479
publisher = Bodleian Libraries, University of Oxford
4580
rights = http://ora.ouls.ox.ac.uk/objects/uuid%3A1d00eebb-8fed-46ad-8e38-45dbdb4b224c
46-
license =
81+
license = CC0 1.0 Universal (CC0 1.0). See http://creativecommons.org/publicdomain/zero/1.0/legalcode
4782
#license = Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. See http://creativecommons.org/licenses/by-nc-sa/3.0/
4883

4984
# If you'd like to fine-tune the individual locations of the cache data dirs
@@ -57,13 +92,12 @@ license =
5792
# execute malicious code after an exception is raised.
5893
#set debug = false
5994

60-
6195
# Logging configuration
6296
[loggers]
6397
keys = root, routes, rdfdatabank
6498

6599
[handlers]
66-
keys = console
100+
keys = console, logfile
67101

68102
[formatters]
69103
keys = generic
@@ -89,6 +123,13 @@ args = (sys.stderr,)
89123
level = NOTSET
90124
formatter = generic
91125

126+
[handler_logfile]
127+
class = FileHandler
128+
level = INFO
129+
formatter = generic
130+
args = ('/var/log/databank/databank.log', 'w')
131+
#args = ('%(here)s/logs/databank.log', 'w')
132+
92133
[formatter_generic]
93134
format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
94135
datefmt = %H:%M:%S

0 commit comments

Comments
 (0)