The file path to a custom SSL certificate authority file. This is usually a file ending with ".pem"
Provides a way to pass custom MongoDB configurations into the MongoDB connection string. This should be a JSON string, and all the configurations are documented at https://mongoosejs.com/docs/connections.html#options
Configures the expiration time for the JWT token that is generated for authentication. Value is in minutes, so 240 would be 4 hours.
An optional key that gives full access to the server including listing all projects. Send in a header with x-admin-key
Used if you wish to enable the portal in this environment making this a Portal Environment
The default email of the super admin account. Only on initial startup when PORTAL_ENABLED is set to "true".
The default password of the super admin account. Only on initial startup when PORTAL_ENABLED is set to "true".
The secret used to connect the portal to your environment
This is the URL of the PDF server, which is set within the API server so that it can download Submission PDF’s pointed to the PDF Server
The database encryption secret
If you need to change the DB_SECRET, set the old value here and it will decrypt with the old and encrypt with the new the next time the server is started. Once changed, you can remove the DB_SECRET_OLD.
[OLD DB SECRET]
Provides a way to point all Email traffic to a server. Should not be used in Production.
The deployed Form.io platform is also capable of offloading all email template processing to a separate micro-service, which is called a Template Service. The code for this service is implemented at the following Github Url.
GitHub - formio/formio-workers: A library of workers for the Form.io platform.
This library can be spun up either using Node.js or as a Lambda function using the Claudia framework. Once you initialize this library with Claudia, you can launch this service in the Lambda function using the NPM command npm run deploy
Once this service is running, you can then provide the following environment variable to now point your environment to the template processing service as follows.
Once this is done, all of the email templates will be processed on an external micro-service which will ensure that bad templates will not bog down the main API service, as well as provides an extra layer of security.
Using Docker Secrets
You can also provide Environment Variables through the use of Docker Secrets. To utilize Docker Secrets, all of the configuration variables are the same as environment variables. Simply use the same name in docker secrets and the server will use the value. In order to use them, set DOCKER_SECRETS=1 in your environment variables. You can also set DOCKER_SECRETS_PATH to use a path other than /run/secrets.
Using Environment Variables with Node.js
For the Node.js deployments, we use a Node.js utility called dotenv to configure the environment variables of the running node application. This can be configured by creating a .env file at the root of the Node.js application, that is similar to the following.
As mentioned above, a Portal Environment enables both the Developer Portal as well as the backend API's for the Projects, forms, submissions, etc. The Docker command to launch a Portal Environment is as follows.
If you are deploying the 6.x version of our deployments, you will need to replace LICENSE_KEY environment variable with LICENSE and use the 6.x license for the value instead.
Once this is done, the server will go through the initialization process and will install the Portal Base project as well as create the initial admin account for this deployment.
The Portal Base project is a special project that is used to control the portal application. Any users that can log into the portal are added to the User resource within this project, and anyone with the Authenticated role within this project will have the ability to log in and create new projects.
After the portal has been enabled, you can now login to the portal, by just navigating to the root url of the deployed API.
To deploy a production ready API Environment, the following command can be used.
docker run -d \
--restart unless-stopped \
--network formio \
--name formio-server \
--link pdf-server:pdf-server \
--link formio-mongo:mongo \
-p 3000:3000 \
After you have your remote deployment API set up, you can now connect that backend using the Hosted Form.io portal found at https://portal.form.io. Ensure that you are logged in to Form.io and have a project created that is on the Enterprise plan. If you don’t already have one, create a project and upgrade its plan.
Within your project, or within each stage of your project, you can now connect to your remote environment by going to the Stage Settings on the left and select On-Premise Environments