annotate man/d2obase.5.md @ 11:350589d762a0 default tip

add cgi, remove tls, update docs
author Atarwn Gard <a@qwa.su>
date Thu, 19 Mar 2026 20:00:49 +0500
parents 54ab94198677
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
1 % D2OBASE(5)
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
2 % March 2026
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
3
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
4 # NAME
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
5 d2obase - syntax and configuration guide for the d2o web server
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
6
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
7 # DESCRIPTION
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
8 The **ICF** (Inheritance Config Format) uses a stream-oriented approach to web serving. It focuses on reducing "boilerplate" by using variables, reusable mixins, and execution pipelines.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
9
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
10 # SYNTAX
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
11 A configuration file consists of variable assignments, mixin definitions, and site blocks containing pipelines.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
12
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
13 ## Variables
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
14 Variables are defined as `KEY=VALUE`. They are global and can be referenced later using the `$` prefix (e.g., `$DOM`).
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
15
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
16 Variable names may only contain characters `[A-Za-z0-9_]`. Values are substituted at the point of declaration, so a variable can reference only those variables defined above it in the file.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
17
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
18 ## Mixins (Templates)
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
19 A mixin is defined with the `@` prefix. It stores a set of pipeline directives that can be "splatted" into a site block to avoid repetition.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
20
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
21 @name
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
22 |> directive argument
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
23
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
24 Mixins can inherit from other mixins:
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
25
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
26 @child @parent
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
27 |> directive argument
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
28
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
29 The parent's directives are inserted before the child's, so the child can override them. Circular references are silently ignored.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
30
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
31 ## Pipelines and Directives
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
32 The core of the configuration is the pipeline. Each line starting with `|>` is a directive executed in top-down order.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
33
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
34 Directives follow the format: `|> directive [arguments...]`.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
35
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
36 ### Argument Expansion
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
37 Directives support curly brace expansion `{}`. For example:
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
38 `file.{crt,key}` expands to two separate arguments: `file.crt` and `file.key`.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
39
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
40 Only one pair of braces per argument is expanded. Nested braces are not supported.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
41
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
42 ## Site Blocks
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
43 A site block starts with a domain name (or a variable containing one), followed by optional mixins, and a pipeline.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
44
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
45 example.org @setup
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
46 |> directive argument
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
47
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
48 ### Pattern Matching
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
49 The domain part of a site block is matched exactly. The path part (if present, separated by `/`) is matched by prefix.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
50
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
51 Named capture groups can be used in patterns with `<name>` syntax. The captured value is available as `$name` in the block's directives.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
52
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
53 <sub>.example.org
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
54 |> root /srv/www/$sub
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
55
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
56 #### Block Specificity
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
57
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
58 When multiple blocks match a request, the most specific one wins. Specificity is the number of literal characters matched in the pattern - capture groups `<n>` do not contribute to the score. Host and path are scored separately; host score is weighted heavier (`score = host_score × 1000 + path_score`).
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
59
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
60 For example, given these two blocks:
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
61
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
62 app.example.org
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
63 |> rprx http://127.0.0.1:8080
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
64
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
65 <sub>.example.org
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
66 |> root /srv/www/$sub
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
67
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
68 A request for `app.example.org` matches both, but `app.example.org` wins - it matched 15 literal characters against 11 for `<sub>.example.org` (`.example.org` only). Order of declaration in the file does not matter.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
69
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
70 ## Comments
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
71 Lines beginning with `;` are ignored. Inline comments start with ` ;` (space before semicolon).
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
72
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
73 ; full line comment
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
74 KEY=value ; inline comment
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
75
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
76 # DIRECTIVES
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
77
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
78 ## Listening
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
79
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
80 **port** *number*
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
81 : Listen for plain HTTP on the given port.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
82
11
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
83 **port+tls** *number* *cert* *key*
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
84 : Listen for HTTPS on the given port. Certificate and key paths are required.
6
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
85
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
86 ## Serving
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
87
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
88 **root** *path* [**show**]
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
89 : Serve static files from *path*. Without **show**, directory listing is forbidden (403). With **show**, an HTML directory listing is returned.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
90
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
91 **ndex** *file...*
11
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
92 : List of index filenames to try when a directory is requested, checked left to right. If a matching file passes the **fcgi** or **cgi** pattern, it is handled accordingly instead of served directly.
6
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
93
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
94 **fcgi** *address* [*pattern*]
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
95 : Forward matching requests to a FastCGI server. *address* is either `unix:///path/to/socket` or `host:port`. *pattern* is a glob matched against the request path (default `*`). When used together with **root**, only requests matching the pattern are forwarded; everything else is served as static.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
96
11
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
97 **cgi** *executable* [*pattern*]
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
98 : Run *executable* as a CGI program for matching requests. *pattern* is a glob matched against the request path (default `*`). The executable is invoked per-request with standard CGI environment variables (`REQUEST_METHOD`, `QUERY_STRING`, `PATH_INFO`, etc.). When used together with **root**, only requests matching the pattern are handled by CGI; everything else is served as static. Useful for simple CGI programs such as **cgit**(1).
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
99
6
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
100 **rprx** *address*
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
101 : Reverse-proxy all requests to *address*. The `http://` scheme is assumed if not specified.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
102
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
103 **rdir** *code* *url*
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
104 : Redirect to *url* with the given HTTP status code. If *code* is omitted or zero, 302 is used.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
105
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
106 ## Global (in `@d2o` block only)
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
107
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
108 **threads** *n*
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
109 : Set `GOMAXPROCS` to *n*.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
110
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
111 # EXAMPLES
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
112 Below is a complex setup using global variables, a shared mixin for PHP sites, and subdomain handling:
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
113
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
114 DOM=qwaderton.org
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
115 ACME=/etc/acme
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
116 WWW=/srv/www/$DOM
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
117
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
118 @ports
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
119 |> port 80
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
120 |> port+tls 443 $ACME/$DOM.{crt,key}
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
121 |> ndex index.php index.html
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
122
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
123 @ports+fcgi @ports
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
124 |> fcgi unix:///run/php-fpm.sock *.php
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
125
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
126 $DOM @ports+fcgi
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
127 |> root $WWW show
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
128
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
129 <sub>.$DOM @ports+fcgi
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
130 |> root $WWW/$sub
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
131
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
132 app.$DOM @ports
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
133 |> rprx http://127.0.0.1:8080
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
134
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
135 qwa.su
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
136 |> port 80
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
137 |> port+tls 443 $ACME/qwa.su.{crt,key}
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
138 |> rdir 307 https://qwaderton.org/
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
139
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
140 We use this configuration on our web server (as it is at the time of writing this manual).
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
141
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
142 If you need something simplier to start quickly, use this config:
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
143
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
144 DOM=mydomain
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
145 TLS=/etc/acme/$DOM
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
146 WWW=/srv/www/$DOM
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
147
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
148 $DOM
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
149 |> port 80
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
150 |> port+tls 443 $TLS.{crt,key}
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
151 |> root $WWW show
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
152
11
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
153 A minimal setup with cgit:
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
154
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
155 git.example.org
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
156 |> port 80
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
157 |> port+tls 443 /etc/acme/git.example.org.{crt,key}
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
158 |> root /usr/share/cgit
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
159 |> ndex cgit.cgi
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
160 |> cgi /usr/lib/cgit/cgit.cgi *.cgi
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
161
6
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
162 # CAVEATS
11
350589d762a0 add cgi, remove tls, update docs
Atarwn Gard <a@qwa.su>
parents: 6
diff changeset
163 1. ICF does not support strings with spaces - there are **no quotes or escapes**. Every character except space is treated as part of a token, including `!`, `*`, `/`, and so on. Glob patterns passed to **fcgi** and **cgi** are forwarded as-is to the server.
6
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
164
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
165 2. Variables are evaluated top-down at the point of declaration. Forward references do not work: if `B=$A` appears before `A=value`, `B` will contain the literal `$A`.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
166
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
167 3. Only one pair of curly braces is expanded per argument. `file.{a,b}.{x,y}` does not produce four arguments - only the first `{}` pair is expanded.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
168
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
169 4. A directive outside of any block (a `|>` line before the first block header) is a parse error and will prevent the server from starting.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
170
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
171 5. Duplicate ports across blocks are silently deduplicated - the first declaration wins. TLS certificate paths from a later block with the same port are ignored.
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
172
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
173 # SEE ALSO
54ab94198677 abstract mixins + building sctipt + documentation
Atarwn Gard <a@qwa.su>
parents:
diff changeset
174 **d2o**(1)