Git Product home page Git Product logo

fh-fhc's Introduction

FHC - FeedHenry Command Line Interface NPM version

FeedHenry CLI, the command line interface to FeedHenry.

Installation

fhc should now be available on your command line. fhc -v will tell you what version of fhc you have installed.

Usage

From the Command Line

To see the list of commands available, just run fhc. See fhc help for general help, or fhc help <someCommand> for help on a specific command.

Getting started

To get started with fhc, set the FeedHenry target and then login:

$ fhc target https://apps.feedhenry.com

$ fhc login <your-email-address> <your-password>

Examples of usage

To list your projects, use:

$ fhc projects

To create an app from a git repository use:

fhc app create --project=SomeProjectId --title=WelcomeApp --type=cloud_nodejs --repo=git://github.com/feedhenry-templates/welcome-app.git

As a Node.js Module

You can also use fh-fhc as a Node.js module in your scripts. This is useful for scripting automated tests, mobile app client builds and cloud deploys.

First, install & add it to your project dependencies by doing npm install --save fh-fhc from your project root.

Then, you can require it in your code like so:

var fhc = require('./lib/fhc');
fhc.load(function(err) {
  if (err) {
    // Something went wrong
  }
  // FHC started up OK - we can now perform commands, like listing projects:
  fhc.projects.list({json:true}, function(err, projects) {
    if (err) {
      // Handle error
    }
    console.log(projects);
  });
});

The commands require params to be passed in - these are typically passed like:

fhc.projects.list({ title : 'Some title', project : 'someProjectId'}, function() {});

Note : To force the result to be a json object use the json: true parameter

From Docker

To use FHC via docker, run commands like:

$ docker run -v $HOME:/root -it feedhenry/fhc target https://rhmap.cup.feedhenry.io

We mount $HOME into the the container to persist configuration in ~/.fhcrc & ~/.fhctargets on the host. You may want to alias this docker run command to fhc, by adding an alias to your shell's config:

alias fhc='docker run -v $HOME:/root -it feedhenry/fhc'

Now you'll be able to run commands similar to:

fhc target https://rhmap.cup.feedhenry.io

Building & Releasing for Docker

To build:

$ docker build -t feedhenry/fhc .

Get your Image ID via:

$ docker images | grep fhc
feedhenry/fhc          latest              0618027d8d57        8 minutes ago       749 MB

Tag this as latest & the version in package.json:

$ docker tag 0618027d8d57 feedhenry/fhc:latest
$ docker tag 0618027d8d57 feedhenry/fhc:2.17.3

Push your images (you may need to log in):

$ docker push feedhenry/fhc

Finally, verify your push by visiting:

https://hub.docker.com/r/feedhenry/fhc/tags/

Extending

The latest version of fh-fhc updates the structure of commands:

lib
  cmd # all commands go here
    fh3      # RHMAP commands ( `E.g fhc.projects.list({})` )
    fhc      # FHC commands   ( `E.g target` )
    internal # internal piping goes here

The fh3 directory structure doesn't get exposed to the user, but everything underneath does - meaning we can have a command lib/cmd/common/fooGroup/barCommand.js, another lib/cmd/common/fh3/fooGroup/anotherCommand.js, and be able to run both fhc fooGroup barCommand and fhc fooGroup anotherCommand. Internal commands in the internal directory are hidden from help output, but are still call-able.

Writing new commands is a little different than before. Old commands export a function - new style commands export an object.

Commands are DRY'd up substantially - see App List lib/cmd/fh3/app/list.js as an example of what a command definition looks like. Using the 'demand' syntax, yargs look after all validation - you don't need to worry about it. Commands can be DRY'd up even more if they're very similar - e.g. app start. This extends from a base class - anything with an _ prefix doesn't go into the command tree.

There's no longer a need to require() new commands in many different places - no need to require() new commands at all, just put them in the relevant tree structure within lib/cmd. Tests are turbo'd, nock for mocks, coverage is at least a little better than before.

Setting a Proxy Server

fhc fhcfg set proxy http://host:port
# eg:
fhc fhcfg set proxy http://127.0.0.1:8080

Tests

$grunt test

Internationalization

All of the strings expecting to be internationalized have to be passed through i18n._() function like:

module.exports = {
  'desc': i18n._('Version info about the FeedHenry instance we\'re connected to'),
  ...
}

To get strings translated, we use Zanata, the web-based translation platform. The source strings file has to be uploaded into the Zanata server. That can be done with:

$grunt potupload

Prior to doing that, please make sure you have an account on the Zanata server. If not, please visit https://translate.zanata.org and follow up the steps at http://docs.zanata.org/en/release/user-guide/account/account-sign-up/ to create an account, and http://zanata-client.readthedocs.io/en/latest/configuration/ to store the API key into $HOME/.config/zanata.ini.

Node version :

FHC requires node 4.4.x version

Javascript style & syntax

Javascript style & syntax can be checked using:

$grunt eslint
  • eslint configuration is in .eslintrc.json
  • If eslint has any errors, the build will fail

Report Bug/Issue:

RHMAP Supportability

If you are targetting a version of RHMAP < 3.5.0 then install an older version of fh-fhc with npm install fh-fhc@latest-1.

Tags/Versions to install

If you want install an older version of fh-fhc you can do it by the available tags via the command npm install fh-fhc@<tag>. To check the available tags use the command npm view fh-fhc and check the dist-tags section. Following a list with the currently tags/versions available.

Tag Version
latest 7.x
latest-1 1.2.0
latest-2 2.18.0-896
latest-4 4.2.5

fh-fhc's People

Contributors

aidenkeating avatar camilamacedo86 avatar cianclarke avatar corinnekrych avatar danielconnor avatar david-martin avatar davidffrench avatar dberesford avatar evanshortiss avatar grdryn avatar jasonmadigan avatar jhellar avatar jimoleary101 avatar leathersole avatar lsean avatar maleck13 avatar mmurphy avatar mmusil avatar nialldonnellyfh avatar odra avatar paolobueno avatar pb82 avatar philipgough avatar psturc avatar rachael-oregan avatar tagoh avatar tomjackman avatar witmicko avatar wtrocki avatar ziccardi avatar

Stargazers

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

Watchers

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

fh-fhc's Issues

'Request' based binary upload not working on all FH clusters

See commit 90bd8e1.

To reproduce, see the two files below, newupload.js and oldupload.js. Tweak storeitems guid and target urls as appropriate when testing these (and run from the root fh-art directory).

The oldupload.js works on all clusters. newupload.js fails when run against CSG and LON3, but pass locally and in staging.

newupload.js:

var requestjs = require('request');
var fs = require('fs');
var util = require('util');
var path = require('path');

var headers =  { accept: 'application/json',
   cookie: 'feedhenry=9iSWBCOqW5dxpDWsDrIgPZGI;',
   'User-Agent': 'FHC/0.7.12-BUILD-NUMBER linux/2.6.32-38-server' };

var opts = {
   url: 'https://testing-csg1.feedhenry.com/box/srv/1.1/admin/storeitem/uploadbinary',
   headers: headers
};

var r = requestjs.post(opts, function(err, response, body){
  console.log("err: " + util.inspect(err))
  console.log("body: " + util.inspect(body))
});

// Get a handle on a form for Multi Part Form Upload
var form = r.form();

form.append('type', 'android');
form.append('guid', 'vxBCC7Q8UYDhOnXZcHFtdjgq');
form.append('file', fs.createReadStream('test/fixtures/android.apk.zip'));

oldupload.js

var requestjs = require('request');
var fs = require('fs');
var util = require('util');
var path = require('path');

  var headers =  { accept: 'application/json',
     cookie: 'feedhenry=9iSWBCOqW5dxpDWsDrIgPZGI;',
     'User-Agent': 'FHC/0.7.12-BUILD-NUMBER linux/2.6.32-38-server' };

  var opts = {
     //url: 'https://testing-csg1.feedhenry.com/box/srv/1.1/admin/storeitem/uploadbinary',
     host: 'testing-csg1.feedhenry.com',
     path: '/box/srv/1.1/admin/storeitem/uploadbinary',
     headers: headers
  };

var log = function() {
  function info(data){
    console.log(data); 
  }
  return { 
    info : info,
    silly : info
  };
}()

uploadFile(opts.url, 'test/fixtures/android.apk.zip', {'type': 'android', 'guid' : 'vxBCC7Q8UYDhOnXZcHFtdjgq'},'"application/octet-stream"', function(err, data){
  console.log("err: " + util.inspect(err))
  console.log("data: " + util.inspect(data))

});

function uploadFile(url, filepath, fields, contentType, cb){
  var boundary = Math.random();
  var post_data = [];
  var path = require('path');
  var filename = path.basename(filepath);
  for(var key in fields){
    post_data.push(new Buffer(EncodeFieldPart(boundary, key, fields[key]), 'ascii'));
  }

  post_data.push(new Buffer(EncodeFilePart(boundary, contentType, 'file', filename), 'ascii'));

  var file_reader = fs.createReadStream(filepath, {encoding: 'binary'});
  var file_contents = '';
  file_reader.on('data', function(data){
    file_contents += data;
  });
  file_reader.on('end', function(){
    post_data.push(new Buffer(file_contents, 'binary'));
    post_data.push(new Buffer("\r\n--" + boundary + "--"), 'ascii');
    doUploadFile(url, post_data, boundary, cb);
  });
}

// Field encoding
function EncodeFieldPart(boundary,name,value) {
    var return_part = "--" + boundary + "\r\n";
    return_part += "Content-Disposition: form-data; name=\"" + name + "\"\r\n\r\n";
    return_part += value + "\r\n";
    return return_part;
}

// File encoding
function EncodeFilePart(boundary,type,name,filename) {
    var return_part = "--" + boundary + "\r\n";
    return_part += "Content-Disposition: form-data; name=\"" + name + "\"; filename=\"" + filename + "\"\r\n";
    return_part += "Content-Type: " + type + "\r\n\r\n";
    return return_part;
}

// do the actual upload
function doUploadFile(urlpath, post_data, boundary, cb) {

  var length = 0;

  for(var i = 0; i < post_data.length; i++) {
    length += post_data[i].length;
  }
  var url = require('url');
  var https = https || require('https');
  var post_options = {
    //host: url.parse(getFeedHenryUrl()).hostname,
    host: 'testing-csg1.feedhenry.com',
    port: '443',
    path: opts.path, //'/box/srv/1.1/admin/storeitem/uploadbinary',
    method: 'POST',
    headers : {
        'Content-Type' : 'multipart/form-data; boundary=' + boundary,
        'Content-Length' : length,
        //'Cookie' : "feedhenry=" + fhc.config.get("cookie") + ";"
        'Cookie' : opts.headers.cookie
    }
  };

  var post_request = https.request(post_options, function(response){
    response.setEncoding('utf8');
    var data = '';
    response.on('data', function(chunk){
      data = data + chunk;
    });
    response.on('end', function(){
      log.silly(data, 'app import');

      data = JSON.parse(data);
      return cb(undefined, data); 
    });
    response.on('error', function(err) {
      return cb(err);
    });
  });

  for (var i = 0; i < post_data.length; i++) {
    post_request.write(post_data[i]);
  }
  post_request.end();
}

FHC Build with FH3 and iOS

Hi,

I'm trying to build my application using FHC with the following command:

fhc build project=<VALID_PROJECT> app=<VALID_CLIENT> destination=ipad keypass=<PASSWORD> config=distribution download=false cloud_app=<VALID_CLOUD> version=6.0 --verbose

It fails with the following error:

eshortiss@MacBook-Pro:~/workspaces/fh/$ fhc build project=sGS2n58YEaoXgYCdMYOtpB6y app=sGS2n27MgabbdVF2guzx2_Gt destination=ipad keypass=password config=distribution download=false cloud_app=sGS2n4DiMJkTIMjV6SI4Lwdq version=6.1 --verbose
fhc info it worked if it ends with ok
fhc info using [email protected]
fhc info using [email protected]
fhc verb feedhenry url https://DOMAIN.feedhenry.com
fhc verb resolveUrl - IN box/srv/1.1/ide/DOMAIN/user/read
fhc verb resolveUrl - OUT https://DOMAIN.feedhenry.com/box/srv/1.1/ide/DOMAIN/user/read
fhc verb calling url https://DOMAIN.feedhenry.com/box/srv/1.1/ide/DOMAIN/user/read payload: null
fhc verb getHeaders { accept: 'application/json',
fhc verb getHeaders   cookie: 'feedhenry=SESSION;',
fhc verb getHeaders   'User-Agent': 'FHC/0.31.5-5 darwin/14.1.0' }
fhc ERR! 
fhc ERR! fhc build project=<project-id> app=<app-id> cloud_app=<cloud-app-id> tag=<tag> destination=<destination> version=<version> config=<config> keypass=<private-key-password> certpass=<certificate-password> download=<true|false> provisioning=<path-to-provisioning-profile> cordova_version=<cordova version>
fhc ERR! where <destination> is one of: andriod, iphone, ipad, ios(for universal binary), blackberry, windowsphone7, windowsphone (windows phone 8)
fhc ERR! where <version> is specific to the destination (e.g. Android version 4.0)
fhc ERR! where <config> is either 'debug' (default), 'distribution', or 'release'
fhc ERR! where <provisioning> is the path to the provisioning profile
fhc ERR! where <cordova_version> is for specifying which version of Cordova to use. Currently supported: either 2.2 or 3.3. Only valid for Android for now.
fhc ERR! 'keypass' and 'certpass' only needed for 'release' builds
fhc ERR! 'provisioning' is only optional for iphone or ipad builds
fhc verb exit [ 1, true ]
fhc not ok

A credential bundle exists on the domain and user. Is there a new syntax required for build with FH3?

Argument parsing fails if using as a module

I'm working on a PR that caused me to run into this issue. When using fhc as a CLI the following works fine:

fhc projects read --project=rmrqnkjpfjnpqmu6ktanlgy7

Using it as a module:

fhc.applyCommandFunction('projects read --project=rmrqnkjpfjnpqmu6ktanlgy7', callback)

causes it to return an error:

Usage:
 fhc projects read --project=<project>

Examples:
  fhc projects read --project=<project>    Read the <project>


Options:
  --project, -p  Unique 24 character GUID of the project  [required]

Missing required arguments: project
Unhandled rejection Error: Missing required arguments: project
    at fail (/Users/eshortis/workspaces/rhmap-features/rhmap-previewer-cloud/node_modules/fh-fhc/node_modules/yargs/index.js:192:21)
    at parseArgs (/Users/eshortis/workspaces/rhmap-features/rhmap-previewer-cloud/node_modules/fh-fhc/node_modules/yargs/index.js:537:13)
    at Object.Argv.Object.defineProperty.get [as argv] (/Users/eshortis/workspaces/rhmap-features/rhmap-previewer-cloud/node_modules/fh-fhc/node_modules/yargs/index.js:460:36)
    at Object.exports.validate (/Users/eshortis/workspaces/rhmap-features/rhmap-previewer-cloud/node_modules/fh-fhc/lib/utils/args.js:23:15)
    at EventEmitter.fhc.applyCommandFunction (/Users/eshortis/workspaces/rhmap-features/rhmap-previewer-cloud/node_modules/fh-fhc/lib/fhc.js:158:23)
    at EventEmitter.tryCatcher (/Users/eshortis/workspaces/rhmap-features/rhmap-previewer-cloud/node_modules/bluebird/js/release/util.js:16:23)
    at EventEmitter.ret [as applyCommandFunctionAsync] (eval at <anonymous> (/Users/eshortis/workspaces/rhmap-features/rhmap-previewer-cloud/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:13:39)

I believe I have tracked it down to the _normaliseFlagsAndArs in args.js. This function incorrectly assumes that FHC will be used as a CLI only and uses process.argv instead of the argsIntoCommand variable which should be used (as far as I can tell).

Node 6.x Support

I'm building an Ionic 2 app, which requires node 6.x. This is the message I get when from fhc -v with node 6.9.5 installed:

fhc ERR! unsupported version 
fhc ERR! unsupported version fhc requires node version: >=0.10 <= 4.4
fhc ERR! unsupported version And you have: v6.9.5
fhc ERR! unsupported version which is not satisfactory.
fhc ERR! unsupported version 
FHC Version: 2.17.1-516

I haven't checked to see if functionality actually breaks, but it the error is disconcerting.

Table listing not always working correctly

When listing apps (fhc apps) using table view (the default view), the data does not always render correctly.

2 issues have been observed:

  1. The table borders are lot always aligned correctly
  2. The app list ended prematurely - the account I was listing for had 94 apps, but the table list ended after showing only 9 apps. When listed using fhc apps --json, the full list of 94 apps was returned.

Copy of actual output:

┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Id                       ┃ Title                                  ┃ Description                                                                                          ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ P7aai4P1KUqMWeqCrebC2nHi ┃ 00001                                  ┃ 00001                                                                                                ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ 2s6kX_7cjqF8QUSCCMSUkliU ┃ ___App Anatomy                         ┃ This app demonstrates how to use client-side packages to customise application behavior and appeara… ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ uG3-dIwPB4-xLinZ3npSD9iV ┃ __Android_Export_Test                  ┃ __Android_Export_Test                                                                        
    ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ fhXjl9GZc7oz8ujLomLZADMt ┃ anatomy app clone                      ┃ This app demonstrates how to use client-side packages to customise application behavior and appeara… ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ olyP5SFjH6s30Demhk0RTx4E ┃ AnatomyTest                            ┃ This app demonstrates how to use client-side packages to customise application behavior and appeara… ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ qECZEwCmNvwZqE_GmUVHuy8u ┃ AndroidViewTest                        ┃ AndroidViewTest                                                                                      ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ TLNPydvdRHlU-zKEDXCqAnco ┃ app3                                   ┃ This app demonstrates how to use client-side packages to customise application behavior and appeara… ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ H3Mho7Z8se-RecRoqMLnHkEi ┃ App Anatomy                            ┃ This app demonstrates how to use client-side packages to customise application behavior and appeara… ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ MtutnAmwLVneYUUda3yeEbK_ ┃ App Anatomy                            ┃ http://docs.feedhenry.com/wiki/App_Anatomy                                                           ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━jfrizelle@DELL-32DXN4J:~$ 

admin-storeitems.addBinary is wrong

It is hard coded to upload iphone apps.

It should read

function addBinary(guid, type, binary, cb){
    fhreq.uploadFile("/box/srv/1.1/admin/storeitem/uploadbinary", binary, {"type":type,"guid":guid},  "application/octet-stream", function (err, ok){
       if(err) return cb(err);
       return cb(undefined, ok);
    });
}

"fhc local"'s port parameter was renamed

When I ran "fhc local" for an FH2 cloud app, the port parameter seemed to be ignored. After checking the fhc source code I found the port parameter was renamed to clientPort. However, the documentation from "fhc help local" still shows the old port parameter.

The problem:

$ fhc -v
0.31.0-469

$ fhc local port=7000 cloudPort=7001
starting cloud code on port 7001
Serving App files on port: 8000

$ fhc local clientPort=7000 cloudPort=7001
starting cloud code on port 7001
Serving App files on port: 7000

The documetation:

https://github.com/feedhenry/fh-fhc/blob/master/doc/local.md
https://github.com/feedhenry/fh-fhc/blob/master/man1/local.1

SYNOPSIS
fhc local [packages=<package[,package...]>] [port=] [cloudPort=] [redisHost=] [redisPort=] [redisPassword=] [debug=true] [debugBrk=true] [decoupled=true] [logprefix=false] [loghighlight=true]

EXAMPLE
fhc local packages=ios,iphone port=8000 redisHost=127.0.0.1

Improve 'target' command

Feedback from Joe below:

  • target should validate that it can contact FH
  • target should add https if user doesn't

Hi Damien,

If you do fhc target demo.feedhenry.com

It says successfully targeted. But if you try and login it bails out with the error below. I then changed the fhc target command to https://demo.feedhenry.com and it worked. Might be better to reject the target command if the https:// prefix is not present or silently add it in if its missing.

Joe.

Shanktop:~ jdrumgoole$ fhc login [email protected] password123
fhc WARN No protocol? { pathname: '/box/srv/1.1/act/sys/auth/login',
fhc WARN No protocol? path: '/box/srv/1.1/act/sys/auth/login',
fhc WARN No protocol? href: '/box/srv/1.1/act/sys/auth/login' }
fhc ERR! login response Error: undefined log message
fhc ERR! login response at log (/usr/local/lib/node_modules/fh-fhc/lib/utils/log.js:111:11)
fhc ERR! login response at Function.verbose (/usr/local/lib/node_modules/fh-fhc/lib/utils/log.js:56:39)
fhc ERR! login response at /usr/local/lib/node_modules/fh-fhc/lib/utils/fhlogin.js:47:9
fhc ERR! login response at /usr/local/lib/node_modules/fh-fhc/lib/utils/fhlogin.js:37:18
fhc ERR! login response at ClientRequest.cb (/usr/local/lib/node_modules/fh-fhc/lib/utils/request.js:44:9)
fhc ERR! login response at ClientRequest.emit (events.js:67:17)
fhc ERR! login response at Socket. (http.js:1114:11)
fhc ERR! login response at Socket.emit (events.js:67:17)
fhc ERR! login response at Array.0 (net.js:301:25)
fhc ERR! login response at EventEmitter._tickCallback (node.js:192:40)
fhc ERR! login Error: undefined log message
fhc ERR! login at log (/usr/local/lib/node_modules/fh-fhc/lib/utils/log.js:111:11)
fhc ERR! login at Function. (/usr/local/lib/node_modules/fh-fhc/lib/utils/log.js:56:39)
fhc ERR! login at /usr/local/lib/node_modules/fh-fhc/lib/utils/fhlogin.js:48:9
fhc ERR! login at /usr/local/lib/node_modules/fh-fhc/lib/utils/fhlogin.js:37:18
fhc ERR! login at ClientRequest.cb (/usr/local/lib/node_modules/fh-fhc/lib/utils/request.js:44:9)
fhc ERR! login at ClientRequest.emit (events.js:67:17)
fhc ERR! login at Socket. (http.js:1114:11)
fhc ERR! login at Socket.emit (events.js:67:17)
fhc ERR! login at Array.0 (net.js:301:25)
fhc ERR! login at EventEmitter._tickCallback (node.js:192:40)
fhc ERR! Error: undefined Could not login!
fhc ERR! undefined
fhc ERR! at /usr/local/lib/node_modules/fh-fhc/lib/utils/fhlogin.js:49:15
fhc ERR! at /usr/local/lib/node_modules/fh-fhc/lib/utils/fhlogin.js:37:18
fhc ERR! at ClientRequest.cb (/usr/local/lib/node_modules/fh-fhc/lib/utils/request.js:44:9)
fhc ERR! at ClientRequest.emit (events.js:67:17)
fhc ERR! at Socket. (http.js:1114:11)
fhc ERR! at Socket.emit (events.js:67:17)
fhc ERR! at Array.0 (net.js:301:25)
fhc ERR! at EventEmitter._tickCallback (node.js:192:40)
fhc ERR!
fhc ERR! System Darwin 10.8.0
fhc ERR! command "node" "/usr/local/bin/fhc" "login" "[email protected]" "password123"
fhc ERR!
fhc ERR! Additional logging details can be found in:
fhc ERR! /Users/jdrumgoole/fhc-debug.log
fhc not ok

how to remove the rule of sonarqube

i use sonarqube firsttime
so how to remove the rule of sonarqube which named "Variables should be declared before they are used"
if you kown the way to work out it,please help me
thanks

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.