Bootstrap sys.path in root proxy files and add PYTHONPATH to CI workflow
CI Test Suite / Run Component Tests & Pipeline Verification (push) Failing after 1m43s

This commit is contained in:
2026-10-03 20:26:26 +02:00
parent 303744a3f8
commit 57f3dd896f
19 changed files with 138 additions and 4 deletions
+2
View File
@@ -16,6 +16,8 @@ jobs:
name: Run Component Tests & Pipeline Verification
if: "!startsWith(github.ref, 'refs/tags/')"
runs-on: logar
env:
PYTHONPATH: .
steps:
- name: Checkout Code
uses: actions/checkout@v3
+8
View File
@@ -1,3 +1,11 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.clients.Linux_Client import *
if __name__ == '__main__':
main()
+8
View File
@@ -1,3 +1,11 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.hub.Server import *
if __name__ == '__main__':
main()
+8
View File
@@ -1,3 +1,11 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.clients.Win_Client import *
if __name__ == '__main__':
main()
+7
View File
@@ -6,6 +6,13 @@ Modular package namespace exposing:
- common: Versioning and shared utilities
"""
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src import hub
from src import clients
from src import common
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.hub.auth_manager import *
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.clients.client_transport import *
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.clients.client_updater import *
+14 -4
View File
@@ -448,6 +448,16 @@ def load_or_init_config(config_path: str = CONFIG_FILE_NAME) -> Dict[str, Any]:
config["cache_mode"] = "direct"
if "encrypt_at_rest" not in config:
config["encrypt_at_rest"] = False
if "auth_token" not in config:
config["auth_token"] = secrets.token_hex(24)
if "enrollment_secret" not in config:
config["enrollment_secret"] = secrets.token_hex(24)
if "server_fingerprint" not in config and "public_key" in config:
try:
pub, _ = pgpy.PGPKey.from_blob(config["public_key"])
config["server_fingerprint"] = str(pub.fingerprint)
except Exception:
config["server_fingerprint"] = ""
config["db_path"] = resolve_writable_path(config["db_path"], "LOGAR-Server", DEFAULT_DB_FILE)
config["cert_dir"] = resolve_writable_path(config["cert_dir"], "LOGAR-Server", "certs")
@@ -592,11 +602,11 @@ def create_client_config(
"server_port": server_port,
"hermes_host": effective_hermes_host,
"hermes_port": hermes_port or server_conf.get("hermes_port", 8443),
"enrollment_secret": server_conf.get("enrollment_secret"),
"enrollment_secret": server_conf.get("enrollment_secret", ""),
"cert_dir": "certs",
"server_fingerprint": server_conf["server_fingerprint"],
"server_public_key": server_conf["public_key"],
"auth_token": server_conf["auth_token"]
"server_fingerprint": server_conf.get("server_fingerprint", ""),
"server_public_key": server_conf.get("public_key", ""),
"auth_token": server_conf.get("auth_token", "")
}
out_dir = os.path.dirname(os.path.abspath(output_path))
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.hub.ingest_queue import *
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.hub.license_manager import *
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.clients.log_collector import *
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.hub.pki_manager import *
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.hub.server_enrollment import *
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.hub.server_models import *
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.hub.storage_engine import *
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.hub.update_manager import *
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.common.version import *
+7
View File
@@ -1 +1,8 @@
import os
import sys
_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if _ROOT not in sys.path:
sys.path.insert(0, _ROOT)
from src.hub.web_ui import *