refactor(services): make artifact root configurable via DECNET_ARTIFACTS_ROOT
The ssh and telnet services hard-coded /var/lib/decnet/artifacts as the host quarantine mount. Read it from DECNET_ARTIFACTS_ROOT with the same default so dev/rootless deploys can point it elsewhere.
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from decnet.services.base import BaseService
|
from decnet.services.base import BaseService
|
||||||
|
|
||||||
TEMPLATES_DIR = Path(__file__).parent.parent / "templates" / "ssh"
|
TEMPLATES_DIR = Path(__file__).parent.parent / "templates" / "ssh"
|
||||||
|
ARTIFACTS_ROOT = os.environ.get("DECNET_ARTIFACTS_ROOT", "/var/lib/decnet/artifacts")
|
||||||
|
|
||||||
|
|
||||||
class SSHService(BaseService):
|
class SSHService(BaseService):
|
||||||
@@ -46,7 +48,7 @@ class SSHService(BaseService):
|
|||||||
# drops (scp/sftp/wget) are mirrored out-of-band for forensic analysis.
|
# drops (scp/sftp/wget) are mirrored out-of-band for forensic analysis.
|
||||||
# The in-container path masquerades as systemd-coredump so `mount`/`df`
|
# The in-container path masquerades as systemd-coredump so `mount`/`df`
|
||||||
# from inside the container looks benign.
|
# from inside the container looks benign.
|
||||||
quarantine_host = f"/var/lib/decnet/artifacts/{decky_name}/ssh"
|
quarantine_host = f"{ARTIFACTS_ROOT}/{decky_name}/ssh"
|
||||||
return {
|
return {
|
||||||
"build": {"context": str(TEMPLATES_DIR)},
|
"build": {"context": str(TEMPLATES_DIR)},
|
||||||
"container_name": f"{decky_name}-ssh",
|
"container_name": f"{decky_name}-ssh",
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from decnet.services.base import BaseService
|
from decnet.services.base import BaseService
|
||||||
|
|
||||||
TEMPLATES_DIR = Path(__file__).parent.parent / "templates" / "telnet"
|
TEMPLATES_DIR = Path(__file__).parent.parent / "templates" / "telnet"
|
||||||
|
ARTIFACTS_ROOT = os.environ.get("DECNET_ARTIFACTS_ROOT", "/var/lib/decnet/artifacts")
|
||||||
|
|
||||||
|
|
||||||
class TelnetService(BaseService):
|
class TelnetService(BaseService):
|
||||||
@@ -42,7 +44,7 @@ class TelnetService(BaseService):
|
|||||||
# Quarantine mount symmetric to the SSH service — sessrec appends
|
# Quarantine mount symmetric to the SSH service — sessrec appends
|
||||||
# pty transcripts to /var/lib/systemd/coredump/transcripts/ inside
|
# pty transcripts to /var/lib/systemd/coredump/transcripts/ inside
|
||||||
# the container, which the host sees under artifacts/<decky>/telnet/.
|
# the container, which the host sees under artifacts/<decky>/telnet/.
|
||||||
quarantine_host = f"/var/lib/decnet/artifacts/{decky_name}/telnet"
|
quarantine_host = f"{ARTIFACTS_ROOT}/{decky_name}/telnet"
|
||||||
return {
|
return {
|
||||||
"build": {"context": str(TEMPLATES_DIR)},
|
"build": {"context": str(TEMPLATES_DIR)},
|
||||||
"container_name": f"{decky_name}-telnet",
|
"container_name": f"{decky_name}-telnet",
|
||||||
|
|||||||
Reference in New Issue
Block a user