Skip to content
This repository

Setting up a Diamond scope server

  1. Install and configure Django 1.3 or above.

  2. Install opendiamond.

    • If installing from source, you will need the Python Imaging Library, python-dateutil, simplejson, and M2Crypto. If installing from Git, you will additionally need xml2rfc 2.x.
    • If installing from RPM, you will need the opendiamond-scopeserver package.
  3. Start a new Django project:

    django-admin startproject scopeserver
    
  4. Create a scope cookie signing key:

    certtool --generate-privkey --outfile scopeserver/key.pem
    certtool --generate-self-signed --load-privkey scopeserver/key.pem --outfile scopeserver/cert.pem
    

    It does not matter much what you fill in, as long as the expiration date is sufficiently far in the future. cert.pem should be copied into ~/.diamond/CERTS on your Diamond servers.

  5. Configure the project by editing scopeserver/settings.py:

    • Modify ADMINS, DATABASES, TIME_ZONE, and STATIC_ROOT to taste.
    • Follow the instructions in INSTALLED_APPS to enable the admin.
    • Add the desired scopeserver apps to INSTALLED_APPS:

        INSTALLED_APPS += (
            ## Provides the basic scopeserver UI.  You will want this.
            'opendiamond.scopeserver.core',
            ## Gatekeeper module for static object lists
            'opendiamond.scopeserver.gatekeeper',
            ## Flickr image data
            #'opendiamond.scopeserver.flickr',
            ## Gigapixel images from gigapan.org
            #'opendiamond.scopeserver.gigapan',
            ## Mirage virtual machine image repository
            #'opendiamond.scopeserver.mirage',
        )
      
    • Add additional settings:

        ## Configure authentication redirects for django.contrib.auth
        LOGIN_URL = '/accounts/login/'
        LOGOUT_URL = '/accounts/logout/'
        LOGIN_REDIRECT_URL = '/'
      
        ## scopeserver settings
        # Path to scope cookie signing key
        SCOPE_KEY_FILE = '/path/to/scopeserver-directory/key.pem'
        # Lifetime of generated scope cookies, in seconds
        SCOPE_COOKIE_EXPIRES = 86400
      
        ## gatekeeper settings
        #GATEKEEPER_BLASTER = 'http://root.url.of.JSON.blaster/'
      
        ## flickr settings
        #FLICKR_SERVERS = ('list', 'of', 'dataretriever', 'hosts')
        #FLICKR_PROXIES = ('list', 'of', 'diamondd', 'hosts')
        #FLICKR_BLASTER = 'http://root.url.of.JSON.blaster/'
      
        ## gigapan settings
        #GIGAPAN_SERVER = 'dataretriever-host'
        #GIGAPAN_PROXIES = ('list', 'of', 'diamondd', 'hosts')
        #GIGAPAN_BLASTER = 'http://root.url.of.JSON.blaster/'
      
        ## mirage settings
        #MIRAGE_DATARETRIEVER = 'http://dataretriever.host:5873'
        #MIRAGE_SERVERS = ('list', 'of', 'diamondd', 'hosts')
        #MIRAGE_BLASTER = 'http://root.url.of.JSON.blaster/'
      

      JSON Blaster URLs are optional.

  6. Edit scopeserver/urls.py:

    • Follow the instructions to enable the admin.
    • Add patterns for enabled applications to urlpatterns:

        ## Configure authentication URLs for django.contrib.auth
        url(r'^accounts/login/$', 'django.contrib.auth.views.login'),
        url(r'^accounts/logout/$', 'django.contrib.auth.views.logout'),
        url(r'^accounts/password/$', 'django.contrib.auth.views.password_change'),
        url(r'^accounts/password/done$', 'django.contrib.auth.views.password_change_done'),
      
        ## Enable core scopeserver UI.
        url(r'^$', include('opendiamond.scopeserver.core.urls')),
      
        ## Gatekeeper module
        url(r'^gatekeeper/', include('opendiamond.scopeserver.gatekeeper.urls')),
      
        ## Flickr module
        #url(r'^flickr/', include('opendiamond.scopeserver.flickr.urls')),
      
        ## GigaPan module
        #url(r'^gigapan/', include('opendiamond.scopeserver.gigapan.urls')),
      
        ## Mirage module
        #url(r'^mirage/', include('opendiamond.scopeserver.mirage.urls')),
      
  7. Set up the Django project:

    # Collect static data into the STATIC_ROOT directory
    python manage.py collectstatic
    
    # Set up database tables
    python manage.py syncdb
    
  8. Do a test run of the server:

    python manage.py runserver
    

    Navigate to http://localhost:8000/admin/ to configure user accounts, permissions, Gatekeeper collections, and diamondd servers for Gatekeeper collections.

  9. For a production site, configure your web server to serve the scopeserver project. Ensure that the directory specified by STATIC_ROOT is served from the URL specified in STATIC_URL.

Something went wrong with that request. Please try again.