appsettings.json file is used to set up settings and general behaviors of Litium.
On this page:
Account settings and security
Job scheduler
Data and files directory
Node services
Sales
Storage
Plugins
Identity server
Url validator
Distributed cache
Ghostscript configuration
Media
Callback domain for backend
Please find the configuration for the accelerator here.
System user
Here you can find all the settings for the system user.
Section: Litium / AdministrationSecurity
- allowWindowsCredential: if the user can log in to Litium with Windows credentials from a remote site (login is always enabled when browsing the site from localhost), only members of the local group Administrators can log in. To change group to not use local administrators, see the WindowsCredentialGroup attribute.
- useSecureConnectionRedirection: if the system should try to redirect the administrator to use https instead of http.
- windowsCredentialGroup: change group to another group than the local Administrators group. Set the name or the SID of the group name according to the pattern "[computername]\[Groupname]" as the value. To allow the local group LitiumBackoffice to access the administration interface, the value computer\LitiumBackoffice should be set, where computer is your local computer name. If any built-in group should be used, the computer should be replaced with builtin.
- requiredClaims: key/value for claims that the identity needs to have to be able to access Litium administration
- signInUrl: alternative path for sign in page, used to replace Litium administration login functionality with your own
- signOutUrl: alternative path for sign out page, used to replace Litium administration logout functionality with your own
To use the system account, log in using an account with admin privileges on the local machine or domain.
"AdministrationSecurity": {
"AllowWindowsCredential": true,
"WindowsCredentialGroup": "YourDomain\\Your Group",
"UseSecureConnectionRedirection": true,
"RequiredClaims": {
"FirstClaim": "FirstClaimValue",
"SecondClaim": "SecondClaimValue"
},
"SignInUrl": "https://your-sign-in-url",
"SignOutUrl": "https://your-sign-out-url"
}
Password policy
Define the password policy, used for all users in Litium.
Section: Litium / PasswordPolicy
- lockoutCount: the number of incorrect password attempts allowed before the account is locked. -1 is unlimited.
- lockoutSeconds: the number of seconds the account should be locked when LockoutCount has been exceeded.
- requireUppercase: if set to true, the password must contain an upper case character
- requireLowercase: if set to true, the password must contain a lower case character.
- requireNonLetterOrDigit: if set to true, the password requires a character that is not a letter and not a digit.
- requiredLength: the minimum number of characters that the password must contain.
"PasswordPolicy": {
"LockoutCount": 3,
"LockoutSeconds": 300,
"RequireUppercase": false,
"RequireDigit": false,
"RequireLowercase": false,
"RequireNonLetterOrDigit": false,
"RequiredLength": 2
}
Back to the top
This section describes how to add job scheduler.
Section: Litium / Scheduler / Policy
Scheduled jobs are background tasks that are run periodically. Add a policy name element for each job you want to execute in a specific time range. You also need to specify the start time and interval for each task based on CRON expression.
The Scheduler Policy attribute contains 5 parameters:
- cronExpression: the cron expression to define how the job should be run.
- parameter: A parameter passed to the job when it runs.
- parameterType: the correct type of Parameter that needs to be converted.
- executionRestriction: the execution restriction that can disallow concurrent executions on a local machine or disallow concurrent execution in the cluster of applications (distributed lock). Users can define it as none.
- cronTimeZone: the cron time zone for the scheduler policy. With no time zone defined, default is UTC.
"Scheduler": {
"Policy": {
"Litium.Auditing.CleanupScheduler": {
"CronExpression": "0 0/1 * 1/1 * ? *",
"CronTimeZone": "Central Standard Time"
}
}
}
Back to the top
This section describes the data and files directory configuration.
Data
Section: Litium / Data
- connectionString: the connection string that links to the database server.
- enableSensitiveDataLogging: if set to True, the sensitive data will be logged.
"Litium": {
"Data": {
"ConnectionString": "Pooling=true;User Id=sa;Password=Pass@word;Database=LitiumEducation;Server=host.docker.internal,5434"
Files directory
Section: Litium / Folder
- local: upload folder where files are stored.
- shared: upload folder where files that are common to all servers are stored. When using multiserver environments, the Shared should be set. This directory is used to store all the information that is common between the servers.
If this element is not present, the Local will be used instead.
"Folder": {
"Local": "../files/local",
"Shared": "../files/shared"
}
Back to the top
Settings for handling Node services configuration. More info about Node services.
Section: Litium / NodeService.
- generateThumbnailsAtServerSide: flag to indicate whether thumbnails should be generated at the server-side or client's browser.
- invocationTimeoutMilliseconds: specifies the maximum duration, in milliseconds, that .NET code should wait for Node.js RPC calls to return.
- navigationTimeoutMilliseconds: maximum navigation time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout.
- projectPath: path to the root of Node application.
- browserExecutablePath: gets the executable path to use a specific, custom version of Chrome or Chromium.
"NodeService": {
"GenerateThumbnailsAtServerSide": true,
"InvocationTimeoutMilliseconds": 60000,
"NavigationTimeoutMilliseconds": 30000,
"ProjectPath": "path\\to\\NodeServices\\folder\\that\\contains\\packagejson",
"BrowserExecutablePath": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
}
Back to the top
Settings for the Sales area.
Section: Litium / Sales
- synchronizationLockTimeout: the timeout per second for the synchronization lock.
- orderNumberPrefix: the prefix for the order number, the default value is "LS".
- paymentNumberPrefix: the prefix for payment number, the default value is "LSP".
"Sales": {
"SynchronizationLockTimeout": 10,
"OrderNumberPrefix": "LS",
"PaymentNumberPrefix": "LSP"
}
Back to the top
Settings for the storage handler contain the list of CDN hosts.
Section: Litium / MediaLocation / CdnHosts
"CdnHosts": [
"https://cdn.company.com", "http://cdn.se"
]
Back to the top
Settings for loading/ignoring plugin assemblies.
Section: Litium / Plugin / Assembly
- firsts: the assembly name of the assemblies that should be loaded first.
- lasts: the assembly name of the assemblies that should be loaded last.
- ignores: the assembly name of the assemblies that should be ignored.
The format for the assembly name is "Lititum.Dummy.Web".
"Assembly": {
"Firsts": [],
"Lasts": [],
"Ignores": [
"Litium.Dummy.Web"
]
}
Section: Litium / Plugin / Type
- ignores: the full type name of the types that should be ignored when loaded in the Dependency Injection. The format for the type name is "Litium.Dummy.Web.MyClass"
"Type": {
"Ignores": [
"Litium.Dummy.Web.MyClass, Litium.Dummy.Web"
]
}
Back to the top
Settings for the identity server.
Section: Litium / IdentityServer
- certificatePfxPath: the path to the certificate in pfx format.
- certificatePassword: the certificate password.
"IdentityServer": {
"CertificatePfxPath": "C:\\path-to-certificatePfx",
"CertificatePassword": "your-certificate-password"
}
Back to the top
Url validator
Settings to handling the url validator:
Section: Litium / UrlValidator
- invalidCharacters: contains all the characters that are configured by the solution to be invalid for urls.
- invalidWords: words that not an url-segment is allowed to use.
- invalidExtensions: extensions that not an url-segments is allowed to use.
"UrlValidator": {
"InvalidCharacters": [
"*"
],
"InvalidWords": [
"Site"
],
"InvalidExtensions": [
".ashx"
]
}
Back to the top
Distributed cache
Settings to handle distributed cache. Use a negative value to disable the cache expiration.
Section: Litium / Cache
- distributed / defaultMemorySlidingExpiration: the default memory sliding expiration, default value is 60 * 60 * 12 (half-day).
- distributed / defaultDistributedSlidingExpiration: the default distributed cache sliding expiration, the default value is -1.
- entity / useDistributedCache: the value indicating whether to use distributed cache.
- entity / slidingExpiration: contains the full type name of the types and the value the sliding interval for the cache item. The format for the type name is "Litium.Dummy.Web.MyClass, AssemblyName"
"Cache": {
"Distributed": {
"DefaultMemorySlidingExpiration": 120,
"DefaultDistributedSlidingExpiration": 86400
},
"Entity": {
"UseDistributedCache": true,
"SlidingExpiration": {
"Litium.Dummy.Web.MyClass, AssemblyName": 3600
}
}
}
Back to the top
Ghostscript configuration
Ghostscript requires two setting keys and works only on Windows; no support in Litium Serverless Cloud.
Section: Litium / Ghostscript
- directory: where the ghostscript DLLs are located.
- convertExtensions: the image extensions that are accepted to convert.
"Ghostscript": {
"Directory": "ghostscript-dlls",
"ConvertExtensions": [
".ept", ".eps"
]
}
Back to the top
Media
Settings for the Media area.
Section: Litium / Media/ MimeTypes
In MimeTypes section administrator can add additional file types.
"Media": {
"MimeTypes": {
".ez": "application/andrew-inset",
".ma": "application/mathematica",
".mb": "application/mathematica",
".pdf": "application/pdf"
}
}
Back to the top
Callback domain for backend
When we have a headless solution where the backend and frontend (Storefront) have different subdomains, the backend url can be configured as a setting in appsetting.json file . The config should look like this :
"CallbackDomain" : "litium.local",
In case "https://" is missing from the domain, the code will add it automatically. Also if the frontend and backend has the same domain then this setting is not needed.
Back to the top