Skip to main content

Configuration

Hosted Mode only

Currently there is no (documented) configuration for using Decsys in Workshop Mode.

Configuration Options

Here are the configurable settings you can change currently in DECSYS:

Top Level

KeyTypeDescription
WorkshopModeboolSpecify whether DECSYS is in Workshop mode

Connection Strings

Prefix keys with ConnectionStrings:

KeyDescription
mongoA MongoDB connection string

Hosted

Prefix keys with Hosted:

Refer to the Hosted mode Installation Guide for details on the required settings.

KeyTypeDescription
OriginstringScheme, Hostname (and Port if non-default) where the application is running
AdminPasswordstringPassword to set for the default Admin user
AdminUsernamestringUsername for the default Admin user. Add @ to the start of this string when logging in.
JwtSigningKeyobjectA JSON Web Key to use for signing Auth tokens. Generate one at https://mkjwk.org.
AllowRegistrationboolCan people register User Accounts?
If false the default Admin user as configured above will be the only Survey Admin
If true, Outbound Email settings must be configured to allow user account functionality.
AccountApprovalRequiredboolAre User Accounts subject to approval before use?
Irrelevant if AllowRegistration is false.
If true then Approvers will be emailed upon new User Account creation, with links to approve or reject the account.
AccountApproversstringComma separated list of email addresses for Account Approvers who will receive the approval links noted above.
At least one email address is required here if AccountApprovalRequired is true.

Outbound Email

Prefix keys with Hosted:OutboundEmail.

Some settings relate to specific providers only.

KeyTypeProviderDescription
Providerstring-Which email provider to use.
One of: local sendgrid
Defaults to local
FromAddressstring*The Email Address to send mail from.
For SendGrid this must match a Verified Sender on the SendGrid account.
Defaults to noreply@example.com
FromNamestring*The Name for the email's From field.
ReplyToAddressstring*The Email Address for the ReplyTo field.
Defaults to the same as FromAddress.
LocalPathstringlocalThe path on disk that .eml files should be written to.
Please ensure the path exists.
Defaults to /temp
SendGridApiKeystringsendgridYour SendGrid API Key. Must be allowed to send mail.

How to configure DECSYS

Simple configuration

Just add an appsettings.Production.json in the DECSYS application directory.

DECSYS reads configuration from the following locations:

  • appsettings.json
  • appsettings.<Environment>.json
    • <environment> defaults to Production
  • Specific JSON files inside settings/
  • Environment variables

Configuring with JSON

When using JSON files to configure .NET apps, the colons (:) in keys represent a level of hierarchy.

Example:

{
"ConnectionStrings": {
"mongo": "mongodb://localhost:27017"
},
"WorkshopMode": false,
"Hosted": {
"Origin": "https://my-decsys-server.com:5001",
"AdminPassword": "hunter2",
"JwtSigningKey": {
// ... JSON Web Key
}
}
}

Configuring with Environment Variables

Configuring .NET apps with Environment Variables is documented here.

However, all you really need to know is the following:

  • in general:
    • prefix environment variables with DOTNET_
    • replace : with __ (double underscore) in the keys above
  • for connection strings:

Example:

CUSTOMCONNSTR_mongo=mongodb://localhost:27017
DOTNET_WorkshopMode=false
DOTNET_Hosted__Origin=https://my-decsys-server.com:5001
DOTNET_Hosted__AdminPassword=hunter2
DOTNET_Hosted__JwtSigningKey=<JSON Web Key>