80 lines
3.1 KiB
Bash
Executable File
80 lines
3.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [[ "$(whoami)" == "root" ]]; then
|
|
dialog --backtitle "Configure Stormux" \
|
|
--msgbox "This must be ran without root privileges." -1 -1 --stdout
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "$(whoami)" == "stormux" ]]; then
|
|
dialog --backtitle "Configure Stormux" \
|
|
--msgbox "Default username \"stormux\" and default password \"stormux\" is a huge security risk for a server. Please change your username and password before proceeding." -1 -1 --stdout
|
|
exit 1
|
|
fi
|
|
|
|
|
|
dialog --backtitle "Configure Stormux" \
|
|
--yesno "This will make catastrophic changes to your system. If you are not sure you want to do this, select no by pressing the letter n on your keyboard. Afterwards, you will only be able to login with an ssh key and there will be no screen reader.\nNote, configure-stormux will no longer be available." -1 -1 --stdout || exit 0
|
|
|
|
dialog --backtitle "Configure Stormux" \
|
|
--msgbox "Now let's upload your ssh key. It is a good idea to go ahead and connect via ssh now, in case something goes wrong you will have a chance to fix it manually. This will be used to login to your server, so whatever you do, don't lose it. If you have not yet created an ssh key, you can do so with the ssh-keygen command. Magic-wormhole will be used to upload the key. if you are doing this from a Windows based ssh session, you can install magic-wormhole with scoop: https://github.com/ScoopInstaller/Scoop" -1 -1 --stdout
|
|
mkdir -p ~/.ssh
|
|
if [[ -e ~/.ssh/known_hosts ]]; then
|
|
dialog --backtitle "Configure Stormux" \
|
|
--msgbox "Key found in ~/.ssh/known_hosts. If you are sure this is the correct key, press enter, otherwise press control+c to close this application and fix your key." -1 -1 --stdout
|
|
fi
|
|
if ! [[ -e ~/.ssh/authorized_keys ]]; then
|
|
dialog --backtitle "Configure Stormux" \
|
|
--msgbox "No public ssh key found. Please upload your ssh key to ~/.ssh/known_hosts before continuing.\nIf you do not have a key, you can create it with ssh-keygen.\nYou can use wormhole ssh invite or ssh-copy-id to upload the key." -1 -1 --stdout
|
|
exit 1
|
|
fi
|
|
sudo sed -i 's/^#PasswordAuthentication yes$/PasswordAuthentication no/' /etc/ssh/sshd_config
|
|
|
|
for i in \
|
|
alsa-firmware \
|
|
alsa-utils \
|
|
bluez \
|
|
bluez-utils \
|
|
brltty \
|
|
cloud-utils \
|
|
espeak-ng \
|
|
fenrir-git \
|
|
growpartfs \
|
|
go \
|
|
nodm-dgw \
|
|
pipewire \
|
|
pipewire-alsa \
|
|
pipewire-jack \
|
|
pipewire-pulse \
|
|
poppler \
|
|
python-pyudev \
|
|
python-daemonize \
|
|
python-evdev \
|
|
python-dbus \
|
|
python-pyte \
|
|
rhvoice-voice-bdl \
|
|
screen \
|
|
sox \
|
|
speech-dispatcher \
|
|
wireplumber \
|
|
xdg-user-dirs \
|
|
xdg-utils ; do
|
|
yay -Runcds --noconfirm $i
|
|
done
|
|
|
|
rm -rfv ~/.config
|
|
rm -rfv ~/Documents
|
|
rm -rfv ~/Desktop
|
|
rm -rfv ~/Downloads
|
|
rm -rfv ~/Music
|
|
rm -rfv ~/Pictures
|
|
rm -rfv ~/Public
|
|
rm -rfv ~/Templates
|
|
rm -rfv ~/Videos
|
|
sudo rm -rf /opt/configure-stormux
|
|
sudo rm -fv /local/bin/configure-stormux
|
|
|
|
dialog --backtitle "Configure Stormux" \
|
|
--msgbox "Hopefully everything went well and your server is ready to go, if not, see you on the other side of the reimage. Reboot for changes to ssh to be applied." -1 -1 --stdout
|
|
exit 0
|