Skip to content

Environment Variables

Eva Stoddard edited this page Aug 5, 2024 · 13 revisions

This project uses dotenv to allow the definition of global variables in config files. There are twoconfig files in the project:

server/.env - Server Config

DATABASE_URL

The postgres connection URL for the application database. This is the URL Knex will refer to.

ex: postgresql://makerspace:pgpassword@localhost:5433/pgdb

SESSION_SECRET

The name of the cookie that will be used to store the login session information. This can be any single-word string.

ex: super_secret

REACT_APP_ORIGIN

The url of the client react application. This is what the server runner will point to for page requests.

ex: http://localhost:3000

REACT_APP_URL

The url of the base url that clients should navigate to to access the web application. This will often be the same as REACT_APP_ORIGIN.

POSTGRES_USER

The postgres user name. This user should have complete read/write permissions for the database.

POSTGRES_PASSWORD

The password for the postgress user.

POSTGRES_DB

The postgress database slug.

ex: pgdb

NODE_ENV

The type of environment mode the server should start in. This makes a major difference in how user authentication will work. See Authentication.

options: development, staging, production

ID_FORMAT

The NameID format that will be specified in any SAML requests. This should match the format expected by the IdP.

ex: "urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified"

SSL_PUBKEY

The public key to be used for the SAML requests. This should start with -----BEGIN CERTIFICATE----- and end with -----END CERTIFICATE-----. This is a multi-line variable.

SSL_PVKEY

The private key to be used for the SAML requests. This should start with -----BEGIN PRIVATE KEY----- and end with -----END PRIVATE KEY-----. This is a multi-line variable.

IDP_PUBKEY

The public key of the IDP. This should not include any headers and is a single-line value. This value can be found in the metadata of the IdP in between the ds:X509Certificate tags.

ENTRY_POINT

The url the user will be redirected to log in. SAML requests will also be directed here.

ex: "https://mocksaml.com/api/saml/sso"

CALLBACK_URL

The url the IdP will send the user to after logging in at the Entry Point.

ISSUER

The url of the location of the SP's (this application's) SAML metadata. For use with Shibboleth, this value should be the public IP or domain of the application (not localhost) + /Shibboleth.sso/metadata.

ex: "http://129.21.158.138:3000/Shibboleth.sso/metadata"

SAML_IDP

Set this as TEST if using a Test IDP. This will avoid using RIT Shibboleth specific settings during user serialization. For production solutions, this attribute is not necessary.

API_KEY

The secret string that will be kept on all card readers to check REST API call authenticity.

API_NORMAL_LOGGING

If true, successful modifying API calls will be reported as an Audit Log entry.

API_DEBUG_LOGGING

If true, errors in any API call will be reported as an Audit Log entry.

CLOUDPRINT_API_URL

The URL of the 3DPrinterOS API.

client/.env

REACT_APP_GRAPHQL_URL

The url of GraphQL's runner. This is the client url + /graphql

ex: "http://localhost:3000/graphql"

REACT_APP_LOGIN_URL

The url of the client's login page.

ex: "http://localhost:3000/login"

PUBLIC_URL

The path where the react app will be running. This will be "/app".

Clone this wiki locally