Sign inSign up

jambonz/db-create

By jambonz

Updated about 17 hours ago

image that initializes and seeds the jambonz database.

Image
0

10K+

jambonz/db-create repository overview

jambonz-api-server Build Status

Jambones REST API server of the jambones platform.

Configuration

Configuration is provided via environment variables:

variablemeaningrequired?
JWT_SECRETsecret for signing JWT tokenyes
JWT_EXPIRES_INexpiration time for JWT token(in minutes)no
ENCRYPTION_SECRETsecret for credential encryption(JWT_SECRET is deprecated)yes
HTTP_PORTtcp port to listen on for API requests from jambonz-api-serverno
JAMBONES_LOGLEVELlog level for application, 'info' or 'debug'no
JAMBONES_MYSQL_HOSTmysql hostyes
JAMBONES_MYSQL_USERmysql usernameyes
JAMBONES_MYSQL_PASSWORDmysql passwordyes
JAMBONES_MYSQL_DATABASEmysql datayes
JAMBONES_MYSQL_PORTmysql portno
JAMBONES_MYSQL_CONNECTION_LIMITmysql connection limitno
JAMBONES_REDIS_HOSTredis hostyes
JAMBONES_REDIS_PORTredis portno
RATE_LIMIT_WINDOWS_MINSrate limit windowno
RATE_LIMIT_MAX_PER_WINDOWnumber of requests per windowno
JAMBONES_TRUST_PROXYtrust proxies, must be a numberno
JAMBONES_API_VERSIONapi versionno
JAMBONES_TIME_SERIES_HOSTinfluxdb hostyes
JAMBONES_CLUSTER_IDcluster idno
HOMER_BASE_URLHOMER URLno
HOMER_USERNAMEHOMER usernameno
HOMER_PASSWORDHOMER passwordno
K8Sservice running as kubernetes serviceno
K8S_FEATURE_SERVER_SERVICE_NAMEfeature server name(required for K8S)no
K8S_FEATURE_SERVER_SERVICE_PORTfeature server port(required for K8S)no
JAMBONZ_RECORD_WS_USERNAMErecording websocket usernameno
JAMBONZ_RECORD_WS_PASSWORDrecording websocket passwordno
Database dependency

A mysql database is used to store long-lived objects such as Accounts, Applications, etc. To create the database schema, use or review the scripts in the 'db' folder, particularly:

Note: due to the dependency on the npmjs mysql package, the mysql database must be configured to use sql native authentication.

Running the app

At this point, if you have followed the above instructions, its simply

npm install
node app

The server will listen by default on port 3000, to change this set the HTTP_PORT environment variable:

HTTP_PORT=4000 node app
Running the test suite

To run the included test suite, you will need to have a mysql server installed on your laptop/server. You will need to set the MYSQL_ROOT_PASSWORD env variable to the mysql root password before running the tests. The test suite creates a database named 'jambones_test' in your mysql server to run the tests against, and removes it when done.

MYSQL_ROOT_PASSWORD=foobar npm test
Testing a deployed server

There is a swagger endpoint at http://<your-ip>:3000/swagger that can be used to exercise the APIs. Bearer authentication is required, so you will need an auth token (refer to create-admin-token.sql to see how to generate one).s

Tag summary

Content type

Image

Digest

sha256:af4cb9a58

Size

216.1 MB

Last updated

about 17 hours ago

docker pull jambonz/db-create