From 753653b4df62723b82d32799825135822886eac7 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 3 Sep 2026 16:20:23 +0200 Subject: refactor(node): platform abstraction for Windows portability (W1-W2-W5-W6-W7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Platform directories, signal handling, chmod guards, ffmpeg discovery, and platform-conditional CLI messages — all testable on Linux. See docs/WINDOWS-PORT.md §5 for the plan these implement. Co-Authored-By: Claude Opus 4.6 --- packages/meshbay-node/src/meshbay_node/transport/tls_cert.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'packages/meshbay-node/src/meshbay_node/transport/tls_cert.py') diff --git a/packages/meshbay-node/src/meshbay_node/transport/tls_cert.py b/packages/meshbay-node/src/meshbay_node/transport/tls_cert.py index 374fd08..8d680ea 100644 --- a/packages/meshbay-node/src/meshbay_node/transport/tls_cert.py +++ b/packages/meshbay-node/src/meshbay_node/transport/tls_cert.py @@ -21,10 +21,12 @@ from cryptography.hazmat.primitives import hashes, serialization from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.x509.oid import NameOID +from meshbay_node.platform import chmod_private, config_dir + log = logging.getLogger(__name__) -DEFAULT_CERT = Path.home() / ".config" / "meshbay" / "node_tls.crt" -DEFAULT_KEY = Path.home() / ".config" / "meshbay" / "node_tls.key" +DEFAULT_CERT = config_dir() / "node_tls.crt" +DEFAULT_KEY = config_dir() / "node_tls.key" def generate_self_signed_cert( @@ -64,8 +66,8 @@ def generate_self_signed_cert( serialization.PrivateFormat.TraditionalOpenSSL, serialization.NoEncryption(), )) - cert_path.chmod(0o644) - key_path.chmod(0o600) + chmod_private(cert_path, mode=0o644) + chmod_private(key_path) log.info("TLS cert generated: %s", cert_path) return cert_path, key_path -- cgit v1.2.3