This documentation site is about the unstable (upcoming) Comentario version.  Switch to the stable version »

Static configuration

How to configure your Comentario server

The Comentario server’s static (start-up) configuration can be defined in three ways, in order of precedence:

  • YAML configuration file
  • Command-line options
  • Environment variables

All three methods are functionally equivalent, but precedence applies: values in the configuration file override command-line options, which in turn override environment variables. Availability of each method depends on the specific setting.

When in doubt, use a YAML configuration file for your Comentario instance. It is the most complete and convenient option, offering a declarative format that works well with version control systems. In this case, the only required setting is specifying the file with the -c <file_name.yaml> command-line option (or the equivalent $CONFIG_FILE environment variable).

The easiest way to get started with a YAML-based config is allowing Comentario to write out its current settings using the following command:

comentario --config-write-to=/path/to/file.yaml

Then you can modify all settings to your taste.

Command-line help

You can also get a complete list of supported command-line options and variables by running:

./comentario -h

Synopsis

comentario [OPTIONS]

Options

Below is a list of available configuration settings (options).

YAML configCommand-lineEnvironment variableDefault valueDescription
-h
--help
Show help message (option summary) and exit.
-c VALUE
--config=VALUE
$CONFIG_FILEPath to a YAML file to load the configuration from.
--config-write-to=VALUEWhen specified, causes Comentario to save its current config to given YAML file and exit.
secrets--secrets=VALUE$SECRETS_FILEsecrets.yamlPath to YAML file with secrets.
host--host=VALUE$HOSTlocalhostThe IP to listen on. If you want to accept connections from any network interface, use value 0.0.0.0.
port--port=VALUE$PORT8080The port to listen on.
maxListen--max-listen=VALUE0Maximum number of outstanding requests. 0 means no limit.
cleanupTimeout--cleanup-timeout=VALUE10sGrace period for which to wait before killing idle connections.
gracefulTimeout--graceful-timeout=VALUE15sGrace period for which to wait before shutting down the server.
maxHeaderSize--max-header-size=VALUE1MiBMaximum number of bytes to read for request header (not request body).
keepAlive--keep-alive=VALUE3mTCP keepalive timeout on accepted connections.
readTimeout--read-timeout=VALUE30sMaximum duration before request read times out.
writeTimeout--write-timeout=VALUE60sMaximum duration before response write times out.
baseUrl--base-url=VALUE$BASE_URLhttp://localhost:8080Server’s own base URL.
baseDocsUrl--base-docs-url=VALUE$BASE_DOCS_URLhttps://docs.comentario.appBase documentation URL. Comentario provides numerous links to various docpages in the Admin UI and the embedded part. By default, points to Comentario production documentation.
tosUrl--tos-url=VALUE$TOS_URL<baseDocsUrl>/en/legal/tos/URL of the Terms of Service page.
privacyPolicyUrl--privacy-policy-url=VALUE$PRIVACY_POLICY_URL<baseDocsUrl>/en/legal/privacy/URL of the Privacy Policy page.
cdnUrl--cdn-url=VALUE$CDN_URLThe base URLStatic file CDN URL.
staticPath--static-path=VALUE$STATIC_PATH.Path to static (frontend) files.
superuser--superuser=VALUE$SUPERUSERUUID or email of a user to become a superuser.
homeContentUrl--home-content-url=VALUE$HOME_CONTENT_URLURL of a HTML page to display on Comentario homepage. If not specified, the home page wil redirect the user to the login page.
maxImportFileSize--max-import-file-size$MAX_IMPORT_FILE_SIZE10MiBMaximum import file size. This can be either a number of bytes, or a number followed by a unit (B=bytes, KB=kilobytes, MB=megabytes etc.).
Logging options
-v, --verboseVerbose logging (use -vv for debug logging). If specified, overrides --log.level.
log.level--log.level=VALUE$LOG_LEVELwarningLog verbosity level. Will be overridden to info if -v is given, or to debug if -vv is given on the command line.
log.noColor--log.no-color$LOG_NO_COLORDisable log colouring with ANSI control sequences.
log.fullIPs--log.full-ips$LOG_FULL_IPSLog IP addresses in full. When omitted, only first two bytes of IP addresses will be stored in fields such as user’s signup IP. Applies to both IPv4 (172.168.x.x) and IPv6 (692e:eace:x:x:x:x:x:x) addresses.
Database options
db.maxIdleConns--db.max-idle-conns=VALUE$DB_MAX_IDLE_CONNS10Maximum number of idle DB connections.
db.debug--db.debugEnable database debug logging (meant for development purposes).
Statistics options
stats.disablePageViews--stats.disable-page-views$STATS_DISABLE_PAGE_VIEWSDisable page view statistics gathering and reporting.
stats.maxDays--stats.max-days$STATS_MAX_DAYS30Statistics retention and reporting period, in days.
Live update options
liveUpdate.disable--lu.disable$NO_LIVE_UPDATEDisable live updates via WebSockets.
liveUpdate.maxClients--lu.max-clients=VALUE$WS_MAX_CLIENTS10000Maximum number of WebSocket clients available for Live update.
Development options
dev.disableXSRF--dev.disable-xsrfDisable XSRF protection. This option is meant for development purposes only; each production environment should have XSRF protection activated.
dev.swaggerUI--dev.swagger-uiEnable Swagger UI at /api/docs.
dev.e2e--dev.e2eStart server in the end-to-end testing mode. This option is meant for development purposes only.

Comentario provides users with links to the following legal policy pages in a number of places:

Apart from being required by law in many countries, such a page is often mandatory when configuring federated authentication via an external service. By default, the above URLs on the documentation website are used.

If you apply your own policies, you should reconfigure Comentario to using your own URLs. Such pages have to be hosted elsewhere as Comentario provides no means for storing them at the moment.

Dynamic configuration defaults

Comentario YAML config also allows to redefine default values for dynamic configuration items.

In order to do that define corresponding overrides under the key dynamicConfigDefaults, for example:

dynamicConfigDefaults:
  auth:
    signup:
      confirm:
        commenter: false
        user: true

  domain.defaults:
    comments:
      text:
        maxLength: 417
      enableVoting: true
      editing:
        author: true
        moderator: false

You can find the key name on the item page, under the heading. Allowed value datatypes are string, number, and boolean.

See also