You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

The Staging Repository runs on top of NodeJS and uses a No-SQL database for storage. By default it uses MongoDB.

  • Install NodeJS
  • Install MongoDB
  • Checkout the project with git or download it from here
git fetch && git checkout develop
  • Install dependencies:
npm install
  • Start MongoDB
mongod
  • Launch the Staging Repository
node server.js

Storage

Staging Repository data is stored in a No-SQL database. By default the Staging Repository uses MongoDB as its storage option. Custom plugins can be developed for other No-SQL databases. To create a custom database connection see.

The Staging Repository will automatically create the database and all needed collections (contentstransactionssettingsforeignkeys and reprocesses) used by each Storage Unit.

Environment Configurations

The Staging Repository can hold the configuration for multiple environments. The config/env folder holds the different configuration files for all environments.

An environment configuration will inherit the configuration present in the config/env/all.js file and can overwrite any configuration field by redefining it on the environments file. New configuration fields be added to the environment file.

  • All configuration example:
'use strict';
module.exports = {
    app: {
        title: 'Staging Repository',
        description: 'Staging Repository',
        keywords: 'MongoDB, Express, Node.js'
    },
    port: process.env.PORT || 3000,
    templateEngine: 'swig',
    dbConn: {
        type: 'mongo',
        hbase:{
            server: 'hadoop-thrift-server',
            port: 9090
        },
        mongo:{
            server:'localhost',
            port: 27017,
            sharding: false
        }
    },
    keyManager:{
        type:'filebased',
        keysNumber: 1000,
        filebased:{
            masterKeyLocation: 'config/MasterKey.txt'
        }
    },
    reqBodySize: '1gb',
    reprocessQueue:{
        batchSize: 20,
        querySize: 40,
        timeout: 3000
    },
    clusterMode: false
};
  • Environment specific configuration (secure.js). In this example, the port and clusterMode parameter will be overridden. authList, logging, keyLocation, certLocation, caLocation and passphrase will be added to the applications configuration.
'use strict';
module.exports = {
    port: 44300,
    authList :[
        'Aspire',
        'testuser'
    ],
    logging:{
        express: {
            request: [
                'connection.remoteAddress',
                'authorizedCN'
            ],
            response: [
            ]
        },
        transports:{
            console:{
                level: 'debug',
                enable: false
            },
            file:{
                level: 'info',
                enable: true
            }
        }
    },
    keyLocation: 'config/sslcerts/sr_server_key.pem',
    certLocation: 'config/sslcerts/sr_server_cert.crt',
    caLocation: 'config/sslcerts/cacert.crt',
    passphrase: '123456abC',
    clusterMode: true
};

To start the Staging Repository with an specific environment configuration, set the environment configuration name to the NODE_ENV environment variable. If the variable is not set, the application will start with the development configuration by default.

  • No labels