From 588aad8afb92f1c1348f0db2c266c787d209a348 Mon Sep 17 00:00:00 2001 From: moisseev Date: Sat, 30 Mar 2024 15:36:36 +0300 Subject: [PATCH] Replace ucl with hcl code fence language name as ucl is not supported by Rouge syntax highlighter --- doc/faq.md | 68 +++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/doc/faq.md b/doc/faq.md index b56adade6..51d5c4a03 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -65,7 +65,7 @@ Therefore, it is strongly advised to employ your own recursive resolver when usi Following that, you can configure your local resolver globally via `/etc/resolv.conf` or explicitly for Rspamd in the `local.d/options.inc` file: -~~~ucl +~~~hcl # local.d/options.inc dns { nameserver = ["127.0.0.1"]; @@ -74,7 +74,7 @@ dns { or, if you want some backup as a last resort, you can use `master-slave` [rotation](configuration/upstream.html) as following: -~~~ucl +~~~hcl # local.d/options.inc dns { nameserver = "master-slave:127.0.0.1,8.8.8.8"; @@ -83,7 +83,7 @@ dns { If you use large scale DNS system you might want to set up `hash` rotation algorithm. It will significantly increase cache hit rate and reduce number of recursive queries if you have more than one upstream resolver: -~~~ucl +~~~hcl # local.d/options.inc dns { nameserver = "hash:10.0.0.1,10.1.0.1,10.3.0.1"; @@ -308,7 +308,7 @@ rspamadm confighelp -k timeout If you're unfamiliar with certain functionalities of Rspamd [modules]({{ site.url }}{{ site.baseurl }}/doc/modules/), enabling debugging for those modules can be quite beneficial. To accomplish this, include the following in your configuration: -```ucl +```hcl # local.d/logging.inc debug_modules = ["module_name"]; ``` @@ -444,7 +444,7 @@ Unfortunately, it's not a straightforward question. If you are using the [WebUI] If you intend to modify a symbol's score in the configuration, you should do it in the `local.d/groups.conf` file. This can be accomplished using the following syntax: -~~~ucl +~~~hcl # local.d/groups.conf symbols { @@ -456,7 +456,7 @@ symbols { Despite of the name of this file, this syntax does not change the group of the symbol, but it changes it's weight. You can also define your own symbols groups in this file: -~~~ucl +~~~hcl group "mygroup" { max_score = 10.0; @@ -476,7 +476,7 @@ You can check your new scores by using `rspamadm configdump -g` from version 2.5 Have you added an extra `section_name {}` to `local.d/section.conf` file? For example, this one will **NOT** work: -```ucl +```hcl # local.d/dkim_signing.conf dkim_signing { # !!!! DO NOT ADD THIS domain { @@ -487,7 +487,7 @@ dkim_signing { # !!!! DO NOT ADD THIS The correct version is the following: -```ucl +```hcl # local.d/dkim_signing.conf domain { ... @@ -530,7 +530,7 @@ From version 1.9, there are also some more actions: From version 1.9, you can also define any action you'd like with its own threshold or use that in the `force_actions` module: -```ucl +```hcl actions { # Generic threshold my_action = { @@ -545,7 +545,7 @@ actions { This might be a bit confusing, but internally Rspamd operates with rules. Each rule can add a positive or negative score to the result. Therefore, it is required to have some thresholds for actions that are applied to a message. These thresholds are defined in the `actions` section: -```ucl +```hcl actions { reject = 15; add_header = 6; @@ -566,7 +566,7 @@ Historically, Rspamd provided user-editable configuration files. However, as the An override configuration (`/etc/rspamd/rspamd.conf.override`) is used to ultimately redefine the default values in Rspamd. In this file, you can redefine **whole sections** of the default configuration. For example, if you have a module `example` defined in the default configuration as follows: -```ucl +```hcl example { option1 = "value"; option2 = true; @@ -575,7 +575,7 @@ example { and you wanted to override `option2` by adding the following to `/etc/rspamd/rspamd.conf.override`: -```ucl +```hcl example { option2 = false; } @@ -583,7 +583,7 @@ example { this might work unexpectedly: the new config would have an `example` section with a single key `option2`, while `option1` would be ignored. The global local file, namely `rspamd.conf.local`, has the same limitation: you can add your configuration there but you should **NOT** redefine anything from the default configuration or it will just be ignored. The only exception to this rule is the _metric_ section. So you could use something like: -```ucl +```hcl metric "default" { symbol "MY_SYMBOL" { score = 10.0; @@ -605,7 +605,7 @@ The types of settings which can be merged are collections (`{}`) and lists (`[]` An important difference from the global override and local rules is that these files are included within each section. Here is an example of utilizing local.d for the `modules.d/example.conf` configuration file: -```ucl +```hcl example { # WebUI include .include(try=true,priority=5) "${DBDIR}/dynamic/example.conf" @@ -620,21 +620,21 @@ example { in `local.d/example.conf`: -```ucl +```hcl option2 = false; option3 = 1.0; ``` in `override.d/example.conf`: -```ucl +```hcl option3 = 2.0; option4 = ["something"]; ``` and the target configuration (that you could see using `rspamadm configdump example`): -```ucl +```hcl example { option1 = "value"; # From default settings option2 = false; # From local.d @@ -645,7 +645,7 @@ example { Here is another example with more complicated structures inside. Here is the original configuration: -```ucl +```hcl # orig.conf rule "something" { key1 = value1; @@ -660,7 +660,7 @@ rule "other" { and there is some `local.d/orig.conf` that looks like this: -```ucl +```hcl # local.d/orig.conf rule "something" { key1 = other_value; # overwrite "value1" @@ -675,7 +675,7 @@ rule "local" { # add new rule then we will have the following merged configuration: -```ucl +```hcl # config with local.d/orig.conf rule "something" { key1 = other_value; # from local @@ -694,7 +694,7 @@ rule "local" { # from local If you have the same config but in `override.d` directory, then it will **completely** override all rules defined in the original file: -```ucl +```hcl # config with override.d/orig.conf rule "something" { key1 = other_value; @@ -727,7 +727,7 @@ All maps operate in a similar way, providing you with choices on how to define a For the second option, it is also possible to have a composite path with fallback: -~~~ucl +~~~hcl exceptions = [ "https://maps.rspamd.com/rspamd/2tld.inc.zst", "${DBDIR}/2tld.inc.local", @@ -807,7 +807,7 @@ In this case, the first three backends will be used when the HTTP map is availab From Rspamd version 1.2 onwards, each map can have a digital signature using the `EdDSA` algorithm. To sign a map, you can use `rspamadm signtool`, and to generate a signing keypair, use `rspamadm keypair -s -u`: -```ucl +```hcl keypair { pubkey = "zo4sejrs9e5idqjp8rn6r3ow3x38o8hi5pyngnz6ktdzgmamy48y"; privkey = "pwq38sby3yi68xyeeuup788z6suqk3fugrbrxieri637bypqejnqbipt1ec9tsm8h14qerhj1bju91xyxamz5yrcrq7in8qpsozywxy"; @@ -850,7 +850,7 @@ In Rspamd, a rule has the potential to be triggered multiple times. Consider a s Symbol groups serve the purpose of grouping similar rules together, proving particularly beneficial when employing group names in composite expressions like `gr:`. Additionally, it is viable to establish a collective limit for the score of a specific group: -```ucl +```hcl group "test" { symbol "test1" { score = 10; @@ -907,7 +907,7 @@ To deactivate an entire module, simply set `enabled = false` in its configuratio You can dynamically enable/disable actions with [settings module]({{ site.url }}{{ site.baseurl }}/doc/configuration/settings.html). From version 1.8.1, you can set `null` to some module there: -~~~ucl +~~~hcl settings { some_settings { authenticated = true; @@ -924,7 +924,7 @@ settings { Just disable `greylisting` module by adding the following configuration: -~~~ucl +~~~hcl # local.d/greylist.conf enabled = false; ~~~ @@ -939,7 +939,7 @@ It's important to note that this mode is activated **by default** for both **aut Yes, use [user settings]({{ site.url }}{{ site.baseurl }}/doc/configuration/settings.html) and enable just `DKIM_SIGN` symbol (and `DKIM_SIGNED` in case if `dkim_signing` module is used), e.g. -```ucl +```hcl # rspamd.conf.local settings { sign_id { @@ -996,7 +996,7 @@ Normally, you might want to check the final log line, for example, `rspamd_task_ Certainly, the `logging.inc` file includes a `log_format` option. The following configuration snippet proves useful as it enables the inclusion of additional information compared to the default output from the Rspamd logger: -```ucl +```hcl # local.d/logging.inc log_format =<