Commit Graph

161 Commits

Author SHA1 Message Date
Robert Adam
59ae429972 MAINT: Update copyright notice to 2021
This was done by running scripts/updateLicenseHeaders.py and then
manually editing the LICENSE file.
2021-03-02 10:15:01 +01:00
TredwellGit
99ea9d7835 FIX(server): Make max bandwidth the highest supported
Closes https://github.com/mumble-voip/mumble/issues/3895
2021-01-18 09:27:49 +00:00
Robert
af7dac72f4 FORMAT: Run clang-format 10 on all C/CXX source-files 2020-09-11 18:29:33 +02:00
Robert Adam
ced1fdd37c FIX(cmake): Set QT_RESTRICTED_CAST_FROM_ASCII
With the old qmake buildsystem we used to set QT_NO_CAST_FROM_ASCII (for
the Mumble client) in order to avoid problems with character encodings
in our Strings. This was not done in the new cmake system yet.

Instead of the aforementioned macro, this commit sets (for all targets)
QT_RESTRICTED_CAST_FROM_ASCII instead in order to be able to
automatically convert direct String literals to QString as these usually
don't contain any problematic characters (non-ASCII) in the first place.
And this allows to e.g. compare a QString against a String literal or do
something like
QString myString = "This is a test";
which we know to be unproblematic.

Note however that (quote from Qt's docs)
"Using this macro together with source strings outside the 7-bit range,
non-literals, or literals with embedded NUL characters is undefined."
2020-08-31 09:59:05 +02:00
Robert Adam
30b67b76eb
Merge pull request #4344: FEAT(server): Allow loading welcome text from file
This allows specifying welcometextfile in murmur.ini. If no welcometext
is set in the ini-file, the welcome text is loaded from the file.

Fixes #3723
2020-07-14 17:57:05 +02:00
Popkornium18
39e12d3325 FEAT(server): Allow loading welcome text from file
This allows specifying welcometextfile in murmur.ini. If no welcometext
is set in the ini-file, the welcome text is loaded from the file.

Fixes #3723
2020-07-08 20:10:32 +02:00
Robert Adam
9d244227aa
Merge pull request #4147: FEAT(server): Add rememberduration option
This option allows to set a threshold on how long a user's channel
should be remembered. This is useful for scenarios where users usually
don't want their channel to be remembered by the server unless they had
a disconnect (aka have ot re-connect after a short period of time).

Implements #4143
2020-07-08 19:21:27 +02:00
deluxghost
13b85a3ae2 FEAT(server): Add rememberduration option
This option allows to set a threshold on how long a user's channel
should be remembered. This is useful for scenarios where users usually
don't want their channel to be remembered by the server unless they had
a disconnect (aka have ot re-connect after a short period of time).

Implements #4143
2020-07-03 19:27:45 +02:00
Popkornium18
410837526c REFAC(server): replace NULL with nullptr
This changes all occurances of NULL in the murmur source
dir to nullptr. Additionally explicit comparisons with NULL were
removed.
2020-07-02 00:55:36 +02:00
Robert Adam
62c215e924 REFAC(deprecated): Replace qrand
qrand() has been deprecated in Qt 5.15. Therefore this commit replaces
it with QRandomNumberGenerator as recommended by Qt.

As the RNG returned by QRandomNumberGenerator::global() (which was used
throughout this refactoring) is already seeded (according to the docs),
there is no need to explicitly seed the RNG in the main function as has
been done before by calling qsrand().
2020-06-11 08:14:18 +02:00
Robert Adam
07836a0e69 REFAC(deprecated): Replace deprecated QString::SkipEmptyParts
Qt 5.14 has introduced Qt::SplitBehavior which now holds the flag that
were previously contained in the QString class. The fields still exist
in QString but they are deprecated since Qt 5.15.
2020-06-10 19:31:34 +02:00
Sean Talts
6c6a591826 src/murmur/Meta.cpp: Negative values of these settings don't make sense.
Instead, we'll turn off the autoban feature if either are negative.
2020-04-20 15:06:07 -04:00
Sean Talts
37d24f6bf2 src/murmur: Add autobanSuccessfulConnections flag.
The idea here is that sometimes you really do have a lot of folks connecting from a single IP,
and if those connections are successful you don't want to ban any of them.
However, in cases where the server needs to guard against malicious users attempting a DDOS
by reconnecting their valid user account over and over, we need to be able to configure the
server to still ban those successful attempts.
2020-04-20 15:05:04 -04:00
Robert Adam
8aadee917d Feature: Channel Listeners
This implements #3319 by allowing users to "listen" to a channel they
have not joined. Doing so will place a "listener proxy" (in other
software this is sometimes known as a "phantom") in that channel which
will look like a normal user except that it'll have the same name as the
user listening to that channel and an ear-icon instead of the normal
avatar-icon. It will also always show a muted-icon next to it.

If a listener proxy is in a channel, the server will route all audio
packets from that channel to the user the proxy belongs to (as if that
user was in the channel). Note though that the opposite of this is not
true: The users in the channel will not hear audio from the listening
user unless that user decides to join the channel.

Furthermore it is possible to set a local volume adjustment for each
individual proxy that will be applied to all audio that is received
through it.
2020-04-16 09:29:49 +02:00
Robert Adam
d45e7e0796 Murmur-Feature: Ability to log ACL and/or group changes
As requested in #2481, this commit introduces the option to print
changes of ACLs and/or groups to the server-log. These logs then contain
the ALCs/groups before the change and after it and should thereby grant
all information necessary to debug what is going on with them.
2020-03-29 19:47:14 +02:00
Davide Beatrici
4e67a2fafb Auto-update LICENSE.header in source files 2020-01-07 03:09:22 +01:00
John Mckay
f046c74aba Client authentication for gRPC
This adds client authentication using TLS certificates when it is
enabled in gRPC. This just the basic feature right now. You either have
access or you do not.

Access is granted by putting the certificate digests of the authorized
users into the murmur.ini file.
2019-11-30 04:10:04 +00:00
Davide Beatrici
1ac534915c Remove remaining Qt 4 stuff
For reference: https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5
2019-10-10 03:14:38 +02:00
Davide Beatrici
15831dbca8 Add missing includes for "no-pch" build
This commit adds all the missing includes when the PCH header is not used.

Also, some includes are reordered and/or made consistent (e.g. "#include <QtEndian>" -> "#include <QtCore/QtEndian>").
2019-09-12 22:08:39 +02:00
Davide Beatrici
5a07244a44 Don't include PCH headers directly
According to Qt's documentation the PCH header doesn't need to be included.

From https://doc.qt.io/qt-5/qmake-precompiledheaders.html:

"To make your project use precompiled headers, you only need to define the PRECOMPILED_HEADER variable in your project file."

"qmake will handle the rest, to ensure the creation and use of the precompiled header file. You do not need to include the precompiled header file in HEADERS, as qmake will do this if the configuration supports precompiled headers."
2019-09-12 00:13:35 +02:00
Davide Beatrici
b427333257 Auto-update LICENSE.header in source files 2019-01-25 04:56:19 +01:00
MadMaurice
73a0b2f888 Make Rate limiter configurable.
This adds messagelimit and messageburst to the configuration file murmur.ini as
well as the ability to set these live.

Though adjusting these live is entirely possible, they only take effect for new connections.
2018-09-08 01:58:23 +02:00
Stefan Hacker
9e0526c485 Introduce channelcountlimit to limit max channels per server
Having to many channels on a server can impact performance to the point
of making the instance unusably slow. This can be a problem for hosters
that allow their users unlimited channel creation.

This patch introduces a new per-server configuration parameter
channelcountlimit which can be used to configure a maximum number of
channels that may be created on each of the virtual servers. Once the
limit is reached channel creation will be rejected with permission
denied.

To allow a translated error message we have to bump the client version
to 1.3.1 to be able to use a fallback message for older clients.

As usual dbus, ice and grpc can ignore this limit. It is only enforced
against clients.
2018-06-14 00:50:50 +02:00
Mikkel Krautz
f6ba3a52bf Auto-update LICENSE.header in source files. 2018-01-01 23:05:37 +01:00
Mikkel Krautz
1ea4b92314 Meta: fix error message shown when using sslDHParams option with Qt without DH support.
The QSslDiffieHellmanParameters class is only available in Qt 5.8 or
greater. (And in our buildenv's Qt 5.6 as well.)

When using Qt 4, or Qt 5 below 5.8, Murmur should refuse to run if
sslDHParams is set in the .ini.

However, with the introduction of the "@ffdhe2048" default value,
this mechanism broke: since the default value is not empty, users
of a Qt without QSslDiffieHellmanParameters would not be able to run
Murmur unless the explicitly set sslDHParams to the empty string.

This commit fixes the problem by comparing against the value from the
.ini, instead of potentially also checking against the default value.
2017-08-06 23:12:58 +02:00
Mikkel Krautz
2a84ae6446 Meta: make sslDHParams errors fatal instead of critical.
I expected qCritial to terminate Murmur. It doesn't.
2017-08-06 22:26:50 +02:00
Mikkel Krautz
7b4535cecf Meta: improve error message when sslDHParams contains unknown named group.
This commit uses the new FFDHE::NamedGroups() method to improve the error
message Murmur shows when sslDHParams is set to an unknown "bundled"
group, i.e. a name that starts with @, such as @ffdhe2048.
2017-08-06 22:20:43 +02:00
Mikkel Krautz
4098109067 Meta: use @ffdhe2048 as default value for sslDHParams. 2017-08-06 22:11:01 +02:00
Mikkel Krautz
5b3190e680 Meta: implement support for named DH parameters for sslDHParams option. 2017-08-06 22:11:00 +02:00
Jan Klass
f7657b57c0 Make use of EnvUtils in murmur 2017-05-20 19:55:51 +02:00
Mikkel Krautz
cad1bac314 Merge PR #2794: ServerDB, Meta: add support for SQLite WAL. 2017-03-05 23:12:15 +01:00
Mikkel Krautz
1818476399 ServerDB, Meta: add support for SQLite WAL.
Using SQLite's WAL (write-ahead log) can create less disk I/O while
still providing good consistency and durability.

This change uses SQLite's WAL with synchronous=NORMAL which can
cause loss of transactions on power failure. Only the transactions
which haven't been synced to the disk by the OS are lost. The
database itself will still be in a consistent state, but it might
not have all recent changes.
2017-03-05 22:42:57 +01:00
Mikkel Krautz
cb952e06f8 Merge PR #2908: Meta: enable both IPv4 and IPv6 if we're unable to query network interfaces. 2017-03-05 22:05:12 +01:00
Mikkel Krautz
a9b9dfe5e9 Meta: enable both IPv4 and IPv6 if we're unable to query network interfaces.
On systems using systemd, Murmur is often started early, even before
Murmur can query the network interfaces.

This commit adds a fallback, where Murmur will expect such a system to
support both IPv4 and IPv6.

Fixes mumble-voip/mumble#1629
Fixes mumble-voip/mumble#1904
2017-03-05 21:48:19 +01:00
Mikkel Krautz
09d4bd33fb MetaParams: replace SSL settings setup code with a call to loadSSLSettings().
This changes MetaParams to use the newly-introduced loadSSLSettings() method
to load SSL settings.
2017-03-02 01:56:39 +01:00
Mikkel Krautz
fd78d6431e Meta, UnixMurmur: implement live certificate reloading via the USR1 signal.
This moves the SSL loading code from MetaParams::read() into a separate
method, loadSSLSettings(). It also hooks up the SIGUSR1 signal handler
to reload SSL settings and apply the setings to each suitable virtual
server.

A follow-up commit will change MetaParams::read() to also use loadSSLSettings(),
however it was left out of this commit to aid in reviewability.
2017-03-02 01:56:35 +01:00
Mikkel Krautz
1a0e145a9d Meta: remove use of global QSslSocket::defaultCiphers() list.
This removes use of the global QSslSocket::defaultCiphers() list.

Instead, we set the ciphers on each socket individually.
2017-02-26 19:27:23 +01:00
Mikkel Krautz
947eb9071a Move SSL check and version log message to main.cpp from MetaParams::read().
This change moves the QSslSocket::supportsSsl() check from MetaParams:read()
to main.cpp. This also ensures that the SSL check happens very early in Murmur's
initialization process, rather than after we might have already attempted to
call some SSL-related APIs.

This change also moves the log message that prints the OpenSSL version to main.cpp,
and integrates it with the QSslSocket::supportsSsl() check.
2017-02-26 19:25:41 +01:00
Mikkel Krautz
887aa91be6 Meta: add qAbsSettingsFilePath variable.
In order to reload the SSL settings live, we need to know the .ini file
Murmur used when initially loading its settings, in order to re-load the
settings from the same file.
2017-02-26 19:25:40 +01:00
Mikkel Krautz
4fbbdda070 Meta: move qmConfig.clear().
This moves the qmConfig.clear() call in MetaParams::read() to the
top of the function.

This allows the SSL part of MetaParams::read() to be moved out to a
separate function in the upcoming PR for live-reloading SSL settings
via the SIGUSR1 signal.
2017-02-26 19:25:38 +01:00
Mikkel Krautz
21888b11b6 Meta: add 'QSettings *' parameter to MetaParams::typeCheckedFromSettings().
This allows the setting to be loaded from an arbitrary QSettings instance.

We need this to be able to implement live reloading of SSL settings via the SIGUSR1 signal.
2017-02-26 19:25:33 +01:00
Mikkel Krautz
d5f04b4223 Meta: avoid cluttering the global QSslSocket::defaultCaCertificates() list.
Before this commit, we would add any intermediate certificates found in
the SSL certificate's PEM bundle to the default CA list via
QSslSocket::addDefaultCaCertificates().
We would also add any certificates found in the sslCA PEM bundle to the
default CA list, using the same method.

Due to the way the hot-reload feature for SSL settings is going to work,
these patterns wouldn't work well in that environment, because reloading
the settings would keep adding entries to the global QSslSocket default
CA certificates list. (QSslSocket::defaultCaCertificates())

To combat this, this series of commits try to be more strict about how
default CAs and intermediates in general are handled.

Generally, instead of adding them to the global QSslSocket default CA
list, we add them to each QSslSocket as necessary.

Note: this commit does not stand on its own. It requires the follow-up
commits in this PR. It is split out to aid in reviewing.
2017-02-25 23:10:38 +01:00
Mikkel Krautz
affa2c4b56 Meta: use Server::privateKeyFromPEM. 2017-02-20 23:44:57 +01:00
Steven Noonan
e75e737130 murmur: add support for EC private keys
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
2017-02-20 23:44:45 +01:00
Mikkel Krautz
645603771d Murmur: use final Qt 5.8 API for QSslDiffieHellmanParameters. 2017-01-22 22:05:52 +01:00
Mikkel Krautz
91ebb8b0b5 Update tree copyrights to 2017. 2017-01-08 21:05:57 +01:00
Mikkel Krautz
54c28d3ee1 src/murmur: update to use LICENSE.header. 2016-05-10 22:42:02 +02:00
John Marion
6123439d1b Remove hardcoded IP whitelist for master server
With the master server being moved, this hardcoded IP is no longer
valid.
2016-05-09 01:09:43 +02:00
Tim Cooper
49a6d35f2b grpc: rename grpcCert, grpcKey to grpccert, grpckey 2016-05-08 16:45:52 +02:00
Tim Cooper
19537ac218 grpc: allow connections to be secured using TLS 2016-05-08 16:45:52 +02:00