sipcapture / homer-app

HOMER 7.x Front-End and API Server
http://sipcapture.io
GNU Affero General Public License v3.0
204 stars 79 forks source link

Support configuration reload via an API #413

Closed mmerrill3 closed 1 year ago

mmerrill3 commented 3 years ago

Expose an API to allow readConfig() to be called again by outside processes, or sidecar containers. This would be a POST for the homer-app to refresh it's configuration, including possible password changes to databases.

adubovikov commented 3 years ago

so, some params can be changed, this is not a problem, but server socket and binding can be changed only on restart.

mmerrill3 commented 3 years ago

Thanks @adubovikov, I was interested in the database passwords. I could see a solution where a configuration reload request is sent, and the readConfig() can be aware if the config was already read. If so, then only look to update certain config settings, like the database passwords.

mmerrill3 commented 3 years ago

I can try a first pass at this over the weekend.

mmerrill3 commented 3 years ago

I believe we can just use viper to watch for changes to the file. I am going to give the ability to turn on/off this feature via configuration. Like this:

if *appFlags.WatchConfig {
        viper.WatchConfig()
    }
adubovikov commented 2 years ago

@mmerrill3 sorry - should we close the ticket ?