Skip to content

Commit

Permalink
Merge pull request #25 from FherStk:ubuntu-24.04
Browse files Browse the repository at this point in the history
Ubuntu-24.04
  • Loading branch information
FherStk authored Aug 10, 2024
2 parents 79becf5 + 1f2f63f commit 0ed0e45
Show file tree
Hide file tree
Showing 75 changed files with 1,559 additions and 42 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# isard-scripts
Template generation scripts for IsardVDI
Template generation scripts for IsardVDI

## Requisites
The app can be installed within any IsardVDI's virtual machine running an Ubuntu (Server and Desktop) 22.04 LTS, but the network interfaces must be setup in the following order:
The app can be installed within any IsardVDI's virtual machine running an Ubuntu (Server and Desktop) 22.04 LTS & 24.04 LTS, but the network interfaces must be setup in the following order:
1. Default: the isolated IsardVDI network which provides internet access.
2. Personal1: this network allows connecting virtual machines to each other (must be owned by the same user).
3. WireguardVPN: this network provides access through a tunnel, in order to connect any host local to the virtual machine.
Expand All @@ -13,19 +13,20 @@ The app can be installed within any IsardVDI's virtual machine running an Ubuntu
</p>

## How to install
The app can be installed within any IsardVDI's virtual machine running an Ubuntu (Server and Desktop) 22.04 LTS:
The app can be installed within any IsardVDI's virtual machine running an Ubuntu (Server and Desktop) 22.04 LTS & 24.04 LTS:

1. Deploy the app cloning the repo: `git clone https://github.com/FherStk/isard-scripts.git`
2. Then, install the app with **sudo** (it will be installed at /etc/isard-scripts):
1. Go to the current distro's folder: `cd ubuntu-24.04`
1. Then, install the app with **sudo** (it will be installed at /etc/isard-scripts):
```
cd isard-scripts
sudo ./install.sh
history -c
```
3. Shutdown the virtual machine and create a template from it.
1. Shutdown the virtual machine and create a template from it.

## How to run
1. The script's deployemnt prompt will be displayed on first boot (won't be disabled if the promt is cancelled), so the user will be able to choose which template must be deployed (select an option with space and `accept`) or do nothinc (`cancel`). The prompt can also be forced by running `sudo ./run.sh` after the user login.
1. The script's deployemnt prompt will be displayed on first boot (won't be disabled if the promt is cancelled), so the user will be able to choose which template must be deployed (select an option with space and `accept`) or do nothing (`cancel`). The prompt can also be forced by running `sudo ./run.sh` after the user login.

<p align="center">
<img src="imgs/tutorial/deploy.png" />
Expand Down
2 changes: 1 addition & 1 deletion install.sh → ubuntu-22.04/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SCRIPT_NAME="App Install"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/utils/main.sh
source $SCRIPT_PATH/utils/core.sh

startup
apt-upgrade
Expand Down
4 changes: 2 additions & 2 deletions run.sh → ubuntu-22.04/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SCRIPT_NAME="Script Installer"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/utils/main.sh
source $SCRIPT_PATH/utils/core.sh

startup

Expand All @@ -16,7 +16,7 @@ _folder="$SCRIPT_PATH/scripts"
_options=$(find $_folder -mindepth 1 -maxdepth 1 -type f -name '*.sh' -printf "%f %TY-%Tm-%Td off\n" | sort -t '\0' -n | awk -F '\0' '{print $1}');
_options+=$(echo " NONE 1900-01-01 off")

_selected=$(dialog --title "$SCRIPT_NAME v$SCRIPT_VERSION" --radiolist "\nPick an IsardVDI script in order to install" 60 70 25 $_options --output-fd 1);
_selected=$(dialog --title "$SCRIPT_NAME v$SCRIPT_VERSION for $CORE_DISTRO" --radiolist "\nPick an IsardVDI script in order to install" 60 70 25 $_options --output-fd 1);
clear

for f in $_selected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="dbeaver-ce"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="dhcp-server"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup "static-address"
Expand Down
2 changes: 1 addition & 1 deletion scripts/dmoj-v4.sh → ubuntu-22.04/scripts/dmoj-v4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DMOJ_SITE="$DMOJ_PATH/site"
DMOJ_MEDIA="$DMOJ_PATH/media"
DMOJ_VENV="$DMOJ_PATH/dmojsite"

source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="gantt-project-v3"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="modelio-v4"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="modelio-v5"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="mysql-server-v8"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="mysql-server-v8"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="odoo-v16"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
2 changes: 1 addition & 1 deletion scripts/odoo-v16.sh → ubuntu-22.04/scripts/odoo-v16.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="odoo-v16"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="open-project-v12"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="pgadmin-v4"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="psql-server-v14"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="psql-server-v14"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
2 changes: 1 addition & 1 deletion scripts/taiga-v6.sh → ubuntu-22.04/scripts/taiga-v6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ HOST_NAME="taiga-v6"
SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
TAIGA_PATH="/etc/taiga"
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HOST_NAME="ubuntu-2204-desktop"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ HOST_NAME="ubuntu-2204-server"
SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)

source $SCRIPT_PATH/../utils/main.sh
source $SCRIPT_PATH/../utils/core.sh

startup
script-setup
Expand Down
2 changes: 1 addition & 1 deletion update.sh → ubuntu-22.04/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SCRIPT_NAME="App Update"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/utils/main.sh
source $SCRIPT_PATH/utils/core.sh

trap 'abort' 0
set -e
Expand Down
27 changes: 15 additions & 12 deletions utils/main.sh → ubuntu-22.04/utils/core.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash
#Global vars:
CORE_VERSION="1.15.0"
CORE_DISTRO="Ubuntu 22.04 LTS"
BASE_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
IS_DESKTOP=$(gnome-shell --version 2>/dev/null | grep -c "GNOME Shell")
CURRENT_BRANCH="main"
INSTALL_PATH="/etc/isard-scripts"
RUN_SCRIPT="sudo bash $INSTALL_PATH/run.sh"
RUN_SCRIPT="sudo bash $INSTALL_PATH/ubuntu-22.04/run.sh"
PROFILE="/home/$SUDO_USER/.profile"
AUTOSTART="/home/$SUDO_USER/.config/autostart"
DESKTOPFILE="$AUTOSTART/isard-scripts.desktop"
Expand Down Expand Up @@ -298,13 +300,13 @@ set-network-static()
then
#Ubuntu Desktop
_file="/etc/netplan/01-network-manager-all.yaml"
cp $BASE_PATH/main/netplan-static-desktop.yaml $_file
cp $BASE_PATH/core/netplan-static-desktop.yaml $_file
sed -i "s|x.x.x.x/yy|$1|g" $_file
chmod 0600 $_file
else
#Ubuntu Server
_file="/etc/netplan/00-network-manager-all.yaml"
cp $BASE_PATH/main/netplan-static-server.yaml $_file
cp $BASE_PATH/core/netplan-static-server.yaml $_file
sed -i "s|x.x.x.x/yy|$1|g" $_file
chmod 0600 $_file
fi
Expand All @@ -327,12 +329,12 @@ set-network-dhcp()
then
#Ubuntu Desktop
_file="/etc/netplan/01-network-manager-all.yaml"
cp $BASE_PATH/main/netplan-dhcp-desktop.yaml $_file
cp $BASE_PATH/core/netplan-dhcp-desktop.yaml $_file
chmod 0600 $_file
else
#Ubuntu Server
_file="/etc/netplan/00-network-manager-all.yaml"
cp $BASE_PATH/main/netplan-dhcp-server.yaml $_file
cp $BASE_PATH/core/netplan-dhcp-server.yaml $_file
chmod 0600 $_file
fi

Expand All @@ -348,8 +350,8 @@ set-network-names()
#Output: N/A
####################################################################################

cp $BASE_PATH/main/isard-scripts-network-setup.sh /usr/local/bin/
cp $BASE_PATH/main/isard-scripts-network-setup.service /etc/systemd/system/
cp $BASE_PATH/core/isard-scripts-network-setup.sh /usr/local/bin/
cp $BASE_PATH/core/isard-scripts-network-setup.service /etc/systemd/system/

chmod 744 /usr/local/bin/isard-scripts-network-setup.sh
chmod 664 /etc/systemd/system/isard-scripts-network-setup.service
Expand Down Expand Up @@ -591,7 +593,7 @@ auto-login-enable()

_file="/etc/systemd/system/[email protected]/override.conf"
echo "Creating the file '$_file'"
cp $BASE_PATH/main/auto-login.conf $_file
cp $BASE_PATH/core/auto-login.conf $_file
sed -i "s|<USERNAME>|$SUDO_USER|g" $_file
fi
}
Expand Down Expand Up @@ -657,7 +659,7 @@ passwords-background()

else
#Server
_source="$BASE_PATH/main/50-landscape-sysinfo"
_source="$BASE_PATH/core/50-landscape-sysinfo"
_dest="/etc/update-motd.d/50-landscape-sysinfo"
echo "Creating entry into '$_dest'..."
cp $_source $_dest
Expand Down Expand Up @@ -688,8 +690,9 @@ info()

echo ""
echo -e "${YELLOW}IsardVDI Template Generator:$NC $1 [v$2]"
echo -e "${YELLOW}Copyright © 2023:$NC Fernando Porrino Serrano"
echo -e "${YELLOW}Under the AGPL license:$NC https://github.com/FherStk/isard-scripts/blob/main/LICENSE"
echo -e "${YELLOW}Core distro:$NC ${CORE_DISTRO} [v${CORE_VERSION}]"
echo -e "${YELLOW}Copyright © 2024:$NC Fernando Porrino Serrano"
echo -e "${YELLOW}Under the AGPL license:$NC https://github.com/FherStk/isard-scripts/blob/core/LICENSE"
}

startup(){
Expand Down Expand Up @@ -755,7 +758,7 @@ script-setup(){
echo ""
title "Performing system setup:"
echo "Disabling auto-upgrades..."
cp $BASE_PATH/main/auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades
cp $BASE_PATH/core/auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades
dpkg-reconfigure -f noninteractive unattended-upgrades

setup-hostname "$HOST_NAME"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source $SCRIPT_PATH/../main.sh
source $SCRIPT_PATH/../core.sh

echo ""
title "Setting up the Odoo repository:"
Expand All @@ -19,7 +19,7 @@ dpkg -i $_file
rm -f $_file

_file="libssl1.1.deb"
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb -O $_file
wget http://security.ubuntu.com/ubuntu/pool/core/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb -O $_file
dpkg -i $_file
rm -f $_file

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source $SCRIPT_PATH/../main.sh
source $SCRIPT_PATH/../core.sh

apt-upgrade
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions ubuntu-24.04/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
SCRIPT_VERSION="1.0.0"
SCRIPT_NAME="App Install"

SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SCRIPT_FILE=$(basename $BASH_SOURCE)
source $SCRIPT_PATH/utils/core.sh

startup
apt-upgrade

echo ""
title "Installing into $INSTALL_PATH:"
rm -rf $INSTALL_PATH

get-branch
git clone https://github.com/FherStk/isard-scripts.git --branch $CURRENT_BRANCH $INSTALL_PATH

sudo-password-disable
auto-login-enable

echo ""
title "Setting up the first launch after user logon (just once):"
if [ $IS_DESKTOP -eq 1 ];
then
#Ubuntu Desktop
echo "Setting up the $DESKTOPFILE entry..."
mkdir -p $AUTOSTART
cp $BASE_PATH/install/isard-scripts.desktop $DESKTOPFILE
sed -i "s|<INSTALL_PATH>|$INSTALL_PATH|g" $DESKTOPFILE
sed -i "s|<RUN_SCRIPT>|$RUN_SCRIPT|g" $DESKTOPFILE
else
#Ubuntu Server
echo "Setting up the $PROFILE entry..."
append-no-repeat "$RUN_SCRIPT" "$PROFILE"
fi

main-password-setup
done-no-reboot

echo -e "${YELLOW}You can now proceed with additional customizations or just shutdown the computer and template it.$NC"
Loading

0 comments on commit 0ed0e45

Please sign in to comment.