Skip to content

Environment Variables

Eva Stoddard edited this page Jun 28, 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.

Clone this wiki locally