57 lines
1.7 KiB
Bash
Executable File
57 lines
1.7 KiB
Bash
Executable File
# Setup Server
|
|
echo '### Setting up Server ###'
|
|
sudo apt-get update
|
|
sudo ufw allow 22/tcp
|
|
sudo ufw allow 443/tcp
|
|
sudo ufw allow 8123/tcp
|
|
sudo ufw allow 8123/udp
|
|
sudo ufw allow 3000/tcp
|
|
sudo ufw allow 3001/tcp
|
|
|
|
# Setup Docker
|
|
echo '### Setting up Docker ###'
|
|
sudo apt -y install lsb-release gnupg apt-transport-https ca-certificates curl software-properties-common
|
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg
|
|
sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
|
sudo apt update
|
|
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
|
|
|
sudo systemctl enable --now docker.service
|
|
if ! getent group docker > /dev/null 2>&1; then
|
|
sudo groupadd docker
|
|
fi
|
|
if ! id -nG "$USER" | grep -qw "docker"; then
|
|
sudo usermod -aG docker "$USER"
|
|
fi
|
|
sudo docker network create homelogic 2>/dev/null || true
|
|
|
|
# Setup ZSH
|
|
echo '### Setting up ZSH ###'
|
|
touch ../.hushlogin
|
|
cp -f .zshrc.base ../.zshrc
|
|
|
|
sudo apt install zsh
|
|
|
|
ZSH_PATH=$(command -v zsh)
|
|
if [ "${SHELL##*/}" != "zsh" ] && [ -n "$ZSH_PATH" ]; then
|
|
chsh -s "$ZSH_PATH"
|
|
fi
|
|
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
|
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
|
|
|
# Setup Tailscale
|
|
echo '### Setting up Tailscale ###'
|
|
printf "Do you want to install and setup Tailscale? [Y/n] "
|
|
read choice
|
|
case "$choice" in
|
|
n|N|no|No|NO )
|
|
echo "Skipping Tailscale setup."
|
|
;;
|
|
* )
|
|
if ! command -v tailscale > /dev/null 2>&1; then
|
|
curl -fsSL https://tailscale.com/install.sh | sh
|
|
sudo tailscale up
|
|
fi
|
|
;;
|
|
esac
|