COREmanager Documentation

/
/
/
External configuration of applications

External configuration of applications

 

Sometimes you may need to configure an application according to your specific needs. All ISPsystem's software products based on COREmanager has a built-in mechanism for external configuration of a custom application during setup or its configuration.

How it works

When you install a control panel, the system will check its license, and the panel will retrieve from the license a "settingurl" URL of the configuration server, which informs the panel where it can obtain further setup instructions.

"settingurl" is added in the user's license provided that the corresponding settings are made in our billing system.

Next, the control panel will follow the URL (the request parameter is specified as the license identifier).

If the server finds the license, it will return an XML response encrypted with XXTEA and converted into a hexadecimal value (the license key is used as the encryption key).

The control panel will de-encrypt the response using the license activation key, and complete the described instructions.

 Notes:
 If a server needs to perform initial external setup,  it will call the  "xset.up" function of the client's panel. Then, the panel will perform the operations described above, and add all parameters specified during initialization, i.e. when calling  "xset.up", to the request parameters. Therefore, the  "xset.up" function is some kind of call back.

Response XML-document

Response format

<?xml version="1.0" encoding="UTF-8"?>
<doc>
  <func name="xset.up.param">
    <arg name="grant">x.x.x.x</arg>
  </func>
  <func name="function name">
    <arg name="parameter name">value</arg>
  </func>
  ...
</doc>

Thus, the server sends the control panel a number of commands that should be executed right away:

Allowed functions:

  • ipaddrlist.delete
  • ipaddrlist.edit
  • dnsparam
  • xset.up.param
  • slaveserver.delete
  • slaveserver.edit

The "xset.up.param" function will inform the control panel which IP addresses are allowed to start the configuration procedure.

Example of an external configuration server

Create the /tmp/settings.py file

#!/usr/bin/env python
 
from flup.server.fcgi import WSGIServer
from xxtea import encrypt
import struct
 
def app(environ, start_response):
  status = '200 OK'
  response_headers = [('Content-type','text/plain')]
  start_response(status, response_headers)
 
  data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><doc><func name=\"ipaddrlist.edit\">ваши настройки</func></doc>"
  key = "1515848-bXy1Avllp4E5VnyI1394582400" # activation key for my license! you should obtain it from the billing by the Id that was passed
  ln = len(data)
  data += "\0" * ((4 - (ln % 4)) & 3)
  data += struct.pack("i", ln);
 
  return [ encrypt(data, key, True) ]
 
WSGIServer(app, bindAddress=('localhost', 9002)).run()

The following block will be added to the Nginx configuration file:

server {
  listen 80;
  root /tmp;
  location /setting.py {
    fastcgi_pass 127.0.0.1:9002;
    include fastcgi_params;
  }
}

Start the script and restart Nginx.

Now, if you include into the license the settingurl parameter with the URL of your server and install the panel, the instructions sent by your server will be executed. с адресом вашего сервера и произвести установку панели, то будут выполнены переданные вашим сервером инструкции.

settingurl parameters

The panel will apply to settingurl after setup/update of every module.

The request will contain two parameters: elid with the install value, and update.

And module with the name of the module that was installed (this parameter has the empty value for the main package)