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
9df389a843
Improve logging for ignored config updates where we are authoritative for (config master)
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
043824a6a9
Leave partial deletes as is, this is dealt with stage purge later
2019-06-19 14:46:11 +02:00
Michael Friedrich
b3fa51a5dc
Code Documentation: Config file sync
...
Adds headers to all functions including parameters. This unveils
certain unused ones too.
2019-06-19 14:46:11 +02:00
Michael Friedrich
604a8a041d
Update log message and implement recursive diff delete
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
46cb806b3f
Add a note for config updates V1 and V2
...
Old clients sync !.conf via update_v2 message, we cannot
remove this handling for the time being.
2019-06-19 14:46:11 +02:00
Michael Friedrich
83c11962b2
Only remove directories if they exist during sync
2019-06-19 14:46:11 +02:00
Michael Friedrich
4e9439f2d8
Ensure that config master zones.d -> var-api-zones sync removes deleted files
2019-06-19 14:46:11 +02:00
Michael Friedrich
9d53db1401
Purge stage and production directories before copying files
...
The cluster-message -> production diff is still intact, we're
just taking care of unwanted/deleted files 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
a91bbe8acd
Fix constant value for zone var override
2019-06-19 14:46:11 +02:00
Michael Friedrich
e3e68caaa3
Inherit parent process arguments for defined path constants
2019-06-19 14:46:11 +02:00
Michael Friedrich
e545884952
Improve logging for staged config sync
2019-06-19 14:46:11 +02:00
Michael Friedrich
1853254201
Pass the zonesVar override around
2019-06-19 14:46:11 +02:00
Michael Friedrich
2ed56b50a4
Ensure directory paths are created from stage -> prod
2019-06-19 14:46:11 +02:00
Michael Friedrich
c2d7063ae7
Better signal for checking the cluster config sync stage (ignore production)
2019-06-19 14:46:11 +02:00
Michael Friedrich
506eee2f7d
Fix crash
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
Alexander A. Klimov
42a33cdc7d
Fix build errors with Boost v1.70
...
refs #7237
2019-06-07 16:30:34 +02:00
Michael Friedrich
b32d818d1b
CLI: Allow to list removed CSRs with 'ca list'
2019-06-07 10:33:55 +02:00
Andrew Jaffie
429f1ed317
Ignore repeated requests from client after using ca remove command
2019-06-07 10:33:55 +02:00
Michael Friedrich
6a8823f879
Avoid concurrent cluster config sync transactions
...
fixes #6660
2019-06-05 15:23:28 +02:00
Michael Friedrich
ef72cd4442
Merge pull request #7220 from Icinga/bugfix/asio-error-handling
...
Improve error handling with network connections (Boost ASIO)
2019-06-05 14:43:31 +02:00
Michael Friedrich
18211ddd23
Merge pull request #7209 from Icinga/bugfix/immediately-close-sockets
...
Close server connections and shutdown coroutines immediately on disconnect
2019-06-05 14:40:24 +02:00
Alexander A. Klimov
ad28380884
Close server connections and shutdown coroutines immediately on disconnect
2019-06-05 10:42:03 +02:00
Michael Friedrich
fd9887c5af
API: Harden default cipher list
...
According to https://www.acunetix.com/blog/articles/tls-ssl-cipher-hardening/
2019-06-05 09:55:43 +02:00
Michael Friedrich
3798089642
Improve error handling with network connections (Boost ASIO)
...
refs #7041
2019-06-05 09:42:51 +02:00
Michael Friedrich
146b337d4d
Merge pull request #7211 from Icinga/feature/asio-tls-version
...
Require TLS 1.2 for Cluster & REST API
2019-06-03 16:19:22 +02:00
Michael Friedrich
d82c067555
Require TLS 1.2 for Cluster & REST API
...
refs #7041
2019-05-29 17:08:36 +02:00
Michael Friedrich
438da67209
Merge pull request #7210 from Icinga/bugfix/boost-asio-deprecated
...
Quality: Replace deprecated get_io_service() with get_executor().context() for Boost ASIO
2019-05-29 15:40:19 +02:00
Michael Friedrich
59b95ed1f0
Quality: Replace deprecated get_io_service() with get_executor().context() for Boost ASIO
...
refs #7041
2019-05-29 14:36:10 +02:00
Michael Friedrich
120aba3919
Quality: Removed unused HttpChunkedEncoding class
2019-05-28 13:46:19 +02:00
Michael Friedrich
e606d14705
Quality: Clean JsonRPC class and add function docs
2019-05-24 15:50:43 +02:00
Michael Friedrich
f933aafd29
Quality: Purge old HTTP code in lib/remote
2019-05-24 15:50:43 +02:00
Michael Friedrich
af42e2dfc0
Merge pull request #7178 from Icinga/bugfix/api-package-repair
...
API: Automatically repair broken _api package
2019-05-10 14:40:48 +02:00
Michael Friedrich
6c9c65323e
Workaround for boost::filesystem and Visual Studio on Windows
2019-05-10 13:38:12 +02:00
Michael Friedrich
6cce9c0fdd
API: Automatically repair broken packages
...
This partially reverts #7150 and avoids exceptions
inside the flow. Each time an empty active stage
is detected, Icinga tries to repair it from the
the given directory tree.
Also, the code now takes into account that it should
create the package storage on startup, whether within
the API object, or if disabled, inside the application.
Caching the active stages for packages in memory
only is in effect with the API feature being enabled.
This is useful for other deployed config packages,
not only the internal one.
fixes #7173
refs #7150
refs #7119
fixes #6959
2019-05-10 12:48:34 +02:00
Elias Ohm
4c86c370bb
fixup errbuf length in the other files and avoid using the static buffer in one place (for thread safety and code consistency reasons)
2019-05-09 09:30:12 +02:00
Michael Friedrich
03324b2fb6
Config packages: Catch active stage exceptions in rare cases
...
Typically this already is detected on startup.
2019-05-08 16:43:27 +02:00
Michael Friedrich
704aabcb63
Avoid dead-lock with config packages and active stages
2019-05-08 16:06:46 +02:00
Elias Ohm
c10ff9dd72
try without initialization of frame Locals which are not used for permissions filter and as far as I can see also not for query filters
2019-05-02 09:03:30 +02:00
Elias Ohm
53febdea81
use current frame scope for permission filter function calls
2019-05-02 07:35:19 +02:00
Michael Friedrich
502c43fb12
Active packages: Don't try to fix broken config packages which are not cached yet
2019-04-30 12:19:35 +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
f92c134b0a
Cluster: Don't try to sync objects from broken _api package
2019-04-26 14:43:38 +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
37de1a919b
Merge pull request #7088 from Icinga/feature/asio-event-queue
...
Implement new event queue for ASIO consumers
2019-04-25 16:54:43 +02:00