Skip to content

Commit

Permalink
Merge branch 'master' of github.com:anusharanganathan/RDFDatabank
Browse files Browse the repository at this point in the history
Code commit after rewrite of databank auth
  • Loading branch information
Anusha Ranganathan committed Apr 11, 2012
2 parents a45f7d3 + 01f8f90 commit b990948
Show file tree
Hide file tree
Showing 222 changed files with 8,742 additions and 12,217 deletions.
23 changes: 23 additions & 0 deletions LICENCE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
The MIT License

Copyright (c) 2012, University of Oxford

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


117 changes: 5 additions & 112 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,118 +8,11 @@ RDF-enhanced storage API, pairtree-backed.
Installation and dependancies
=============================

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

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

pylons==0.9.7
pairtree==0.5.6-T
rdfobject
recordsilo
simplejson
solrpy

redis (use the redis client that is compatible with your redis server - http://github.com/andymccurdy/redis-py/)


- Change the settings in development.ini to suit your uses, specifically:

redis.host = localhost

granary.store = silos # Directory to storage directory. Can be absolute: /var/silos
granary.uri_root = http://databank.bodleian.ox.ac.uk/objects/ # URI root - must end with /, # or :

broadcast.to = redis
broadcast.queue = silochanges # redis 'queue' to push audit messages to (create, delete, update or embargo change)

solr.host = http://localhost:8983/solr # Unset this to ignore solr while testing

Setup:
======

Create a file 'passwd' in the root directory of the application using 'htpasswd' or similar:

$ htpasswd -c passwd admin
[enter admin password]

Add any users you wish to access or work with this application.

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
to suit your users - the important thing is the 'role'.

Start up the redis-server and confirm that you can access it.

You should be able to start the application now (as long as the application has access to r+w to the aforementioned 'silos' directory.)

paster serve development.ini

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.

WGSI deployment:
================

Copy 'development.ini' to a file called 'production.ini' and make sure debug = false and that the 'silos' directory is
owned by the web-server user (www-data for example). Recommendation is to have a separate silo directory for production use.

Create a folder called 'egg-cache' and make sure that is writable by the web-server user too.

Create a folder 'mod_wsgi' in the root of the application.

Create a file within that called 'dispatch.wsgi' and put in the following:

---------------
# Add the virtual Python environment site-packages directory to the path

import pkg_resources
pkg_resources.working_set.add_entry('/opt/rdfdatabank/src') # Path to application root

# Avoid ``[Errno 13] Permission denied: '/var/www/.python-eggs'`` messages
import os
os.environ['PYTHON_EGG_CACHE'] = '/opt/rdfdatabank/src/egg-cache' # Path to writable directory for egg-cache

# Load the Pylons application
from paste.deploy import loadapp
application = loadapp('config:/opt/rdfdatabank/src/production.ini') # Path to production.ini file

---------------

In your apache2 configuration, you need an entry like:

<VirtualHost *:80>
ServerName foo.com

# Logfiles
ErrorLog /opt/rdfdatabank/apachelog/error.log
CustomLog /opt/rdfdatabank/apachelog/access.log combined

# Use only 1 Python sub-interpreter. Multiple sub-interpreters
# play badly with C extensions.
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
# Setup mod_wsgi
WSGIScriptAlias / /opt/rdfdatabank/src/mod_wsgi/dispatch.wsgi

<Directory /opt/rdfdatabank/src/mod_wsgi>
Order deny,allow
Allow from all
</Directory>

</VirtualHost>

Note the WSGIScriptAlias points to the dispatch.wsgi file.

---------------

Note about permissions:
src directory and all its files and directories:
Set the owner as admin_user:www-data
Set the permission to 775 on all directories and everything under it
set the owner as www-data:www-data for src/data folder
Set the permission to 644 on all files
apachelog directory and all its files and directories:
Set the owner as admin_user:www-data
Set the persmissions 755 (currently the dir permission is set to 755 and the permission of the files within it is set to 644)
All of other directories:
Set the owner as admin_user:admin_user
Set the permission to 775 on all directories and everything under it

6 changes: 6 additions & 0 deletions debian/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The Debian Package databank
----------------------------

Comments regarding the Package

-- Anusha Ranganathan <[email protected]> Fri, 09 Mar 2012 17:08:50 +0000
13 changes: 13 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
databank (0.2) unstable; urgency=low

* Added message workers
* Databank root set to /var/lib/databank

-- Anusha Ranganathan <[email protected]> Fri, 09 Mar 2012 17:08:50 +0000


databank (0.1) unstable; urgency=low

* Initial Release.

-- Anusha Ranganathan <[email protected]> Tue, 21 Feb 2012 17:08:50 +0000
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7
37 changes: 37 additions & 0 deletions debian/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh -e

# Source debconf library.
. /usr/share/debconf/confmodule

# Admin email?
db_input critical databank/email || true
db_go

# SMTP server?
db_input high databank/smtpserver || true
db_go

# Storgae area?
db_input high databank/store || true
db_go

# Databank URI?
db_input critical databank/uri || true
db_go

#Configure SOLR
db_input high databank/confsolr || true
db_go

#Note on configuring SOLR
#db_input high databank/nosolrconf || true
#db_go

# Password?
#db_input critical databank/password || true
#db_go

# Note on Password
db_input critical databank/passwdnote || true
db_go

37 changes: 37 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Source: databank
Section: web
Priority: extra
Maintainer: Anusha Ranganathan <[email protected]>
Build-Depends: debhelper (>= 7)
Standards-Version: 3.9.2
Vcs-Git: git://github.com/dataflow/RDFDatabank.git
Homepage: https://github.com/dataflow/RDFDatabank
Uploaders: Anusha Ranganathan <[email protected]>
XS-Python-Version: >= 2.6

Package: databank
Architecture: all
Depends: python,
python-pylons,
python-repoze.who,
python-repoze.who-friendlyform,
python-rdflib,
python-dateutil,
python-libxml2,
python-libxslt1,
python-pairtree,
python-recordsilo,
python-solrpy,
python-redis,
unzip,
apache2,
apache2-utils,
libapache2-mod-wsgi,
redis-server,
supervisor,
debconf,
openjdk-6-jre
Recommends: solr-tomcat
Description: RDF-enhanced, pairtree-backed storage API
Databank is a simple, RDF-enhanced storage API which is backed by pairtree,
for the safe storage of and access to data.
42 changes: 42 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
This work was packaged for Debian by:

Anusha Ranganathan <[email protected]> on Fri, 09 Mar 2012 17:08:50 +0000

It was downloaded from:

https://github.com/dataflow/RDFDatabank

Upstream Author(s):

Anusha Ranganathan <[email protected]>
Ben O'Steen <[email protected]>

Copyright:

Copyright (C) 2012 University of Oxford

License:

MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

The Debian packaging is:

Copyright (C) 2012 University of Oxford
and is licensed under the MIT License. See above.
12 changes: 12 additions & 0 deletions debian/databank.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
docs/apache_config/databank_wsgi /etc/default/databank/
docs/solr_config/conf/schema.xml /etc/default/databank/
production.ini /etc/default/databank/
development.ini /etc/default/databank/
MANIFEST.in /var/lib/databank/
mod_wsgi /var/lib/databank/
message_workers/ /var/lib/databank/
passwd-default /var/lib/databank/
rdfdatabank/ /var/lib/databank/
rdfdatabank.egg-info/ /var/lib/databank
test.ini /var/lib/databank/
who.ini /var/lib/databank/
7 changes: 7 additions & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
LICENCE.txt
README.txt
requirements.txt
docs/assigning_dois
docs/Databank_VM_Installation.txt
docs/Dependencies.pdf
docs/using_databank_api
Loading

0 comments on commit b990948

Please sign in to comment.