1
0
Fork 0
Commit Graph

14 Commits (1cb47d4acfd4087f4e8641fa4c80ce0eaa3fc058)

Author SHA1 Message Date
Austin Schaffer 1cb47d4acf [DEV-6710] [WIP] Save environment on quote save 2019-12-19 14:17:06 -05:00
Mike Gerwitz e058c8b509 Copyright range update
All files now have the same range, beginning from the conception of this
project.
2019-08-30 09:41:35 -04:00
Mike Gerwitz 77ddbbef3b Exclusively use RatingServicePublish over submit URL 2019-03-26 11:01:16 -04:00
Mike Gerwitz c4591f681d Daemon: Return promise for post_rate reduction
This was causing a race condition in some environments.
2019-03-21 14:56:42 -04:00
Mike Gerwitz b8801c039f RatingServicePublish: New trait (mostly proof-of-concept)
This is unfortunately not production-ready code, but we need to get
something out there in the meantime.  The RatingServicePublish's docblock
mentions some of the shortcomings, which will be addressed in the near
future.

There is also more documentation to come once we settle on an implementation.

DEV-4400
2019-03-21 14:08:00 -04:00
Mike Gerwitz 2b93a0bbe4 [bugfix] Daemon: Do not un-initialize controller no_result_url
* src/server/daemon/Daemon.js (getProgramController): Do not initialize
  `no_results_url' to an empty string if not provided; instead, keep any
  existing value.  Otherwise, later calls with no arguments will clear
  previously-set values.

DEV-3254
2018-08-15 14:22:01 -04:00
Mike Gerwitz ea30e94527 Integrate noResultsUrl configuration
This is not the ideal implementation.  Instantiation of RatingService and
such should be moved out of the controller entirely, but we don't have the
time for that right now.
2018-05-01 09:44:55 -04:00
Mike Gerwitz 6733556582 Remove hard-coded skey
This wasn't intended to make its way into a public repo. :)

The existing key was a long-forgotten kluge that was supposed to be
temporary, allowing internal services to create quotes without
authentication.  The chances of this being practically exploited are minimal
in our environment, and it's auditable using webserver logs.

This moves the skey into a configuration file, which allows it to vary by
server and be rotated until a better solution is made available.  skey is
disabled by default (empty string), and when used by us internally, the keys
are now generated using a CSPRNG rather than a brute-forcable 5-byte key
that was hard-coded.

The fact that this appears in webserver logs is a big issue as well.  I
added a task to address that.

* conf/vanilla-server.json (skey): New key.  Default empty.
* src/server/daemon/Daemon.js (start): Provide skey to `#getRouters'.
  (getRouters): Provide skey to `#getProgramController'.
  (getProgramController): Set skey on `controller'.
* src/server/daemon/controller.js (skey): New mutable export (unideal; quick
    change).
  (has_skey): Use it.
2018-04-03 15:29:47 -04:00
Mike Gerwitz 2baabf5e7e Output correct HTTP server port on start
Was outputting NaN, because the property that was being used no longer
existed after previous changes.

* src/server/daemon/Daemon.js (_initHttpServer): Use HTTP port number
  in output.
2017-09-08 14:19:58 -04:00
Mike Gerwitz 445783c256 [BC BREAK] DataApi config lookup
This was a bit involved because the system had to be made async all
the way up the stack.  No attempt was made to clean up the mess up the
stack---no time.

* src/dapi/DataApiFactory.js
  (fromType): [BC BREAK] Fix docblock.  Add `api_name' param.  Call
    `#descLookup' and return promise.
  (descLookup): Add method.  Return promise resolving to provided
    descriptor.  Intended to be overridden by subtype.
* src/dapi/DataApiManager.js
  (_dataApis): Update docblock to indicate that it now stores
    promises.
  (getApiData): Expect promise for `DataApiFactory#fromType' call.
* src/server/DocumentServer.js: (create): [BC BREAK] Accept
    configuration.  Look up dapi conf and pass to
    `ServerDataApiFactory' ctor.  Return promise.
* src/server/daemon/Daemon.js (_initRouters): Provide configuration.
* src/server/daemon/controller.js
  (init): Accept configuration.  Handle return of promise from
    `_createDocumentServer'.
  (_createDocumentServer): Accept configuration, providing to
    `DocumentServer#create'.  Because of aforementioned change to
    `#create', returns promise.
* src/server/request/ServerDataApiFactory.js: Add StoreMissError
    import.
  (_conf): Add property.
  (constructor): [BC BREAK] Accept configuration.
  (descLookup): Add override.  Look up configuration for provided
    dapi.
2017-08-29 15:11:28 -04:00
Mike Gerwitz 985819c31b [BC BREAK] bin/server.js and associated changes
This is based (very) loosely on an internal script to start the
daemon.  It accepts a configuration and starts the daemon.

To accommodate the configuration, a number of miscellaneous changes
have been made.

The vanilla configuration shows the concept, but it has not yet been
fully implemented; that'll likely happen at a later date.  Until then,
the existing environment-variable-based configuration will be used.

* bin/server.js: Add file.
* conf/vanilla-server.json: Example configuration added.
* src/server/daemon/Daemon.js (_httpPort): Remove field.
  (_conf): Add field.
  (__construct): [BC BREAK] Accept conf instead of port and log
    priority.  Move initialization code into `start'.
  (start): [BC BREAK] Initialization code moved here.  Now returns
    promise for entire daemon, which will error in the event of an
    error starting.  Move existing code into `_startDaemon'.
  (_startDaemon): Old `start' code.  Invoked after `start'
    initialization.
  (_createDebugLog, _createAccessLog): Use configuration.  Return
    promise.
  (_initHttpServer): Use configuration.
  (_httpError): Add function to output error and exit.  Extracted from
    `_initHttpServer'.
* src/server/daemon/scripts.js: [BC BREAK] Append "program/" to
    `LV_LEGACY_PATH' so that it can be re-used for script lookups
    rather than using the cwd.  This removes the need of the cwd being
    the legacy src path.
2017-08-29 14:56:10 -04:00
Mike Gerwitz 4d22107a57 Create ProcessManager out of rater/service
* src/server/daemon/Daemon.js (__construct): Reference new class.
* src/server/rater/ProcessManager.js: Add class (extracted from
  service).
* src/server/rater/service.js: Refactored into ProcessManager.
2017-07-06 15:06:57 -04:00
Mike Gerwitz 1bb5191e3e LoVullo Associates => R-T Specialty
Copyright notices updated.  More casual references to "LoVullo
Associates" replaced with "RT Specialty / Lovullo", which will be "RT
Specialty Buffalo" in the future.  Or "RT Specialty", depending on how
this is rolled out.  Or "Ryan Specialty Group".  Who knows.

"R-T Specialty, LLC." is the legal name, which includes the dash.  Not
to be confused with a certain television network.
2017-06-08 14:48:43 -04:00
Mike Gerwitz 657573ab63 Near-complete liberation of liza
I have sat on releasing a lot of this code for years because I wanted
the liza repo to be in a pristine state---tests and all---which
required a great deal of refactoring.  Well, that never happened, and
time is up.

LoVullo Associates---my employer---has been purchased by another
company.  This means that any agreement with LoVullo regarding
releasing free software is going to have to be re-negotiated with this
new company, and I have no idea how those negotiations will go.  So,
I have no choice but to simply release everything in its current state,
or risk it being lost forever.

This represents work over the past 6--7 years, 99.9% of it written by
me.  This project has been my baby for quite some time, and has been
through a number of battles with deadlines and other unfortunate
circumstances; the scars show.  I also didn't really "know" JS when
starting this project.  Perhaps you can help improve upon it.

There are some odds-and-ends that could be committed.  And references
to insurance and LoVullo need to be removed to generalize this.

I hope that this will not be the last public commit for this project.
I'll fight the good fight and we'll see where that takes us.  Maybe
it'll be easy.

Happy hacking.
2017-06-08 14:38:28 -04:00