You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> :bulb:**Note:** It's recommended that a [Straitjacket](#Straitjacket) with a `chroot` option is declared
438
+
> [!NOTE]
439
+
>
440
+
> It's recommended that a [Straitjacket](#Straitjacket) with a `chroot` option is declared
417
441
> right after a `tls_listener` section, in such a way that the paths to the
418
442
> certificate and key are out of reach from that point on.
419
443
@@ -467,7 +491,9 @@ section can be present in the declaration of a module instance. Handlers do
467
491
not take any configuration options, but may include the `authorization`
468
492
section.
469
493
470
-
> :magic_wand:**Tip:** Executing Lwan with the `--help` command-line
494
+
> [!TIP]
495
+
>
496
+
> Executing Lwan with the `--help` command-line
471
497
> argument will show a list of built-in modules and handlers.
472
498
473
499
The following is some basic documentation for the modules shipped with Lwan.
@@ -490,7 +516,9 @@ best to serve files in the fastest way possible according to some heuristics.
490
516
|`read_ahead`|`int`|`131702`| Maximum amount of bytes to read ahead when caching open files. A value of `0` disables readahead. Readahead is performed by a low priority thread to not block the I/O threads while file extents are being read from the filesystem. |
491
517
|`cache_for`|`time`|`5s`| Time to keep file metadata (size, compressed contents, open file descriptor, etc.) in cache |
492
518
493
-
> :bulb:**Note:** Files smaller than 16KiB will be compressed in RAM for
519
+
> [!NOTE]
520
+
>
521
+
> Files smaller than 16KiB will be compressed in RAM for
494
522
> the duration specified in the `cache_for` setting. Lwan will always try
495
523
> to compress with deflate, and will optionally compress with Brotli and
496
524
> zstd (if Lwan has been built with proper support).
@@ -534,7 +562,9 @@ Scripts can be served from files or embedded in the configuration file, and
534
562
the results of loading them, the standard Lua modules, and (optionally, if
535
563
using LuaJIT) optimizing the code will be cached for a while.
536
564
537
-
> :bulb:**Note:** Lua scripts can't use global variables, as they may be not
565
+
> [!NOTE]
566
+
>
567
+
> Lua scripts can't use global variables, as they may be not
538
568
> only serviced by different threads, but the state will be available only
539
569
> for the amount of time specified in the `cache_period` configuration
540
570
> option. This is because each I/O thread in Lwan will create an instance
@@ -549,7 +579,9 @@ the following signature: `handle_${METHOD}_${ENDPOINT}(req)`, where
549
579
`${METHOD}` can be a HTTP method (i.e. `get`, `post`, `head`, etc.), and
550
580
`${ENDPOINT}` is the desired endpoint to be handled by that function.
551
581
552
-
> :magic_wand:**Tip:** Use the `root` endpoint for a catchall. For example,
582
+
> [!TIP]
583
+
>
584
+
> Use the `root` endpoint for a catchall. For example,
553
585
> the handler function `handle_get_root()` will be called if no other handler
554
586
> could be found for that request. If no catchall is specified, the server
555
587
> will return a `404 Not Found` error.
@@ -599,7 +631,9 @@ The `rewrite` module will match
599
631
to either redirect to another URL, or rewrite the request in a way that Lwan
600
632
will handle the request as if it were made in that way originally.
601
633
602
-
> :information_source:**Info:** Forked from Lua 5.3.1, the regular expresion
634
+
> [!INFORMATION]
635
+
>
636
+
> Forked from Lua 5.3.1, the regular expresion
603
637
> engine may not be as feature-packed as most general-purpose engines, but
604
638
> has been chosen specifically because it is a [deterministic finite
@@ -609,7 +643,9 @@ will handle the request as if it were made in that way originally.
609
643
610
644
The new URL can be specified using a simple text substitution syntax, or use Lua scripts.
611
645
612
-
> :magic_wand:**Tip:** Lua scripts will contain the same metamethods
646
+
> [!TIP]
647
+
>
648
+
> Lua scripts will contain the same metamethods
613
649
> available in the `req` metatable provided by the Lua module, so it can be
614
650
> quite powerful.
615
651
@@ -686,7 +722,9 @@ pattern using the same substitution syntax used for the `rewrite as` or
686
722
foo-%1-bar }` will substitute `%1` with the first match from the pattern
687
723
this condition is related to.
688
724
689
-
> :bulb:**Note:** Conditions that do not require a section have to be written
725
+
> [!NOTE]
726
+
>
727
+
> Conditions that do not require a section have to be written
690
728
> as a key; for instance, `condition has_query_string = yes`.
691
729
692
730
For example, if one wants to send `site-dark-mode.css` if there is a
@@ -729,7 +767,9 @@ pattern (%g+) {
729
767
}
730
768
```
731
769
732
-
> :bulb:**Note:** In general, this is not necessary, as the file serving
770
+
> [!NOTE]
771
+
>
772
+
> In general, this is not necessary, as the file serving
733
773
> module will do this automatically and pick the smallest file available for
734
774
> the requested encoding, but this shows it's possible to have a similar
735
775
> feature by configuration alone.
@@ -775,7 +815,9 @@ Lwan and a [FastCGI](https://en.wikipedia.org/wiki/FastCGI) server
775
815
accessible by Lwan. This is useful, for instance, to serve pages from a
776
816
scripting language such as PHP.
777
817
778
-
> :bulb:**Note:** This is a preliminary version of this module, and
818
+
> [!NOTE]
819
+
>
820
+
> This is a preliminary version of this module, and
779
821
> as such, it's not well optimized, some features are missing, and
780
822
> some values provided to the environment are hardcoded.
781
823
@@ -798,7 +840,9 @@ section with a `basic` parameter, and set one of its options.
798
840
|`realm`|`str`|`Lwan`| Realm for authorization. This is usually shown in the user/password UI in browsers |
799
841
|`password_file`|`str`|`NULL`| Path for a file containing username and passwords (in clear text). The file format is the same as the configuration file format used by Lwan |
800
842
801
-
> :warning:**Warning:** Not only passwords are stored in clear text in a file
843
+
> [!WARNING]
844
+
>
845
+
> Not only passwords are stored in clear text in a file
802
846
> that should be accessible by the server, they'll be kept in memory for a few
0 commit comments