5
0
mirror of git://git.proxmox.com/git/pve-http-server.git synced 2025-01-10 01:18:00 +03:00
Commit Graph

123 Commits

Author SHA1 Message Date
Thomas Lamprecht
779306a757 bump version to 3.0-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-09 16:12:51 +01:00
Fabian Grünbichler
f1b41d8405 websocket_proxy: fix indentation
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-03-07 20:19:03 +01:00
Fabian Grünbichler
e6cb79b52c websocket_proxy: implement ping/pong support
needed to keep tunnel connections alive.

> The Ping frame contains an opcode of 0x9.
> [...]
> The Pong frame contains an opcode of 0xA.
-- Section 5.5.2 cf. https://tools.ietf.org/html/rfc6455#section-5.5.2

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-07 20:17:41 +01:00
Fabian Grünbichler
c3bd22ec46 websocket_proxy: pull out encoding into helper sub
to allow adding other types of frames.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-03-07 20:11:12 +01:00
Fabian Grünbichler
c55702c39b websocket: improve masking performance
in order to make websocket proxying feasible as general tunnel, we need
to be able to transfer more than a few MB/s

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-03-07 20:11:12 +01:00
Thomas Lamprecht
597f8fb9d1 d/control: bump versioned dependency to pve-common
to ensure that we've PVE::Tools::spice_port_range available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-06 19:02:00 +01:00
Thomas Lamprecht
9789c451a5 followup: indentation and error message improvement
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-06 19:01:40 +01:00
Dominik Csapak
542f4c3a03 increase allowed spiceport range
by using the new spice_port_range sub from PVE::Tools

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-03-06 18:58:45 +01:00
Thomas Lamprecht
bd8e8612d8 bump version to 3.0-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-29 21:36:08 +01:00
Thomas Lamprecht
3d358efe29 d/control: versioned break pve-manager and pmg-api
due to incompatible new cookie/header extraction method

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-29 21:36:08 +01:00
Fabian Grünbichler
362dd8eb9a api-server: extract, set and handle API token header
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-01-28 20:43:51 +01:00
Tim Marx
e045d0700e allow ticket in auth header as fallback
based on idea & RFC by Tim Marx, incorporating feedback by Thomas
Lamprecht. this will be extended to support API tokens in the
Authorization header as well, so make it generic.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-01-28 20:43:51 +01:00
Thomas Lamprecht
fa5e6f6908 update standards version
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-11 10:14:01 +01:00
Thomas Lamprecht
aa6e7a0d63 Revert "tls: make dh to openssl 1.1 compatible"
The libanyevent-perl version 7.140-3 included a fix for this.
It migrated to the then still testing (buster was not yet released)
on 07.04.2019, and so we can safely revert this workaround again
here.

Albeit this was fixed since Buster was officially released, still
bump the version dependency to libanyevent-perl in debian/control.

A future libanyevent-perl will use "ffdhe3072" for DH; another good
reason to revert this, to not keep hardcoded parameters with possible
(future) security implications here.

[0]: https://tracker.debian.org/news/1037514/libanyevent-perl-7140-3-migrated-to-testing/

This reverts commit ea574439f7.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-28 10:26:26 +01:00
Fabian Grünbichler
f5fe153b48 proxy_request: drop duplicate, unused parameter
which was mistakenly added back when this was still in pve-manager.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-10-17 17:36:06 +02:00
Thomas Lamprecht
c66bf47bff bump version to 3.0-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-11 11:25:23 +02:00
Dominik Csapak
05e777bce5 AnyEvent: extend send_file with content-type
for pmg, we need to send temporary files (for the attachment quarantine),
but we cannot know beforehand what content-type it is, so we
optionally give it to send_file_start

we give a hash with the open filehandle and the content-type in that case

this also removes the unnecessary open on the filename, since we open
it in send_file_start anyway...

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-10-10 11:58:37 +02:00
Thomas Lamprecht
d1287429bc bump version to 3.0-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-11 19:30:36 +02:00
Thomas Lamprecht
4a09623bbd decode_urlencoded: cope with undefined values
Avoids syslog/journal warning like:
>  Use of uninitialized value $v in substitution (s///) at
>  /usr/share/perl5/PVE/APIServer/AnyEvent.pm line 648.

If one passes a "value-less" GET argument to a request, e.g.,
GET /?debug

Besides the fact that this allows us to even use such arguments it
also is a general improvement against a slight "syslog DOS attack",
because anybody can pass such parameters to the '/' page, and all
proxmox daemons providing a API/UI using libpve-http-server-perl
allow to do such requests unauthenticated (which itself is OK, as
else one could not show the login window at all). As each of such
request produces two log lines in the syslog/journal it's far from
ideal.

A simple reproducer of the possible outcome can be seen with the
following shell script using curl:

> PVEURL='127.0.0.1'
> ARGS='?a'; # send multiple args at once to amplify the per-connection cost
> for c in {a..z}; do for i in {0..9}; do ARGS="$ARGS&$c$i"; done; done
> while true; do curl --insecure --silent --output /dev/null "https://$PVEURL:8006$ARGS"; done

Not really bad, but not nice either, as logging is not too cheap this
has some resource usage cost and noise in the syslog is never nice.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-09 14:25:30 +02:00
Thomas Lamprecht
88628fd141 re-use Debians jQuery and Bootstrap packages
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-22 08:10:58 +02:00
Thomas Lamprecht
e52d940029 anyevent: rpcenv is optional and from our child instance
This fixes the simple-demo, which was regressed with commit
8782148642 were we falsely assumed that
we always have an rpcenv instance here, but actually that's just
optional as it comes from our child class instance

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-22 08:08:00 +02:00
Thomas Lamprecht
3396e08126 buildsys: switch upload dist over to buster
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-22 07:39:03 +02:00
Thomas Lamprecht
8a29f1fce9 buildsys: also cleanup build directory on clean
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-22 07:23:11 +02:00
Thomas Lamprecht
e6dc4ff346 buildsys: no need to include arch detection for arch-independent package
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-21 22:25:36 +02:00
Thomas Lamprecht
584d34a7de buildsys: clean and distclean are phony targets
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-21 21:43:05 +02:00
Thomas Lamprecht
54ec74bb2d bump version to 3.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-21 21:41:37 +02:00
Thomas Lamprecht
80a258900b buildsys: fix dependencies for bootstrap files
avoid removing and unzipping the bootstrap source archive as many
times as ${BTDATA} has file entries, add an intermediate target for
the directory, which is the producer for all those BTDATA files, and
that directory then depends on the zip archive.

I mean, it would be even better to just use the libjs-bootstrap
package (and jQuery for that matter) but that a little bigger change
for now

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-21 21:41:37 +02:00
Thomas Lamprecht
a94e0490c7 update Bootstrap to 3.4.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-21 21:41:37 +02:00
Thomas Lamprecht
6be73370c6 update jQuery to 3.4.1
by bumping and actually using ${JQVER} when downloading ;)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-21 21:41:37 +02:00
Thomas Lamprecht
a9fc6893f6 buildsys: use dpkg-dev makefile helpers for pkg info
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-21 21:41:37 +02:00
Thomas Lamprecht
d8ff724d8d bump version to 2.0-13
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-03 13:56:04 +02:00
Wolfgang Bumiller
090019fa13 forward Host header in proxy_request
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-03 12:16:38 +02:00
Wolfgang Bumiller
8782148642 store Host header in rpc environment
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-03 12:16:38 +02:00
Thomas Lamprecht
ea574439f7 tls: make dh to openssl 1.1 compatible
Effective the same approach used in libanyevent-perl 7.140-3[0]
Stretch is also compatible with this, and we can remove it for
buster/PVE 6 once the libanyevent-perl package transitioned to
from unstable to buster, until then do it ourself to have a
functioning api/proxy...

[0]: 7f3d5721bb

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-03-22 10:32:50 +01:00
Thomas Lamprecht
487cedb5a7 bump version to 2.0-12
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-26 07:08:11 +01:00
Stoiko Ivanov
7266fc2d97 Add short comment about users of read_proxy_config
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-26 07:05:33 +01:00
Stoiko Ivanov
c610c8597c move read_proxy_conf from PVE::API2Tools to new Utils module
move the read_proxy_conf method into a new perl module
'PVE::APIServer::Utils'.
It now takes the proxy_name (e.g. pveproxy, pmgproxy) as variable to be used
for the configfile location (/etc/default/$proxy_name)

This serves as preparation to make pmgproxy configurable in the same way as
pveproxy.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-26 07:05:12 +01:00
Stoiko Ivanov
fac83ab296 add ssl fallback values to AnyEvent->new
This allows for sharing the values between pveproxy and pmgproxy

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-26 07:01:51 +01:00
Thomas Lamprecht
025b303821 followup: adapt coding style to surrounding
compression is set to true by default, and we only want to be able to
switch it off, not force it on.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-21 10:44:28 +01:00
Stoiko Ivanov
404175ada2 Don't override explicit $nocomp with default
By making compression configurable the $nocomp flag in response got set to
the configured (or default) setting, irrespective of the explicitly passed
value to response.

This broke (e.g.) noVNC connections

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-21 10:40:16 +01:00
Stoiko Ivanov
23dfd1b7c9 Add configurable 'compression'
Rationale for disabling compression is the potential for being affected by
the BREACH (CVE-2013-3587) attack and it's considered good practice for https
configuration (see e.g. [0]).

The default remains: to have compression enabled for compressible file-types.

[0] https://cipherli.st/

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-19 17:14:14 +01:00
Stoiko Ivanov
54c0ead916 Add configurable 'honor_cipher_order'
Needed to fix #2069.

Prefering the ciphers set in the server, instead of relying on the offer of the
client is considered good practice in TLS1.[012] (see e.g. [0]).

[0] https://cipherli.st/

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-02-19 17:14:14 +01:00
Thomas Lamprecht
55af714ea8 bump version to 2.0-11
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-28 10:42:07 +02:00
Dominik Csapak
6c31d13ebc fix #1935: read empty line after 200 OK
commit a4d8bbafbe
introduced an additional empty line after '200 OK'
for remote-viewer 7 to work, but we also have to read this line
in our own proxy reader else the connection to a remote node does
not work

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-28 09:40:15 +02:00
Rhonda D'Vine
131889e977 Use https for Homepage URL
Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2018-09-06 11:49:21 +02:00
Rhonda D'Vine
5e9788ddd7 Add unzip to Build-Depends
Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2018-09-06 11:49:21 +02:00
Dietmar Maurer
60f28d48c2 bump version to 2.0-10 2018-08-17 08:30:07 +02:00
Dominik Csapak
a4d8bbafbe fix #1869: send correct http response in spice proxy
the glib implementation of the http proxy correctly checks the
http response (response code, followed by an empty line)
so we need to answer with the correct status

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-08-17 08:28:36 +02:00
Dietmar Maurer
ed8d2557ae websocket: set $max_payload_size = 128*1024; (131072)
AnyEvent checks rbuf_max after calling the callback (too late), so
we can receive larger data, because AnyEvent uses MAX_READ_SIZE=131072
to fill the buffer.

So a more elegant solution is to set $max_payload_size=128*1024. At least
I am not able to receive rbuf larger than 128*1024 now. But I keep the
protection from the previous patch - just to be sure.
2018-06-07 10:08:59 +02:00
Dietmar Maurer
cdb6932787 limit websocket frame size
AnyEvent checks rbuf_max after calling the callback (too late), so
we can receive larger data.
2018-06-06 16:41:30 +02:00