Page Menu
Home
VyOS Platform
Search
Configure Global Search
Log In
Files
F119064045
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
10 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/data/templates/https/nginx.default.j2 b/data/templates/https/nginx.default.j2
index 5d17df001..4619361e5 100644
--- a/data/templates/https/nginx.default.j2
+++ b/data/templates/https/nginx.default.j2
@@ -1,65 +1,69 @@
### Autogenerated by service_https.py ###
{% if enable_http_redirect is vyos_defined %}
server {
listen 80 default_server;
server_name {{ hostname }};
return 301 https://$host$request_uri;
}
{% endif %}
server {
{% if listen_address is vyos_defined %}
{% for address in listen_address %}
listen {{ address | bracketize_ipv6 }}:{{ port }} ssl;
{% endfor %}
{% else %}
listen {{ port }} ssl;
listen [::]:{{ port }} ssl;
{% endif %}
server_name {{ hostname }};
root /srv/localui;
+{% if request_body_size_limit is vyos_defined %}
+ client_max_body_size {{ request_body_size_limit }}M;
+{% endif %}
+
# SSL configuration
{% if certificates.cert_path is vyos_defined and certificates.key_path is vyos_defined %}
ssl_certificate {{ certificates.cert_path }};
ssl_certificate_key {{ certificates.key_path }};
{% if certificates.dh_file is vyos_defined %}
ssl_dhparam {{ certificates.dh_file }};
{% endif %}
{% else %}
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
include snippets/snakeoil.conf;
{% endif %}
# Improve HTTPS performance with session resumption
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_protocols {{ 'TLSv' ~ ' TLSv'.join(tls_version) }};
# From LetsEncrypt
ssl_prefer_server_ciphers on;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK';
# proxy settings for HTTP API, if enabled; 503, if not
location ~ ^/(retrieve|configure|config-file|image|container-image|generate|show|reboot|reset|poweroff|docs|openapi.json|redoc|graphql) {
{% if api is vyos_defined %}
proxy_pass http://unix:/run/api.sock;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 600;
proxy_buffering off;
{% else %}
return 503;
{% endif %}
{% if allow_client.address is vyos_defined %}
{% for address in allow_client.address %}
allow {{ address }};
{% endfor %}
deny all;
{% endif %}
}
error_page 497 =301 https://$host:{{ port }}$request_uri;
}
diff --git a/interface-definitions/service_https.xml.in b/interface-definitions/service_https.xml.in
index b60c7ff2e..afe430c0c 100644
--- a/interface-definitions/service_https.xml.in
+++ b/interface-definitions/service_https.xml.in
@@ -1,177 +1,190 @@
<?xml version="1.0"?>
<interfaceDefinition>
<node name="service">
<children>
<node name="https" owner="${vyos_conf_scripts_dir}/service_https.py">
<properties>
<help>HTTPS configuration</help>
<priority>1001</priority>
</properties>
<children>
<node name="api">
<properties>
<help>VyOS HTTP API configuration</help>
</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>
#include <include/allow-client.xml.i>
<leafNode name="enable-http-redirect">
<properties>
<help>Enable HTTP to HTTPS redirect</help>
<valueless/>
</properties>
</leafNode>
#include <include/listen-address.xml.i>
#include <include/port-number.xml.i>
<leafNode name='port'>
<defaultValue>443</defaultValue>
</leafNode>
+ <leafNode name="request-body-size-limit">
+ <properties>
+ <help>Maximum request body size in megabytes</help>
+ <valueHelp>
+ <format>u32:1-256</format>
+ <description>Request body size in megabytes</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-256"/>
+ </constraint>
+ </properties>
+ <defaultValue>1</defaultValue>
+ </leafNode>
<node name="certificates">
<properties>
<help>TLS certificates</help>
</properties>
<children>
#include <include/pki/ca-certificate.xml.i>
#include <include/pki/certificate.xml.i>
#include <include/pki/dh-params.xml.i>
</children>
</node>
<leafNode name="tls-version">
<properties>
<help>Specify available TLS version(s)</help>
<completionHelp>
<list>1.2 1.3</list>
</completionHelp>
<valueHelp>
<format>1.2</format>
<description>TLSv1.2</description>
</valueHelp>
<valueHelp>
<format>1.3</format>
<description>TLSv1.3</description>
</valueHelp>
<constraint>
<regex>(1.2|1.3)</regex>
</constraint>
<multi/>
</properties>
<defaultValue>1.2 1.3</defaultValue>
</leafNode>
#include <include/interface/vrf.xml.i>
</children>
</node>
</children>
</node>
</interfaceDefinition>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Nov 6, 9:25 AM (22 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4601630
Default Alt Text
(10 KB)
Attached To
Mode
rVYOSONEX vyos-1x
Attached
Detach File
Event Timeline
Log In to Comment