Code Monkey home page Code Monkey logo

fh-mbaas's Introduction

fh-mbaas - FeedHenry MBaaS Management Service

Email Configuration

To configure email sending from fh-mbaas, the email.transport configuration property must be set to:

  • "" to use the default transport (sendmail).
  • "sendgrid" - to use sendgrid. The following config must also be set on the email.sendgrid object:
  "auth": {
      "api_user": "SENDGRID_USER",
      "api_key": "SENDGRID_PASSWORD"
    }
  • "smtp" - to use SMTP. An SMTP connection URL must also be set on the email.smtp string:

"smtps://user:[email protected]"

OSE3

For OSE3 images, fh-mbaas will use smtp by default. An administrator must add an Environment variable to configure fh-mbaas to use a local SMTP relay/server - the name of this environment variable is FH_EMAIL_SMTP and it should be set to an SMTP URL:

e.g.

smtps://user:[email protected]

Testing (grunt fh:test)

  • Modules published to npm.skunkhenry.com.

    • The module turbo-test-runner has been updated (heapdump and memwatch needed upgrading), due to permissions on npmjs this has been published to npm.skunkhenry.com.

Developing on OpenShift

For development purposes, we can build a CentOS based Docker image and watch for changes in the local filesystem which would be reflected in the running image.

Build the development image

  1. Generate the config file: grunt fh-generate-dockerised-config
  2. docker build -t docker.io/my-Username/fh-mbaas:dev -f Dockerfile.dev .
  3. docker push docker.io/my-Username/fh-mbaas:dev
  4. oc edit dc fh-mbaas
  5. Replace the image with the tagged version above.

Hot Deployment

The development image will allow you to sync local code changes to the running container without the need for rebuilding or redeploying the image.

From the root of the `fh-mbaas directory, run the following:

oc rsync --no-perms=true --watch ./lib $(oc get po | grep fh-mbaas | grep Running | awk '{print $1}'):/opt/app-root/src

Debugging with VS Code

  1. Open Visual Studio Code
  2. oc set probe dc fh-mbaas --liveness --readiness --remove=true
  3. oc port-forward $(oc get po | grep fh-mbaas | grep Running | awk '{print $1}') :5858. - This will forward port 5858 from the running Pod to a local port. Note the port.
  4. Select the debug option and choose Node.js as the runtime.
  5. Set the launch.json file similar to the following, using the port obtained above via the port forward command:
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "attach",
      "name": "Attach to Remote",
      "address": "localhost",
      "port": 59180,
      "localRoot": "${workspaceRoot}",
      "remoteRoot": "/opt/app-root/src/"
    },
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "program": "${workspaceRoot}/fh-mbaas.js"
    }
  ]
}
  1. Click Attach to Remote.

License

fh-mbaas is licensed under the Apache License, Version 2.0.

fh-mbaas's People

Contributors

adamsaleh avatar austincunningham avatar brizrobbo avatar camilamacedo86 avatar danielpassos avatar davidffrench avatar davidkirwan avatar grdryn avatar jasonmadigan avatar judyobrienie avatar matskiv avatar mikenairn avatar nialldonnellyfh avatar odra avatar pb82 avatar philbrookes avatar philipgough avatar pmccarthy avatar pmdarrow avatar psturc avatar rachael-oregan avatar sedroche avatar thailekha avatar vchepeli avatar witmicko avatar wtrocki avatar ziccardi avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fh-mbaas's Issues

Is some of the code still closed???

Hi guys..

I'm trying to get feedhenry to run..

When starting, I get:

scl enable rh-nodejs6 "node ./fh-mbaas.js config/conf.json --master-only"
starting single master process
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":20,"msg":"JSON Config  { mongoUrl: 'mongodb://localhost:27017/fh-mbaas',\n  mongo: \n   { host: 'localhost',\n     port: 27017,\n     name: 'fh-mbaas',\n     admin_auth: { user: 'mbaas', pass: 'password' },\n     replicaSet: null },\n  crash_monitor: \n   { enabled: true,\n     min_num_crashes: 10,\n     max_num_crashes: 40,\n     tolerance: 1,\n     base_time_seconds: 60,\n     sample_time_hrs: 1 },\n  email: \n   { transport: '',\n     sendgrid: { auth: [Object] },\n     smtp: 'smtps://user:[email protected]',\n     alert_email_from: '[email protected]',\n     alert_email_bcc: '' },\n  fhamqp: \n   { app: { enabled: true },\n     enabled: true,\n     max_connection_retry: 10,\n     ssl: false,\n     nodes: 'node1:5672',\n     vhosts: { events: [Object], internal: [Object] } },\n  logger: \n   Logger {\n     domain: null,\n     _events: {},\n     _eventsCount: 0,\n     _maxListeners: undefined,\n     _level: 10,\n     streams: [ [Object], [Object] ],\n     serializers: { req: [Function: requestSerializer], res: [Function: res] },\n     src: false,\n     fields: \n      { name: 'mbaas',\n        hostname: 'feedhenry.casalogic.lan',\n        pid: 27333 },\n     requestIdMiddleware: { [Function: middleware] header: 'X-FH-REQUEST-ID' },\n     requestIdHeader: 'X-FH-REQUEST-ID',\n     getRequestId: [Function: getRequestId],\n     setRequestId: [Function: setRequestId],\n     getLoggerNamespace: [Function: getLoggerNamespace],\n     ensureRequestId: [Function: ensureRequestId],\n     fatal: [Function],\n     error: [Function],\n     warn: [Function],\n     info: [Function],\n     debug: [Function],\n     trace: [Function] },\n  mongoUserUrl: 'mongodb://localhost:27017/fh-mbaas',\n  mongo_userdb: \n   { host: 'localhost',\n     port: 27017,\n     name: 'fh-mbaas',\n     admin_auth: { user: 'mbaas', pass: 'password' },\n     replicaSet: null } }","time":"2018-05-15T11:20:23.541Z","v":0}
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":20,"msg":"setup mongodb connections { mongoConnectionString: 'mongodb://localhost:27017/fh-mbaas',\n  config: { auth: { user: 'mbaas', pass: 'password' }, poolSize: 20 } }","time":"2018-05-15T11:20:23.746Z","v":0}
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":20,"msg":"formated mongo connection url { mongoDbUrl: 'mongodb://mbaas:password@localhost:27017/admin?poolSize=20' }","time":"2018-05-15T11:20:23.747Z","v":0}
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":20,"msg":"creating mongodb connection for data_source_update job { mongoDbUrl: 'mongodb://mbaas:password@localhost:27017/admin?poolSize=20' }","time":"2018-05-15T11:20:23.748Z","v":0}
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":50,"msg":"Cannot find ops info file.  { location: '/etc/feedhenry/openv.json' }","time":"2018-05-15T11:20:23.893Z","v":0}
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":40,"msg":"Connecting to amqp with prefix . ops file path /etc/feedhenry/openv.json","time":"2018-05-15T11:20:23.894Z","v":0}
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":30,"msg":"Subscribing to amqp queue { exchangeName: '-fh-internal',\n  queueName: 'fh--appDeployStatus' }","time":"2018-05-15T11:20:23.894Z","v":0}
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":20,"msg":"JSON Config  { mongoUrl: 'mongodb://localhost:27017/fh-mbaas',\n  mongo: \n   { host: 'localhost',\n     port: 27017,\n     name: 'fh-mbaas',\n     admin_auth: { user: 'mbaas', pass: 'password' },\n     replicaSet: null },\n  crash_monitor: \n   { enabled: true,\n     min_num_crashes: 10,\n     max_num_crashes: 40,\n     tolerance: 1,\n     base_time_seconds: 60,\n     sample_time_hrs: 1 },\n  email: \n   { transport: '',\n     sendgrid: { auth: [Object] },\n     smtp: 'smtps://user:[email protected]',\n     alert_email_from: '[email protected]',\n     alert_email_bcc: '' },\n  fhamqp: \n   { app: { enabled: true },\n     enabled: true,\n     max_connection_retry: 10,\n     ssl: false,\n     nodes: 'node1:5672',\n     vhosts: { events: [Object], internal: [Object] } },\n  logger: \n   Logger {\n     domain: null,\n     _events: {},\n     _eventsCount: 0,\n     _maxListeners: undefined,\n     _level: 10,\n     streams: [ [Object], [Object] ],\n     serializers: { req: [Function: requestSerializer], res: [Function: res] },\n     src: false,\n     fields: \n      { name: 'mbaas',\n        hostname: 'feedhenry.casalogic.lan',\n        pid: 27333 },\n     requestIdMiddleware: { [Function: middleware] header: 'X-FH-REQUEST-ID' },\n     requestIdHeader: 'X-FH-REQUEST-ID',\n     getRequestId: [Function: getRequestId],\n     setRequestId: [Function: setRequestId],\n     getLoggerNamespace: [Function: getLoggerNamespace],\n     ensureRequestId: [Function: ensureRequestId],\n     fatal: [Function],\n     error: [Function],\n     warn: [Function],\n     info: [Function],\n     debug: [Function],\n     trace: [Function],\n     haveNonRawStreams: true },\n  mongoUserUrl: 'mongodb://localhost:27017/fh-mbaas',\n  mongo_userdb: \n   { host: 'localhost',\n     port: 27017,\n     name: 'fh-mbaas',\n     admin_auth: { user: 'mbaas', pass: 'password' },\n     replicaSet: null } }","time":"2018-05-15T11:20:23.896Z","v":0}
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":30,"msg":"Initialising scheduler.","time":"2018-05-15T11:20:23.897Z","v":0}
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":30,"msg":"Setting up Agenda 27333","time":"2018-05-15T11:20:23.897Z","v":0}
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":30,"msg":"Initialised scheduler { tearDown: [Function: tearDown] }","time":"2018-05-15T11:20:23.908Z","v":0}
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":50,"msg":"FATAL: UncaughtException, please report: { Error: Cannot find module 'fh-dfc'\n    at Function.Module._resolveFilename (module.js:469:15)\n    at Function.Module._load (module.js:417:25)\n    at Module.require (module.js:497:17)\n    at require (internal/module.js:20:19)\n    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/util/dfutils.js:8:15)\n    at Module._compile (module.js:570:32)\n    at Object.Module._extensions..js (module.js:579:10)\n    at Module.load (module.js:487:32)\n    at tryModuleLoad (module.js:446:12)\n    at Function.Module._load (module.js:438:3)\n    at Module.require (module.js:497:17)\n    at require (internal/module.js:20:19)\n    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/export/preparationSteps.js:6:15)\n    at Module._compile (module.js:570:32)\n    at Object.Module._extensions..js (module.js:579:10)\n    at Module.load (module.js:487:32)\n    at tryModuleLoad (module.js:446:12)\n    at Function.Module._load (module.js:438:3)\n    at Module.require (module.js:497:17)\n    at require (internal/module.js:20:19)\n    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/export/AppDataExportRunner.js:8:17)\n    at Module._compile (module.js:570:32)\n    at Object.Module._extensions..js (module.js:579:10)\n    at Module.load (module.js:487:32)\n    at tryModuleLoad (module.js:446:12)\n    at Function.Module._load (module.js:438:3)\n    at Module.require (module.js:497:17)\n    at require (internal/module.js:20:19)\n    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/jobs/appDataJob.js:5:67)\n    at Module._compile (module.js:570:32)\n    at Object.Module._extensions..js (module.js:579:10)\n    at Module.load (module.js:487:32)\n    at tryModuleLoad (module.js:446:12)\n    at Function.Module._load (module.js:438:3) code: 'MODULE_NOT_FOUND' }","time":"2018-05-15T11:20:23.999Z","v":0}
Tue May 15 2018 13:20:24 GMT+0200 (CEST) FATAL: UncaughtException, please report: { Error: Cannot find module 'fh-dfc'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/util/dfutils.js:8:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/export/preparationSteps.js:6:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/export/AppDataExportRunner.js:8:17)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/jobs/appDataJob.js:5:67)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3) code: 'MODULE_NOT_FOUND' }
{"name":"mbaas","hostname":"feedhenry.casalogic.lan","pid":27333,"level":50,"msg":"'Error: Cannot find module \\'fh-dfc\\'\\n    at Function.Module._resolveFilename (module.js:469:15)\\n    at Function.Module._load (module.js:417:25)\\n    at Module.require (module.js:497:17)\\n    at require (internal/module.js:20:19)\\n    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/util/dfutils.js:8:15)\\n    at Module._compile (module.js:570:32)\\n    at Object.Module._extensions..js (module.js:579:10)\\n    at Module.load (module.js:487:32)\\n    at tryModuleLoad (module.js:446:12)\\n    at Function.Module._load (module.js:438:3)\\n    at Module.require (module.js:497:17)\\n    at require (internal/module.js:20:19)\\n    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/export/preparationSteps.js:6:15)\\n    at Module._compile (module.js:570:32)\\n    at Object.Module._extensions..js (module.js:579:10)\\n    at Module.load (module.js:487:32)\\n    at tryModuleLoad (module.js:446:12)\\n    at Function.Module._load (module.js:438:3)\\n    at Module.require (module.js:497:17)\\n    at require (internal/module.js:20:19)\\n    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/export/AppDataExportRunner.js:8:17)\\n    at Module._compile (module.js:570:32)\\n    at Object.Module._extensions..js (module.js:579:10)\\n    at Module.load (module.js:487:32)\\n    at tryModuleLoad (module.js:446:12)\\n    at Function.Module._load (module.js:438:3)\\n    at Module.require (module.js:497:17)\\n    at require (internal/module.js:20:19)\\n    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/jobs/appDataJob.js:5:67)\\n    at Module._compile (module.js:570:32)\\n    at Object.Module._extensions..js (module.js:579:10)\\n    at Module.load (module.js:487:32)\\n    at tryModuleLoad (module.js:446:12)\\n    at Function.Module._load (module.js:438:3)'","time":"2018-05-15T11:20:24.000Z","v":0}
Trace: Error: Cannot find module 'fh-dfc'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/util/dfutils.js:8:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/export/preparationSteps.js:6:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/export/AppDataExportRunner.js:8:17)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/opt/feedhenry/fh-mbaas/lib/jobs/appDataJob.js:5:67)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at process.<anonymous> (/opt/feedhenry/fh-mbaas/fh-mbaas.js:399:15)
    at emitOne (events.js:96:13)
    at process.emit (events.js:188:7)
    at process._fatalException (bootstrap_node.js:296:26)
    at process._asyncFatalException [as _fatalException] (/opt/feedhenry/fh-mbaas/node_modules/fh-forms/node_modules/fh-logger/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:211:34)

I can't find the fh-dfc module anywhere????

Is that still closed source???

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.