refactor: update digitalocean image building to match what Digitalocean does
The scripts run/installed on the server are based on what was given to me by Digitalocean in 2019, so they may have diverged a bit since.
This commit is contained in:
1 parent
eba867a3bb
commit
96c737eae4
13 files changed
+333
-32
No files matched your search
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Configured as part of the DigitalOcean 1-Click Image build process
|
||||
|
||||
myip=$(hostname -I | awk '{print$1}')
|
||||
cat <<EOF
|
||||
********************************************************************************
|
||||
|
||||
Welcome to DigitalOcean's One-Click Dokku Droplet.
|
||||
To keep this Droplet secure, the UFW firewall is enabled.
|
||||
All ports are BLOCKED except 22 (SSH), 80 (HTTP), 443 (HTTPS),
|
||||
2375 (Docker) and 2376 (Docker).
|
||||
|
||||
In a web browser, you can view:
|
||||
* The Dokku One-Click Quickstart guide: http://do.co/dokku1804#start
|
||||
* Your Dokku setup page: http://$myip
|
||||
|
||||
For help and more information, visit http://do.co/dokku1804
|
||||
|
||||
********************************************************************************
|
||||
To delete this message of the day: rm -rf $(readlink -f ${0})
|
||||
EOF
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash -x
|
||||
set +e
|
||||
exec > >(tee /var/log/one_click_setup.log) 2>&1
|
||||
|
||||
ufw --force enable
|
||||
printf "dokku dokku/hostname string %s" hostname | debconf-set-selections
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
export LANG=C
|
||||
export LC_ALL=C
|
||||
|
||||
# Install Dokku....
|
||||
for count in {1..30}; do
|
||||
dpkg -i /var/lib/digitalocean/debs/*deb || /bin/true
|
||||
apt-get -f install || /bin/true
|
||||
|
||||
version=$(dpkg-query --showformat='${Version}' -W dokku)
|
||||
if [[ -n "$version" ]]; then
|
||||
ran=0
|
||||
exit 0
|
||||
else
|
||||
count=$(($count + 1))
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
exec > >(tee /var/log/one_click_setup.log) 2>&1
|
||||
|
||||
# Remove the force command
|
||||
sed -e '/Match user root/d' \
|
||||
-e '/.*ForceCommand.*droplet.*/d' \
|
||||
-i /etc/ssh/sshd_config
|
||||
|
||||
systemctl restart ssh
|
||||
Reference in new issue
Block a user