Manual Configuration

Settings File

The Settings file for the REST API Administration Panel is:

/opt/bacula/rest-api/www/protected/Data/settings.conf

This file is writen by the configuration wizard available in the REST API Administration Panel available as WebGUI.

Please note that after first install Bacula Enterprise REST API this settings file will not exist. If this file is created manually you must ensure that your Web server has read access to it or even better has read and write access.

DB1 Section within the Setting File

Section “db1” allows defining the primary database inside is stored “oauth2_* tables for OAuth2 authorization. Data from other Catalog databases if any will be available by “?catalog=XXX” requests, where XXX is name of Catalog resource name from configuration file of the Bacula Director service. There is no need to define other Catalog databases.

OPTIONS

  • Catalog database type.

    Possible values:

    mysql

    for MySQL catalog database type,

    pgsql

    for PostgreSQL catalog database type.

  • Catalog database name.

  • Catalog database login/username.

  • Catalog database password as plain text.

  • IP address or hostname on which the Catalog database server listens.

Note

If database access is available via Unix socket then:
- for MySQL Catalog database please input “localhost” value,
- for PostgreSQL Catalog database please leave this field empty. I.e. “”.
  • port on which the Catalog database server listens.

Example configuration of “db1” section

[db1]
type = "pgsql"
name = "bacula"
login = "bacula"
password = "My$tR0n6Pa$$"
ip_addr = "172.16.77.1"
port = "5432"

Bconsole Section

The “bconsole” section is used to input locations for access to the Bacula Console (bconsole) program.

OPTIONS

  • the full path and filename of the Bacula Console program.

  • the full path to the Bacula Console configuration file.

  • enable/disable access by the web server to using “sudo”.

    Possible values:

    0

    disable access by “sudo” and are using direct Bacula Console executions.

    1

    enable access by “sudo” and are using Bacula Console executions with “sudo”.

Example configuration of “bconsole” section

[bconsole]
bin_path = "/opt/bacula/bin/bconsole"
cfg_path = "/opt/bacula/etc/bconsole.conf"
use_sudo = "1"

Tools section

The “tools” section defines access to the bdirjson, bsdjson, bfdjson programs. These programs are used for getting Bacula configuration settings directly from configuration files. Subsequently these settings are available via REST API interface with “/res/” requests.

OPTIONS

  • full path and filename to the bdirjson program.

  • full path and filename to the bsdjson program.

  • full path and filename to the bfdjson program.

  • enable/disable access by the web server to using “sudo”.

    Possible values:

    0

    disable using “sudo” to execute the Bacula JSON tools. I.e. execute them directly.

    1

    enable using “sudo” to execute the Bacula JSON tools executions with “sudo”

Example configuration of “tools” section

[tools]
bdirjson = "/opt/bacula/bin/bdirjson"
bsdjson = "/opt/bacula/bin/bsdjson"
bfdjson = "/opt/bacula/bin/bfdjson"
use_sudo = "1"

API section

API section defines access parameters to REST API Administration Panel available as WebGUI address:

http(s)://yourhost/panel/

OPTIONS

  • username administration access to the REST API Panel.

  • the password hashed by md5 to get administration access to REST API Panel.

    Possible values:

    0

    NOT RECOMMENDED, disable OAuth2 authorization framework. When set to 0 then access to REST API resources will be available directly by HTTP GET requests.

    1

    DEFAULT, enable OAuth2 authorization framework. When set “1” value then the REST API access is protected by the OAuth2 framework.

  • determine log level for messages, warnings and errors that are saving in log file located on:

    /opt/bacula/rest-api/www/protected/Data/bacula-rest-api.log
    

    Possible values:

    0

    no logs are saved.

    1

    DEFAULT, only error messages are saved in the log file.

    2

    all available messages including messages “info” type are saved in the log file.

Example configuration of “api” section

username = "gani"
password = "e42e3b59f26e17b02bee3967f78782ef"
enable_oauth2 = "1"
log_level = "1"

Example configuration whole settings.conf file

Please note that for the REST API to work correctly one must define all possible sections. Here is example of a configuration file:

[db1]
type = "pgsql"
name = "bacula"
login = "bacula"
password = "MyEasyPassword"
ip_addr = "192.168.100.1"
port = "5432"

[bconsole]
bin_path = "/opt/bacula/bin/bconsole"
cfg_path = "/opt/bacula/etc/bconsole.conf"
use_sudo = "1"

[tools]
bdirjson = "/opt/bacula/bin/bdirjson"
bsdjson = "/opt/bacula/bin/bsdjson"
bfdjson = "/opt/bacula/bin/bfdjson"
use_sudo = "1"

[api]
username = "Joe"
password = "e42e3b59f26e17b02bee3967f78782ef"
enable_oauth2 = "1"
log_level = "1"

Go back to the REST API chapter.

Go back to the main Advanced Features Usage page.