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
CI Test Suite / Run Component Tests & Pipeline Verification (push) Failing after 1m43s
This commit is contained in:
@@ -16,6 +16,8 @@ jobs:
|
|||||||
name: Run Component Tests & Pipeline Verification
|
name: Run Component Tests & Pipeline Verification
|
||||||
if: "!startsWith(github.ref, 'refs/tags/')"
|
if: "!startsWith(github.ref, 'refs/tags/')"
|
||||||
runs-on: logar
|
runs-on: logar
|
||||||
|
env:
|
||||||
|
PYTHONPATH: .
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|||||||
@@ -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 *
|
from src.clients.Linux_Client import *
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
@@ -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 *
|
from src.hub.Server import *
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
@@ -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 *
|
from src.clients.Win_Client import *
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
@@ -6,6 +6,13 @@ Modular package namespace exposing:
|
|||||||
- common: Versioning and shared utilities
|
- 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 hub
|
||||||
from src import clients
|
from src import clients
|
||||||
from src import common
|
from src import common
|
||||||
|
|||||||
@@ -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 *
|
from src.hub.auth_manager import *
|
||||||
@@ -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 *
|
from src.clients.client_transport import *
|
||||||
@@ -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 *
|
from src.clients.client_updater import *
|
||||||
+14
-4
@@ -448,6 +448,16 @@ def load_or_init_config(config_path: str = CONFIG_FILE_NAME) -> Dict[str, Any]:
|
|||||||
config["cache_mode"] = "direct"
|
config["cache_mode"] = "direct"
|
||||||
if "encrypt_at_rest" not in config:
|
if "encrypt_at_rest" not in config:
|
||||||
config["encrypt_at_rest"] = False
|
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["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")
|
config["cert_dir"] = resolve_writable_path(config["cert_dir"], "LOGAR-Server", "certs")
|
||||||
@@ -592,11 +602,11 @@ def create_client_config(
|
|||||||
"server_port": server_port,
|
"server_port": server_port,
|
||||||
"hermes_host": effective_hermes_host,
|
"hermes_host": effective_hermes_host,
|
||||||
"hermes_port": hermes_port or server_conf.get("hermes_port", 8443),
|
"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",
|
"cert_dir": "certs",
|
||||||
"server_fingerprint": server_conf["server_fingerprint"],
|
"server_fingerprint": server_conf.get("server_fingerprint", ""),
|
||||||
"server_public_key": server_conf["public_key"],
|
"server_public_key": server_conf.get("public_key", ""),
|
||||||
"auth_token": server_conf["auth_token"]
|
"auth_token": server_conf.get("auth_token", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
out_dir = os.path.dirname(os.path.abspath(output_path))
|
out_dir = os.path.dirname(os.path.abspath(output_path))
|
||||||
|
|||||||
@@ -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 *
|
from src.hub.ingest_queue import *
|
||||||
@@ -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 *
|
from src.hub.license_manager import *
|
||||||
@@ -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 *
|
from src.clients.log_collector import *
|
||||||
@@ -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 *
|
from src.hub.pki_manager import *
|
||||||
@@ -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 *
|
from src.hub.server_enrollment import *
|
||||||
@@ -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 *
|
from src.hub.server_models import *
|
||||||
@@ -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 *
|
from src.hub.storage_engine import *
|
||||||
@@ -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 *
|
from src.hub.update_manager import *
|
||||||
@@ -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 *
|
from src.common.version import *
|
||||||
@@ -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 *
|
from src.hub.web_ui import *
|
||||||
Reference in New Issue
Block a user