Environment variables

You can easily create environment variables using the built in setup tool 'npm run setup', or manually create the files.

Create a config folder on the root of the project, and create a file with the name prod.env for the server. For the client variables create a .env.production file in the root of the project.

Docker: If you're using Docker, instead create a file named 'docker-variables.env' on the root of the project. You must also include DOCKER=true in the servers environment variables.

Server Environment Variables:

  • MONGODB_URL (Required): Sets the MongoDB URL, this should also work with DocumentDB.

  • HTTP_PORT (Required): Sets the HTTP port number.

  • HTTPS_PORT (Required): Sets the HTTPS port number.

  • REMOTE_URL (Required): This is the URL that the client navigates to in their browser in order to access myDrive. This is needed for things like the Google Drive redirect URL, and including the URL when sending email verification/password reset emails.

  • PASSWORD_ACCESS (Required): Sets the JWT secret for access tokens.

  • PASSWORD_REFRESH (Required): Sets the JWT secret for refresh tokens.

  • PASSWORD_COOKIE (Required): Sets the secret for cookies.

  • DB_TYPE (Required): Sets the Database Type, options include s3/mongo/fs. Go below to see what other variables are needed depending on what option you select.

  • NODE_ENV (Required): Must be set to 'production'.

  • SSL (Optional): Enables SSL, place certificate.crt, certificate.ca-bundle, and certificate.key at the root of the project. Set this to 'true'

  • SECURE_COOKIES (Optional): Makes cookies secure, which means they can only be sent with HTTPS/SSL. Choose this option only if you are using HTTPS.

  • KEY (Optional): Encryption key for data, this is not recommended, please use the built in webUI for setting the key. Do not lose this key, you cannot recover this key, and all data will be lost.

  • DOCKER (Optional/Required): Sets the server to use docker, set this to 'true'.

  • FS_DIRECTORY (Optional/Required): Sets the directory for file data on the file system.

  • S3_ID (Optional/Required): Sets the Amazon S3 ID.

  • S3_KEY (Optional/Required): Sets the Amazon S3 Key.

  • S3_BUCKET (Optional/Required): Sets the Amazon Bucket.

  • ROOT (Optional): Uses a filesystem path, is used for storage space.

  • URL (Optional): Allows to specify URL to host on, this is usually not needed.

  • DISABLE_EMAIL_VERIFICATION (optional): Disabled email verification when creating an account. Also will not allow users to reset their password with an email.

  • SENDGRID_EMAIL (optional): If you are using email verification it is done through sendgrid, enter the sendgrid email address you would like to use. This is the email address users will see when they need to verify their account, or reset their password.

  • SENDGRID_KEY (optional): This is the sendgrid API key.

  • USE_DOCUMENT_DB (Optional): Enables documentDB, this is experimental, set this to 'true'.

  • DOCUMENT_DB_BUNDLE (Optional): Enables SSL with documentDB, set this to 'true'.

  • BLOCK_CREATE_ACCOUNT (Optional): Blocks the ability to create accounts, set this to 'true'.