Tyleo-Scripts/irp-alp-base

51 lines
1.7 KiB
Text
Raw Normal View History

2024-02-18 18:06:30 +00:00
clear
echo =======================================
echo = Server Node Installation Basic Mode =
echo =======================================
echo '[cli] Patching Repos to Latest Stable...'
cp /etc/apk/repositories /etc/apk/repositories.backup
echo https://dl-cdn.alpinelinux.org/alpine/latest-stable/main > /etc/apk/repositories
echo https://dl-cdn.alpinelinux.org/alpine/latest-stable/community >> /etc/apk/repositories
echo '[apk] Updating Index...'
apk update
echo '[apk] Upgrading Packages to latest version before setup...'
apk upgrade
echo '[apk] Installing Base Packages...'
apk add curl wget aria2 screen sudo shadow htop btop nano vim fish bash zsh openssh bat fd ack ncdu exa
echo '[orc] Enabling OpenSSH Server Daemon...'
rc-update add sshd
service sshd start
# Setup Service Account
clear
echo =======================================
echo = Server Node Installation Basic Mode =
echo =======================================
echo = Patching Sudo with Ruby Group Patch...
groupadd --gid 50000 ruby
echo "%ruby ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ruby-root
echo = Service Account Creation...
echo -n "= Username (lowercase): "
read Suid
echo = Creating $Suid...
useradd -d /home/service-$Suid -m $Suid
echo = Defining Shell to FiSH...
usermod --shell /usr/bin/fish $Suid
usermod --shell /usr/bin/fish root
echo = Adding to Groups Wheel, Ruby and Docker...
usermod -aG wheel $Suid
usermod -aG ruby $Suid
usermod -aG docker $Suid
echo = Set Password for $Suid Account...
passwd $Suid
echo = Setup $Suid Quick Sudo...
# Setup DNS Client to Server
clear
echo =======================================
echo = Server Node Installation Basic Mode =
echo =======================================
mkdir -p /etc/udhcpc
echo RESOLV_CONF=no >> /etc/udhcpc/udhcpc.conf
setup-dns