Skip to content

Commit

Permalink
Enhance docker and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Sep 17, 2024
1 parent 21c69d6 commit af0cb1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/executor/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default async function runConfig(config, domain, writer, sandbox = false)
// sometimes we need to wait for the domain to be created
await writeLog("$> virtualmin list-domains");
await new Promise((resolve, reject) => {
setTimeout(resolve, 3000);
setTimeout(resolve, 1000);
});
await new Promise((resolve, reject) => {
let tries = 0;
Expand Down Expand Up @@ -237,7 +237,6 @@ export default async function runConfig(config, domain, writer, sandbox = false)
await virtExec("backup-domain", value, {
user,
'all-features': true,
'as-owner': true,
'ignore-errors': true,
});
break;
Expand Down
3 changes: 2 additions & 1 deletion src/executor/runnercode.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ export async function runConfigCodeFeatures(key, value, writeLog, domaindata, ss
break;
case 'docker':
await sshExec(`export XDG_RUNTIME_DIR=/run/user/$(id -u)`, false);
await sshExec(`export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock`, false);
await sshExec(`export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus`, false);
if (value === '' || value === 'on') {
await writeLog("$> Enabling docker features");
await writeLog(await dockerExec.enableDocker(domaindata['Username']));
await sshExec(`sed -i '/DOCKER_HOST=/d' ~/.bashrc`, false);
await sshExec(`echo "export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock" >> ~/.bashrc; source ~/.bashrc`);
await sshExec(`echo "export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock" >> ~/.bashrc;`);
await sshExec(`mkdir -p ~/.config/docker; echo '{"exec-opts": ["native.cgroupdriver=cgroupfs"]}' > ~/.config/docker/daemon.json`);
await sshExec(`dockerd-rootless-setuptool.sh install`);
} else if (value === 'off') {
Expand Down

0 comments on commit af0cb1e

Please sign in to comment.