summaryrefslogtreecommitdiff
path: root/interface-definitions/https.xml.in
blob: 448075b5b47856a8c41901dd1e97ec0dabba0072 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<?xml version="1.0"?>
<interfaceDefinition>
  <node name="service">
    <children>
      <node name="https" owner="${vyos_conf_scripts_dir}/https.py">
        <properties>
          <help>HTTPS configuration</help>
          <priority>1001</priority>
        </properties>
        <children>
          <tagNode name="virtual-host">
            <properties>
              <help>Identifier for virtual host</help>
              <constraint>
                <regex>[a-zA-Z0-9-_.:]{1,255}</regex>
              </constraint>
              <constraintErrorMessage>illegal characters in identifier or identifier longer than 255 characters</constraintErrorMessage>
            </properties>
            <children>
              <leafNode name="listen-address">
                <properties>
                  <help>Address to listen for HTTPS requests</help>
                  <completionHelp>
                    <script>${vyos_completion_dir}/list_local_ips.sh --both</script>
                  </completionHelp>
                  <valueHelp>
                    <format>ipv4</format>
                   <description>HTTPS IPv4 address</description>
                  </valueHelp>
                  <valueHelp>
                    <format>ipv6</format>
                    <description>HTTPS IPv6 address</description>
                  </valueHelp>
                  <valueHelp>
                    <format>'*'</format>
                    <description>any</description>
                  </valueHelp>
                  <constraint>
                    <validator name="ip-address"/>
                    <regex>\*</regex>
                  </constraint>
                </properties>
              </leafNode>
              <leafNode name='listen-port'>
                <properties>
                  <help>Port to listen for HTTPS requests; default 443</help>
                  <valueHelp>
                    <format>u32:1-65535</format>
                    <description>Numeric IP port</description>
                  </valueHelp>
                  <constraint>
                    <validator name="numeric" argument="--range 1-65535"/>
                  </constraint>
                </properties>
              </leafNode>
              <leafNode name="server-name">
                <properties>
                  <help>Server names: exact, wildcard, or regex</help>
                  <multi/>
                </properties>
              </leafNode>
              #include <include/allow-client.xml.i>
            </children>
          </tagNode>
          <node name="api" owner="${vyos_conf_scripts_dir}/http-api.py">
            <properties>
              <help>VyOS HTTP API configuration</help>
              <priority>1002</priority>
            </properties>
            <children>
              <node name="keys">
                <properties>
                  <help>HTTP API keys</help>
                </properties>
                <children>
                  <tagNode name="id">
                    <properties>
                      <help>HTTP API id</help>
                    </properties>
                    <children>
                      <leafNode name="key">
                        <properties>
                          <help>HTTP API plaintext key</help>
                        </properties>
                      </leafNode>
                    </children>
                  </tagNode>
                </children>
              </node>
              <leafNode name="strict">
                <properties>
                  <help>Enforce strict path checking</help>
                  <valueless/>
                </properties>
              </leafNode>
              <leafNode name="debug">
                <properties>
                  <help>Debug</help>
                  <valueless/>
                  <hidden/>
                </properties>
              </leafNode>
              <node name="graphql">
                <properties>
                  <help>GraphQL support</help>
                </properties>
                <children>
                  <leafNode name="introspection">
                    <properties>
                      <help>Schema introspection</help>
                      <valueless/>
                    </properties>
                  </leafNode>
                  <node name="authentication">
                    <properties>
                      <help>GraphQL authentication</help>
                    </properties>
                    <children>
                      <leafNode name="type">
                        <properties>
                          <help>Authentication type</help>
                          <completionHelp>
                            <list>key token</list>
                          </completionHelp>
                          <valueHelp>
                            <format>key</format>
                            <description>Use API keys</description>
                          </valueHelp>
                          <valueHelp>
                            <format>token</format>
                            <description>Use JWT token</description>
                          </valueHelp>
                          <constraint>
                            <regex>(key|token)</regex>
                          </constraint>
                        </properties>
                        <defaultValue>key</defaultValue>
                      </leafNode>
                      <leafNode name="expiration">
                        <properties>
                          <help>Token time to expire in seconds</help>
                          <valueHelp>
                            <format>u32:60-31536000</format>
                            <description>Token lifetime in seconds</description>
                          </valueHelp>
                          <constraint>
                            <validator name="numeric" argument="--range 60-31536000"/>
                          </constraint>
                        </properties>
                        <defaultValue>3600</defaultValue>
                      </leafNode>
                      <leafNode name="secret-length">
                        <properties>
                          <help>Length of shared secret in bytes</help>
                          <valueHelp>
                            <format>u32:16-65535</format>
                            <description>Byte length of generated shared secret</description>
                          </valueHelp>
                          <constraint>
                            <validator name="numeric" argument="--range 16-65535"/>
                          </constraint>
                        </properties>
                        <defaultValue>32</defaultValue>
                      </leafNode>
                    </children>
                  </node>
                </children>
              </node>
              <node name="cors">
                <properties>
                  <help>Set CORS options</help>
                </properties>
                <children>
                  <leafNode name="allow-origin">
                    <properties>
                      <help>Allow resource request from origin</help>
                      <multi/>
                    </properties>
                  </leafNode>
                </children>
              </node>
            </children>
          </node>
          <node name="api-restrict">
            <properties>
              <help>Restrict api proxy to subset of virtual hosts</help>
            </properties>
            <children>
              <leafNode name="virtual-host">
                <properties>
                  <help>Restrict proxy to virtual host(s)</help>
                  <multi/>
                </properties>
              </leafNode>
            </children>
          </node>
          <node name="certificates">
            <properties>
              <help>TLS certificates</help>
            </properties>
            <children>
              #include <include/pki/ca-certificate.xml.i>
              #include <include/pki/certificate.xml.i>
              <node name="certbot" owner="${vyos_conf_scripts_dir}/le_cert.py">
                <properties>
                  <help>Request or apply a letsencrypt certificate for domain-name</help>
                </properties>
                <children>
                  <leafNode name="domain-name">
                    <properties>
                      <help>Domain name(s) for which to obtain certificate</help>
                      <multi/>
                    </properties>
                  </leafNode>
                  <leafNode name="email">
                    <properties>
                      <help>Email address to associate with certificate</help>
                    </properties>
                  </leafNode>
                </children>
              </node>
            </children>
          </node>
          #include <include/interface/vrf.xml.i>
        </children>
      </node>
    </children>
  </node>
</interfaceDefinition>