Configurations
Configure Harness Open Source with Docker environment variables.
Configure a Harness Open Source instance with the following Docker environment variables.
This command starts a Harness Open Source instance and enables the Admin account. It disables user registration. The Admin account creates all user accounts manually.
docker run -d \
-e GITNESS_PRINCIPAL_ADMIN_EMAIL=mail@example.com \
-e GITNESS_PRINCIPAL_ADMIN_PASSWORD=correct-horse-battery-staple \
-e GITNESS_USER_SIGNUP_ENABLED=false \
-p 3000:3000 -p 3022:3022 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/harness:/data \
--name opensource \
--restart always \
harness/harnessGITNESS_CI_CONTAINER_NETWORKS
Optional comma separated list of Docker networks that are attached to every pipeline step.
Harness Open Source creates a temporary Docker network for steps during pipeline execution. Attach additional Docker networks to all steps in your pipelines by setting this variable.
When setting this variable, GITNESS_URL_CONTAINER must also be set based on the container name.
GITNESS_CI_CONTAINER_NETWORKS=networkA,networkBGITNESS_CI_PARALLEL_WORKERS
Optional number of parallel workers. Each worker can run a single pipeline.
The default value is 2.
GITNESS_DATABASE_DATASOURCE
Set the database connection string.
The default value is the sqlite database file.
If you configure Harness Open Source to use your own Postgres database, you must set the connection string according to your Postgres server configuration. This can be a URI or a series of key-value pairs, for example:
For more information, go to the Postgres driver documentation.
GITNESS_DATABASE_DRIVER
Set the database driver name.
The default value is the sqlite3 driver.
If you configure Harness Open Source to use your own Postgres database, you must set the database driver to postgres.
GITNESS_DEBUG
Set DEBUG log level.
The default value is false.
GITNESS_ENCRYPTER_MIXED_CONTENT
If set to true, existing secrets stored in plaintext are fully supported, even if GITNESS_ENCRYPTER_SECRET is provided and new secrets are stored encrypted.
The default value is false.
GITNESS_ENCRYPTER_SECRET
The secret used to encrypt secrets in the database. If no value is provided, data is stored in plaintext.
Create an encryption key:
Provide the encryption key to Harness Open Source:
This only impacts newly created secrets, existing secrets are not migrated. If this value is changed, all values encrypted with the previous secret will fail decryption.
GITNESS_GRACEFUL_SHUTDOWN_TIME
The max time the service is waiting for its components to complete any ongoing operations before shutting down.
The default is 300 seconds.
GITNESS_HTTP_PORT
The port on which the system listens for incoming calls.
The default port is 3000.
GITNESS_PRINCIPAL_ADMIN_EMAIL
Enable the Admin user with the email specified. When setting this variable, GITNESS_PRINCIPAL_ADMIN_PASSWORD must also be set.
GITNESS_PRINCIPAL_ADMIN_PASSWORD
Enable the Admin user with the password specified. When setting this variable, GITNESS_PRINCIPAL_ADMIN_EMAIL must also be set.
GITNESS_TOKEN_COOKIE_NAME
The name of the cookie that is generated for UI during login/signup which contains the JWT.
The default value is token.
GITNESS_TOKEN_EXPIRE
The validity time of session tokens that are generated during user login/signup.
The default is 720 hours.
GITNESS_TRACE
Set TRACE log level.
The default value is false.
GITNESS_URL_API
Used to generate user-facing API URLs.
The default value is http://$GITNESS_URL_BASE/api
GITNESS_URL_BASE
Used to generate the default value for all URLs. This allows for a custom DNS address without setting multiple variables.
The default value is http://localhost:$GITNESS_HTTP_PORT
GITNESS_URL_CONTAINER
Optional endpoint used by pipeline step containers to communicate with Harness Open Source, such as cloning repositories.
This variable is usually set along with GITNESS_CI_CONTAINER_NETWORKS.
The default value is http://host.docker.internal:$GITNESS_HTTP_PORT
GITNESS_URL_GIT
Used to generate user facing git clone URLs for repositories.
The default value is http://$GITNESS_URL_BASE/git
GITNESS_URL_REGISTRY
Set the registry endpoint for your Harness Open Source instance.
The default value is http://host.docker.internal:3000.
GITNESS_URL_UI
The URL that is used to generate user-facing UI URLs.
The default value is http://$GITNESS_URL_BASE
GITNESS_USER_SIGNUP_ENABLED
Enable user signups.
The default value is true.
Last updated
Was this helpful?