Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wyclif

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wyclif - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

bin/makecert

47

bin/server.js
#!/usr/bin/env node
//Wyatt-ERP example server
//WyattERP basic server
//Copyright WyattERP.org; See license in root of this package
// -----------------------------------------------------------------------------
//TODO:
//- Move schema location to a command line option?
//- Default to wyselib's stock schema
//-
var log = require('../lib/logger')('wyclif')
const Fs = require('fs')
const Express = require('express')
const Http = require('http')
const Https = require('https')
var expSPApp = Express()
var argv = require('../args').argv
var credentials = argv.noSSL ? null : require('../credentials')(argv.serverKey, argv.serverCert)
var dbConf = {database:argv.dbName, user: argv.dbAdmin, host: argv.dbHost}
const MaxTimeDelta = 2000 //Allow max 2 second time difference between query and login
const { Wyseman } = require('wyseman')
const { Args, Dispatch, Log, Credentials, SpaServer} = require('../lib/index')
log.trace("SPA Port: ", argv.spaPort, argv.wysegi, argv.serverKey, argv.serverCert)
log.trace("WyCLIf Port: ", argv.clifPort)
log.trace("dbConf:", dbConf)
var log = Log('wyclif')
var { actions, Parser } = require('wyselib')
var argv = Args().argv
var expApp = require('../spaserver')({spaPort:argv.spaPort})
var clif = require('../clifserver')({port: argv.clifPort, credentials, expApp})
var credentials = argv.noSSL ? null : Credentials(argv.serverKey, argv.serverCert, log)
log.debug("SPA Port: ", argv.spaPort, argv.wysegi, argv.serverKey, argv.serverCert)
log.debug("CLIF Port: ", argv.clifPort)
log.debug("Database:", argv.dbName, "At:", argv.dbHost, "Admin:", argv.dbAdmin)
log.trace("Actions: ", actions)
var expApp = SpaServer({spaPort: argv.spaPort, credentials, log})
var wyseman = new Wyseman({
host: argv.dbHost,
database:argv.dbName,
user: null,
}, {
port: argv.clifPort,
dispatch: Dispatch,
delta: MaxTimeDelta,
log, credentials, expApp, actions,
}, {
host: argv.dbHost,
database:argv.dbName,
user: argv.dbAdmin,
schema: __dirname + "/schema.sql"
})
//Parse standard server command line parameters
//Copyright WyattERP.org; See license in root of this package
// -----------------------------------------------------------------------------
//TODO:
//-
const Yargs = require('yargs')
const DefConfig = {
spaPort: 8000,
clifPort: 54320,
spaPort: 4000,
clifPort: 4100,
dbAdmin: 'admin',

@@ -18,3 +14,4 @@ serverKey: process.env.WYCLIF_SERVER_KEY || __dirname + '/../pki/server_private_key.pem',

let d = Object.assign({}, DefConfig, config)
return Yargs()
return require('yargs')
.alias('s','spaPort') .default('spaPort', d.spaPort) //Serve client SPA's at this port

@@ -25,6 +22,7 @@ .alias('i','clifPort') .default('clifPort', d.clifPort) //Access to control layer interface

.alias('D','dbName') .default('dbName', d.dbName) //Database name
.alias('P','dbPassword') .default('dbPassword', d.dbPassword) //Database password
.alias('A','dbAdmin') .default('dbAdmin', d.dbAdmin) //Database administrator name
.alias('H','dbHost') .default('dbHost', d.dbHost) //Database administrator name
.alias('H','dbHost') .default('dbHost', d.dbHost) //Database host computer
.alias('w','wysegi') .default('wysegi', d.wysegi) //Serve wysegi SPA
.alias('n','noSSL') .default('noSSL', false) //Do not run server with SSL
}
//Dispatch action and report interactions to the appropriate service function
//Copyright WyattERP.org; See license in root of this package
// -----------------------------------------------------------------------------
//TODO:
//-
const StringHash = require('string-hash')

@@ -7,0 +5,0 @@ var connectionCount = 0

//Copyright WyattERP.org; See license in root of this package
// -----------------------------------------------------------------------------
module.exports = {

@@ -5,0 +4,0 @@ Args: require('./args.js'),

@@ -5,3 +5,4 @@ //Launch http service to serve applications to the browser

//TODO:
//-
//- Re-enable wysegi (where to serve from?)
//-
const Express = require('express')

@@ -8,0 +9,0 @@ const Http = require('http')

{
"name": "wyclif",
"version": "1.0.1",
"version": "1.0.2",
"description": "WyattERP Control Layer InterFace",

@@ -20,2 +20,5 @@ "main": "lib/index.js",

},
"bin": {
"wyclif": "bin/server.js"
},
"keywords": [],

@@ -22,0 +25,0 @@ "author": "Kyle Bateman",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc