525 Commits

Author SHA1 Message Date
Gunnar Beutner
e6638cf8df Fix missing variable name in ApiListener::Start
fixes #5924
refs #5807

refs #5925
2018-04-19 12:44:57 +02:00
Jean Flach
cf570c9a93 Fix package error message
fixes #5879

refs #5881
2018-04-19 11:18:52 +02:00
Michael Friedrich
9f418f5356 Allow to disable brackets for the Url class and Format()
This commit also adds unit tests.

refs #5706

refs #6207
2018-04-19 10:46:15 +02:00
Jan Beich
e3ecf83bfb Explicitly use long with boost::posix_time 2018-04-16 15:39:57 +02:00
Michael Friedrich
1969a9071a Improve error handling for empty packages in /v1/config/packages
- If there is no package main directory, assume "empty packages".
- Catch exceptions thrown through GlobRecursive() and present a better http 500
to the user.

The packages directory tree is automatically created with the first
package creation, either from the user, or by the `_api` package.

fixes #6129
2018-03-13 11:03:02 +01:00
Gunnar Beutner
ddab94feb3 Build fix 2018-03-07 09:57:08 +01:00
Jean Flach
f357439485 Code style 2018-03-07 09:57:08 +01:00
Gunnar Beutner
6670024f62 Ensure that SetCorked() works properly 2018-03-06 09:35:57 +01:00
Jean Flach
fda4faac06 Limit anonymous connections to 25 2018-03-06 08:53:52 +01:00
Noah Hilverling
fdf2dc43d5 Limit JSON-RPC message size 2018-03-06 08:53:14 +01:00
Gunnar Beutner
622127276b Fix incorrect HTTP content length limits 2018-02-28 14:17:17 +01:00
Gunnar Beutner
85858e6a36 Add SetCorked() calls to the JsonRpcConnection class 2018-02-28 12:57:22 +01:00
Jean Flach
8b334fe259 Use cork in tlsstream and HTTP connection 2018-02-28 12:57:22 +01:00
Gunnar Beutner
6e7421eab0 Fix null ptr dereference in HttpServerConnection::ProcessMessageAsync 2018-02-28 11:54:48 +01:00
Gunnar Beutner
6400a300cd Fix incorrect return value 2018-02-28 11:53:49 +01:00
Jean Flach
952e3616e5 Fix incorrect size of request limits
refs #6103
2018-02-23 14:44:44 +01:00
Jean Flach
2e5aedd28a Fix crash when using incorrectly formatted password hash 2018-02-23 13:07:55 +01:00
Jean Flach
6387f5442e Move new password functions into tlsutility 2018-02-23 13:06:22 +01:00
Jean Flach
6504606e23 Hash API password and comparison
fixes #4920
2018-02-23 11:23:19 +01:00
Jean Flach
adc054097d Build/Merge fixes 2018-02-23 10:27:55 +01:00
Jean Flach
c5b92defec Minor codestyle and doc changes 2018-02-23 10:09:28 +01:00
Noah Hilverling
4b77afedcd Limit HTTP body size 2018-02-23 10:09:28 +01:00
Noah Hilverling
3fe818b44b Fix requests not being closed correctly 2018-02-23 10:09:28 +01:00
Jean Flach
70c81734c5 Add timeout for TLS handshakes 2018-02-23 10:09:26 +01:00
Jean Flach
aa1ccd7ada Authenticate API user before parsing body 2018-02-23 10:08:24 +01:00
Jean Flach
a46dc64e6a Only read body from authenticated connections
This means we are not allowing unauthenticated requests anymore
2018-02-23 09:52:54 +01:00
Jean Flach
e1c46cedd1 Fix nullptr deref 2018-02-23 08:34:10 +01:00
Gunnar Beutner
f5f8b90ec8 Add HTTP Header size limits 2018-02-23 08:31:28 +01:00
Gunnar Beutner
0339a2b827 Add validation for HTTP connection sizes 2018-02-23 08:31:28 +01:00
Noah Hilverling
71c420d501 Fix nullptr deref in cluster events 2018-02-22 14:55:44 +01:00
Noah Hilverling
157358c24f Fix HTTP response parsing for HTTP 1.1
refs #5987
2018-01-17 15:02:33 +01:00
Gunnar Beutner
680939a289 Fix incorrect socket handling for the HTTP client 2018-01-17 15:02:33 +01:00
Michael Friedrich
c3fe1a6323 Revert "Fix incorrect socket handling for the HTTP client"
This reverts commit 59da943548c7c1be5f4b27dce73a0ad27cf0de5d.

refs #5760
2018-01-16 10:44:31 +01:00
Gunnar Beutner
59da943548 Fix incorrect socket handling for the HTTP client 2017-12-12 11:18:09 +01:00
Michael Friedrich
5b231147fe Silence UpdateRepository message errors
Mixed setups with 2.8 and 2.7 will log this error every time
a new message is received. While this is truly an error,
it just fills the log to infinity. Should be used for debug only.

fixes #5776

refs #5804
2017-11-28 11:27:39 +01:00
Gunnar Beutner
a18fbcb27a Fix missing variable name which can lead to segfaults
refs #5808
refs #5807

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
2017-11-28 11:14:32 +01:00
Gunnar Beutner
2bbb5366fd Merge pull request #5620 from Icinga/fix/api-staging-3668
WIP: Ensure that the REST API config package/stage creation is atomic
2017-10-24 12:51:09 +02:00
Gunnar Beutner
f2d437e96c Implement support for migrating certificates to /var/lib/icinga2/certs
This commit includes documentation too.

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
2017-10-20 14:06:02 +02:00
Jean Flach
aad96d6b09 Improve error message for unknow functions
refs #5686
2017-10-18 11:25:38 +02:00
Michael Friedrich
77ecdbd85c Merge pull request #5581 from Icinga/fix/api-crash-race-condition
Fix possible race condition in ApiListener locking
2017-10-12 13:40:59 +02:00
Michael Friedrich
a521f49803 Fix debug builds on Apple Clang 9.0.0 (macOS High Sierra) 2017-10-02 13:49:42 +02:00
Gunnar Beutner
92727d13c7 Fix a build warning
refs #5443
2017-09-25 12:15:59 +02:00
Michael Friedrich
953d840cc1 Fix certificate paths for installers
refs #5450
2017-09-22 15:00:45 +02:00
Michael Friedrich
601c10b997 Remove bottom-up CLI commands
refs #4799
2017-09-22 14:04:43 +02:00
Jean Flach
79166a31d4 Revert "Add Log Warning in case active-stage is empty"
This reverts commit 287f72b0a0ee76e1ef5052969677c5bbc672d65b.
2017-09-21 13:54:29 +02:00
Jean Flach
287f72b0a0 Add Log Warning in case active-stage is empty
Maybe Critical instead? Throwing an exception seems unnecessary.

refs #3668
2017-09-20 17:57:14 +02:00
Jean Flach
ef5013b903 Use locks in api config staging
refs #3668
2017-09-20 16:45:09 +02:00
ryanohnemus
1cb39994a5 API: Add optional reload parameter to config stage upload
You can now specify a boolean `reload` attribute that
will allow you to skip the icinga2 reload after config
validation. By default this is set to true.

The response text has been updated to show if icinga2
will reload or if it was requested to be skipped.

fixes #4769
2017-09-20 14:16:55 +02:00
Michael Friedrich
7bdeeeadcf Silence log level for configuration file updates
This only helps with debugging the configuration sync, but seems
to be highlighted quite often in default configurations (where
the timestamp is equal).

refs #5566
2017-09-20 13:30:02 +02:00
Noah Hilverling
94fe1b2292 HttpServerConnection: Implement CORS support
fixes #4326
2017-09-20 13:18:29 +02:00