Skip to content

Commit

Permalink
Replace ucl with hcl code fence language name
Browse files Browse the repository at this point in the history
as ucl is not supported by Rouge syntax highlighter
  • Loading branch information
moisseev committed Mar 30, 2024
1 parent f7f9157 commit 588aad8
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions doc/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand All @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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"];
```
Expand Down Expand Up @@ -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 {
Expand All @@ -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;
Expand All @@ -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 {
Expand All @@ -487,7 +487,7 @@ dkim_signing { # !!!! DO NOT ADD THIS

The correct version is the following:

```ucl
```hcl
# local.d/dkim_signing.conf
domain {
...
Expand Down Expand Up @@ -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 = {
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -575,15 +575,15 @@ example {

and you wanted to override `option2` by adding the following to `/etc/rspamd/rspamd.conf.override`:

```ucl
```hcl
example {
option2 = false;
}
```

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;
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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;
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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:<group_name>`. Additionally, it is viable to establish a collective limit for the score of a specific group:

```ucl
```hcl
group "test" {
symbol "test1" {
score = 10;
Expand Down Expand Up @@ -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;
Expand All @@ -924,7 +924,7 @@ settings {

Just disable `greylisting` module by adding the following configuration:

~~~ucl
~~~hcl
# local.d/greylist.conf
enabled = false;
~~~
Expand All @@ -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 {
Expand Down Expand Up @@ -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 =<<EOD
Expand Down Expand Up @@ -1025,7 +1025,7 @@ As evident, you have the flexibility to employ both embedded log variables and L

For obtaining debug information on a specific module in Rspamd, the `debug_modules` option within the logging configuration proves to be a valuable resource:

```ucl
```hcl
# local.d/logging.inc
debug_modules = ["spf"];
Expand Down Expand Up @@ -1054,13 +1054,13 @@ Finally, you need to change the default `sqlite` backend to `redis` and restart

local.d/classifier-bayes.conf:

```ucl
```hcl
backend = "redis";
```

override.d/worker-fuzzy.inc:

```ucl
```hcl
backend = "redis";
```

Expand Down Expand Up @@ -1217,7 +1217,7 @@ lnk

Then define the following multimap rule in `local.d/multimap.conf`:

```ucl
```hcl
file_extension_blacklist {
type = "filename";
filter = "extension";
Expand Down Expand Up @@ -1510,7 +1510,7 @@ However, you should consider using regexp maps with [multimap module]({{ site.ba

Starting from version 1.7.0, the proxy worker has the capability to transmit a designated header called `settings-id` during checks, applicable to both proxy and self-scan modes. This header empowers Rspamd to apply specific settings tailored to a message. Custom scores can be assigned, certain rules or rule groups can be deactivated, and more. For instance, to disable specific rules for outbound scanning, an entry in the [settings]({{ site.url }}{{ site.baseurl }}/doc/configuration/settings.html) module can be created:

```ucl
```hcl
settings {
outbound {
priority = high;
Expand All @@ -1533,7 +1533,7 @@ settings {

Then, we can apply this setting ID on the outbound MTA using the proxy configuration:

```ucl
```hcl
upstream "local" {
default = yes;
self_scan = yes; # Enable self-scan
Expand Down

0 comments on commit 588aad8

Please sign in to comment.