125 Commits

Author SHA1 Message Date
Yonas Habteab
ff0e12e6ac ApiListener: Sync runtime configs in order 2025-01-07 11:07:46 +01:00
Yonas Habteab
a924a49cd8
Revert "Process config::update/delete cluster events gracefully" 2024-03-07 17:17:17 +01:00
Yonas Habteab
456144c1dc ApiListener: Process cluster config updates sequentially 2024-02-14 14:25:53 +01:00
Yonas Habteab
40011b0584 Introduce ObjectNamesMutex helper class 2024-02-14 14:25:53 +01:00
Alexander A. Klimov
bc778116e9 ApiListener#Start(): auto-renew CA on its owner
otherwise it would expire.
2023-12-18 15:28:11 +01:00
Alexander A. Klimov
36a08b0497 ApiListener#RenewCert(): enable optional CA creation 2023-12-18 15:28:11 +01:00
Alexander Aleksandrovič Klimov
000a776dfb
Built-in check command: ifw-api (#9062) 2023-07-06 14:18:21 +02:00
Alexander A. Klimov
c9e4c016e0 Protect ApiListener#m_SSLContext with a mutex 2022-04-11 11:02:45 +02:00
Alexander A. Klimov
e490883577 Renew certificates also periodically 2022-04-11 11:02:39 +02:00
Alexander A. Klimov
3753f86c80 ApiListener#Start(): auto-renew own cert if CA owner
otherwise that particular cert would expire.
2022-04-04 12:13:31 +02:00
Alexander A. Klimov
6d470a3ca5 Introduce ApiListener#RenewCert() 2022-04-04 12:12:31 +02:00
Alexander A. Klimov
c3388e9af6 Use std::mutex, not boost::mutex 2021-02-03 09:54:57 +01:00
Alexander Aleksandrovič Klimov
bee4ac7f7c
Merge pull request #8040 from Icinga/feature/v1-actions-execute-command-8034
Add API endpoint: /v1/actions/execute-command
2020-12-02 10:53:24 +01:00
Julian Brost
70c9d49ebc ApiListener: merge new config validation and actication functions
Merge AsyncTryActivateZonesStage and TryActivateZonesStageCallback and
name the result TryActivateZonesStage. The old split was a leftover from
the one being a callback function with no actual meaningful separation.
2020-11-17 09:37:13 +01:00
Julian Brost
e4610e7dbd Use std::mutex instead of Spinlock 2020-11-16 17:38:03 +01:00
Julian Brost
74b65f1642 API filesync: wait for validation process to exit
This avoid having to pass a lock implictly using the captured variables
of a lambda.
2020-11-16 17:10:57 +01:00
Alexander A. Klimov
bb851b0558 Merge branch 'master' into feature/v1-actions-execute-command-8034 2020-10-28 18:37:08 +01:00
Alexander A. Klimov
40ac05c182 Introduce Endpoint#capabilities
refs #8034
2020-10-19 13:04:20 +02:00
Alexander Aleksandrovič Klimov
f60ae93717
Merge pull request #7870 from Icinga/bugfix/last-zone-sync-stage-validation-failed-7642
Clear ApiListener#last_failed_zones_stage_validation on config::Update if config not changed
2020-10-19 12:31:01 +02:00
Alexander A. Klimov
fbfa931b31 Clear ApiListener#last_failed_zones_stage_validation on config::Update if config not changed
refs #7642
2020-10-14 12:17:14 +02:00
Alexander A. Klimov
a083635de4 Make ApiListener::m_ConfigSyncStageLock a SpinLock 2020-10-14 10:47:08 +02:00
Alexander A. Klimov
38f3108c1a ApiListener::HandleConfigUpdate(): make the whole process mutually exclusive
refs #7742
2020-03-23 17:33:14 +01:00
Alexander A. Klimov
dc3062a9b0 ApiListener::ConfigUpdateHandler(): block as less as possible
refs #7742
2020-03-23 17:31:59 +01:00
Alexander A. Klimov
35c9f2e7b3 Close connections w/o sucessful TLS handshakes during 10s
refs #7805
2020-02-05 15:53:56 +01:00
Alexander A. Klimov
ba1ce9c853 Replace std::shared_ptr<boost::asio::ssl::context> with Shared<boost::asio::ssl::context>::Ptr 2019-10-21 16:12:46 +02:00
Alexander A. Klimov
a1fef92835 Replace std::shared_ptr<boost::asio::ip::tcp::acceptor> with Shared<boost::asio::ip::tcp::acceptor>::Ptr 2019-10-21 16:12:46 +02:00
Alexander A. Klimov
a1683568a1 Replace std::shared_ptr<AsioTlsStream> with Shared<AsioTlsStream>::Ptr 2019-10-21 16:12:35 +02:00
Alexander A. Klimov
3f4cb0936c Add ApiListener::UpdatedObjectAuthority()
refs #7086
2019-07-11 12:58:07 +02:00
Michael Friedrich
f92f6f7f8c Improve checksum checks for each file content 2019-06-19 14:46:11 +02:00
Michael Friedrich
7a02990ef8 Refactor the client sync, part II (WIP, currently checksums generate an endless loop) 2019-06-19 14:46:11 +02:00
Michael Friedrich
fcc1799a5d Split config file sync updates, part I
This commit also introduces a playground for checksums,
whilst refactoring the code in large parts.
2019-06-19 14:46:11 +02:00
Michael Friedrich
efc2289178 Remove duplicated validation paths in function signatures 2019-06-19 14:46:11 +02:00
Michael Friedrich
2acf3a6941 Indicate a warning in the 'icinga' check when cluster stage validation failed
- success: clear the last failed attribute
- failed: populate it with the output and current timestamp

This can be used to highlight this in the 'icinga' check task.
Since 2.9 we don't have problems with circular library dependencies
with just one linked binary, therefore it is safe to include libremote
in libmethods here.
2019-06-19 14:46:11 +02:00
Michael Friedrich
86108e6a1e Improve logging and code quality 2019-06-19 14:46:11 +02:00
Michael Friedrich
fb367e12cc Store the last failed zone stage sync validation as runtime ApiListener attribute 2019-06-19 14:46:11 +02:00
Michael Friedrich
2c39d69428 Implement first draft for cluster config staged sync 2019-06-19 14:46:11 +02:00
Michael Friedrich
6a8823f879 Avoid concurrent cluster config sync transactions
fixes #6660
2019-06-05 15:23:28 +02:00
Michael Friedrich
2bca7a5bb5 Repair broken API config packages at runtime
This means a new timer which checks every 5m whether the
active-stage can be read, and if not, it overwrites the
file on disk with the details from memory.
2019-04-26 14:53:36 +02:00
Michael Friedrich
c821e73364 Cache the API package stage name with a active-stage fallback
This prevents reading the file everytime the stageName is required
for when creating a runtime object via REST API.
2019-04-26 13:40:27 +02:00
Michael Friedrich
b24a3be083 Improve code docs for cluster message routing conditions
refs #6781
2019-04-10 14:17:36 +02:00
Alexander A. Klimov
64b2ac4b30 ApiListener: drop unused thread pool 2019-04-01 15:06:17 +02:00
Alexander A. Klimov
832365195d ApiListener: connect(2) via Boost ASIO 2019-04-01 11:40:14 +02:00
Alexander A. Klimov
e21956e26e ApiListener: detect protocol 2019-04-01 11:40:14 +02:00
Alexander A. Klimov
720c53ab77 ApiListener: perform TLS handshake 2019-04-01 11:40:14 +02:00
Alexander A. Klimov
2615967e7f Make ApiListener#m_SSLContext a Boost ASIO SSL context 2019-04-01 11:40:14 +02:00
Alexander A. Klimov
e4f3422b3a ApiListener: listen(2) via Boost ASIO 2019-04-01 11:40:14 +02:00
Michael Friedrich
d14a88235d Replace Copyright header with a short version, part I
CLion -> replace in path
2019-02-25 14:48:22 +01:00
Michael Friedrich
dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich
cbde35ff22 Use a dynamic thread pool for API connections
The full analysis is located in #6517.

fixes #6517
2018-09-25 12:43:10 +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