|
|
5 yıl önce | |
|---|---|---|
| __tests__ | 5 yıl önce | |
| client | 5 yıl önce | |
| config | 5 yıl önce | |
| db | 5 yıl önce | |
| modules | 5 yıl önce | |
| processes | 5 yıl önce | |
| server | 5 yıl önce | |
| xml | 5 yıl önce | |
| .dockerignore | 5 yıl önce | |
| .eslintrc.json | 5 yıl önce | |
| .gitignore | 5 yıl önce | |
| .prettierrc | 5 yıl önce | |
| Dockerfile | 5 yıl önce | |
| Dockerfile.test | 5 yıl önce | |
| README.md | 5 yıl önce | |
| docker-compose.yml | 5 yıl önce | |
| docker.npmrc | 5 yıl önce | |
| docker_build.sh | 5 yıl önce | |
| docker_run_psql.sh | 5 yıl önce | |
| docker_run_tests.sh | 5 yıl önce | |
| index.js | 5 yıl önce | |
| logger.js | 5 yıl önce | |
| nginx.conf | 5 yıl önce | |
| package-lock.json | 5 yıl önce | |
| package.json | 5 yıl önce |
A NodeJS web application providing OpenADR 2.0b services.
RSA private key for Kinesis must be installed at pem/private-key.pem.
Please set the following environment variables:
COMPANY: Which company we're associated toNODE_ENV: Which environment we're running in. Can be production | development | test.DB_URL: The database URL used to store buffered sensor readingsENCRYPT_PASS: The password used to encrypt the RSA private key, as well as LOGGER_PEMPORT: The TCP port the webserver should bind toREGION: AWS region to use for KinesisINSTANCE_ID: Instance ID to be used by Kinesis-LoggerLOGGER_PEM: RSA private key contents to be used by Kinesis-LoggerNO_AWS: Set this true when NODE_ENV is development to be able to run outside an AWS environmentAt a minimum you will want to set NODE_ENV to development, NO_AWS to true, and configure a DB_URL to point to
a Postgres database.
Ensure you have a .npmrc file with an authToken for the @hw and @be private repos. If you get an error E401 it's likely
that this is mis-configured.
Run
npm install
to install dependencies.
npm run test
npm run start
The following files should be present in the project directory and are referred to by docker-compose.yml
ssl.crt: VTN certificate file in PEM format. This will be the concatenated result of 3 certificates: 1) VTN cert TEST_RSA_VTN_2003XXXXXXXXX_cert.pem, 2) Root Cert Authority TEST_OpenADR_RSA_RCA0002_Cert.pem, 3) Service Provider TEST_OpenADR_RSA_SPCA0002_Cert.pem. Certificates must be present in that order.ssl.key: VTN key file in PEM format. This will come from a file that looks like TEST_RSA_VTN_2003XXXXXXXXX_privkey.pem in the VTN cert bundle.clientssl.crt: VEN CA certificate file in PEM format. This will be the concatenated result of 2 certificates from the VEN cert bundle (e.g. TEST_RSA_VEN_2003XXXXXXXXX_certs.zip): 1) Intermediate "MCA" cert TEST_OpenADR_RSA_MCA0002_Cert.pem, 2) Root "RCA" cert TEST_OpenADR_RSA_RCA0002_Cert.pem. Certificates must be present in that order. nginx uses this to validate client certificates.You will need an authToken for the @hw repo. You should be able to retrieve this by running npm login https://[insert repo url here]
and looking in ~/.npmrc or ./.npmrc.
Pass the auth token to ./docker_build.sh like
env NPM_TOKEN=YOURTOKENHERE ./docker_build.sh
First follow the Build steps above, then run
./docker_run_tests.sh
First follow the Build steps above, then run
docker-compose up -d
You can tweak the environment variables in docker-compose.yml.
You can run
./docker_run_psql.sh
To get a psql session for the Docker Postgres database.
If you don't want to spin up a separate Postgres database, you can follow the steps in Running in Docker for development,
un-comment the 2 port lines under db in docker-compose.yml, then use a DB_URL of postgres://vtn:vtn@127.0.0.1:55432/vtn_test
in your local NodeJS environment. This will let you change code quickly without rebuilding a Docker image.