Browse Source

sudo env

merge-requests/32/head
Steven Foerster 6 years ago
parent
commit
dc20f43a9d
  1. 2
      modules/mistborn-cli
  2. 16
      scripts/install.sh
  3. 2
      scripts/update.sh

2
modules/mistborn-cli

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit 00986bcb7f945c611d13099672b4fb1e2d0721f2
Subproject commit a0a1bb57ede8ea95607d99442e8d85c68068034f

16
scripts/install.sh

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
set -e
DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND=noninteractive
## ensure run as nonroot user
#if [ "$EUID" -eq 0 ]; then
@ -39,7 +39,7 @@ if [ $(whoami) != "$MISTBORN_USER" ]; then @@ -39,7 +39,7 @@ if [ $(whoami) != "$MISTBORN_USER" ]; then
sudo cp $FULLPATH /home/$MISTBORN_USER
sudo chown $MISTBORN_USER:$MISTBORN_USER /home/$MISTBORN_USER/$FILENAME
sudo SSH_CLIENT="$SSH_CLIENT" MISTBORN_DEFAULT_PASSWORD="$MISTBORN_DEFAULT_PASSWORD" GIT_BRANCH="$GIT_BRANCH" MISTBORN_INSTALL_COCKPIT="$MISTBORN_INSTALL_COCKPIT" -i -u $MISTBORN_USER bash -c "/home/$MISTBORN_USER/$FILENAME" # self-referential call
sudo -E -i -u $MISTBORN_USER bash -c "/home/$MISTBORN_USER/$FILENAME" # self-referential call
exit 0
fi
@ -99,7 +99,7 @@ git submodule update --init --recursive @@ -99,7 +99,7 @@ git submodule update --init --recursive
sudo apt-get update
# install figlet
sudo apt-get install -y figlet
sudo -E apt-get install -y figlet
# get os and distro
source ./scripts/subinstallers/platform.sh
@ -116,7 +116,7 @@ fi @@ -116,7 +116,7 @@ fi
# SSH Server
sudo apt-get install -y openssh-server
sudo -E apt-get install -y openssh-server
sudo sed -i 's/#PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
sudo sed -i 's/PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
sudo sed -i 's/#PermitRootLogin.*/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config
@ -127,13 +127,13 @@ sudo systemctl enable ssh @@ -127,13 +127,13 @@ sudo systemctl enable ssh
sudo systemctl restart ssh
# Additional tools fail2ban
sudo apt-get install -y dnsutils fail2ban
sudo -E apt-get install -y dnsutils fail2ban
# Install kernel headers
if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ]; then
sudo apt install -y linux-headers-$(uname -r)
sudo -E apt install -y linux-headers-$(uname -r)
elif [ "$DISTRO" == "raspbian" ]; then
sudo apt install -y raspberrypi-kernel-headers
sudo -E apt install -y raspberrypi-kernel-headers
fi
# Wireugard
@ -145,7 +145,7 @@ sudo systemctl enable docker @@ -145,7 +145,7 @@ sudo systemctl enable docker
sudo systemctl start docker
# Unattended upgrades
sudo apt-get install -y unattended-upgrades
sudo -E apt-get install -y unattended-upgrades
# Cockpit
if [[ "$MISTBORN_INSTALL_COCKPIT" =~ ^([yY][eE][sS]|[yY])$ ]]

2
scripts/update.sh

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
set -e
DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND=noninteractive
sudo git -C /opt/mistborn pull
sudo git -C /opt/mistborn submodule update --init --recursive

Loading…
Cancel
Save