Skip to content

Configure the Forms Backend#

First, we navigate to the Form Backend subfolder within the i-doit installation:

1
cd /var/www/html/src/classes/modules/forms/backend/

We create a copy of the configuration template:

1
sudo -u www-data cp .env.dist .env

Using a text editor like, vi or nano, we now edit the .env:

1
sudo nano .env

The 'FORMS_SECRET' must not be empty. The key can consist of alphanumeric and special characters.

We now set a FORMS_SECRET and save the file.

Key Value Description
FORMS_SECRET 'g87z$t2r346aSdas%&f52458g724g875!' Key for encrypting the data in the database.
Must not be empty!
Example: FORMS_SECRET='h982t)24/(&%houaq3ho4'
FORMS_PORT '3000' Port for connections
Example: FORMS_PORT='3000'
FORMS_MONGO_DB_SERVER 'mongodb://127.0.0.1:27017/forms' URL and port to connect to the MongoDB server
Example: FORMS_MONGO_DB_SERVER='mongodb://127.0.0.1:27017/forms'

Next, we create an instance.

To use the run.sh, we must first set the rights to run:

1
sudo chmod +x run.sh

Now we can run the run.sh:

1
sudo ./run.sh instance:create {Username} {Apikey}

Each Forms instance has its own API and gets its own {Username} and {Apikey}. These can be defined freely and have nothing in common with the i-doit API.

The data must be noted during the installation, because they must be entered later in the configuration of the Forms Add-on in the i-doit interface.

Example: sudo ./run.sh instance:create forms1 abDzfk74dsfi55FOS32

We have to create a Service for the Forms backend, so it runs in the Background

In order to use forms-service.sh, we must first set the rights to run it:

1
sudo chmod +x forms-service.sh

We now have the systemd service created for the Forms backend.
The Service will be activated and started:

1
sudo ./forms-service.sh

Continue to configuration in i-doit