Add DC CMS site workspace deploy component
This commit is contained in:
parent
a31b679ab9
commit
7ef0ca8eab
|
|
@ -156,6 +156,22 @@ COMPONENTS = {
|
|||
},
|
||||
),
|
||||
},
|
||||
"dc-cms-site-nodedc": {
|
||||
"payload_root": Path("/volume1/docker/dc-cms/sites/nodedc"),
|
||||
"compose_root": Path("/volume1/docker/dc-cms/source/infra"),
|
||||
"compose_env_file": Path("/volume1/docker/dc-cms/source/infra/.env.synology"),
|
||||
"compose_files": (
|
||||
Path("/volume1/docker/dc-cms/source/infra/docker-compose.yml"),
|
||||
),
|
||||
"compose_no_deps": True,
|
||||
"services": ("cms-app", "reverse-proxy"),
|
||||
"healthchecks": (
|
||||
{
|
||||
"url": "http://172.22.0.222:9918/auth/login?returnTo=%2F",
|
||||
"headers": {"Host": "cms.dcserve.ru"},
|
||||
},
|
||||
),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -584,6 +600,12 @@ def denied_payload_path(component, rel):
|
|||
return "dc-cms env file"
|
||||
if rel.startswith(("Dockerfile.bak", "infra/docker-compose.yml.bak")):
|
||||
return "dc-cms backup file"
|
||||
elif component == "dc-cms-site-nodedc":
|
||||
runtime_prefixes = (
|
||||
"assets/.trash",
|
||||
"assets/uploads/.trash",
|
||||
"node_modules",
|
||||
)
|
||||
|
||||
if any(rel == prefix or rel.startswith(prefix + "/") for prefix in runtime_prefixes):
|
||||
return "runtime data path"
|
||||
|
|
@ -749,6 +771,27 @@ def allowed_payload_path(component, rel):
|
|||
)):
|
||||
return True
|
||||
|
||||
if component == "dc-cms-site-nodedc":
|
||||
if rel in (
|
||||
".gitignore",
|
||||
"README.md",
|
||||
"asset-manifest.json",
|
||||
"index.html",
|
||||
"package.json",
|
||||
"package-lock.json",
|
||||
"robots.txt",
|
||||
"sitemap.xml",
|
||||
):
|
||||
return True
|
||||
if rel.startswith((
|
||||
"assets/",
|
||||
"content/",
|
||||
"knowledge/",
|
||||
"templates/",
|
||||
"tools/",
|
||||
)):
|
||||
return True
|
||||
|
||||
die(f"path allowlist rejected: {rel}")
|
||||
|
||||
|
||||
|
|
@ -1160,7 +1203,7 @@ def run_compose(component, services):
|
|||
|
||||
|
||||
def prepare_component_runtime(component):
|
||||
if component == "dc-cms":
|
||||
if component in ("dc-cms", "dc-cms-site-nodedc"):
|
||||
(Path("/volume1/docker/dc-cms/sites") / "nodedc").mkdir(parents=True, exist_ok=True)
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue