A few updates to convert-to-server.
This commit is contained in:
@@ -17,35 +17,48 @@ 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
|
||||
--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 can 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
|
||||
chmod 700 ~/.ssh
|
||||
if ! [[ -s ~/.ssh/authorized_keys ]]; 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
|
||||
--msgbox "No public ssh key found. Please upload your public key to ~/.ssh/authorized_keys 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
|
||||
chmod 600 ~/.ssh/authorized_keys
|
||||
sshPort="22"
|
||||
sshPortInput="$(dialog --backtitle "Configure Stormux" \
|
||||
--inputbox "Enter a custom SSH port (1-65535) or leave blank to keep 22." -1 -1 --stdout || true)"
|
||||
if [[ -n "$sshPortInput" && "$sshPortInput" =~ ^[0-9]+$ ]]; then
|
||||
if [[ "$sshPortInput" -ge 1 && "$sshPortInput" -le 65535 ]]; then
|
||||
sshPort="$sshPortInput"
|
||||
fi
|
||||
fi
|
||||
sudo mkdir -p /etc/ssh/sshd_config.d
|
||||
sudo tee /etc/ssh/sshd_config.d/99-stormux-server.conf > /dev/null << EOF
|
||||
Port ${sshPort}
|
||||
PasswordAuthentication no
|
||||
KbdInteractiveAuthentication no
|
||||
EOF
|
||||
|
||||
for i in \
|
||||
for packageName in \
|
||||
alsa-firmware \
|
||||
alsa-utils \
|
||||
bluez \
|
||||
bluez-utils \
|
||||
brltty \
|
||||
espeak-ng \
|
||||
fenrir \
|
||||
fenrir-git \
|
||||
go \
|
||||
gstreamer \
|
||||
gst-plugins-base \
|
||||
gst-plugins-good \
|
||||
ii \
|
||||
pipewire \
|
||||
pipewire-alsa \
|
||||
pipewire-jack \
|
||||
pipewire-pulse \
|
||||
poppler \
|
||||
python-pyudev \
|
||||
python-daemonize \
|
||||
python-evdev \
|
||||
python-dbus \
|
||||
python-pyte \
|
||||
@@ -59,7 +72,7 @@ for i in \
|
||||
wireplumber \
|
||||
xdg-user-dirs \
|
||||
xdg-utils ; do
|
||||
yay -Runcds --noconfirm $i
|
||||
yay -Runcds --noconfirm "$packageName"
|
||||
done
|
||||
|
||||
rm -rfv ~/.config
|
||||
|
||||
Reference in New Issue
Block a user