Проекты

Configuration Http Plugin

Plugin to change the settings of other plugins, through the browser, through the menu - no access.

In the service host, change — quite problematic, for this you need to either restart the service, or change the settings in the settings source and implement callback events after changing the settings in the data source.

Or, use the plug-in for changing settings through the browser. The plugin raises an HTTP server on the specified port and tries to display a list of plugins, their settings and settings values via JSON.

The main problem when deploying a service and specifying one TCP port for settings is that instances of the same host, but with a different array of plugins — there can be a lot, so the plugin takes not only the TCP port of the server, but also raises the IPC host. Therefore, if the TCP port is busy, the new instance tries to connect to the existing IPC host, and if it fails, it fails with an error that the port is busy. If it was possible to connect to the IPC host successfully, then the child plugin tells the host its ID (ProcessId is used in the first version) and when accessed through the browser, the administrator has the opportunity to select the process and the list of loaded plugins.

Next comes the problem of closing the master host, which releases the port and closes the IPC host. All processes connected via IPC start pinging each other with a certain frequency, and if the IPC host is closed, one of the child processes tries to occupy the TCP port and opens the IPC host itself, to which the disconnected child processes try to connect again.

When the host is successfully started, the following messages appear in the logs:

Started at Url:
	http://127.0.0.1:8180/
	net.pipe://serverName/Plugin.ConfigurationHttp-1634336167/Control/Host

In the case of connecting to a running IPC host, the following message will appear in the child process:

Started at Url:
	net.pipe://serverName/Plugin.ConfigurationHttp-970326027/Control/17392/Plugins

And in the previously launched IPC host, there will be the following message:

IPC service connected -> ProcessId: 17,392 Address: net.pipe://serverName/Plugin.ConfigurationHttp-970326027/Control/17392/Plugins Count: 4

On Windows 10, it may also be necessary to reserve a TCP port for the application using the netsh command, so that if you get an "Access is denied" error when trying to open a TCP port, the following message will be written to the log:

You have to reserve host with netsh command or run application in [Administrator] mode.

And an exception will be thrown, which in the data will contain a line like:

String.Format("netsh http add urlacl url={0} user={1}\\{2}\"", this._hostUrl, Environment.UserDomainName, Environment.UserName);
Screenshot
Screenshot

Configuration

  1. AuthenticationScheme: Anonymous — Authorization using a specific scheme.
  2. Realm: — ?
  3. UnsafeConnectionNtlmAuthentication: False — ?
  4. Users: — Array of accounts, together with the domain, used for logging in with Basic authorization. Format: DOMAIN\Login
  5. UnsafeConnectionNtlmAuthentication: False — ?
  6. HostUrl: http://{ipAddress}:8180/ — Host where the application settings are opened. Constant {ipAddress} — Used to substitute the global IP address of a machine.
  7. IgnoreWriteExceptions: True — Receive errors on the server when sending a response to the client
  8. ListenersCount: 1 — Number of threads that process client requests
Теги:

Скачать

Родительские файлы