ifeval::["{backend}" != "manpage"]
= `racksdb-web` CLI manpage

This section explains all `racksdb-web` command options available. The content
of the page this also available in `racksdb-web(1)` manpage after installation.

endif::[]

:!example-caption:

== Synopsis

[.cli-opt]#*racksdb-web*# `[_OPTIONS_]`

== Options

[.cli-opt]#*-h, --help*#::
  Show this help message and exit.

[.cli-opt]#*-v, --version*#::
  Show RacksDB version number and exit.

[.cli-opt]#*--debug*#::
  Enable debug mode with more messages in output.

[.cli-opt]#*-b, --db*=#[.cli-optval]##_DB_##::
  Path to database. Both files and directories paths are accepted. If the path
  is a directory, all YAML files in this directory are loaded, recursively. If
  the path does not exist, an error is reported. Default value is
  [.path]#`/var/lib/racksdb/`# directory or environment variable
  [.cli-opt]#*RACKSDB_DB*# if set.

[.cli-opt]#*-s, --schema*=#[.cli-optval]##_SCHEMA_##::
  Path to RacksDB schema YAML file. If the file does not exist, an error is
  reported. Default value is [.path]#`/usr/share/racksdb/schemas/racksdb.yml`#
  or environment variable [.cli-opt]#*RACKSDB_SCHEMA*# if set.

[.cli-opt]#*-e, --ext*=#[.cli-optval]##_EXT_##::
  Path to optional RacksDB schema extensions. If the file does not exist,
  it is silently ignored by RacksDB. Default value is
  [.path]#`/etc/racksdb/extensions.yml`# or environment variable
  [.cli-opt]#*RACKSDB_EXTENSIONS*# if set.

[.cli-opt]#*--host*=#[.cli-optval]##_HOST_##::
  The hostname to listen for incoming requests. Set to `0.0.0.0` to listen on
  all IP addresses of the host. Default value is `localhost` which restricts
  connections to local host.

[.cli-opt]#*-p, --port*=#[.cli-optval]##_PORT_##::
  TCP port to listen for incoming requests. Default value is 5000.

[.cli-opt]#*--drawings-schema*=#[.cli-optval]##_DRAWINGS_SCHEMA_##::
  Path to drawing parameters schema YAML file. Default value is
  [.path]#`/usr/share/racksdb/drawings.yml`#.

[.cli-opt]#*--cors*#::
  Enable CORS headers.

[.cli-opt]#*--openapi*#::
  Enable OpenAPI endpoint to retrieve REST API specifications.

[.cli-opt]#*--with-ui*#[.cli-optval]##[=_PATH_]##::
  Enable web UI. The web UI is disabled by default. When the option is used
  without value, default UI path [.path]#`/usr/share/racksdb/frontend`# is used.
  When a path is provided, `racksdb-web` loads UI files from this path.

== Environment variables

When a command-line option above is omitted, `racksdb-web` uses the following
environment variables if they are set to a non-empty value:

[.cli-opt]#*RACKSDB_SCHEMA*#::
  Path to the RacksDB schema YAML file.

[.cli-opt]#*RACKSDB_EXTENSIONS*#::
  Path to optional schema extensions.

[.cli-opt]#*RACKSDB_DB*#::
  Path to the database.

Command-line options always override environment variables.

== Exit status

*0*::
  `racksdb-web` has processed command with success.

*1*::
  `racksdb-web` encountered an error.
