REST API cofiguration
The appsettings.json
file is the main configuration file for the HEAppE Middleware. It contains the configuration for the database, logging, and other services. The file is located in the app directory of the HEAppE Middleware.
Note
The appsettings.json
file is generated automatically during the installation of the HEAppE Middleware.
You can modify the file to change the configuration of the HEAppE Middleware, it is stored in the /opt/heappe/projects/<project>/app/confs
directory.
The file is in JSON format and contains the following configuration blocks:
ConnectionStrings
This configuration block contains the connection strings for the database and logging services.
The connection strings are used to connect to the database and logging services. The connection strings are stored in the appsettings.json
file and are used by the HEAppE Middleware to connect to the database and logging services.
Following connection string can be used, but <mssql_password>
needs to be replaced the with the password. Password must meet the password policy of the Microsoft SQL Server.
"ConnectionStrings": {
"MiddlewareContext": "Server=mssql;Database=heappe;User=SA;Password=<mssql_password>;TrustServerCertificate=true;",
"Logging": ""
}
DatabaseMigrationSettings
- This configuration block allows the setup of database migration settings.
AutoMigrateDatabase - Automatically migrate the database when the HEAppE Middleware starts
"DatabaseMigrationSettings": {
"AutoMigrateDatabase": true
}
ApplicationAPISettings
- This configuration block allows the setup of the HEAppE Middleware API settings.
AllowedHosts - List of allowed hosts for the HEAppE Middleware API
- DeploymentSettings - Settings for the deployment of the HEAppE Middleware
Name - Name of the deployment
Description - Description of the deployment
Version - Version of the deployment
DeployedIPAddress - IP address of the deployment
Port - Port of the deployment
Host - Host of the deployment
HostPostfix - Postfix for the host
DeploymentEnvironmentType - Type of deployment environment (Docker, Local, etc.)
ResourceAllocationInfrastructureTypes - Types of resource allocation infrastructure (HPC, Local, etc.)
- SwaggerDocSettings - Settings for the Swagger documentation
Title - Title of the Swagger documentation
DetailedJobReportingTitle - Title of the detailed job reporting API
Description - Description of the Swagger documentation
PrefixDocPath - Prefix path for the Swagger documentation
TermOfUsageUrl - URL for terms of usage
License - License for the Swagger documentation
LicenseUrl - URL for the license
ContactName - Name of the contact person for the Swagger documentation
ContactEmail - Email address of the contact person for the Swagger documentation
ContactUrl - URL for the contact person for the Swagger documentation
"ApplicationAPISettings": {
"AllowedHosts": [
"http://localhost:5000"
],
"DeploymentSettings": {
"Name": "Local instance",
"Description": "Local testing instance",
"Version": "vX.X.X",
"DeployedIPAddress": "127.0.0.1",
"Port": "5000",
"Host": "http://localhost:5000",
"HostPostfix": "",
"DeploymentEnvironmentType": "Docker",
"ResourceAllocationInfrastructureTypes": [
"HPC"
]
},
"SwaggerDocSettings": {
"Title": "HEAppE Web API",
"DetailedJobReportingTitle": "Detailed Job Reporting API",
"Description": "HEAppE middleware API",
"PrefixDocPath": "swagger",
"TermOfUsageUrl": "https://heappe.eu",
"License": "GNU General Public License v3.0",
"LicenseUrl": "https://www.gnu.org/licenses/gpl-3.0.html",
"ContactName": "IT4Innovations",
"ContactEmail": "support.heappe@it4i.cz",
"ContactUrl": "https://twitter.com/it4innovations"
}
}
BackGroundThreadSettings
- This configuration block allows time-interval definition (in seconds), where each background thread is activated.
GetAllJobsInformationCheck - Update job status from batch schedulers
CloseConnectionToFinishedJobsCheck - Close tunnel connection for finished jobs
ClusterAccountRotationJobCheck - Check if Middleware is able to submit job (ClusterAccountRotation = true)
FileTransferKeyRemovalCheck - Removal FileTransfer temporary added keys
"BackGroundThreadSettings": {
"GetAllJobsInformationCheck": 30,
"CloseConnectionToFinishedJobsCheck": 30,
"ClusterAccountRotationJobCheck": 30,
"FileTransferKeyRemovalCheck": 10800
}
BusinessLogicSettings
- This setting block allows the HEAppE business logic configurations.
ClusterAccountRotation - Rotation of cluster service accounts
GeneratedFileTransferKeyLimitPerJob - Maximal active FileTransfer temporary keys per job
ValidityOfTemporaryTransferKeysInHours - Validity of FileTransfer temporary keys
SessionExpirationInSeconds - User session expiration
HTTPRequestConnectionTimeoutInSeconds - HTTP requests timeout
"BusinessLogicSettings": {
"ClusterAccountRotation": false,
"GeneratedFileTransferKeyLimitPerJob": 5,
"ValidityOfTemporaryTransferKeysInHours": 24,
"SessionExpirationInSeconds": 900,
"HTTPRequestConnectionTimeoutInSeconds": 10
}
CertificateGeneratorSettings
These configurations allow the setup of encryption ciphers (file transfer temporary key). You can define path, in which keys will be generated and stored, keys prefix and type. You can choose type from several options:
RSA 3072
RSA 4096
ECDSA 256
ECDSA 521
"CertificateGeneratorSettings": {
"GeneratedKeysDirectory": "/opt/heappe/keys/",
"GeneratedKeyPrefix": "key",
"CipherSettings": {
"TypeName": "RSA",
"Size": 4096
}
}
HPCConnectionFrameworkSettings
The following two blocks present the configuration of the HEAppE HPC connection framework (for HPC as well as Local Cluster).
"HPCConnectionFrameworkSettings": {
"GenericCommandKeyParameter": "#HEAPPE_PARAM",
"JobArrayDbDelimiter": "<JOB_ARRAY_ITERATION>",
"TunnelSettings": {
"LocalhostName": "127.0.0.1",
"MinLocalPort": 4000,
"MaxLocalPort": 4500
},
"CommandScriptsPathSettings": {
"AddFiletransferKeyCmdPath": "~/.key_scripts/add_key.sh",
"RemoveFiletransferKeyCmdPath": "~/.key_scripts/remove_key.sh",
"CreateJobDirectoryCmdPath": "~/.key_scripts/create_job_directory.sh",
"ExecuteCmdPath": "~/.key_scripts/run_command.sh",
"ExecuteBackgroundCmdPath": "~/.key_scripts/run_background_command.sh",
"CopyDataFromTempCmdPath": "~/.key_scripts/copy_data_from_temp.sh",
"CopyDataToTempCmdPath": "~/.key_scripts/copy_data_to_temp.sh"
},
"ClustersConnectionPoolSettings":{
"ConnectionPoolCleaningInterval": 60,
"ConnectionPoolMaxUnusedInterval": 1800
},
"ScriptsSettings": {
"ClusterScriptsRepository": "https://github.com/It4innovations/HEAppE-scripts.git",
"KeyScriptsDirectoryInRepository": "HEAppE-scripts/HPC/.key_scripts/",
"SubExecutionsPath": "HEAppE/Executions",
"SubScriptsPath": "HEAppE/Scripts",
"ScriptsBasePath": "~/.key_scripts",
"CommandScriptsPathSettings": {
"AddFiletransferKeyCmdScriptName": "add_key.sh",
"RemoveFiletransferKeyCmdScriptName": "remove_key.sh",
"CreateJobDirectoryCmdScriptName": "create_job_directory.sh",
"ExecuteCmdScriptName": "run_command.sh",
"CopyDataFromTempCmdScriptName": "copy_data_from_temp.sh",
"CopyDataToTempCmdScriptName": "copy_data_to_temp.sh"
},
"LinuxLocalCommandScriptPathSettings": {
"ScriptsBasePath": "~/.local_hpc_scripts",
"PrepareJobDirCmdScriptName": "prepare_job_dir.sh",
"RunLocalCmdScriptName": "run_local.sh",
"GetJobInfoCmdScriptName": "get_job_info.sh",
"CountJobsCmdScriptName": "count_jobs.sh",
"CancelJobCmdScriptName": "cancel_job.sh"
}
}
}
ExternalAuthenticationSettings
This configuration block allows the setup of external authentication services. You can define the URL of the external authentication service, the URL of the external authentication service’s token endpoint, and the client ID and client secret of the external authentication service.
"ExternalAuthenticationSettings": {
"BaseUrl": "",
"Protocol": "openid-connect",
"RealmName": "",
"ClientId": "",
"SecretId": "",
"ConnectionTimeout": 15,
"AllowedClientIds": [],
"RoleMapping": {
"prj_list": "Maintainer",
"prj_read": "Reporter",
"prj_write": "Submitter"
},
"Projects":
[
{
"UUID": "",
"Name": "",
"HEAppEGroupName": "OpenIDGroup"
}
],
"HEAppEUserPrefix": "Open-Id_",
"LexisAuthenticationConfiguration":
{
"BaseAddress": "",
"EndpointPrefix": "userorg",
"ExtendedUserInfoEndpoint": "/api/UserInfo/Extended",
"HEAppEGroupNamePrefix": "Lexis_",
"HEAppEUserPrefix": "Lexis_<USERNAME>",
"RoleMapping":
{
"Submitter": "heappe_exec"
}
}
},
"OpenStackSettings": {
"IdentityPort": 5000,
"ConnectionTimeout": 15,
"OpenStackVersion": 3,
"OpenStackSessionExpiration": 1800
}