Regenerate certificates on startup, fix permissions bug

This commit is contained in:
Jeffrey Morgan 2015-03-05 21:09:06 -05:00
Родитель 7b8d6be11c
Коммит 2760b56574
5 изменённых файлов: 19 добавлений и 11 удалений

Просмотреть файл

@ -40,7 +40,7 @@
]
},
"docker-version": "1.5.0",
"docker-machine-version": "0.1.0",
"docker-machine-version": "0.1.0-kitematic-0.5.8",
"atom-shell-version": "0.21.2",
"virtualbox-version": "4.3.24",
"virtualbox-filename": "VirtualBox-4.3.24.pkg",

Просмотреть файл

@ -83,6 +83,9 @@ var DockerMachine = {
return Promise.resolve(stdout.trim().replace('\n', ''));
});
},
regenerateCerts: function () {
return util.exec([DockerMachine.command(), 'tls-regenerate-certs', '-f', NAME]);
},
state: function () {
return DockerMachine.info().then(info => {
return info ? info.state : null;

Просмотреть файл

@ -61,7 +61,7 @@ var _steps = [{
message: 'To run Docker containers on your computer, Kitematic is starting a Linux virtual machine. This may take a minute...',
totalPercent: 60,
percent: 0,
seconds: 53,
seconds: 58,
run: Promise.coroutine(function* (progressCallback) {
setupUtil.simulateProgress(this.seconds, progressCallback);
yield virtualBox.vmdestroy('kitematic-vm');
@ -86,6 +86,7 @@ var _steps = [{
yield machine.upgrade();
}
yield machine.start();
yield machine.regenerateCerts();
})
}];

Просмотреть файл

@ -13,15 +13,15 @@ var SetupUtil = {
return true;
}
if (!fs.existsSync('/usr/local/bin/docker') || !fs.existsSync('/usr/local/bin/docker-machine')) {
return fs.statSync('/usr/local/bin').gid !== 80 || fs.statSync('/usr/local/bin').uid !== process.getuid();
}
if (fs.statSync('/usr/local/bin/docker').gid !== 80 || fs.statSync('/usr/local/bin/docker').uid !== process.getuid()) {
if (fs.statSync('/usr/local/bin').gid !== 80 || fs.statSync('/usr/local/bin').uid !== process.getuid()) {
return true;
}
if (fs.statSync('/usr/local/bin/docker-machine').gid !== 80 || fs.statSync('/usr/local/bin/docker-machine').uid !== process.getuid()) {
if (fs.existsSync('/usr/local/bin/docker') && (fs.statSync('/usr/local/bin/docker').gid !== 80 || fs.statSync('/usr/local/bin/docker').uid !== process.getuid())) {
return true;
}
if (fs.existsSync('/usr/local/bin/docker-machine') && (fs.statSync('/usr/local/bin/docker-machine').gid !== 80 || fs.statSync('/usr/local/bin/docker-machine').uid !== process.getuid())) {
return true;
}
return false;
@ -50,9 +50,11 @@ var SetupUtil = {
},
fixBinariesCmd: function () {
var cmd = [];
cmd.push.apply(cmd, ['chown', `${process.getuid()}:${80}`, this.escapePath(path.join('/usr/local/bin', 'docker-machine'))]);
cmd.push.apply(cmd, ['chown', `${process.getuid()}:${80}`, path.join('/usr/local/bin')]);
cmd.push('&&');
cmd.push.apply(cmd, ['chown', `${process.getuid()}:${80}`, this.escapePath(path.join('/usr/local/bin', 'docker'))]);
cmd.push.apply(cmd, ['chown', `${process.getuid()}:${80}`, path.join('/usr/local/bin', 'docker-machine')]);
cmd.push('&&');
cmd.push.apply(cmd, ['chown', `${process.getuid()}:${80}`, path.join('/usr/local/bin', 'docker')]);
return cmd.join(' ');
},
installVirtualBoxCmd: function () {

Просмотреть файл

@ -11,7 +11,9 @@ pushd $BASE/resources > /dev/null
if [ ! -f $DOCKER_MACHINE_CLI_FILE ]; then
echo "-----> Downloading Docker Machine CLI..."
rm -rf docker-machine*
curl -L -o $DOCKER_MACHINE_CLI_FILE https://github.com/docker/machine/releases/download/v$DOCKER_MACHINE_CLI_VERSION/docker-machine_darwin-amd64
# Use temporary, new version of docker-machine that has some important fixes
# curl -L -o $DOCKER_MACHINE_CLI_FILE https://github.com/docker/machine/releases/download/v$DOCKER_MACHINE_CLI_VERSION/docker-machine_darwin-amd64
curl -L -o $DOCKER_MACHINE_CLI_FILE https://github.com/kitematic/kitematic/releases/download/v0.5.8/docker-machine_darwin-amd64
chmod +x $DOCKER_MACHINE_CLI_FILE
fi