Files
homelogic-setup/setup_homelogic.sh

37 lines
1.2 KiB
Bash
Raw Normal View History

2026-03-21 10:09:59 -03:00
# Setup SSH server
2026-03-20 20:17:21 -03:00
sudo systemctl enable sshd
sudo ufw allow 22/tcp
2026-03-21 10:09:59 -03:00
# Setup Docker
2026-03-21 10:36:25 -03:00
sudo pacman -Sy --needed docker docker-compose docker-buildx
2026-03-20 20:17:21 -03:00
sudo systemctl enable --now docker.service
2026-03-21 10:20:22 -03:00
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
2026-03-20 20:17:21 -03:00
newgrp docker
2026-03-21 10:09:59 -03:00
docker create network homelogic
2026-03-20 20:17:21 -03:00
2026-03-21 10:09:59 -03:00
# Setup ZSH
2026-03-21 10:20:22 -03:00
echo '# Custom aliases' >> ~/.zshrc
echo 'alias la="ls -a"' >> ~/.zshrc
echo 'alias lah="ls -lah"' >> ~/.zshrc
echo "alias treesize='sudo du -sh \\* | sort -rh'" >> ~/.zshrc
echo "alias up='docker compose up -d'" >> ~/.zshrc
echo "alias down='docker compose down'" >> ~/.zshrc
echo "alias pull='docker compose pull && up'" >> ~/.zshrc
echo "alias mkdir='createDir() { mkdir \\$1 && cd \"\\$\\_\" };createDir'" >> ~/.zshrc
echo "alias token='openssl rand -hex 32'" >> ~/.zshrc
echo "alias shortToken='openssl rand -hex 16'" >> ~/.zshrc
echo "alias size='sudo du -sxh .'" >> ~/.zshrc
echo "alias ,,='..'" >> ~/.zshrc
echo "alias restart='down && up'" >> ~/.zshrc
2026-03-20 20:17:21 -03:00
2026-03-21 10:09:59 -03:00
# Setup Tailscale
2026-03-21 10:20:22 -03:00
if ! command -v tailscale > /dev/null 2>&1; then
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
fi