Config

The /api/v3/config endpoints allow you to inspect, modify, and reload the configuration of the datarhei Core.

Read

Retrieve the currently active Core configuration with additionally a list of all fields that have an override by an environment variable. Such fields can be changed, but it will have no effect because the enviroment variable will always override the value.

Example:

curl http://127.0.0.1:8080/api/v3/config \
   -H 'accept: application/json' \
   -H 'Content-Type: application/json' \
   -X GET

Description:

Update

Upload a modified configuration. You can provide a partial configuration with only the fields you want to change. The minimal valid configuration you have to provide contains the version number:

{
    "version": 3
}

Example:

curl http://127.0.0.1:8080/api/v3/config \
   -H 'accept: application/json' \
   -H 'Content-Type: application/json' \
   -X PUT \
   -d '{
         "version": 3,
         "name": "core-1",
         "log": {
            "level": "debug"
         }
      }'

This has no effect until the configuration is reloaded.

Description:

Reload

After changing the configuration, the datarhei Core has to be restarted in order to reload the changed configuration.

Example:

curl http://127.0.0.1:8080/api/v3/config/reload \
   -H 'accept: application/json' \
   -H 'Content-Type: application/json' \
   -X GET

Configuration reload will restart the Core! The in-memory file system and sessions will remain intact.

Description:

Configuration

Complete config example:

{
    "version": 3,
    "id": "03a1d1af-b947-4a13-a169-d3f2238714ee",
    "name": "super-core-1337",
    "address": ":8080",
    "update_check": true,
    "log": {
        "level": "info",
        "topics": [],
        "max_lines": 1000
    },
    "db": {
        "dir": "/core/config"
    },
    "host": {
        "name": [
            "example.com"
        ],
        "auto": true
    },
    "api": {
        "read_only": false,
        "access": {
            "http": {
                "allow": [],
                "block": []
            },
            "https": {
                "allow": [],
                "block": []
            }
        },
        "auth": {
            "enable": true,
            "disable_localhost": false,
            "username": "admin",
            "password": "datarhei",
            "jwt": {
                "secret": "cz$L%a(d%%[lLh;Y8dahIjcQx+tBq(%5"
            },
            "auth0": {
                "enable": false,
                "tenants": []
            }
        }
    },
    "tls": {
        "address": ":8181",
        "enable": true,
        "auto": true,
        "email": "cert@example.com",
        "cert_file": "",
        "key_file": ""
    },
    "storage": {
        "disk": {
            "dir": "/core/data",
            "max_size_mbytes": 50000,
            "cache": {
                "enable": true,
                "max_size_mbytes": 500,
                "ttl_seconds": 300,
                "max_file_size_mbytes": 1,
                "types": {
                    "allow": [],
                    "block": [
                        ".m3u8",
                        ".mpd"
                    ]
                }
            }
        },
        "memory": {
            "auth": {
                "enable": true,
                "username": "admin",
                "password": "WH8y3alD7pHGsuBGwb"
            },
            "max_size_mbytes": 2000,
            "purge": true
        },
        "s3": [],
        "cors": {
            "origins": [
                "*"
            ]
        },
        "mimetypes_file": "./mime.types"
    },
    "rtmp": {
        "enable": true,
        "enable_tls": true,
        "address": ":1935",
        "address_tls": ":1936",
        "app": "/",
        "token": "n4jk235nNJKN4k5n24k"
    },
    "srt": {
        "enable": true,
        "address": ":6000",
        "passphrase": "n23jk4DD5DOAn5jk4DSS",
        "token": "",
        "log": {
            "enable": false,
            "topics": []
        }
    },
    "ffmpeg": {
        "binary": "ffmpeg",
        "max_processes": 0,
        "access": {
            "input": {
                "allow": [],
                "block": []
            },
            "output": {
                "allow": [],
                "block": []
            }
        },
        "log": {
            "max_lines": 50,
            "max_history": 3
        }
    },
    "playout": {
        "enable": false,
        "min_port": 0,
        "max_port": 0
    },
    "debug": {
        "profiling": false,
        "force_gc": 0
    },
    "metrics": {
        "enable": false,
        "enable_prometheus": false,
        "range_sec": 300,
        "interval_sec": 2
    },
    "sessions": {
        "enable": true,
        "ip_ignorelist": [
            "127.0.0.1/32",
            "::1/128"
        ],
        "session_timeout_sec": 30,
        "persist": true,
        "persist_interval_sec": 300,
        "max_bitrate_mbit": 250,
        "max_sessions": 50
    },
    "service": {
        "enable": false,
        "token": "",
        "url": "https://service.datarhei.com"
    },
    "router": {
        "blocked_prefixes": [
            "/api"
        ],
        "routes": {},
        "ui_path": "/core/ui"
    }
}

Required fields: version

Descriptions

pageConfiguration

Last updated