Skip to content

Environment Variables

Eva Stoddard edited this page Dec 4, 2024 · 11 revisions

This project uses dotenv to allow the definition of global variables in config files. There are two config files in the project, but if you are using a managed provided like Heroku, this will be combined into one Config Variable list:

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.

CLOUDPRINT_API_USERNAME

The Username of a 3DPrinterOS user with permission to add users to noted workgroups.

CLOUDPRINT_API_PASSWORD

The Password of the above user.

CLOUDPRINT_API_WORKGROUP

The ID number of the self-service access workgroup.

CLOUDPRINT_API_FS_WORKGROUP

The ID number of the full-service access workgroup.

ID_3DPRINTEROS_QUIZ

The ID number of the quiz that will grant the taker self-service access.

ID_3DPRINTEROS_FS_QUIZ

The ID number of the quiz that will grant the taker full-service access.

REACT_APP_CDN_URL

The url of the CDN that will be used to source equipment images, training media, etc. Given a small scale, you can use Github's CDN to access media stored in a repository: https://cdn.jsdelivr.net/gh/rit-construct-makerspace/makerspace/<directory path (i.e. client/public/)>

REACT_APP_CDN_EQUIPMENT_DIR

The directory path appended to the above url that will be used to pull equipment images based on the filename defined in the Equipment table.

REACT_APP_DEFAULT_STAT_OPEN_TIME

The default open time that will be used to calculate temporal statistics on the Statistics page if no relevant Zone open time is available.

REACT_APP_DEFAULT_STAT_CLOSE_TIME

The default close time that will be used to calculate temporal statistics on the Statistics page if no relevant Zone close time is available.

SLACK_CHANNEL_ID

The ID of the Slack channel that the server will send service notifications to. Note that the Slack bot must be joined to the channel.

SLACK_TOKEN

The API Token for the Slack bot.

STAT_TIMEZONE

The timezone all statistics should be set to on translation. Uses Postgresql notation.

ex: EDT

TRAINING_MAX_ATTEMPTS_PER_DAY_BEFORE_LOCK

The number of times a user must fail a training for a training hold to be placed on that specific training. Seeting this to

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"

REACT_APP_EVENTBRITE_API_LIST_EVENTS_URL

The Eventbrite API url to fetch events for the noted organization.

ex: "https://www.eventbriteapi.com/v3/organizations/2287721641363/events"

REACT_APP_EVENTBRITE_API_KEY

The Eventbrite API key from a user with API access to the above organization.

REACT_APP_EVENTBRITE_PAGE_LINK

The url to be attached to the "View All" link of the events module.

ex: "https://www.eventbrite.com/organizations/18748936242"

PUBLIC_URL

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