]>
Commit | Line | Data |
---|---|---|
f872534d DM |
1 | #!/usr/bin/perl |
2 | ||
3 | use lib '.'; | |
4 | use strict; | |
5 | use warnings; | |
6 | use PVE::RESTHandler; | |
7 | ||
8 | use Data::Dumper; | |
9 | ||
10 | use PMG::Config; | |
11 | ||
12 | my $types = PMG::Config::Base->lookup_types; | |
13 | ||
7608b70c DM |
14 | my $single_section = shift; |
15 | my $found = 0; | |
16 | ||
e09057ab | 17 | my $key_groups = { |
e3d778e0 DM |
18 | 'mail-options' => [ |
19 | 'mail' , { | |
20 | maxsize => 1, | |
21 | rejectunknown => 1, | |
22 | rejectunknownsender => 1, | |
23 | helotests => 1, | |
24 | dnsbl_sites => 1, | |
25 | verifyreceivers => 1, | |
26 | greylist => 1, | |
27 | spf => 1, | |
28 | hide_received => 1, | |
29 | dwarning => 1, | |
30 | conn_count_limit => 1, | |
31 | conn_rate_limit => 1, | |
32 | message_rate_limit => 1, | |
33 | banner => 1, | |
34 | }], | |
d9c56b22 DM |
35 | 'mail-ports' => [ |
36 | 'mail' , { | |
37 | int_port => 1, | |
38 | ext_port => 1, | |
39 | }], | |
e09057ab DM |
40 | 'mail-relaying' => [ |
41 | 'mail' , { | |
42 | relay => 1, | |
43 | relaynomx => 1, | |
44 | relayport => 1, | |
45 | smarthost => 1, | |
46 | }], | |
47 | }; | |
48 | ||
49 | my $select_keys; | |
50 | ||
51 | if ($single_section) { | |
52 | if (my $a = $key_groups->{$single_section}) { | |
53 | my ($sec, $hash) = @$a; | |
54 | $single_section = $sec; | |
55 | $select_keys = $hash; | |
56 | } | |
57 | } | |
58 | ||
59 | ||
f872534d DM |
60 | foreach my $section (@$types) { |
61 | my $plugin = PMG::Config::Base->lookup($section); | |
62 | my $schema = $plugin->updateSchema(1); | |
63 | my $properties = $schema->{properties}; | |
7608b70c DM |
64 | |
65 | if (defined($single_section)) { | |
66 | next if $section ne $single_section; | |
67 | } else { | |
68 | print ".Section '$section'\n\n"; | |
69 | } | |
70 | ||
71 | $found = 1; | |
a18c67c0 DM |
72 | |
73 | my $filter = sub { | |
74 | my ($key, $phash) = @_; | |
75 | return 1 if $key eq 'digest'; | |
76 | return 1 if $key eq 'delete'; | |
e09057ab | 77 | return 1 if $select_keys && !$select_keys->{$key}; |
a18c67c0 DM |
78 | return 0; |
79 | }; | |
f872534d | 80 | |
a18c67c0 DM |
81 | print PVE::RESTHandler::dump_properties( |
82 | $properties, 'asciidoc', 'config', $filter); | |
f872534d | 83 | } |
7608b70c DM |
84 | |
85 | if (defined($single_section)) { | |
86 | die "no such section '$single_section'" if !$found; | |
87 | } | |
f872534d DM |
88 | |
89 | exit(0); |