main: modify local_install.sh

This commit is contained in:
Gary 2024-02-23 09:34:07 -08:00
parent fce392c7ed
commit 0a31199ecd

View File

@ -186,13 +186,13 @@ if [ -s /etc/docker/daemon.json.original-"$DATE" ]; then
DIFF=$(diff <(jq --sort-keys . /etc/docker/daemon.json) <(jq --sort-keys . /etc/docker/daemon.json.original-"$DATE"))
if [ "$DIFF" != "" ]; then
echo "Docker configuration updated, restart docker daemon..."
sudo systemctl restart docker
systemctl restart docker
else
echo "Docker configuration is up to date."
fi
else
echo "Docker configuration updated, restart docker daemon..."
sudo systemctl restart docker
systemctl restart docker
fi
echo -e "-------------"
@ -219,8 +219,8 @@ cp -r /home/lasthour/lasthourcloud/app/Livewire /data/coolify/
cp /home/lasthour/lasthourcloud/.coolify-logo /data/coolify/.coolify-logo
cp /home/lasthour/lasthourcloud/tailwind.config.js /data/coolify/tailwind/
sudo chown -R 9999:root /data/coolify
sudo chmod -R 700 /data/coolify
chown -R 9999:root /data/coolify
chmod -R 700 /data/coolify
# Copy .env.example if .env does not exist
if [ ! -f /data/coolify/source/.env ]; then
@ -248,25 +248,27 @@ fi
# Generate an ssh key (ed25519) at /data/coolify/ssh/keys/id.root@host.docker.internal
if [ ! -f /data/coolify/ssh/keys/id.root@host.docker.internal ]; then
ssh-keygen -t ed25519 -a 100 -f /data/coolify/ssh/keys/id.root@host.docker.internal -q -N "" -C root@coolify
sudo chown 9999 /data/coolify/ssh/keys/id.root@host.docker.internal
chown 9999 /data/coolify/ssh/keys/id.root@host.docker.internal
fi
addSshKey() {
sudo cat /data/coolify/ssh/keys/id.root@host.docker.internal.pub >>~/.ssh/authorized_keys
sudo chmod 600 ~/.ssh/authorized_keys
cat /data/coolify/ssh/keys/id.root@host.docker.internal.pub >>~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
}
if [ ! -f ~/.ssh/authorized_keys ]; then
sudo mkdir -p ~/.ssh
sudo chmod 700 ~/.ssh
sudo touch ~/.ssh/authorized_keys
mkdir -p ~/.ssh
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
addSshKey
fi
if ! grep -qw "root@coolify" ~/.ssh/authorized_keys; then
addSshKey
fi
echo "Generated SSH access"
echo "Begin upgrade.sh"
bash /data/coolify/source/upgrade.sh "${LATEST_VERSION:-latest}"
echo -e "\nCongratulations! Your Coolify instance is ready to use.\n"