File tree Expand file tree Collapse file tree
integration/default/controls Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 {% - for k , v in value .items () -%}
88 {% - if v is number or v is string -%}
99{{ server_config([v] , k, ind) }}
10- {% - elif v |length () > 0 and (v [0] is number or v [0] is string ) -%}
11- {{ server_config(v, k, ind) }}
12- {% - else -%}
10+ {% - elif v is iterable and v is not string -%}
1311{{ '\t' * ind }}{{ k }}{{ operator }}{{ '{' }}
1412{{ server_config(v, ind = ind + ind_increment) }}
1513{{- '\t' * ind }}{{ '}' }}{{ lb }}
14+ {% - elif value is iterable and value is not string -%}
15+ {{ server_config(value, key, ind + ind_increment) }}
1616 {% - endif -%}
1717 {% - endfor -%}
18- {% - elif value is iterable -%}
19- {{ server_config(value, key, ind + ind_increment) }}
2018 {% - endif -%}
2119 {% - endfor -%}
2220{% - endmacro -%}
3230}
3331# Vhosts
3432# https://caddyserver.com/docs/caddyfile
35- {{ server_config(caddy['servers'] ) }}
33+ {{ server_config(caddy['servers'] ) }}
Original file line number Diff line number Diff line change 1313 'File managed by Salt at <salt://caddy/files/default/Caddyfile.tmpl.jinja>'
1414 )
1515 end
16+ # rubocop:disable Lint/RedundantCopDisableDirective
17+ # rubocop:disable Layout/LineLength
1618 its ( 'content' ) do
17- # rubocop:disable Lint/RedundantCopDisableDirective
18- # rubocop:disable Layout/LineLength
1919 should match (
2020 "{\n " \
2121 "\t email webmaster@example.net\n " \
4848 its ( 'content' ) do
4949 should match (
5050 "example.net {\n " \
51+ "\t encode gzip\n " \
5152 "\t handle_path /\\ * {\n " \
5253 "\t \t root \\ * /var/www/example.net/\n " \
5354 "\t \t file_server\n " \
5859 "\t }\n " \
5960 '}'
6061 )
61- # rubocop:enable Layout/LineLength
62- # rubocop:enable Lint/RedundantCopDisableDirective
6362 end
63+ its ( 'content' ) do
64+ should match (
65+ "multi.level.example.net {\n " \
66+ "\t encode gzip\n " \
67+ "\t route /path/\\ * {\n " \
68+ "\t \t basicauth \\ * {\n " \
69+ "\t \t \t user JDJhJDE0JFJxLjBBTXhVTHF2VHBoVU54LjFXQnVEQkZYdFhlVmUzSmxRL3VrQVcwS05IQnVIS2FBREIy\n " \
70+ "\t \t }\n " \
71+ "\t \t root \\ * /var/www/html/\n " \
72+ "\t \t try_files {path} /path/to/index.cgi\n " \
73+ "\t \t @cgi path \\ *.cgi\n " \
74+ "\t \t handle /path/to/index.cgi {\n " \
75+ "\t \t \t reverse_proxy @cgi unix//run/fcgiwrap.socket {\n " \
76+ "\t \t \t \t transport fastcgi {\n " \
77+ "\t \t \t \t \t resolve_root_symlink\n " \
78+ "\t \t \t \t \t split .cgi\n " \
79+ "\t \t \t \t }\n " \
80+ "\t \t \t }\n " \
81+ "\t \t }\n " \
82+ "\t \t file_server\n " \
83+ "\t }\n " \
84+ "\t log {\n " \
85+ "\t \t level WARN\n " \
86+ "\t \t output file /var/log/caddy/multi.level.example.net.log\n " \
87+ "\t }\n " \
88+ '}'
89+ )
90+ end
91+ # rubocop:enable Layout/LineLength
92+ # rubocop:enable Lint/RedundantCopDisableDirective
6493 end
6594end
Original file line number Diff line number Diff line change 1313 config :
1414 dir : /etc/caddy
1515 file : Caddyfile
16- validate : true
17- format : true
1816 global_options :
1917 - email : webmaster@example.net
2018 - auto_https : ' off'
2321 - output : file /var/log/caddy/caddy-general.log
2422 service :
2523 name : caddy
26- xcaddy : {}
2724 servers :
2825 - localhost :
2926 - root : ' * /usr/share/caddy'
@@ -33,9 +30,27 @@ caddy:
3330 - ' example.com:80 ' :
3431 - redir : ' https://example.net'
3532 - example.net :
33+ - encode : gzip
3634 - ' handle_path /* ' :
3735 - root : ' * /var/www/example.net/'
3836 - file_server
3937 - log :
4038 - level : WARN
4139 - output : file /var/log/caddy/example.net.log
40+ - multi.level.example.net :
41+ - encode : gzip
42+ - ' route /path/* ' :
43+ - ' basicauth * ' :
44+ - user : JDJhJDE0JFJxLjBBTXhVTHF2VHBoVU54LjFXQnVEQkZYdFhlVmUzSmxRL3VrQVcwS05IQnVIS2FBREIy
45+ - root : ' * /var/www/html/'
46+ - try_files : ' {path} /path/to/index.cgi'
47+ - ' @cgi ' : ' path *.cgi'
48+ - handle /path/to/index.cgi :
49+ - reverse_proxy @cgi unix//run/fcgiwrap.socket :
50+ - transport fastcgi :
51+ - resolve_root_symlink
52+ - split : .cgi
53+ - file_server
54+ - log :
55+ - level : WARN
56+ - output : file /var/log/caddy/multi.level.example.net.log
You can’t perform that action at this time.
0 commit comments