1.0.1 • Published 6 years ago

@onenorth/keystone-hosting v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

onenorth-keystone-hosting

This is an NPM module that provides One North Hosting functionality for KeystoneJS applications.

Installation

npm install --save @onenorth/keystone-hosting

API

'trust proxy' is required when behind a proxy. Set this to enable processing of the HTTP request X-Forwarded-For header.

var keystone = require('keystone');
var hosting = require('@onenorth/keystone-hosting');
...
keystone.init({
    ...
    'trust proxy': true
});
...
hosting.register(keystone);
keystone.start();

Configuration

The following environment variables need to be set

ANONYMOUS_ACCESS_BLOCKER_ENABLED=true
ANONYMOUS_ACCESS_BLOCKER_ALLOWED_IP_RANGES=127.0.0.1/32 ::1

HEALTH_CHECK_ENABLED=true
HEALTH_CHECK_PATH={application path}
HEALTH_CHECK_KEYSTONE_USER_EMAIL={email address}
HEALTH_CHECK_AMAZON_TEST_FILE={filename}
HEALTH_CHECK_AZURE_TEST_FILE={filename}
HEALTH_CHECK_CLOUDINARY_TEST_FILE={filename}

LOG41N_CLIENT_ID={client id}
LOG41N_CLIENT_SECRET={client secret}
LOG41N_ENABLED=true
LOG41N_ENDPOINT={log41n endpoint}
LOG41N_PATH={application path}

Examples

var keystone = require('keystone');
var hosting = require('@onenorth/keystone-hosting');
...
keystone.init({
    ...
    'trust proxy': true
});
...
hosting.register(keystone);
keystone.start();

License

The associated code is released under the terms of the MIT license.