Skip to content

Commit ecceb4e

Browse files
authored
Refactor Settings DB and Handling (#1786)
* Refactor config API * Corrections * Test Qt 6.8 * Revert "Test Qt 6.8" This reverts commit eceebec. * Corrections 2 * Update Changelog * Add configFilter element for getconfig call * Do not create errors for DB updates when in read-only mode * Have configuration migration and validation before Hyperion starts * Correct Tests * Corrections * Add migration items * Correct windows build * Ensure that first instance as default one exists * Remove dependency between AuthManager and SSDPHandler * Correct typos * Address CodeQL findings * Replace CamkeSettings by Presets and provide debug scenarios
1 parent aed4abc commit ecceb4e

File tree

88 files changed

+4378
-2443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+4378
-2443
lines changed

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,15 @@ NULL
3939

4040
# Docker deploy folder
4141
deploy/*
42+
43+
# ccache/buildcache
44+
.*cache/
45+
46+
# release-deps/debug-deps
47+
*-deps/
48+
49+
# User defined CMake preset file.
50+
CMakeUserPresets.json
51+
52+
#Configurations created under config for testing
53+
/configs

.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.17-beta.1
1+
2.0.17-beta.2

.vs/launch.vs.json

+31-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,42 @@
66
"type": "default",
77
"project": "CMakeLists.txt",
88
"projectTarget": "hyperiond.exe (bin\\hyperiond.exe)",
9-
"name": "Run hyperion with debug option and external console",
9+
"name": "Run Hyperion"
10+
},
11+
{
12+
"type": "default",
13+
"project": "CMakeLists.txt",
14+
"projectTarget": "hyperiond.exe (bin\\hyperiond.exe)",
15+
"name": "Run hyperion with debug logging and external console",
1016
"args": [
1117
"-d",
1218
"-c"
1319
],
1420
"externalConsole": true
21+
},
22+
{
23+
"type": "default",
24+
"project": "CMakeLists.txt",
25+
"projectTarget": "hyperiond.exe (bin\\hyperiond.exe)",
26+
"name": "Run hyperion with verbose logging with external console",
27+
"args": [
28+
"-v",
29+
"-c"
30+
],
31+
"externalConsole": true
32+
},
33+
{
34+
"type": "default",
35+
"project": "CMakeLists.txt",
36+
"projectTarget": "hyperiond.exe (bin\\hyperiond.exe)",
37+
"name": "Run hyperion with debug logging and a test configuration DB",
38+
"args": [
39+
"-d",
40+
"-c",
41+
"-u",
42+
"${workspaceRoot}\\configs\\testConfig"
43+
],
44+
"externalConsole": true
1545
}
1646
]
1747
}

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
**JSON-API**
1212
- Align JSON subscription update elements. `ledcolors-imagestream-update, ledcolors-ledstream-update, logmsg-update` now return data via `data` and not `result
13+
- Global global configuration elements are now separated form instance specific ones
1314

1415
### Added
1516

@@ -18,6 +19,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1819
- Support gaps on Matrix Layout (#1696)
1920
- Windows: Added a new grabber that uses the DXGI DDA (Desktop Duplication API). This has much better performance than the DX grabber as it does more of its work on the GPU.
2021

22+
- Support to import, export and backup Hyperion's full configuration via the UI, JSON-API and commandline (`--importConfig, --exportConfig`) (#804)
23+
- Allow to force starting Hyperion in read-only mode (`--readonlyMode`)
24+
- JSON-API: Support to query for a dedicated set of configuration items for a set of instances
25+
- JSON-API: Support to save a dedicated set of configuration items for a set of instances
26+
2127
**JSON-API**
2228
- New subscription support for event updates, i.e. `Suspend, Resume, Idle, idleResume, Restart, Quit`.
2329
- Support direct or multiple instance addressing via single requests (#809)
@@ -33,12 +39,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3339
- Fixed: Kodi Color Calibration, Refactor Wizards (#1674)
3440
- Fixed: Token Dialog not closing
3541
- Fixed: Philip Hue APIv2 support without Entertainment group defined (#1742)
42+
- Refactored: Database access layer
43+
- Refactored: Hyperion's configuration database is validated before start-up (and migrated, if required)
3644

3745
**JSON-API**
3846
- Refactored JSON-API to ensure consistent authorization behaviour across sessions and single requests with token authorization.
3947
- Provide additional error details with API responses, esp. on JSON parsing, validation or token errors.
4048
- Generate random TANs for every API request from the Hyperion UI
4149
- Fixed: Handling of IP4 addresses wrapped in IPv6 for external network connections-
50+
- Fixed: Local Admin API Authentication rejects valid tokens (#1251)
4251

4352
### Removed
4453

CMakeLists.txt

+28-14
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ PROJECT(hyperion)
2020
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cmake)
2121
file (STRINGS ".version" HYPERION_VERSION)
2222
SetVersionNumber(HYPERION ${HYPERION_VERSION})
23-
set(DEFAULT_JSON_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/config/hyperion.config.json.default)
23+
set(DEFAULT_JSON_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/settings/hyperion.settings.json.default)
2424
file(READ ${DEFAULT_JSON_CONFIG_FILE} DEFAULT_JSON_CONFIG_VAR)
2525
string(REPLACE "configVersionValue" ${HYPERION_VERSION} DEFAULT_JSON_CONFIG_VAR "${DEFAULT_JSON_CONFIG_VAR}")
26-
string(REPLACE "previousVersionValue" ${HYPERION_VERSION} DEFAULT_JSON_CONFIG_VAR "${DEFAULT_JSON_CONFIG_VAR}")
27-
file(WRITE ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default "${DEFAULT_JSON_CONFIG_VAR}")
26+
file(WRITE ${CMAKE_BINARY_DIR}/settings/hyperion.settings.json.default "${DEFAULT_JSON_CONFIG_VAR}")
2827

2928
# Instruct CMake to run moc automatically when needed.
3029
set(CMAKE_AUTOMOC ON)
@@ -227,7 +226,7 @@ message(STATUS "HYPERION_LIGHT = ${HYPERION_LIGHT}")
227226

228227
if(HYPERION_LIGHT)
229228
message(STATUS "HYPERION_LIGHT: Hyperion is build with a reduced set of functionality.")
230-
# Disable Grabbers
229+
# Disable Screen/Video Grabbers
231230
SET ( DEFAULT_AMLOGIC OFF )
232231
SET ( DEFAULT_DISPMANX OFF )
233232
SET ( DEFAULT_DX OFF )
@@ -240,22 +239,37 @@ if(HYPERION_LIGHT)
240239
SET ( DEFAULT_X11 OFF )
241240
SET ( DEFAULT_XCB OFF )
242241

242+
# Disable Audio Grabbers
243243
SET ( DEFAULT_AUDIO OFF )
244244

245+
# LED-Devices
246+
#SET ( DEFAULT_DEV_NETWORK OFF )
247+
#SET ( DEFAULT_DEV_FTDI OFF )
248+
#SET ( DEFAULT_DEV_SERIAL OFF )
249+
#SET ( DEFAULT_DEV_SPI OFF )
250+
#SET ( DEFAULT_DEV_TINKERFORGE OFF )
251+
#SET ( DEFAULT_DEV_USB_HID OFF )
252+
#SET ( DEFAULT_DEV_WS281XPWM OFF )
253+
245254
# Disable Input Servers
246-
set(DEFAULT_BOBLIGHT_SERVER OFF)
247-
set(DEFAULT_CEC OFF)
248-
set(DEFAULT_FLATBUF_SERVER OFF)
249-
set(DEFAULT_PROTOBUF_SERVER OFF)
255+
SET ( DEFAULT_BOBLIGHT_SERVER OFF )
256+
SET ( DEFAULT_CEC OFF )
257+
SET ( DEFAULT_FLATBUF_SERVER OFF )
258+
SET ( DEFAULT_PROTOBUF_SERVER OFF )
250259

251260
# Disable Output Connectors
252-
set(DEFAULT_FORWARDER OFF)
253-
set(DEFAULT_FLATBUF_CONNECT OFF)
261+
SET ( DEFAULT_FORWARDER OFF )
262+
SET ( DEFAULT_FLATBUF_CONNECT OFF )
254263

255264
# Disable Services
256-
set(DEFAULT_EFFECTENGINE OFF)
265+
SET ( DEFAULT_EFFECTENGINE OFF )
266+
#SET ( DEFAULT_EXPERIMENTAL OFF )
267+
#SET ( DEFAULT_MDNS OFF )
268+
#SET ( DEFAULT_REMOTE_CTL OFF )
269+
270+
#SET ( ENABLE_JSONCHECKS OFF )
271+
#SET ( ENABLE_DEPLOY_DEPENDENCIES OFF )
257272
endif()
258-
259273
message(STATUS "Grabber options:")
260274

261275
addIndent(" - ")
@@ -430,7 +444,7 @@ endif()
430444
if(ENABLE_JSONCHECKS)
431445
# check all json files
432446
file (GLOB_RECURSE HYPERION_SCHEMAS RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/libsrc/*schema*.json)
433-
set(JSON_FILES ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default ${HYPERION_SCHEMAS})
447+
set(JSON_FILES ${CMAKE_BINARY_DIR}/settings/hyperion.settings.json.default ${HYPERION_SCHEMAS})
434448

435449
execute_process (
436450
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkjson.py ${JSON_FILES}
@@ -453,7 +467,7 @@ if(ENABLE_JSONCHECKS)
453467
endif()
454468

455469
execute_process (
456-
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkschema.py ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default libsrc/hyperion/hyperion.schema.json
470+
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkschema.py ${CMAKE_BINARY_DIR}/settings/hyperion.settings.json.default libsrc/hyperion/schema/schema-settings-default.json
457471
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
458472
RESULT_VARIABLE CHECK_CONFIG_FAILED
459473
)

0 commit comments

Comments
 (0)