1564 Commits

Author SHA1 Message Date
Michael Friedrich
7e87a61a62 Backport Defer class for 2.10 2019-03-19 11:23:18 +01:00
Alexander A. Klimov
1436b7dc1c Don't require OS headers to provide SO_REUSEPORT
(cherry picked from commit bf0c68757f99f88b43d7696f98d8361f39b83b82)
2019-03-13 10:31:09 +01:00
Alexander A. Klimov
f98e40d880 Secure ApiUser::GetByAuthHeader() against timing attacks
(cherry picked from commit 9558ebc0f46febc7692bbb65394708b78b276d46)
2019-02-25 13:34:51 +01:00
Michael Friedrich
466096a6a4 Debug: Log calls to ConfigObject::Deactivate()
Only available in debug builds.

(cherry picked from commit d98c0704c446b0fd47b18b610a92ac75de180853)
2019-02-19 13:53:09 +01:00
Alexander A. Klimov
362c7eb28a TcpSocket#Bind(): also set SO_REUSEPORT
refs #6898

(cherry picked from commit 984f7be03060f89235ccee1a1ef3e5fba652a9df)
2019-02-11 13:16:40 +01:00
Michael Friedrich
4fb444d3b7 Fix Convert::ToLong(double val)
(cherry picked from commit b58cb17e4b389c6bd703e2334cb0bb2739213f62)
2019-02-11 13:15:18 +01:00
Michael Friedrich
ea64467c65 Revert "ThreadPool#Stop(): discard non-processed queue items"
This reverts commit 797ecd1539c91d3dd02dc7d164ce602c52a6f802.
2018-12-06 09:55:42 +01:00
Michael Friedrich
173455de22 Call SSL_shutdown() at least twice 2018-12-05 16:00:53 +01:00
Alexander A. Klimov
f3f402fa7e Socket engine: drop life support objects
refs #6477
2018-12-05 15:59:29 +01:00
Alexander A. Klimov
ad06c4f5ab Make SocketEventDescriptor#EventInterface a SocketEvents::Ptr
refs #6477
2018-12-05 15:59:23 +01:00
Alexander A. Klimov
0b03a3d8f8 SocketEvents: inherit from Stream
refs #6477
2018-12-05 15:59:17 +01:00
Alexander A. Klimov
797ecd1539 ThreadPool#Stop(): discard non-processed queue items 2018-12-05 15:46:03 +01:00
Michael Friedrich
b3e98a842f Fix possible double free in StreamLogger::BindStream()
refs #6737
2018-11-12 17:07:51 +01:00
Michael Friedrich
46ed01348c Ensure that API/JSON-RPC messages in the same session are processed and not stalled
This basically drops the "corked" implementation which just stalled the
TLS IO polling after some requests. If you need sort of rate limiting
for these events, use an external TLS proxy which terminates that in front
of Icinga.

fixes #6635
2018-11-12 17:07:38 +01:00
Michael Friedrich
dea5ec614e icinga.com: Update CMakeLists.txt 2018-10-18 09:35:18 +02:00
Michael Friedrich
44c3b83769 icinga.com: Update '*.ti' 2018-10-18 09:30:00 +02:00
Michael Friedrich
dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich
af6c8a1f50 Add missing shutdown/program state dumps for SIGUSR2 reload handler
Credits to @west0rmann finding the issue and providing the initial fix.

fixes #6689
fixes #6592
2018-10-16 12:36:43 +02:00
Michael Friedrich
43a571e013 Don't throw an error when namespace indexers don't find a valid key
Examples:

```
globals["abc"]
globals.def
```

The patch for the Icinga Director unfortunately only solves the
master, and as discussed with @lippserd we need to ensure that
satellites and clients with 2.10 can be restarted without any errors
from deployed configuration.

refs #6509
refs icinga/icingaweb2-module-director#1654
2018-10-11 12:42:56 +02:00
Michael Friedrich
4be9f418a9 Revert "Initialize Socket Event Engine on application startup"
This reverts commit c8dcd1297f6d0be8685c5a3079e40fc44e779add.

We cannot do this during application startup, since Daemonize()
kills the threads again.

refs #6514
refs #6630
2018-10-09 19:38:29 +02:00
Michael Friedrich
96c0de9bea Allow to override MaxConcurrentChecks constant 2018-09-27 20:23:00 +02:00
Michael Friedrich
c8dcd1297f Initialize Socket Event Engine on application startup
Previously this happened inside the TlsStream constructor
during the first connection attempt.
2018-09-24 15:50:59 +02:00
Michael Friedrich
3038b150a9
Merge pull request #6616 from Icinga/feature/tls-handshake-timeout-config
Add ApiListener#tls_handshake_timeout option
2018-09-17 11:20:12 +02:00
Michael Friedrich
b81ac972b9 Silence compiler warning for nice() 2018-09-14 14:29:52 +02:00
Michael Friedrich
29701b4db5 Add ApiListener#tls_handshake_timeout option
This allows to specify the previously hardcoded
timeout of 10s.

refs #6517
2018-09-14 09:20:09 +02:00
Michael Friedrich
1c2a59bf63
Merge pull request #6591 from Icinga/bugfix/lto-builds-static-initialize-namespaces
Fix static initializer priority for namespaces in LTO builds
2018-09-04 16:54:30 +02:00
Michael Friedrich
19993df380 Fix static initializer priority for namespaces in LTO builds
fixes #6575
2018-09-04 16:36:22 +02:00
Jean Flach
72cc41d14e
Merge pull request #6356 from sourcejedi/fix/systemd
Fix logging under systemd
2018-09-04 15:24:43 +02:00
Michael Friedrich
bc844aca06 Fix non-unity builds on CentOS 7 with std::shared_ptr
refs #6509
2018-09-03 15:32:28 +02:00
Alan Jenkins
a0fb0bbfe3 fix "Console" log to flush
It's called "Console", which would be line-buffered anyway.  But, it's
implemented as std::cout.  This might be piped to a logger, as in
daemontools or systemd.  In this case it will not be a TTY, and log lines
should be flushed without too much delay.  Let's just flush each message.

Let's not introduce a static instance of StreamLogger (flushed by interval
timer).  That's too stressful to read, because static instances are really
annoying to order.  Example citation: "Yay, our static destructors are
pretty much beyond repair at this point." -- application.cpp.

I don't know if there will be any need to optimize logging syscalls.  The
init script uses `--daemonize`.  I think the systemd service should also
avoid using the "Console" log after startup (see next commit).  The
documentation does not warn that the syslog feature is less efficient
in system calls than mainlog; deferred flusing does not seem to be a highly
prominent feature.  There's no cool comment in the code about how much the
syscalls were slowing down some use case (or qualifying that this
optimization can only eliminate syscalls on platforms with both mutexes and
clocks that can work without syscalls).
2018-08-25 09:54:55 +01:00
Gunnar Beutner
e678fa1aa5 Refactor Application::*Const() 2018-08-13 15:27:05 +02:00
Gunnar Beutner
1a0311a49f Implement namespace support for the keys() function 2018-08-13 13:44:31 +02:00
Gunnar Beutner
8fda8d72ac Implement support for the namespace and using keywords 2018-08-13 13:44:31 +02:00
Gunnar Beutner
10d6f70a85 Move constants and functions into different namespaces 2018-08-13 13:44:31 +02:00
Gunnar Beutner
1a8692d972 Implement support for namespaces 2018-08-13 13:44:31 +02:00
Gunnar Beutner
9d513d8f05 Implement support for modifying frozen attributes 2018-08-13 13:44:31 +02:00
Gunnar Beutner
d9c0b6f806 Refactor REGISTER_SCRIPTFUNCTION_* macros 2018-08-13 13:44:31 +02:00
Michael Friedrich
97513965e6 Introduce IcingaApplication#environment
Precedence as follows:

- DEnvironment=...
- const Environment = ...
- object IcingaApplication "app" { environment = "..." }

The wrapped script constant handling is required
since we cannot directly link from libremote (SNI handling)
to libicinga where the object resides. Instead we'll
use the Application class helpers for hiding the ScriptGlobal
calls.
2018-08-10 12:49:48 +02:00
Markus Frosch
20269a89d0 ApiListener: Add support for dynamic port handling 2018-08-08 17:42:57 +02:00
Michael Friedrich
9be3ee1a1a Update output for --version
This moves the system and build information before
the application paths which are normally not that important.
2018-08-07 18:46:18 +02:00
Markus Frosch
9fbc40615a Improve path handling in cmake and daemon 2018-08-07 14:10:26 +02:00
Michael Friedrich
8bac1dc99e
Merge pull request #6521 from gunnarbeutner/feature/references
Implement references
2018-08-07 12:00:19 +02:00
Gunnar Beutner
24de1963b1
Merge pull request #6526 from Icinga/bugfix/wpessimizing-move-6524
icinga::PackObject(): shorten conversion to string
2018-08-07 10:05:18 +02:00
Alexander A. Klimov
137f5363c4 icinga::PackObject(): shorten conversion to string
refs #6524
2018-08-07 09:57:08 +02:00
Gunnar Beutner
8bfd419702 Implement references 2018-08-07 07:44:48 +02:00
Michael Friedrich
33492420f3
Merge pull request #6427 from gunnarbeutner/fix/recursive-serialize
Improve error message for serializing objects with recursive references
2018-08-03 11:03:42 +02:00
Gunnar Beutner
56cf64f590 Improve error message for serializing objects with recursive references 2018-08-02 11:06:24 +02:00
Jean Flach
065bc23d9a
Merge pull request #6508 from gunnarbeutner/feature/dictionary-clear
Implement the Dictionary#clear script function
2018-08-02 10:30:08 +02:00
Gunnar Beutner
a5a0119799 Implement the Dictionary#clear script function 2018-08-02 08:45:19 +02:00
Jean Flach
2e3a1ff0c6
Merge pull request #6498 from Icinga/bugfix/match-regex-match-any-regression
Fix regression with MatchAny false conditions on match/regex/cidr_match
2018-07-27 17:28:13 +02:00