jsreport license use



  • My company recently purchased a enterprise license for jsreport and i'm having trouble finding out where exactly you enter/put the license for jsreport to use. I did not see anything in prod.config.json or dev.config.json. I looked through the help documentation and did not see anything related to it. Hopefully i'm not blind. Thanks in advance for your help.



  • Hi,

    thank you for reaching us here and supporting the development by purchasing the license.

    You are not blind because it was not there. This information should be delivered though the email from gumroad.
    However since this quite often ends in the spam, I've add the instructions also to the FAQ.

    https://jsreport.net/learn/faq#how-to-apply-license-key

    How to apply license key?

    You can choose one from the options below:

    1. The license key can be saved into the application working directory or data folder as license-key.txt
    2. Filled in the configuration file in the property license-key
    3. Passed in the command line parameter as --license-key=xxx
    4. Set in the environment variable as license-key

    Make sure to remove all the white spaces around the key.

    Jan



  • Thanks Jan! Our purchase department just let me know where they put the key without forwarding the email. Thanks for the info!



  • Hello,
    We have just bought an enterprise license. I have 2 questions:

    1. Is it OK to put the key in a public git repo? Should we gitignore key files including license.json generated?
    2. I can activate the licence with: jsreport start --license-key=XYZ...
      But since it is a bit tedious, I would like to use the license-key.txt file in the working directory but it does not work! I tried to put it at same level as server.js/package.json, tried data folder too. There is no space, no CR+LF in the file, nothing but the key itself. If I copy this key on jsreport start --license-key=XYZ... , it works fine!
      Here is the dump:
      2018-04-10T21:33:56.910Z - error: Error occured during reporter init Error: License key is not valid
      at D:\sources\bfp-stages-rapport\node_modules\jsreport-licensing\lib\licensing.js:141:20
      at tryCatcher (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:512:31)
      at Promise._settlePromise (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:569:18)
      at Promise._settlePromise0 (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:614:10)
      at Promise._settlePromises (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:693:18)
      at Promise._fulfill (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:638:18)
      at Promise._settlePromise (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:582:21)
      at Promise._settlePromise0 (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:614:10)
      at Promise._settlePromises (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:693:18)
      at Promise._fulfill (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:638:18)
      at D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\nodeback.js:42:21
      at D:\sources\bfp-stages-rapport\node_modules\graceful-fs\graceful-fs.js:43:10
      at FSReqWrap.oncomplete (fs.js:135:15)
      Error: License key is not valid
      at D:\sources\bfp-stages-rapport\node_modules\jsreport-licensing\lib\licensing.js:141:20
      at tryCatcher (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:512:31)
      at Promise._settlePromise (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:569:18)
      at Promise._settlePromise0 (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:614:10)
      at Promise._settlePromises (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:693:18)
      at Promise._fulfill (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:638:18)
      at Promise._settlePromise (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:582:21)
      at Promise._settlePromise0 (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:614:10)
      at Promise._settlePromises (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:693:18)
      at Promise._fulfill (D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\promise.js:638:18)
      at D:\sources\bfp-stages-rapport\node_modules\bluebird\js\release\nodeback.js:42:21
      at D:\sources\bfp-stages-rapport\node_modules\graceful-fs\graceful-fs.js:43:10
      at FSReqWrap.oncomplete (fs.js:135:15)

    Thanks for help


  • administrators

    hi @Normand-Blais

    Is it OK to put the key in a public git repo?

    i think that as a general recommendation nothing confidential should be put inside a git repository so my advice will be that you should distribute the license in internal communication channels of your company, i know it will be more work to distribute the file in that way but it is safer than a public git repo.

    Should we gitignore key files including license.json generated?

    yes, you can add both files into .gitignore, license.json will be generated again if it does not exists so every machine where you use the key will have that file in the end when jsreport runs.

    I can activate the licence with: jsreport start --license-key=XYZ...
    But since it is a bit tedious, I would like to use the license-key.txt file in the working directory but it does not work! I tried to put it at same level as server.js/package.json

    can you email me more details about your setup and how your directory looks like? your node.js version and jsreport version? email: support@jsreport.net

    i checked your license in our DB and tested it in a sample project with latest version of jsreport (1.10.0) with license-key.txt file at the root directory of my project:

    0_1523399505772_Captura de pantalla 2018-04-10 a las 5.31.27 p.m..png

    and it worked without issues.



  • I have found the problem.
    We deploy jsreport docker on a Kubernetes cluster. It appears that Kubernetes does not accept environment variables with an hyphen (license-key). So I used license_key instead and put a line in server.js: "process.env["license-key"] = process.env.license_key" before server starts.
    If the variable license_key is unset on developer's PC, the string "undefined" is put in license-key! The server does not read the license-key.txt file and throws an error.
    Thanks


  • administrators

    great, thanks for sharing the details about the problem!


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.