refactor: drop web installer in favor of setup via cli

This makes the installation a bit more secure by ensuring a user does not accidentally expose a way for unauthorized users to add new ssh keys to the system.

Additionally, this removes the extra HOSTNAME file to make the initial install process easier (that file was not modifiable by any dokku commands.

Closes #2247
This commit is contained in:
Jose Diaz-Gonzalez
2021-08-06 17:48:39 -04:00
parent 857850b4c6
commit a1c768b9b3
42 changed files with 154 additions and 702 deletions

8
Vagrantfile vendored
View File

@@ -56,7 +56,6 @@ Vagrant::configure("2") do |config|
end
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update -qq >/dev/null && apt-get -qq -y --no-install-recommends install git build-essential >/dev/null && cd /root/dokku && #{make_cmd}"
vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
vm.vm.provision :shell do |s|
s.inline = <<-EOT
echo '"\e[5~": history-search-backward' > /root/.inputrc
@@ -65,6 +64,10 @@ Vagrant::configure("2") do |config|
echo 'set completion-ignore-case on' >> /root/.inputrc
EOT
end
if Pathname.new(PUBLIC_KEY_PATH).exist?
vm.vm.provision :shell, :inline => "echo 'Importing ssh key into dokku' && cat /root/.ssh/authorized_keys | dokku ssh-keys:add admin"
end
end
# For windows users. Sharing folder from windows creates problem with sym links and so, sync the repo instead from GOS.
@@ -74,7 +77,6 @@ Vagrant::configure("2") do |config|
vm.vm.network :private_network, ip: DOKKU_IP
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update -qq >/dev/null && apt-get -qq -y --no-install-recommends install git dos2unix >/dev/null"
vm.vm.provision :shell, :inline => "cd /vagrant/ && export DOKKU_BRANCH=`git symbolic-ref -q --short HEAD 2>/dev/null` && export DOKKU_TAG=`git describe --tags --exact-match 2>/dev/null` && cd /root/ && cp /vagrant/bootstrap.sh ./ && dos2unix bootstrap.sh && bash bootstrap.sh"
vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
end
config.vm.define "dokku-deb", autostart: false do |vm|
@@ -117,6 +119,6 @@ Vagrant::configure("2") do |config|
if Pathname.new(PUBLIC_KEY_PATH).exist?
config.vm.provision :file, source: PUBLIC_KEY_PATH, destination: '/tmp/id_rsa.pub'
config.vm.provision :shell, :inline => "rm -f /root/.ssh/authorized_keys && mkdir -p /root/.ssh && sudo cp /tmp/id_rsa.pub /root/.ssh/authorized_keys"
config.vm.provision :shell, :inline => "echo 'Copying ssh key into vm' && rm -f /root/.ssh/authorized_keys && mkdir -p /root/.ssh && sudo cp /tmp/id_rsa.pub /root/.ssh/authorized_keys"
end
end