Docs/System & infrastructure/Server configuration file
DartRelay 2.1 documentation
System & infrastructure

Server configuration file

Almost everything in DartRelay is set in the console. A few settings belong to one particular server, or must keep working when the console cannot be reached. Those live in a small file on each server, dartrelay.config.json. This page explains where the file is, how it relates to the console, and every setting an administrator may need to put in it.

When you need this file

Most administrators never touch it. You need it when:

Tip

If a setting is available in the console, change it there. The console stores it once for every server and records who changed it in the audit log. Use the file only for the cases above.

Where the file is

The file lives in DartRelay's data folder, the App_Data folder inside the installation folder, beside the SQLite database (if you use SQLite), the logs and the keys that protect stored passwords:

<installation folder>\App_Data\dartrelay.config.json
Important

DartRelay's installation folder also contains other settings files. Do not edit those: they are replaced on every upgrade, and changes made there are lost. dartrelay.config.json in App_Data is the file meant for you.

Format

The file is JSON. Every setting sits inside one top-level "DartRelay" object, grouped into sections. In this guide a key is written with colons between the levels: DartRelay:Proxy:ForwardLimit means the ForwardLimit value inside the Proxy section inside DartRelay.

Example

{
  "DartRelay": {
    "Proxy": {
      "TrustedProxies": [ "10.0.0.10", "10.0.0.11" ],
      "ForwardLimit": 1
    },
    "PublicUrl": "https://apps.example.com",
    "Node": {
      "Draining": false
    },
    "Security": {
      "CaptchaDisabled": true
    }
  }
}

Only include the settings you need. Anything you leave out takes its value from the console or its default.

Writing values

A file with a mistake in it

A file that is not valid JSON, for example because of a missing comma or quote, does not stop DartRelay. The server starts without it, records an error in the log, and shows a banner in the console saying the file could not be read. Fix the mistake and the file is read again the next time the DartRelay service starts.

How the file and the console work together

The file is one of several places DartRelay reads its server configuration from. Within that configuration a later source wins over an earlier one:

  1. DartRelay's built-in defaults.
  2. Settings the installer placed in the Windows service's environment, such as the port.
  3. dartrelay.config.json on this server.
  4. Values given on the command line, used only by support engineers.

For the settings that can also be changed in the console under System → Load balancer, a value in the file overrides the console, field by field, for that one server only. The console shows such a field as locked: it is disabled, carries a set on this server label, and the page gives the path of the file. To let the console's value apply again, remove the setting from the file. The recovery switches described below are read only from the server's configuration and have no console equivalent.

Values in the file are read when the DartRelay service starts, so a change takes effect from the next start of the service.

Settings moved into the console in version 1.9

Before version 1.9, load balancer settings such as trusted proxies, the public URL and sign-in by header had to be written in this file on every server, which made it easy for two servers in a pool to disagree. They are now set once under System → Load balancer. On the first start after upgrading to 1.9 or later, DartRelay copied any such values from the file into the console and removed them from the file, keeping a dated backup copy beside it (the original name with .bak added). Any comments in the file were not kept. A value that differed from what the console already held was left in the file and noted in the log; it still overrides the console on that server.

Settings reference

All keys below sit under DartRelay. "In the console" says where the same setting can be changed without the file, if it can.

Load balancer and proxy settings

These describe the load balancer, reverse proxy or application delivery controller in front of DartRelay. Set them in the console under System → Load balancer unless one server genuinely needs a different value. See Load balancer and ADC integration.

KeyWhat it doesIn the console
Proxy:TrustedProxiesThe addresses (or address ranges) of the proxies or load balancers in front of DartRelay. Forwarded headers saying who the real visitor is and whether they used HTTPS are believed only when they come from one of these. Without it, every visitor appears to come from the proxy, which affects the audit log, lockout and network access rules.Trusted proxies
Proxy:TrustLoopbackAlso trusts a proxy running on the DartRelay server itself.Trust loopback
Proxy:ForwardLimitHow many proxies in a chain to read through when working out the visitor's real address.Proxies in the chain
Proxy:AllowApplianceSignInLets a trusted load balancer fill in DartRelay's sign-in form on the user's behalf (form-based single sign-on). The credentials are still checked, counted towards lockout and audited exactly as if typed. Must be the same on every server in a pool.Let the load balancer fill in the sign-in form
PublicUrlThe address people use to reach DartRelay, such as https://apps.example.com. Used to build links in emails, for example password-reset links.Public URL
Node:SendHeaderAdds a response header naming which server answered, which helps when checking a load balancer's behaviour.Server name header
HeaderAuth:UserHeaderFor sign-in by header from a trusted appliance: the request header that carries the signed-in user's name.Sign-in by header settings
HeaderAuth:DisplayNameHeaderThe request header that carries the user's display name.Sign-in by header settings
HeaderAuth:LogoutUrlWhere to send people when they sign out, for any address that has no sign-out address of its own in Tenancy & Branding.Sign-out address

Sign-in by header itself is switched on in the console. DartRelay refuses to turn it on unless at least one trusted proxy is set, because otherwise anybody could send the header.

Pool membership (this server only)

These identify a server within a pool. They are written by the installer when a server joins an existing installation and are not shown in the console. Leave them as they are, apart from Node:Draining. See Running several servers (pools).

KeyWhat it doesIn the console
Node:IdThis server's identity within the pool. Written when the server joins.—
Node:DrainingWhen true, the server starts drained: it reports itself as unavailable to the load balancer's health check, so no new sessions are sent to it, while sessions already on it carry on. Useful when bringing a server up for maintenance.Drain on System → Load balancer (for the running server)
Cluster:EnabledMarks this server as a member of a pool. Written when the server joins.—
Cluster:KeyCertificateThumbprintIdentifies a certificate the servers in the pool share. Written when the server joins.—

The database connection is chosen in the setup wizard, or by the installer when a server joins, and is also kept in this server's data folder. Change the database from the console rather than by hand; see Databases and migration.

Recovery switches

These exist so you can get back into a DartRelay that the console cannot fix, because the problem stops you reaching or signing in to the console. They are read only from the server's configuration, never from the database, for exactly that reason. Remove them again once the problem is fixed.

KeyWhat it doesDefault
Security:CaptchaDisabledTurns off the sign-in challenge (the picture verification or third-party challenge) on every sign-in page. Use it if a challenge provider has become unreachable or misconfigured and is stopping administrators signing in. The console's recovery box on Authentication → Security shows the exact text to add.false
Endpoints:FromDatabaseWhen false, DartRelay ignores the endpoints configured under System → Endpoints and listens only on the address and port set when it was installed. Use it if an endpoint change has left DartRelay unable to listen where you can reach it. The Endpoints page shows a banner while this is in effect.true
NetworkAccess:Disabled New in 2.0When true, switches off the network access rules under Authentication → Network Access, so the portal and console are reachable from any address. Use it if a rule has locked you out. The console shows a warning while this is in effect. (The console is always reachable from the DartRelay server's own desktop, which is often the quicker way back in.)false

Host preparation over WinRM

DartRelay normally checks and prepares hosts over Windows file sharing. When that route is not available, and always when DartRelay runs on Linux, it uses WinRM instead. See Adding and preparing hosts.

KeyWhat it doesDefault
WinRm:UseHttpsConnects to WinRM over HTTPS. Leave it on: plain HTTP would send the management account's sign-in over the network unprotected, and is refused by hosts in their standard configuration.true
WinRm:PortThe WinRM port on the hosts.5986
WinRm:AcceptAnyCertificateAccepts a host's WinRM certificate even if it is not trusted, such as the self-signed certificate created by winrm quickconfig -transport:https. This removes the protection HTTPS gives the management account, so prefer giving hosts certificates from a trusted authority.false

Older settings

KeyWhat it does
AdDomainBefore version 2.0, named the single Active Directory domain people signed in from. Version 2.0 reads it once and adds that domain to the Directories list as the default domain; from then on, manage domains in the console. See Active Directory and multiple domains.

The data folder's location

The data folder, and so this file, is the App_Data folder inside the installation folder. Its location is set when DartRelay is installed and is not changed from inside this file, because DartRelay has to know where the data folder is before it can find the file.

Worked examples

Example: getting back in after a sign-in challenge problem

An administrator switched the sign-in challenge to a third-party provider, the provider's keys were wrong, and now nobody can sign in to the console.

  1. On the DartRelay server, open an elevated editor and open (or create) App_Data\dartrelay.config.json in the installation folder.
  2. Add the switch, keeping anything already in the file:
    {
      "DartRelay": {
        "Security": { "CaptchaDisabled": true }
      }
    }
  3. Save the file. From the next start of the DartRelay service the challenge is off.
  4. Sign in, fix the challenge settings under Authentication → Security, then remove the switch from the file.

Example: one server starts drained for maintenance

A pool has two servers. You want the second to come up after maintenance without receiving new sessions until you have checked it. Add "Node": { "Draining": true } to that server's file. When you are satisfied, undrain it from System → Load balancer and set the value back to false (or remove it) so it does not start drained next time.

If something goes wrong

Still stuck? Email support@dartinnovations.com with what you were doing, what you expected and what you saw. A screenshot helps.