Skip to content

tzoratto/faya

Repository files navigation

Faya

Faya provides a simple way to create and manage tokens through its web interface or its API.

Usage

You can create tokens with various properties :

  • Active (true/false)

  • From (date)

  • To (date)

  • Pool (number)

The Active property prevails over the others. All properties can be set at the same time, for instance, if you set To property to 2017-01-01 00:00 and Pool property to 25 000 then the token can be used 25 000 times until 2017-01-01 00:00. Once the date is reached, the token cannot be used again, even if the Pool is not empty yet. Correspondingly, if the token is used 25 000 times before the date then it cannot be used again even though the date hasn’t been reached yet.

Tokens are stored in namespaces in order to use them for totally unrelated subjects. Consequently, a token is valid (or not) against a specific namespace.

Configuration

Some environment variables are available to configure Faya :

Table 1. Environment variables
Name Default Description

MONGO_URL

null

Full URL of the MongoDB instance used for production

MONGO_TEST_URL

mongodb://localhost/faya_test

Full URL of the MongoDB instance used for tests

JWT_SECRET

changethis

Secret used to sign JWT

HTTPS_ENABLED

null

Set to true if Faya is behind a reverse proxy providing HTTPS

LOG_LEVEL

info

Pick from [error, warn, info, verbose, debug, silly]

MAIL_HOST

null

SMTP host

MAIL_PORT

null

SMTP port

MAIL_TLS

null

SMTP TLS

MAIL_USERNAME

null

SMPT username

MAIL_PASSWORD

null

SMTP password

MAIL_FROM

null

Email address used to send mail

Run

You can either install node and NPM to run Faya or simply build the Docker image :

docker build -t faya .
docker run -e MONGO_URL=... faya
Important
This repository only contains the Faya server. In order to deploy/run a full instance, see deploy-exemple directory

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published