Seeing currently set options

Is there a way to see what options are currently enabled/disabled on a running instance of Orthanc? I know that many are returned by the /system API endpoint but not all of them. For example, I want to check whether DicomAlwaysAllowStore is enabled (there are other options I would like to check as well).

Apologies if this is addressed somewhere. I’ve searched the documentation, discussion, and checked whether this is logged at startup but haven’t found anything.

Hello,

The built-in REST API of Orthanc does not provide a way to access the Orthanc configuration, as this would be highly insecure (e.g., the configuration can contain passwords).

However, Orthanc plugins have full access to the configuration file, so you can easily create a Python plugin that returns a subset of selected configuration options. Here is such a Python plugin:

import orthanc
import json

def GetConfiguration(output, uri, **request):
    config = json.loads(orthanc.GetConfiguration())

    selection = {}
    for option in [ 'Plugins', 'DicomAlwaysAllowStore' ]:
        selection[option] = config.get(option)
    
    output.AnswerBuffer(json.dumps(selection, indent=2), 'application/json')

orthanc.RegisterRestCallback('/config', GetConfiguration)

You can then access this plugin by typing at the command line:

$ curl http://localhost:8042/config

Regards,
Sébastien-

1 Like

Thank you! That is very helpful!