Installation using a Lua Startup Script
This page provides an example Lua script which can be used to configure a Node.
| These installation instructions will create a secure-by-default initial configuration for the system. This includes a secure and encrypted https communication with the WebServer and the necessary Administration Profile needed to connect and continue configuration. |
The steps below continue directly from the steps here. Therefore, before you proceed through these steps, ensure that you have completed the previous instructions.
First, in the "inmation-config.yaml", add the following and save the changes:
startup:
luaFile: C:\<installation_folder>\inmation.root\bin\inmation-startup.lua
| The full path to the startup file must be defined in the yaml file. |
Creating the Lua Startup Script
-
Create an "inmation-startup.lua" file in the "bin" folder (C:\<installation_folder>\Home\inmation.root\bin) and add the following:
-- The bootstrap options are passed to the script as a table. local bootstrap_options = select(1, ...) or {} -- Check if it is a new setup. If not, exit the script. if bootstrap_options.init ~= true then return end --Create Profile group underneath the Node Delegate object. syslib.mass({ { class = syslib.model.classes.ProfileGroup, operation = syslib.model.codes.MassOp.UPSERT, path = syslib.getnodedelegatepath() .. "/Admin Group", ["ObjectName"] = "Admin Group" }, }) --Create an administrative Profile underneath the Profile Group object. syslib.mass({ { class = syslib.model.classes.Profile, operation = syslib.model.codes.MassOp.UPSERT, path = syslib.getnodedelegatepath() .. "/Admin Group/so-Home", ["ObjectName"] = "so-Home", ["AdministrativeGroup"] = syslib.model.codes.AdministrativeGroup.ADMIN, ProfileUserAccess = syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_DATA_WEB | syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_OPC_DA | syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_OPC_HDA | syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_OPC_AE | syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_OPC_UA | syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_LUA_SCRIPT_CONSOLE, ProfileModelAccess = syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_IO | syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_SYS | syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_ACC | syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_EQU | syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_SCR | syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_DEL, }, }) --Create a secure WebServer object underneath the Node object. The insecure connection is disabled. syslib.mass({ { class = syslib.model.classes.WebServer, operation = syslib.model.codes.MassOp.UPSERT, path = syslib.getnodepath() .. "/Webserver", ["ObjectName"] = "Webserver", ["WebServerProfile"] = syslib.getnodedelegatepath() .. "/Admin Group/so-Home", ["WebServerInsecureConnection.WebServerListenHost"] = "0.0.0.0", ["WebServerInsecureConnection.WebServerListenPort"] = 8008, ["WebServerInsecureConnection.WebServerConnectionEnabled"]= 0, ["WebServerSecureConnection.WebServerListenHost"] = "0.0.0.0", ["WebServerSecureConnection.WebServerListenSslPort"] = 8009, ["WebServerStatic.WebServerStaticEnabled"] = true, ["WebServerSecuritySettings.WebServerAllowedOrigins.WebServerOrigin"] = { "https://<domain>.<tld>"} (1) }, }) -- Create an IWA Security Provider object underneath the WebServer object. This is used for authentication purposes. syslib.mass({ { class = syslib.model.classes.IwaSecurityProvider, path = syslib.getnodepath() .. "/WebServer/IWA Security Provider", ["ObjectName"] = "IWA Security Provider", ["ClaimMatching.UserIdClaim"] = "user_sid", ["ClaimMatching.UserNameClaim"] = "user_sam_name" } }) --Create a User Identifier object underneath the Profile object. syslib.mass({ { class = syslib.model.classes.UserIdentifier, operation = syslib.model.codes.MassOp.UPSERT, path = syslib.getnodedelegatepath() .. "/Admin Group/so-Home/User Identifier IWA", ["ObjectName"] = "User Identifier IWA", ["AuthID"] = "<user_sid>" (2) } })1 - The "WebServerAllowedOrigins" property should be configured for your own system. The value of the property should be the domain name of the hosted WebStudio application. For example, if the WebStudio application is hosted at "https://mydomain.com", then the value of the property should be "https://mydomain.com". See WebServer Object Guide for more information. 2 - See User Identifier Object Guide for how to find the user_sidfor AuthID property configuration.This simple example will create the Node as well as a corresponding Node Delegate object. It will also create Profile Group, Profile and User Identifier objects.
A WebServer will also be created which can be used to connect to WebStudio and an IWA Security Provider object is configured for authentication purposes. Alternative authentication methods can be used - see the Alternative Authentication Options section below for more details.
In this example, the "AuthID" property for the User Identifier object should be configured to match you own system. The value of the property should be the Windows user security identifier, which can be found by running the whoami /usercommand in Powershell. -
Save the changes to the "inmation-startup.lua" file and then open a Powershell window as an administrator. In this window, navigate to the "bin" folder (C:\<installation_folder>\inmation.root\bin).
-
Run the following:
.\inmation.exe --install NodeIf the configuration files are not located in the same folder as the executable, then the following should be used instead, replacing the values in the angular brackets with the paths to the configuration file and the Lua startup script respectively:
.\inmation.exe --install Node --cfg-file <path_to_config_file> --startup-lua-file <path_to_lua_script>
Alternative Authentication Options
In the example above, Integrated Windows Authentication is used. However, the system also supports OIDC and Built-In authentication methods. These methods require different configuration options to be defined in the Lua startup file.
OIDC Authentication
To use OIDC Authentication, an OIDC Security Provider object is required. For installation of a Node with OIDC Authentication enabled, replace the script in step 1 above with the following script.
-- The bootstrap options are passed to the script as a table.
local bootstrap_options = select(1, ...) or {}
-- Check if it is a new setup. If not, exit the script.
if bootstrap_options.init ~= true then return end
--Create Profile group underneath the Node Delegate object.
syslib.mass({
{
class = syslib.model.classes.ProfileGroup,
operation = syslib.model.codes.MassOp.UPSERT,
path = syslib.getnodedelegatepath() .. "/Admin Group",
["ObjectName"] = "Admin Group"
},
})
--Create an administrative Profile underneath the Profile Group object.
syslib.mass({
{
class = syslib.model.classes.Profile,
operation = syslib.model.codes.MassOp.UPSERT,
path = syslib.getnodedelegatepath() .. "/Admin Group/so-Home",
["ObjectName"] = "so-Home",
["AdministrativeGroup"] = syslib.model.codes.AdministrativeGroup.ADMIN,
ProfileUserAccess = syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_DATA_WEB
| syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_OPC_DA
| syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_OPC_HDA
| syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_OPC_AE
| syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_OPC_UA
| syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_LUA_SCRIPT_CONSOLE,
ProfileModelAccess = syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_IO
| syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_SYS
| syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_ACC
| syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_EQU
| syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_SCR
| syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_DEL,
},
})
--Create a secure WebServer object underneath the Node object. The insecure connection is disabled.
syslib.mass({
{
class = syslib.model.classes.WebServer,
operation = syslib.model.codes.MassOp.UPSERT,
path = syslib.getnodepath() .. "/Webserver",
["ObjectName"] = "Webserver",
["WebServerProfile"] = syslib.getnodedelegatepath() .. "/Admin Group/so-Home",
["WebServerInsecureConnection.WebServerListenHost"] = "0.0.0.0",
["WebServerInsecureConnection.WebServerListenPort"] = 8008,
["WebServerInsecureConnection.WebServerConnectionEnabled"]= 0,
["WebServerSecureConnection.WebServerListenHost"] = "0.0.0.0",
["WebServerSecureConnection.WebServerListenSslPort"] = 8009,
["WebServerStatic.WebServerStaticEnabled"] = true,
["WebServerSecuritySettings.WebServerAllowedOrigins.WebServerOrigin"] = { "https://<domain>.<tld>"} (1)
},
})
--Create an OIDC Security Provider object underneath the WebServer object.
syslib.mass({
{
class = syslib.model.classes.OidcSecurityProvider,
path = syslib.getnodepath() .. "/WebServer/OIDC Security Provider",
["ObjectName"] = "OIDC Security Provider",
["ClaimMatching.UserIdClaim"] = "oid",
["ClaimMatching.UserNameClaim"] = "upn",
["OidcConfiguration.OidcClientId"] = "<client_ID>", (2)
["OidcConfiguration.OidcConfigurationUrl"] = "<authentication_provider_URL>", (3)
["OidcConfiguration.OidcRedirectBaseUrl"] = "<redirect_URL>" (4)
}
})
--Create a User Identifier object underneath the Profile object.
syslib.mass({
{
class = syslib.model.classes.UserIdentifier,
operation = syslib.model.codes.MassOp.UPSERT,
path = syslib.getnodedelegatepath() .. "/Admin Group/so-Home/User Identifier OIDC",
["ObjectName"] = "User Identifier OIDC",
["AuthId"] = "<oid>" (4) (5)
}
})
| 1 | - The "WebServerAllowedOrigins" property should be configured for your own system. The value of the property should be the domain name for the hosted WebStudio application. For example, if the WebStudio application is hosted at "https://mydomain.com", then the value of the property should be "https://mydomain.com". See WebServer Object Guide for more information. |
| 2 | - See OIDC Security Provider Object Guide for more information. |
| 3 | - See OIDC Security Provider Object Guide for more information. |
| 4 | - See OIDC Security Provider Object Guide for more information. |
| 5 | - The oid for OIDC authentication is often a Microsoft Entra ID. See User Identifier Object Guide for more information. |
| The "AuthID" for the User Identifier object in the example above should be configured for your own system. This value can be obtained from your selected authentication provider, for example Microsoft Entra ID. |
| The OIDC Configuration options should be configured for your own system. The "OidcClientId" is the identifier assigned to the application by the OIDC provider and the "OidcConfigurationUrl" is the URL of the OIDC provider login. The "OidcRedirectBaseUrl" is the URL to redirect the user to once authenticated. |
Built-In Authentication
To use Built-In Authentication, a Built-In Security Provider object must be configured. In addition, credentials must be defined and enabled for the Profile. To install the Node with Built-In Authentication enabled, replace the script in step 1 above with the following:
-- The bootstrap options are passed to the script as a table.
local bootstrap_options = select(1, ...) or {}
-- Check if it is a new setup. If not, exit the script.
if bootstrap_options.init ~= true then return end
--Create Profile group underneath the Node Delegate object.
syslib.mass({
{
class = syslib.model.classes.ProfileGroup,
operation = syslib.model.codes.MassOp.UPSERT,
path = syslib.getnodedelegatepath() .. "/Admin Group",
["ObjectName"] = "Admin Group"
},
})
--Create an administrative Profile underneath the Profile Group object.
syslib.mass({
{
class = syslib.model.classes.Profile,
operation = syslib.model.codes.MassOp.UPSERT,
path = syslib.getnodedelegatepath() .. "/Admin Group/so-Home",
["ObjectName"] = "so-Home",
["AdministrativeGroup"] = syslib.model.codes.AdministrativeGroup.ADMIN,
ProfileUserAccess = syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_DATA_WEB
| syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_OPC_DA
| syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_OPC_HDA
| syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_OPC_AE
| syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_OPC_UA
| syslib.model.flags.ProfileUserAccessControl.USR_ACC_CTRL_LUA_SCRIPT_CONSOLE,
ProfileModelAccess = syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_IO
| syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_SYS
| syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_ACC
| syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_EQU
| syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_SCR
| syslib.model.flags.ProfileModelAccess.PRF_MDL_ACC_DEL,
["InmationProfileCredentials.Available"] = true,
["InmationProfileCredentials.PasswordHashed"] = "<password>" (2)
},
})
--Create a secure WebServer object underneath the Node object. The insecure connection is disabled.
syslib.mass({
{
class = syslib.model.classes.WebServer,
operation = syslib.model.codes.MassOp.UPSERT,
path = syslib.getnodepath() .. "/Webserver",
["ObjectName"] = "Webserver",
["WebServerProfile"] = syslib.getnodedelegatepath() .. "/Admin Group/so-Home",
["WebServerInsecureConnection.WebServerListenHost"] = "0.0.0.0",
["WebServerInsecureConnection.WebServerListenPort"] = 8008,
["WebServerInsecureConnection.WebServerConnectionEnabled"]= 0,
["WebServerSecureConnection.WebServerListenHost"] = "0.0.0.0",
["WebServerSecureConnection.WebServerListenSslPort"] = 8009,
["WebServerStatic.WebServerStaticEnabled"] = true,
["WebServerSecuritySettings.WebServerAllowedOrigins.WebServerOrigin"] = { "https://<domain>.<tld>"} (1)
},
})
--Create a Built-In Security Provider object underneath the WebServer object.
syslib.mass({
{
class = syslib.model.classes.BuiltInSecurityProvider,
path = syslib.getnodepath() .. "/WebServer/Built-In Security Provider",
["ObjectName"] = "Built-In Security Provider",
["ClaimMatching.UserIdClaim"] = "profile",
["ClaimMatching.UserNameClaim"] = "username"
}
})
| 1 | - The "WebServerAllowedOrigins" property should be configured for your own system. The value of the property should be the domain name of the hosted WebStudio application. For example, if the WebStudio application is hosted at "https://mydomain.com", then the value of the property should be "https://mydomain.com". See WebServer Object Guide for more information. |
| 2 | - Replace with your own choice of password that follows the system Password Policy. |
| The "PasswordHashed" property in the Profile object should be configured according to the Password Policy. It is important to note that anyone with access to this Lua file will be able to view/edit this field. This is not recommended in production environments. |