OpenSIPS/opensips-cp

[Settings] Database connection provisioning

razvancrainea opened this issue · 0 comments

There are currently two levels for provisioning the database connection OpenSIPS CP uses:

  • a global one, defined in config/db.inc.php which is used for storing the CP users and permissions, and act as the default connection for tools
  • the "local" db.inc.php per tool, which overwrites the default/globaly defined (above) connection

The current approach has two drawbacks:

  1. you cannot define a connection for users and pass, and a different, default one, for the modules to use. If you want to have this setup, you need to provision the default connection, and explicit set the module's connection for each module.
  2. the database connection needs to be provisioned through cli php editing.

This feature request is basically a reminder to change both behavior. To fix issue no. 1, we can use a different approach, where we could define multiple connections, each identified by an id, and one that can be marked as default. Then, each module/CP users, can be assigned one of these IDs, and if one is not assigned, the default is used. Basically the idea is that the CP Users provisioning should be considered as a module as well, and can have its own connector, independent of the global one.

Another feature to fix no. 2 is to be able to define multiple DB connections in a web interface, rather than through php editing.