From 9a0c8f21842804bd905c881ec09fd5c8f2ee4b36 Mon Sep 17 00:00:00 2001 From: moisseev Date: Fri, 29 Mar 2024 17:34:42 +0300 Subject: [PATCH] Highlight with Markdown instead of Jekyll tags --- ...-09-07-universal-configuration-language.md | 53 +++++++++++-------- doc/faq.md | 4 +- doc/quickstart.md | 30 ++++++----- 3 files changed, 51 insertions(+), 36 deletions(-) diff --git a/_posts/2013-09-07-universal-configuration-language.md b/_posts/2013-09-07-universal-configuration-language.md index 8405576e2..dcb181a0c 100644 --- a/_posts/2013-09-07-universal-configuration-language.md +++ b/_posts/2013-09-07-universal-configuration-language.md @@ -16,7 +16,7 @@ For example, you can write the same configuration in the following ways: * in nginx like: -{% highlight nginx %} +~~~nginx param = value; section { param = value; @@ -36,11 +36,11 @@ section { } } } -{% endhighlight %} +~~~ * or in JSON: -{% highlight json %} +~~~json { "param": "value", "param1": "value1", @@ -58,7 +58,7 @@ section { ] } } -{% endhighlight %} +~~~ ## Improvements to the json notation. @@ -66,55 +66,61 @@ There are various things that makes json parsing more convenient for editing: * Braces are not necessary to enclose the top object: it is automatically treated as object: -{% highlight json %} +~~~json "key": "value" -{% endhighlight %} +~~~ + is the equivalent to: -{% highlight json %} + +~~~json {"key": "value"} -{% endhighlight %} +~~~ * There is no requirement of quotes for strings and keys, moreover, `:` sign may be replaced with `=` sign or even skipped for objects: -{% highlight nginx %} +~~~nginx key = value; section { key = value; } -{% endhighlight %} +~~~ + is the equivalent to: -{% highlight json %} + +~~~json { "key": "value", "section": { "key": "value" } } -{% endhighlight %} +~~~ * No commas mess: you can safely place a comma or semicolon for the last element in array or object: -{% highlight json %} +~~~json { "key1": "value", "key2": "value", } -{% endhighlight %} +~~~ * Non-unique keys in an object are allowed and automatically converted to the arrays internally: -{% highlight json %} +~~~json { "key": "value1", "key": "value2" } -{% endhighlight %} +~~~ + is converted to: -{% highlight json %} + +~~~json { "key": ["value1", "value2"] } -{% endhighlight %} +~~~ * Numbers can have suffixes to specify standard multipliers: * `[kKmMgG]` - standard 10 base multipliers (so `1k` is translated to 1000) @@ -131,23 +137,26 @@ RCL supports different style of comments: * multiline: `/* ... */` Multiline comments may be nested: -{% highlight c %} + +~~~c # Sample single line comment /* some comment /* nested comment */ end of comment */ -{% endhighlight %} +~~~ RCL supports external macroes both multiline and single line ones: -{% highlight nginx %} + +~~~nginx .macro "sometext"; .macro { Some long text .... }; -{% endhighlight %} +~~~ + There are two internal macroes provided by RCL: * `include` - read a file `/path/to/file` or an url `http://example.com/file` and include it to the current place of diff --git a/doc/faq.md b/doc/faq.md index b56adade6..8657e1620 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -83,12 +83,12 @@ 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 +```ucl # local.d/options.inc dns { nameserver = "hash:10.0.0.1,10.1.0.1,10.3.0.1"; } -~~~ +``` Rspamd uses consistent hashing and has some tolerance to the configuration changes. diff --git a/doc/quickstart.md b/doc/quickstart.md index 179fa8118..e35c81cde 100644 --- a/doc/quickstart.md +++ b/doc/quickstart.md @@ -42,7 +42,8 @@ It is assumed that you are using your operating system's package manager (e.g. ` main.cf
-

+
+~~~sh
 # TLS setup (we assume the same certs for IMAP and SMTP here)
 smtpd_tls_cert_file = /etc/letsencrypt/live/your.domain/fullchain.pem
 smtpd_tls_key_file = /etc/letsencrypt/live/your.domain/privkey.pem
@@ -114,7 +115,8 @@ smtpd_relay_restrictions = check_recipient_access hash:/etc/postfix/access, reje
 smtpd_milters = inet:localhost:11332
 milter_default_action = accept
 milter_protocol = 6
-
+~~~ +
You also need to create maps for access control and virtual aliases: @@ -395,7 +397,8 @@ The WebUI is managed by a controller worker, but for added functionality such as
-{% highlight nginx %} + +~~~nginx worker_processes 2; user www-data www-data; @@ -450,7 +453,8 @@ http { server_tokens off; } } -{% endhighlight %} +~~~ +
@@ -458,14 +462,16 @@ You might also use subdirs, as suggested by [@julienmalik](https://github.com/ju
-{% highlight nginx %} + +~~~nginx location /rspamd/ { proxy_pass http://localhost:11334/; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } -{% endhighlight %} +~~~ +
@@ -506,11 +512,11 @@ For more advanced proxy usage, please see the corresponding [documentation]({{ s Starting with version 1.1, it is now possible to utilize Redis as a backend for statistics and caching of learned messages. Redis is particularly recommended for clustered configurations as it enables concurrent learning and checking, and also performs very quickly. To configure Redis, you can specify the `redis` backend for a classifier, and the cache will automatically be set to the same servers. -{% highlight hcl %} +~~~hcl # /etc/rspamd/local.d/classifier-bayes.conf servers = "127.0.0.1"; backend = "redis"; -{% endhighlight %} +~~~ Please review the full [statistics documentation]({{ site.baseurl }}/doc/configuration/statistic.html) for further information as well as the [Redis configuration documentation]({{ site.baseurl }}/doc/configuration/redis.html) if you plan to use Redis. @@ -660,13 +666,13 @@ See [here]({{ site.url }}{{ site.baseurl }}/doc/rspamadm.html) for more informat It is also useful to have a simple `Sieve` script to place all messages marked as spam in the `Junk` folder. Here is an example of such a script (~/.dovecot.sieve): -{% highlight nginx %} +~~~nginx require ["fileinto"]; if header :is "X-Spam" "Yes" { fileinto "Junk"; } -{% endhighlight %} +~~~ It is also possible to set up Rspamc to learn by forwarding messages to a specific email address. I recommend using `/etc/aliases` for these purposes and `mail-redirect` command (e.g. provided by [Mail Redirect addon](https://addons.mozilla.org/en-GB/thunderbird/addon/mailredirect/){:target="_blank"} for `Thunderbird` MUA). The desired aliases could be the following: @@ -679,9 +685,9 @@ There is also an add-on for Thunderbird MUA written by Alexander Moisseev to vis To enable extended spam headers in [Milter headers module]({{ site.baseurl }}/doc/modules/milter_headers.html) add the following line to `local.d/milter_headers.conf`: -{% highlight hcl %} +~~~hcl extended_spam_headers = true; -{% endhighlight %} +~~~ To enable headers in Exim refer to the "Integration with Exim MTA" section of the [MTA integration]({{ site.baseurl }}/doc/integration.html) document.