GithubHelp home page GithubHelp logo

miniblister / mario Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 18f/mario

0.0 2.0 0.0 3.47 MB

DEPRECATED: Initial repo for some shared thoughts around a shopping cart idea.

License: Other

Ruby 3.76% JavaScript 96.24%

mario's Introduction

IMPORTANT WARNING

Note: This project currently uses nodemailer, which seems to suffer from, or benefit from, a tightening of security in Node itself. This is well-documented, but a little obscure. It manifests itself as an error concerning Self-signed SSL Certificates. We made the documented hack and got it working.

However, I doubt this code will work out-of-the-box for you unless you make the same hack after install nodemailer.

Mario : What is this project?

The basic purpose of Mario is to support the email processing of the Communicart (C2) diet. We are using Mario as the Node.js-based mail reader. It also invokes the gsa-advantage-scraper.

We could have implemented this in the C2 rails application, and may still move that feature there.

The basic execution of Mario is that you execute it once, which reads any unread mail. We use a cron job to run it every minute.

This architecture allow us to keep C2 independent of the GSA Advantage.

How to Install Mario

  1. Install Node.js 0.10
  2. Run npm install.
  3. Copy configs.js.EXAMPLE to configs.js and adjust the values there.

In particular, Mario is meant to be installed on the same server with C2, and the path to the shared constants file in C2 should be set in C2_APPLICATION_YML_PATH.

Mario needs these variable to be set into the environment where it runs:

NODE_ENV # (optional) can be set to 'debug' or 'development'

GSA_USERNAME # username for GSA Advantage for the scraper
GSA_PASSWORD # password used by the scraper to pass to GSA Advantage

DYNO_CART_SENDER # email address to read from
COMMUNICART_DOT_SENDER # password for the DYNO_CART_SENDER email

C2_SERVER_ENDPOINT # domain that points to the C2 API
C2_API_KEY # API key assigned to your application for accessing the C2 API. To request a key, please contact <[email protected]>

This mechanism avoids the danger of setting a password in the repo and accidentally committing it.

Although Mario can be used in a number of ways, we normally use a crontab job to run it once a minute. The job actually implements a shell scripts which ensures the environmental variables are correctly exported, and then Mario is invoked, piping the output to a log file.

For debugging, you can of course invoke it by hand. Additionally, there is a flag not to mark email as unread, which allows repetitive execution without a need to recreate the initiating emails.

How to Test Mario

To run the test suite, run npm test. To check code coverage, run npm run-script coverage.

mario's People

Contributors

robertlread avatar afeld avatar phirefly avatar annalee avatar dlapiduz avatar

Watchers

James Cloos avatar  avatar

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.