Set serverinfo token in config file

To be able to query the metrics of my nextcloud instance with prometheus, I use the nextcloud-exporter. There must be an acces token set in the serverinfo app for the exporter. Is there a way to set this token in the nextcloud config file instead of using the occ command (occ config:app:set serverinfo token --value “access-token”)?

I don’t understand why occ is a problem… but running occ command results in such attribute in your config.php:

  'serverinfo' =>
  array (
    'token' => 'access-token',
  ),

@wwe occ config:app:set writes the config value in the database, whereas occ config:system:set writes it in config.php.

2 Likes

thank you for heads up @tcit very welcome. I was not aware of this detail, always used occ config:system:get serverinfo token and missed the difference in the OP post.