fix: run staging mutations as root
Deploy staging to test server / deploy (push) Successful in 5m33s
Deploy staging to test server / deploy (push) Successful in 5m33s
This commit is contained in:
@@ -231,13 +231,22 @@ test("Gitea staging mutations use deploy-owned temporary paths", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("Gitea remote staging Docker operations stay inside non-interactive sudo", () => {
|
||||
test("Gitea remote staging mutations run as root with controlled Docker configuration", () => {
|
||||
for (const workflow of [read(giteaDeployWorkflow), read(giteaMigrationWorkflow)]) {
|
||||
assert.match(workflow, /sudo -n docker ps -aq/);
|
||||
assert.match(workflow, /sudo -n docker inspect/);
|
||||
assert.match(workflow, /sudo -n docker --config '\$incoming\/\.docker' login/);
|
||||
assert.match(workflow, /sudo -n docker --config '\$incoming\/\.docker' logout/);
|
||||
assert.match(workflow, /DOCKER_BIN='sudo -n docker'/);
|
||||
assert.match(workflow, /sudo -n rm -rf -- '\$incoming'/);
|
||||
assert.match(
|
||||
workflow,
|
||||
/sudo -n env INCOMING_PATH='\$incoming'[\s\S]*DOCKER_CONFIG='\$incoming\/\.docker' DOCKER_BIN='docker'[\s\S]*bash '\$incoming\/deploy\/run-staging-(?:deploy|migration)\.sh'/,
|
||||
);
|
||||
assert.doesNotMatch(workflow, /DOCKER_BIN='sudo -n docker'/);
|
||||
assert.doesNotMatch(
|
||||
workflow,
|
||||
/"INCOMING_PATH='\$incoming'[^"]*bash '\$incoming\/deploy\/run-staging-(?:deploy|migration)\.sh'"/,
|
||||
);
|
||||
assert.doesNotMatch(workflow, /DOCKER_CONFIG='\$incoming\/\.docker' docker (?:login|logout)/);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user