Commit Graph

43 Commits

Author SHA1 Message Date
Stoiko Ivanov
36ad2b3c0e proxy: fix wildcard address use
This patch fixes a regression for hosts disabling ipv6 via kernel
commandline ('ipv6.disable=1')introduced in commit
e224b7d2e6
(disabling IPv6 via sysctl did not exhibit these problems)

by hardcoding the address to '::', pveproxy and spiceproxy failed to
start with:
'unable to create socket - Address family not supported by protocol'

This patch depends on the commit in pve-common, which tries first
binding to '::' and then falling back to '0.0.0.0', and needs a
versioned dependency bump on libpve-common-perl.

With this patch the listening addresses are (`ss -tlnp |grep 8006` output)
* ipv6 disabled via kernel cmdline: '0.0.0.0:8006'
* sysctl net.ipv6.conf.all.disable_ipv6=1: '*:8006'
* sysctl net.ipv6.bindv6only=1: '[::]:8006'
* else: '*:8006'

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-05-07 18:15:43 +02:00
Oguz Bektas
e224b7d2e6 fix #417: proxy: allow settnig LISTEN_IP for pveproxy and spiceproxy
The $host variable is set to "::0" by default to listen on wildcard
(with 'Domain' => PF_INET6).

If 'LISTEN_IP' is defined in /etc/default/pveproxy, that IP will be used
instead.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2021-04-23 17:13:45 +02:00
Fabian Grünbichler
9a5a1655f1 pveproxy: use new cookie extraction method
we only care about the regular cookie case for the index.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-01-29 10:27:06 +01:00
Fabian Grünbichler
3ac3653e63 use PVE::DataCenterConfig
to make sure that the corresponding cfs_read_file works() works.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Dominik Csapak
cc8c253f23 add the css/images from proxmox widget toolkit
add the dirs to the proxy and the css file to the index template

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-08-13 15:38:39 +02:00
Thomas Lamprecht
c195a3c2d6 pveproxy: allow to request debug sources directly over GET parameter
Avoids the need to stop the current pveproxy and restart it in debug
mode, if one wants to get the debug un-minified sources for ExtJS,
for example.

For a local PVE instance the following URL would ensure you load the
debug sources:
https://localhost:8006/?debug#v1:0:18:4:25:19::8:20:28

For convenience allow to omit the parameters value, and default to
true, iow, ?debug and ?debug=1 are the same, one could force it off -
even if the server was started in debug mode - by using ?debug=0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-09 15:07:41 +02:00
Thomas Lamprecht
180a86d39a pvecfg: adapt version and release semantic
Wit commit a74ba607d4 we switched over
to using the dpkg-dev provided helpers to set package version,
architecture and such in the buildsystem.

But unlike other repositories we used the version also for giving it
back over the API through the during build generated PVE::pvecfg
module, which wasn't fully updated to the new style.

This patch does that, and also cleans up semantics a bit, the
following two changed:

release is now the Debian release, instead of the "package release"
(i.e., the -X part of a full package version).
version is now simply the full (pve-manager) version, e.g., 6.0-1 or
the currently for testing used 6.0-0+1

This allows to do everything we used this information for even in a
slightly easier way (no  string concat needed anymore), and fits also
with the terminology we often used in our public channels (mailing
lists, forum, website)

Remove some cruft as we touch things.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-26 16:11:43 +02:00
Stoiko Ivanov
a642f8a01b pveproxy, spiceproxy: new read_proxy_conf location
read_proxy_conf was moved to the new PVE::ApiServer::Utils so that it
can be reused by other apiservers (e.g., PMG one). Use that one, so
that we can remove it here later

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-26 07:32:22 +01:00
Stoiko Ivanov
9503511809 remove default values from pveproxy ssl config
they are in PVE::APIServer::AnyEvent

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-26 07:32:22 +01:00
Stoiko Ivanov
f0ea5afcd7 pveproxy: honor_cipher_order by default
change the default from client preference to server preference, but leave it
configurable.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-20 07:15:38 +01:00
Stoiko Ivanov
a33abad12d pveproxy: add configurable COMPRESSION
disabling http compression is considered good practice and certain TLS-testing
scripts/sites lower the security rating if it's enabled.

compression is still on by default for the potential speed/performance gain.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-20 07:15:38 +01:00
Stoiko Ivanov
1f7809624b pveproxy: add configurable HONOR_CIPHER_ORDER
fix #2069 (the report includes rationale and also information on test-cases).

Tested by:
* running testssl.sh [0]
* enabling this setting (our default cipherlist prefers AES256,
  chromium on stretch AES128)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-20 07:15:38 +01:00
Stoiko Ivanov
bbb0c700bd fix typo in comment (ssl-config)
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-19 17:17:17 +01:00
Rhonda D'Vine
5878f07454 Update default CIPHERS to a more current list
The default CIPHERS allowed for a fair amount of not really considered
secure anymore connections.  This updated cipher list is taken from
mozilla: https://wiki.mozilla.org/Security/Server_Side_TLS

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2018-10-17 07:56:32 +02:00
Dominik Csapak
f4aa76c549 fix #1393: use language from datacenter.cfg for gui
if we do not have a language cookie, try to read
the language from the datacenter.cfg and fall back to 'en'

also set it into the 'Proxmox' object, so that the gui can show it
in the LoginWindow

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-08-17 11:01:44 +02:00
Thomas Lamprecht
b2682f33ce pveproxy: add link to extjs for api-viewer
allows us to remove the external loading of extjs from the cloudflare
cdn in pve-docs easier with having the external hosted version in
mind.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-27 11:09:21 +02:00
Dominik Csapak
411967db91 use pve-i18n package
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-01-25 13:36:37 +01:00
Dominik Csapak
f90908cb16 add proxmox-widget-toolkit to pve gui
we will use components from proxmox-widget-toolkit rather than
directly from pve-manager

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-23 10:15:09 +01:00
Dominik Csapak
03f09f9ab0 add xtermjs to pveproxy dirs
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-12-12 08:34:07 +01:00
Dominik Csapak
54165ad3ce add ver get parameter for js/css files to improve cache behaviour
we do not set an Expire header for our js files, and certain browsers
do not even make the request then (on which we would answer
with a correct 304 not modified)

so to force the browser to load a new version of the gui when we change
something, we add the package version as a get parameter

when doing this, the browsers still cache the file, until the get
parameter changes, which is exactly what we want

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-11-07 08:55:02 +01:00
Dominik Csapak
7f3b89a012 change to debian font-awesome
instead of having font-awesome copied into the repository,
depend on the debian package 'fonts-font-awesome', which provides all we
need

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-12 10:26:29 +02:00
Dietmar Maurer
9af88cbb9a pveproxy: do not serve /usr/share/vncterm - no longer required
Note: We removed the java applet
2017-03-14 07:21:09 +01:00
Dominik Csapak
184825e190 use Template::Toolkit instead of [ExtJs|Touch|NoVnc]Index.pm
this makes it easier to change the html if needed and seperates
it from the perl code

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-03-09 10:34:30 +01:00
Dominik Csapak
245e567e62 specify basedirs instead of hardcoding them several times
using a hash with the directories makes it easier to reuse them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-03-09 10:33:19 +01:00
Dietmar Maurer
9556b395b0 depend on libjs-extjs 2017-01-25 18:29:17 +01:00
Dietmar Maurer
c5bd68e84f pveproxy: do not expose /pve2/js/ (no longer required) 2017-01-18 12:59:21 +01:00
Dietmar Maurer
b84415d325 remove base_handler_class - directly use PVE::API2 instead
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2017-01-16 11:54:34 +01:00
Dietmar Maurer
a9de2d443b pveproxy.pm: set title to 'Proxmox VE API'
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2017-01-16 11:54:34 +01:00
Dietmar Maurer
e469770953 pveproxy.pm: use PVE::APIServer::AnyEvent::add_dirs()
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2017-01-16 11:54:33 +01:00
Dietmar Maurer
b996e6c0ec use new libpve-http-server-perl package
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2017-01-16 11:54:33 +01:00
Fabian Grünbichler
f50cdc4e8c fix CSRF token generation
this broke with the recent refactoring
2017-01-13 10:58:44 +01:00
Dietmar Maurer
ddaefd5c65 PVE/Service/pveproxy.pm: avoid using PVE::REST
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2017-01-12 11:53:18 +01:00
Dietmar Maurer
33dc998183 remove obsolete inline documentation 2017-01-11 10:54:47 +01:00
Dietmar Maurer
d5d08d2aca depend on pve-docs package
and serve documentation files with pveproxy:

https://<HOST>:8006/pve-docs/index.html
2016-05-25 09:41:46 +02:00
Emmanuel Kasper
69f17ac3d7 Serve debug versions of ExtJS libs when pveproxy is started in debug mode 2016-05-04 08:12:19 +02:00
Dietmar Maurer
5783c7f4dd switch GUI to extjs6 2016-03-31 12:11:31 +02:00
Fabian Grünbichler
299d290c42 Allow non-self-signed override certificate for API
if the files pveproxy-ssl.pem and pveproxy-ssl.key are
available for a node (i.e., in /etc/pve/<node>/), they will
be used as TLS certificate and private key for the web
interface and API of this node.

Note: the Spice and non-websocket VNC connections are still
using the self-signed certificate and key in pve-ssl.pem
and pve-ssl.key.
2016-03-09 14:37:55 +01:00
Wolfgang Bumiller
c7f3280811 Close #822: show the nodename in the page title 2016-02-11 12:05:08 +01:00
Fabian Grünbichler
41196653e1 Add DHPARAMS option in /etc/default/pveproxy
If set, Diffie-Hellman parameters in PEM format are loaded
from the given path. Otherwise, the built-in 'skip2048'
group is used.

Also fix some typos in the man page.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2016-01-26 16:44:17 +01:00
Fabian Grünbichler
ee0b96b15f Enable TLS 1.1 and 1.2, change default DH params
AnyEvent uses a built-in DH group defined as 'schmorp1539'
by default, which seems to trigger the bug in [1] for every
attempt of accessing the web GUI using IE11 and TLS1.2. By
switching to a bigger default DH group ('skip2048'), the
bug seems to be gone (or trigger sufficiently rarely).

1: http://engineering.imvu.com/2015/01/27/the-case-of-the-page-cant-be-displayed-intermittent-selenium-test/
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2016-01-26 16:42:53 +01:00
Emmanuel Kasper
faea780768 update build infrastucture to be able to develop with Ext6 2015-11-13 07:08:04 +01:00
Thomas Lamprecht
2ebf4aecf9 check for ext5 dir to avoid missing directory errors
As we, for now, default to exclude ext5 from our build it's better
to make an check if its directory exists, and only then allow to
load from it. Else we can get errors on proxy startup, and when
someone passes the ext5 parameter.

Also make a indent/whitespace cleanup.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2015-09-29 07:17:19 +02:00
Dietmar Maurer
4a17e72e77 convert pveproxy into a PVE::Service class 2015-09-04 14:16:25 +02:00