3 Commits
Author SHA1 Message Date
faumaray 0000c6232f Read module test versions from component lock
Modular container CI / release-build (push) Has been cancelled
Signed modular release / publish (push) Successful in 23m44s
Nightly product integration / publish-nightly (push) Successful in 4m20s
2026-08-02 02:36:52 +03:00
faumaray 884fd2dd19 Prepare Echoion 2.0.1
Modular container CI / release-build (push) Failing after 21m53s
2026-08-02 02:09:14 +03:00
faumaray 5d06619d66 Bind releases to licensing build signatures 2026-08-02 01:50:40 +03:00
9 changed files with 125 additions and 26 deletions

No files matched your search

+17 -2
View File
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 4.0.0) cmake_minimum_required(VERSION 4.0.0)
project(Echoion VERSION 2.0.0 LANGUAGES CXX) project(Echoion VERSION 2.0.1 LANGUAGES CXX)
include(GNUInstallDirs) include(GNUInstallDirs)
include(cmake/DependencyLock.cmake) include(cmake/DependencyLock.cmake)
@@ -538,6 +538,16 @@ if(BUILD_TESTS AND UNIX)
TARGET EchoionHost AND TARGET EchoionCore AND TARGET EchoionWeb AND TARGET EchoionHost AND TARGET EchoionCore AND TARGET EchoionWeb AND
TARGET EchoionUrlShortenerInternalPlugin AND TARGET EchoionUrlShortenerInternalPlugin AND
TARGET EchoionUrlShortenerExternalPlugin) TARGET EchoionUrlShortenerExternalPlugin)
foreach(_echoionTestComponent IN ITEMS
EchoionHost EchoionCore EchoionWeb
EchoionPluginUrlShortenerInternal
EchoionPluginUrlShortenerExternal)
string(JSON _echoionTestComponentVersion GET
"${_echoionComponentLockJson}"
components "${_echoionTestComponent}" componentVersion)
set("_echoionTestVersion${_echoionTestComponent}"
"${_echoionTestComponentVersion}")
endforeach()
add_executable(EchoionModuleTests tests/ModuleDescriptors.cpp) add_executable(EchoionModuleTests tests/ModuleDescriptors.cpp)
target_compile_features(EchoionModuleTests PRIVATE cxx_std_26) target_compile_features(EchoionModuleTests PRIVATE cxx_std_26)
target_link_libraries(EchoionModuleTests PRIVATE target_link_libraries(EchoionModuleTests PRIVATE
@@ -549,7 +559,12 @@ if(BUILD_TESTS AND UNIX)
"ECHOION_TEST_CORE=\"$<TARGET_FILE:EchoionCore>\"" "ECHOION_TEST_CORE=\"$<TARGET_FILE:EchoionCore>\""
"ECHOION_TEST_WEB=\"$<TARGET_FILE:EchoionWeb>\"" "ECHOION_TEST_WEB=\"$<TARGET_FILE:EchoionWeb>\""
"ECHOION_TEST_PLUGIN_INTERNAL=\"$<TARGET_FILE:EchoionUrlShortenerInternalPlugin>\"" "ECHOION_TEST_PLUGIN_INTERNAL=\"$<TARGET_FILE:EchoionUrlShortenerInternalPlugin>\""
"ECHOION_TEST_PLUGIN_EXTERNAL=\"$<TARGET_FILE:EchoionUrlShortenerExternalPlugin>\"") "ECHOION_TEST_PLUGIN_EXTERNAL=\"$<TARGET_FILE:EchoionUrlShortenerExternalPlugin>\""
"ECHOION_TEST_HOST_VERSION=\"${_echoionTestVersionEchoionHost}\""
"ECHOION_TEST_CORE_VERSION=\"${_echoionTestVersionEchoionCore}\""
"ECHOION_TEST_WEB_VERSION=\"${_echoionTestVersionEchoionWeb}\""
"ECHOION_TEST_PLUGIN_INTERNAL_VERSION=\"${_echoionTestVersionEchoionPluginUrlShortenerInternal}\""
"ECHOION_TEST_PLUGIN_EXTERNAL_VERSION=\"${_echoionTestVersionEchoionPluginUrlShortenerExternal}\"")
void_add_tests(EchoionModuleTests) void_add_tests(EchoionModuleTests)
add_test(NAME echoion_module_descriptor_tests add_test(NAME echoion_module_descriptor_tests
COMMAND EchoionModuleTests) COMMAND EchoionModuleTests)
+9 -9
View File
@@ -1,14 +1,14 @@
{ {
"schemaVersion": 2, "schemaVersion": 2,
"productVersion": "2.0.0", "productVersion": "2.0.1",
"components": { "components": {
"EchoionApi": { "EchoionApi": {
"repository": "Void/EchoionApi", "repository": "Void/EchoionApi",
"revision": "847308c16071d579bf75d60a66f45cad385da8dc", "revision": "e2503244b36281ccd7da7349727197c77dcbeb38",
"componentVersion": "2.0.0", "componentVersion": "2.0.1",
"abiHash": "sha256:d50293d345a97e52f9844088bdd42277f566bc815a21b7636d3e053f06c6c113", "abiHash": "sha256:d50293d345a97e52f9844088bdd42277f566bc815a21b7636d3e053f06c6c113",
"sourceTreeHash": "git-sha1:cc2d424525291f8d3824444cc256d90099854e4d", "sourceTreeHash": "git-sha1:c674c0bcf291600d413f1ecdce6de75cb7c7fdac",
"artifactIdentity": "echoion-api-2.0.0-linux-x86_64" "artifactIdentity": "echoion-api-2.0.1-linux-x86_64"
}, },
"EchoionHost": { "EchoionHost": {
"repository": "Void/EchoionHost", "repository": "Void/EchoionHost",
@@ -20,11 +20,11 @@
}, },
"EchoionCore": { "EchoionCore": {
"repository": "Void/EchoionCore", "repository": "Void/EchoionCore",
"revision": "c2ec314eb9cc3b06f7dae7c01cd85be8a22bbfc5", "revision": "a6555d4c698d796bf1f8efcd4af1653d7240b043",
"componentVersion": "2.0.0", "componentVersion": "2.0.1",
"abiHash": "sha256:9cb668e2a502dcfe02d145ed63635d63619732d77ff5749685834382705e8d21", "abiHash": "sha256:9cb668e2a502dcfe02d145ed63635d63619732d77ff5749685834382705e8d21",
"sourceTreeHash": "git-sha1:7887ff0ee0be9a8b4f074eae025e758d0b318adf", "sourceTreeHash": "git-sha1:ad16aea45f04e28c2f531121bdc472a37f831a53",
"artifactIdentity": "echoion-core-2.0.0-linux-x86_64" "artifactIdentity": "echoion-core-2.0.1-linux-x86_64"
}, },
"EchoionWeb": { "EchoionWeb": {
"repository": "Void/EchoionWeb", "repository": "Void/EchoionWeb",
+28 -3
View File
@@ -152,6 +152,20 @@
"voteSkipThreshold": 0 "voteSkipThreshold": 0
}, },
"licensing": {
"_section": "Short-lived signed lease from the separately deployed EchoionLicensing service. Production release configurations must set required=true.",
"required": false,
"serviceUrl": "https://license.example.com",
"productId": "echoion",
"_activationTokenEnv": "The environment variable contains the activation token; its value is never stored in config or logs.",
"activationTokenEnv": "ECHOION_LICENSE_TOKEN",
"refreshInterval": "6h",
"retryInterval": "5m",
"maximumLeaseLifetime": "24h",
"developmentMode": false,
"developmentKeys": []
},
"updates": { "updates": {
"_section": "Signed component updates for the runtime bundle, Core, and already-installed managed plugins", "_section": "Signed component updates for the runtime bundle, Core, and already-installed managed plugins",
"enabled": true, "enabled": true,
@@ -173,7 +187,7 @@
"publicKeys": [], "publicKeys": [],
"allowUnsigned": false, "allowUnsigned": false,
"_bearerTokenEnv": "Environment variable name only; the token value is never stored in this file or returned to the web UI.", "_bearerTokenEnv": "Environment variable name only; the token value is never stored in this file or returned to the web UI.",
"bearerTokenEnv": "" "bearerTokenEnv": "ECHOION_LICENSE_TOKEN"
} }
}, },
"runtime": { "runtime": {
@@ -199,12 +213,23 @@
}, },
"logging": { "logging": {
"_section": "Rolling process logs (the active file is archived on every start)", "_section": "Process logs below the state directory. Split mode writes one exact-level file per severity plus optional all.log; all files rotate as one bounded snapshot.",
"console": true, "console": true,
"level": "debug", "level": "debug",
"splitByLevel": true,
"combined": true,
"_legacyFileName": "Used only when splitByLevel is false.",
"fileName": "echoion.log", "fileName": "echoion.log",
"maxFileSizeBytes": 10485760, "maxFileSizeBytes": 10485760,
"maxFiles": 10 "maxFiles": 10,
"_format": "pattern, json (JSON Lines), or logfmt",
"format": "pattern",
"pattern": "[{time}] [{level}] [{thread}] {file} - {message}",
"_mode": "async, immediate, or buffered",
"mode": "async",
"queueCapacity": 2048,
"_overflowPolicy": "block, drop-newest, or drop-oldest",
"overflowPolicy": "block"
}, },
"advanced": { "advanced": {
+21 -2
View File
@@ -108,7 +108,11 @@ def collect_entries(root: Path) -> list[dict[str, object]]:
def write_manifest( def write_manifest(
root: Path, version: str, build_type: str, output: Path root: Path,
version: str,
build_type: str,
build_signature: str,
output: Path,
) -> None: ) -> None:
entries = collect_entries(root) entries = collect_entries(root)
regular_files = { regular_files = {
@@ -144,6 +148,7 @@ def write_manifest(
"schemaVersion": 2, "schemaVersion": 2,
"version": version, "version": version,
"buildType": build_type, "buildType": build_type,
"buildSignature": build_signature,
"executable": executable, "executable": executable,
"updater": updater, "updater": updater,
"core": core, "core": core,
@@ -176,6 +181,7 @@ def main() -> int:
choices=("RelWithDebInfo",), choices=("RelWithDebInfo",),
default="RelWithDebInfo", default="RelWithDebInfo",
) )
parser.add_argument("--build-signature")
parser.add_argument("--output", type=Path) parser.add_argument("--output", type=Path)
arguments = parser.parse_args() arguments = parser.parse_args()
@@ -183,7 +189,20 @@ def main() -> int:
parser.error("version must contain only letters, digits, dot, underscore, or dash") parser.error("version must contain only letters, digits, dot, underscore, or dash")
root = arguments.root.resolve(strict=True) root = arguments.root.resolve(strict=True)
output = arguments.output or root / "manifest.json" output = arguments.output or root / "manifest.json"
write_manifest(root, arguments.version, arguments.build_type, output) build_signature = arguments.build_signature or f"development:{arguments.version}"
if (
not build_signature
or len(build_signature) > 256
or any(character in build_signature for character in "\r\n\0")
):
parser.error("build signature must be 1-256 characters without controls")
write_manifest(
root,
arguments.version,
arguments.build_type,
build_signature,
output,
)
return 0 return 0
+8 -1
View File
@@ -218,9 +218,15 @@ def main() -> None:
or manifest.get("schemaVersion") != 2 or manifest.get("schemaVersion") != 2
or manifest.get("version") != arguments.version or manifest.get("version") != arguments.version
or manifest.get("buildType") != "RelWithDebInfo" or manifest.get("buildType") != "RelWithDebInfo"
or not isinstance(manifest.get("buildSignature"), str)
or not manifest["buildSignature"]
or len(manifest["buildSignature"]) > 256
or any(
character in manifest["buildSignature"] for character in "\r\n\0"
)
): ):
fail( fail(
"release manifest schema/version/build type does not match the feed" "release manifest schema/version/build type/signature does not match the feed"
) )
source_epoch = os.environ.get("SOURCE_DATE_EPOCH") source_epoch = os.environ.get("SOURCE_DATE_EPOCH")
@@ -267,6 +273,7 @@ def main() -> None:
if manifest_path is not None: if manifest_path is not None:
release["releaseManifestSha256"] = digest(manifest_path) release["releaseManifestSha256"] = digest(manifest_path)
release["buildType"] = manifest["buildType"] release["buildType"] = manifest["buildType"]
release["buildSignature"] = manifest["buildSignature"]
payload_document = { payload_document = {
"schemaVersion": 1, "schemaVersion": 1,
+21
View File
@@ -332,6 +332,19 @@ if [[ -z ${SOURCE_DATE_EPOCH:-} ]]; then
fi fi
export SOURCE_DATE_EPOCH export SOURCE_DATE_EPOCH
source_revision=$(git -C "$source_dir" rev-parse HEAD) ||
die "cannot determine release source revision"
lock_digest=$(sha256sum "$source_dir/components.lock.json") ||
die "cannot hash components.lock.json"
lock_digest=${lock_digest%% *}
build_signature="echoion:${version}:${source_revision}:${lock_digest}"
license_root_key_id=${ECHOION_LICENSE_ROOT_KEY_ID:-}
license_root_public_key=${ECHOION_LICENSE_ROOT_PUBLIC_KEY:-}
if [[ -n $license_root_key_id || -n $license_root_public_key ]]; then
[[ -n $license_root_key_id && -n $license_root_public_key ]] ||
die "both ECHOION_LICENSE_ROOT_KEY_ID and ECHOION_LICENSE_ROOT_PUBLIC_KEY are required"
fi
safe_remove_tree() { safe_remove_tree() {
local path=$1 local path=$1
case $path in case $path in
@@ -355,9 +368,16 @@ configure_args=(
-DECHOION_REPRODUCIBLE_BUILD=ON -DECHOION_REPRODUCIBLE_BUILD=ON
"-DECHOION_RELEASE_VERSION=$version" "-DECHOION_RELEASE_VERSION=$version"
"-DECHOION_RUNTIME_VERSION=$version" "-DECHOION_RUNTIME_VERSION=$version"
"-DECHOION_BUILD_SIGNATURE=$build_signature"
"-DECHOION_TOOLCHAIN_ABI=linux-x86_64-glibc-2.35-cxx26" "-DECHOION_TOOLCHAIN_ABI=linux-x86_64-glibc-2.35-cxx26"
"-DECHOION_COMPONENT_WORKSPACE=$component_workspace" "-DECHOION_COMPONENT_WORKSPACE=$component_workspace"
) )
if [[ -n $license_root_key_id ]]; then
configure_args+=(
"-DECHOION_LICENSE_ROOT_KEY_ID=$license_root_key_id"
"-DECHOION_LICENSE_ROOT_PUBLIC_KEY=$license_root_public_key"
)
fi
for component_id in "${component_ids[@]}"; do for component_id in "${component_ids[@]}"; do
configure_args+=( configure_args+=(
"-DCPM_${component_id}_SOURCE=$component_workspace/$component_id" "-DCPM_${component_id}_SOURCE=$component_workspace/$component_id"
@@ -583,6 +603,7 @@ python3 "$source_dir/scripts/generate-release-manifest.py" \
--root "$stage" \ --root "$stage" \
--version "$version" \ --version "$version" \
--build-type RelWithDebInfo \ --build-type RelWithDebInfo \
--build-signature "$build_signature" \
--output "$stage/manifest.json" --output "$stage/manifest.json"
# Installer helpers are mutable prefix-level files and intentionally are not # Installer helpers are mutable prefix-level files and intentionally are not
+2 -1
View File
@@ -15,7 +15,7 @@ install -m 0755 /bin/true "$stage/bin/echoiond"
install -m 0755 /bin/true "$stage/bin/echoion-updater" install -m 0755 /bin/true "$stage/bin/echoion-updater"
install -m 0644 /bin/true "$stage/lib/Echoion.ts" install -m 0644 /bin/true "$stage/lib/Echoion.ts"
printf '%s\n' \ printf '%s\n' \
'{"schemaVersion":2,"version":"1.2.3","buildType":"RelWithDebInfo"}' \ '{"schemaVersion":2,"version":"1.2.3","buildType":"RelWithDebInfo","buildSignature":"test:1.2.3"}' \
>"$stage/manifest.json" >"$stage/manifest.json"
cat >"$stage/install.sh" <<'INSTALL' cat >"$stage/install.sh" <<'INSTALL'
#!/bin/sh #!/bin/sh
@@ -76,6 +76,7 @@ manifest = Path(sys.argv[3])
release = payload["releases"][0] release = payload["releases"][0]
assert payload["schemaVersion"] == 1 assert payload["schemaVersion"] == 1
assert payload["releases"][0]["buildType"] == "RelWithDebInfo" assert payload["releases"][0]["buildType"] == "RelWithDebInfo"
assert payload["releases"][0]["buildSignature"] == "test:1.2.3"
assert payload["feedId"] == "echoion-test" assert payload["feedId"] == "echoion-test"
assert payload["sequence"] == 42 assert payload["sequence"] == 42
assert release["component"] == "runtime" assert release["component"] == "runtime"
+8
View File
@@ -103,6 +103,14 @@ def load_and_validate(root: Path, expected_version: str | None = None) -> dict:
) )
if manifest.get("buildType") != "RelWithDebInfo": if manifest.get("buildType") != "RelWithDebInfo":
raise ValueError("release manifest buildType must be RelWithDebInfo") raise ValueError("release manifest buildType must be RelWithDebInfo")
build_signature = manifest.get("buildSignature")
if (
not isinstance(build_signature, str)
or not build_signature
or len(build_signature) > 256
or any(character in build_signature for character in "\r\n\0")
):
raise ValueError("release manifest has no valid build signature")
entries = manifest.get("files") entries = manifest.get("files")
if not isinstance(entries, list): if not isinstance(entries, list):
+11 -8
View File
@@ -6,6 +6,7 @@
#include <dlfcn.h> #include <dlfcn.h>
#include <array> #include <array>
#include <string>
#include <string_view> #include <string_view>
namespace namespace
@@ -25,31 +26,31 @@ Void::Testing::Test component_module_descriptors_are_loadable()
.path = ECHOION_TEST_HOST, .path = ECHOION_TEST_HOST,
.moduleId = "EchoionHost", .moduleId = "EchoionHost",
.stableComponentId = "EchoionHost", .stableComponentId = "EchoionHost",
.version = "2.0.0", .version = ECHOION_TEST_HOST_VERSION,
}, },
ModuleExpectation{ ModuleExpectation{
.path = ECHOION_TEST_CORE, .path = ECHOION_TEST_CORE,
.moduleId = "EchoionCore", .moduleId = "EchoionCore",
.stableComponentId = "EchoionCore", .stableComponentId = "EchoionCore",
.version = "2.0.0", .version = ECHOION_TEST_CORE_VERSION,
}, },
ModuleExpectation{ ModuleExpectation{
.path = ECHOION_TEST_WEB, .path = ECHOION_TEST_WEB,
.moduleId = "EchoionWeb", .moduleId = "EchoionWeb",
.stableComponentId = "EchoionWeb", .stableComponentId = "EchoionWeb",
.version = "2.0.0", .version = ECHOION_TEST_WEB_VERSION,
}, },
ModuleExpectation{ ModuleExpectation{
.path = ECHOION_TEST_PLUGIN_INTERNAL, .path = ECHOION_TEST_PLUGIN_INTERNAL,
.moduleId = "url-shortener-internal", .moduleId = "url-shortener-internal",
.stableComponentId = "EchoionPluginUrlShortenerInternal", .stableComponentId = "EchoionPluginUrlShortenerInternal",
.version = "2.0.0", .version = ECHOION_TEST_PLUGIN_INTERNAL_VERSION,
}, },
ModuleExpectation{ ModuleExpectation{
.path = ECHOION_TEST_PLUGIN_EXTERNAL, .path = ECHOION_TEST_PLUGIN_EXTERNAL,
.moduleId = "url-shortener-external", .moduleId = "url-shortener-external",
.stableComponentId = "EchoionPluginUrlShortenerExternal", .stableComponentId = "EchoionPluginUrlShortenerExternal",
.version = "2.0.0", .version = ECHOION_TEST_PLUGIN_EXTERNAL_VERSION,
}, },
}; };
@@ -103,9 +104,11 @@ Void::Testing::Test component_module_descriptors_are_loadable()
std::string_view{stable->component_id.data, std::string_view{stable->component_id.data,
stable->component_id.size}, stable->component_id.size},
expected.stableComponentId); expected.stableComponentId);
Void::Testing::expect_eq(stable->version_major, 2U); const auto stableVersion =
Void::Testing::expect_eq(stable->version_minor, 0U); std::to_string(stable->version_major) + "." +
Void::Testing::expect_eq(stable->version_patch, 0U); std::to_string(stable->version_minor) + "." +
std::to_string(stable->version_patch);
Void::Testing::expect_eq(stableVersion, expected.version);
Void::Testing::expect(stable->api != nullptr); Void::Testing::expect(stable->api != nullptr);
if (stable->api != nullptr) { if (stable->api != nullptr) {
Void::Testing::expect_eq(stable->api->struct_size, Void::Testing::expect_eq(stable->api->struct_size,