Skip to content

Commit

Permalink
add more config parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
bodsch committed Jan 30, 2024
1 parent 264339d commit 8ca3ce9
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/configured.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: collabora with sqlite and custom config
name: collabora with custom config

on:
workflow_dispatch:
Expand Down
77 changes: 49 additions & 28 deletions templates/etc/coolwsd/coolwsd.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
document e.g. the text part of it will be sent to the cloud API. Please read the respective privacy policies, e.g. https://languagetool.org/legal/privacy.
-->
<languagetool desc="Remote API settings for spell and grammar checking">
<enabled desc="Enable Remote Spell and Grammar Checker" type="bool" default="false"></enabled>
<base_url desc="HTTP endpoint for the API server, without /check or /languages postfix at the end." type="string" default=""></base_url>
<user_name desc="LanguageTool or Duden account username for premium usage." type="string" default=""></user_name>
<api_key desc="API key provided by LanguageTool or Duden account for premium usage." type="string" default=""></api_key>
<ssl_verification desc="Enable or disable SSL verification. You may have to disable it in test environments with self-signed certificates." type="string" default="true"></ssl_verification>
<rest_protocol desc="REST API protocol. For LanguageTool leave it blank, for Duden Korrekturserver use the string 'duden'." type="string" default=""></rest_protocol>
<enabled desc="Enable Remote Spell and Grammar Checker" type="bool" default="false">{{ collabora_config.languagetool.enable | default('false') }}</enabled>
<base_url desc="HTTP endpoint for the API server, without /check or /languages postfix at the end." type="string" default="">{{ collabora_config.languagetool.base_url | default('') }}</base_url>
<user_name desc="LanguageTool or Duden account username for premium usage." type="string" default="">{{ collabora_config.languagetool.user_name | default('') }}</user_name>
<api_key desc="API key provided by LanguageTool or Duden account for premium usage." type="string" default="">{{ collabora_config.languagetool.api_key | default('') }}</api_key>
<ssl_verification desc="Enable or disable SSL verification. You may have to disable it in test environments with self-signed certificates." type="string" default="true">{{ collabora_config.languagetool.ssl_verification | default('') }}</ssl_verification>
<rest_protocol desc="REST API protocol. For LanguageTool leave it blank, for Duden Korrekturserver use the string 'duden'." type="string" default="">{{ collabora_config.languagetool.rest_protocol | default('') }}</rest_protocol>
</languagetool>

<deepl desc="DeepL API settings for translation service">
<enabled desc="If true, shows translate option as a menu entry in the compact view and as an icon in the tabbed view." type="bool" default="false">false</enabled>
<api_url desc="URL for the API" type="string" default=""></api_url>
<auth_key desc="Auth Key generated by your account" type="string" default=""></auth_key>
<enabled desc="If true, shows translate option as a menu entry in the compact view and as an icon in the tabbed view." type="bool" default="false">{{ collabora_config.deepl.enable | default('false') }}</enabled>
<api_url desc="URL for the API" type="string" default="">{{ collabora_config.deepl.api_url | default('') }}</api_url>
<auth_key desc="Auth Key generated by your account" type="string" default="">{{ collabora_config.deepl.auth_key | default('') }}</auth_key>
</deepl>

<sys_template_path desc="Path to a template tree with shared libraries etc to be used as source for chroot jails for child processes." type="path" relative="true" default="systemplate"></sys_template_path>
Expand All @@ -56,11 +56,12 @@
<server_name desc="External hostname:port of the server running coolwsd. If empty, it's derived from the request (please set it if this doesn't work). May be specified when behind a reverse-proxy or when the hostname is not reachable directly." type="string" default="">{{ collabora_config.server_name | default('') }}</server_name>
<file_server_root_path desc="Path to the directory that should be considered root for the file server. This should be the directory containing cool." type="path" relative="true" default="browser/../"></file_server_root_path>
<hexify_embedded_urls desc="Enable to protect encoded URLs from getting decoded by intermediate hops. Particularly useful on Azure deployments" type="bool" default="false"></hexify_embedded_urls>
<experimental_features desc="Enable/Disable experimental features" type="bool" default="true">true</experimental_features>
<experimental_features desc="Enable/Disable experimental features" type="bool" default="true">{{ collabora_config.experimental_features | default('true') }}</experimental_features>

<memproportion desc="The maximum percentage of available memory consumed by all of the Collabora Online Development Edition processes, after which we start cleaning up idle documents. If cgroup memory limits are set, this is the maximum percentage of that limit to consume." type="double" default="80.0"></memproportion>
<num_prespawn_children desc="Number of child processes to keep started in advance and waiting for new clients." type="uint" default="1">1</num_prespawn_children>
<memproportion desc="The maximum percentage of available memory consumed by all of the Collabora Online Development Edition processes, after which we start cleaning up idle documents. If cgroup memory limits are set, this is the maximum percentage of that limit to consume." type="double" default="80.0">{{ collabora_config.memproportion | default('') }}</memproportion>
<num_prespawn_children desc="Number of child processes to keep started in advance and waiting for new clients." type="uint" default="1">{{ collabora_config.num_prespawn_children | default('1') }}</num_prespawn_children>
<!-- <fetch_update_check desc="Every number of hours will fetch latest version data. Defaults to 10 hours." type="uint" default="10">{{ collabora_config.fetch_update_check | default('') }}</fetch_update_check> -->

<per_document desc="Document-specific settings, including LO Core settings.">
<max_concurrency desc="The maximum number of threads to use while processing a document." type="uint" default="4">4</max_concurrency>
<batch_priority desc="A (lower) priority for use by batch eg. convert-to processes to avoid starving interactive ones" type="uint" default="5">5</batch_priority>
Expand Down Expand Up @@ -104,17 +105,28 @@
coolwsd command line, so if you want to change it for your testing, do it in
Makefile.am, not here.
-->
<level type="string" desc="Can be 0-8 (with the lowest numbers being the least verbose), or none (turns off logging), fatal, critical, error, warning, notice, information, debug, trace" default="warning">{{ collabora_config.logging.level }}</level>
<level_startup type="string" desc="As for level - but for the initial startup phase which is most problematic, logging reverts to level configured above when startup is complete" default="trace">{{ collabora_config.logging.startup }}</level_startup>
{% set _logging_level = "information" %}
{% set _logging_startup = "debug" %}
{% set _valid_logging_level = ["fatal", "critical", "error", "warning", "notice", "information", "debug", "trace"] %}
{% if collabora_config.logging.level is defined and
collabora_config.logging.level in _valid_logging_level %}
{% set _logging_level = collabora_config.logging.level %}
{% endif %}
{% if collabora_config.logging.startup is defined and
collabora_config.logging.startup in _valid_logging_level %}
{% set _logging_startup = collabora_config.logging.startup %}
{% endif %}
<level type="string" desc="Can be 0-8 (with the lowest numbers being the least verbose), or none (turns off logging), fatal, critical, error, warning, notice, information, debug, trace" default="warning">{{ _logging_level }}</level>
<level_startup type="string" desc="As for level - but for the initial startup phase which is most problematic, logging reverts to level configured above when startup is complete" default="trace">{{ _logging_startup }}</level_startup>
<most_verbose_level_settable_from_client type="string" desc="A loggingleveloverride message from the client can not set a more verbose log level than this" default="notice">notice</most_verbose_level_settable_from_client>
<least_verbose_level_settable_from_client type="string" desc="A loggingleveloverride message from a client can not set a less verbose log level than this" default="fatal">fatal</least_verbose_level_settable_from_client>
<protocol type="bool" desc="Enable minimal client-site JS protocol logging from the start">false</protocol>
<!-- lokit_sal_log example: Log WebDAV-related messages, that is interesting for debugging Insert - Image operation: "+TIMESTAMP+INFO.ucb.ucp.webdav+WARN.ucb.ucp.webdav"
See also: https://docs.libreoffice.org/sal/html/sal_log.html -->
<lokit_sal_log type="string" desc="Fine tune log messages from LOKit. Default is to suppress log messages from LOKit." default="-INFO-WARN">-INFO-WARN</lokit_sal_log>
<file enable="false">
<file enable="{{ collabora_config.logging.file.enable | default('false') }}">
<!-- If you use other path than /var/log and you run coolwsd from systemd, make sure that you enable that path in coolwsd.service (ReadWritePaths). -->
<property name="path" desc="Log file path.">/var/log/coolwsd.log</property>
<property name="path" desc="Log file path.">{{ collabora_config.logging.file.path | default('/var/log/coolwsd.log') }}</property>
<property name="rotation" desc="Log file rotation strategy. See Poco FileChannel.">never</property>
<property name="archive" desc="Append either timestamp or number to the archived log filename.">timestamp</property>
<property name="compress" desc="Enable/disable log file compression.">true</property>
Expand All @@ -124,8 +136,8 @@
<property name="flush" desc="Enable/disable flushing after logging each line. May harm performance. Note that without flushing after each line, the log lines from the different processes will not appear in chronological order.">false</property>
</file>
<anonymize>
<anonymize_user_data type="bool" desc="Enable to anonymize/obfuscate of user-data in logs. If default is true, it was forced at compile-time and cannot be disabled." default="false">false</anonymize_user_data>
<anonymization_salt type="uint" desc="The salt used to anonymize/obfuscate user-data in logs. Use a secret 64-bit random number." default="82589933">82589933</anonymization_salt>
<anonymize_user_data type="bool" desc="Enable to anonymize/obfuscate of user-data in logs. If default is true, it was forced at compile-time and cannot be disabled." default="false">{{ collabora_config.logging.anonymize.user_data | default('true') }}</anonymize_user_data>
<anonymization_salt type="uint" desc="The salt used to anonymize/obfuscate user-data in logs. Use a secret 64-bit random number." default="82589933">{{ collabora_config.logging.anonymize.salt | default('82589933') }}</anonymization_salt>
</anonymize>
<docstats type="bool" desc="Enable to see document handling information in logs." default="false">{{ collabora_config.logging.docstats }}</docstats>
<userstats desc="Enable user stats. i.e: logs the details of a file and user" type="bool" default="false">{{ collabora_config.logging.userstats }}</userstats>
Expand Down Expand Up @@ -275,8 +287,13 @@
</watermark>

<user_interface>
<mode type="string" desc="Controls the user interface style. The 'default' means: Take the value from ui_defaults, or decide for one of compact or tabbed (default|compact|tabbed)" default="default">default</mode>
<use_integration_theme desc="Use theme from the integrator" type="bool" default="true">true</use_integration_theme>
{% set _user_interface_type = "default" %}
{% if collabora_config.user_interface.mode is defined and
collabora_config.user_interface.mode in ["default", "compact", "tabbed"] %}
{% set _user_interface_type = collabora_config.user_interface.mode %}
{% endif %}
<mode type="string" desc="Controls the user interface style. The 'default' means: Take the value from ui_defaults, or decide for one of compact or tabbed (default|compact|tabbed)" default="default">{{ _user_interface_type }}</mode>
<use_integration_theme desc="Use theme from the integrator" type="bool" default="true">{{ collabora_config.user_interface.use_integration_theme | default('true') }}</use_integration_theme>
</user_interface>

<storage desc="Backend storage">
Expand Down Expand Up @@ -306,8 +323,12 @@
<locking desc="Locking settings">
<refresh desc="How frequently we should re-acquire a lock with the storage server, in seconds (default 15 mins) or 0 for no refresh" type="int" default="900">{{ collabora_config.storage.wopi.locking.refresh | default('900') }}</refresh>
</locking>

<alias_groups desc="default mode is 'first' it allows only the first host when groups are not defined. set mode to 'groups' and define group to allow multiple host and its aliases" mode="{{ collabora_config.storage.wopi.alias_groups.mode | default('first') }}">
{% set _alias_groups_mode = "first" %}
{% if collabora_config.storage.wopi.alias_groups.mode is defined and
collabora_config.storage.wopi.alias_groups.mode in ["first", "groups"] %}
{% set _alias_groups_mode = collabora_config.storage.wopi.alias_groups.mode %}
{% endif %}
<alias_groups desc="default mode is 'first' it allows only the first host when groups are not defined. set mode to 'groups' and define group to allow multiple host and its aliases" mode="{{ _alias_groups_mode }}">
<!-- If you need to use multiple wopi hosts, please change the mode to "groups" and
add the hosts below. If one host is accessible under multiple ip addresses
or names, add them as aliases. -->
Expand Down Expand Up @@ -358,15 +379,15 @@
</storage>

<admin_console desc="Web admin console settings.">
<enable desc="Enable the admin console functionality" type="bool" default="true">true</enable>
<enable_pam desc="Enable admin user authentication with PAM" type="bool" default="false">false</enable_pam>
<enable desc="Enable the admin console functionality" type="bool" default="true">{{ collabora_config.admin_console.enable | default('true') }}</enable>
<enable_pam desc="Enable admin user authentication with PAM" type="bool" default="false">{{ collabora_config.admin_console.enable | default('false') }}</enable_pam>
<username desc="The username of the admin console. Ignored if PAM is enabled.">{{ collabora_config.admin_console.username }}</username>
<password desc="The password of the admin console. Deprecated on most platforms. Instead, use PAM or coolconfig to set up a secure password.">{{ collabora_config.admin_console.password }}</password>
<logging desc="Log admin activities irrespective of logging.level">
<admin_login desc="log when an admin logged into the console" type="bool" default="true">true</admin_login>
<metrics_fetch desc="log when metrics endpoint is accessed and metrics endpoint authentication is enabled" type="bool" default="true">true</metrics_fetch>
<monitor_connect desc="log when external monitor gets connected" type="bool" default="true">true</monitor_connect>
<admin_action desc="log when admin does some action for example killing a process" type="bool" default="true">true</admin_action>
<admin_login desc="log when an admin logged into the console" type="bool" default="true">{{ collabora_config.admin_console.logging.admin_login | default('true') }}</admin_login>
<metrics_fetch desc="log when metrics endpoint is accessed and metrics endpoint authentication is enabled" type="bool" default="true">{{ collabora_config.admin_console.logging.metrics_fetch | default('true') }}</metrics_fetch>
<monitor_connect desc="log when external monitor gets connected" type="bool" default="true">{{ collabora_config.admin_console.logging.monitor_connect | default('true') }}</monitor_connect>
<admin_action desc="log when admin does some action for example killing a process" type="bool" default="true">{{ collabora_config.admin_console.logging.admin_action | default('true') }}</admin_action>
</logging>
</admin_console>

Expand Down
30 changes: 28 additions & 2 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,37 @@ collabora_defaults_service:
collabora_defaults_config:
# The languages allowed.
allowed_languages: []
fetch_update_check: "" # hours

cache_path: /var/cache/loolwsd
# You can manage the mounting feature. Either "false" or "true". (As a string.)
mount_jail_tree: "true"

# Remote API settings for spell and grammar checking
languagetool:
enable: false
base_url: ""
user_name: ""
api_key:
ssl_verification:
rest_protocol: ""

# DeepL API settings for translation service
deepl:
enable: false
api_url: ""
auth_key: ""

# External hostname:port of the server running coolwsd
server_name: ""
# Enable/Disable experimental features
experimental_features: true
# The maximum percentage of available memory consumed by all of the Collabora Online processes
memproportion: "80.0"
# Number of child processes to keep started in advance and waiting for new clients
num_prespawn_children: "1"
# Every number of hours will fetch latest version data
fetch_update_check: "10" # hours

logging:
color: true
# Set the log level. Can be 0 through 8, none or "fatal", "critical", "error",
Expand All @@ -72,7 +98,7 @@ collabora_defaults_config:

anonymize:
user_data: true
salt: ""
salt: "" # A secret 64-bit random number (default: 82589933)
docstats: false
userstats: false
#
Expand Down

0 comments on commit 8ca3ce9

Please sign in to comment.