Skip to content

Commit

Permalink
chore: merge develop into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsANameToo authored Oct 31, 2023
2 parents 697e7c9 + 018df87 commit a4aba7e
Show file tree
Hide file tree
Showing 43 changed files with 238 additions and 69 deletions.
2 changes: 1 addition & 1 deletion app/Domain/Server/Services/Providers/AWS.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public function deleteSecureShellKey(string $id): bool
*/
public function getImageId(): string
{
return 'Ubuntu 18.04 x64';
return 'Ubuntu 22.04 x64';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Server/Services/Providers/DigitalOcean.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public function deleteSecureShellKey(string $id): bool
*/
public function getImageId(): string
{
return 'ubuntu-18-04-x64';
return 'ubuntu-22-04-x64';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Server/Services/Providers/Hetzner.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public function deleteSecureShellKey(string $id): bool
*/
public function getImageId(): string
{
return 'ubuntu-18.04';
return 'ubuntu-22.04';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Server/Services/Providers/Linode.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public function deleteSecureShellKey(string $id): bool
*/
public function getImageId(): string
{
return 'linode/ubuntu18.04';
return 'linode/ubuntu22.04';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Server/Services/Providers/Vultr.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public function deleteSecureShellKey(string $id): bool
*/
public function getImageId(): string
{
return '270'; //'Ubuntu 18.04 x64';
return '270'; //'Ubuntu 22.04 x64';
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,60 @@
# Wait For Apt To Unlock

while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
echo "Waiting for other software managers to finish..."
apt_wait () {
while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
echo "Waiting for dpkg/lock to be unlocked for sudo..."

sleep 1
done
sleep 5
done

while sudo fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1 ; do
echo "Waiting: dpk for lock-frontend to be unlocked for sudo..."

sleep 5
done

while sudo fuser /var/lib/apt/lists/lock >/dev/null 2>&1 ; do
echo "Waiting for lists/lock to be unlocked for sudo..."

sleep 5
done

if [ -f /var/log/unattended-upgrades/unattended-upgrades.log ]; then
while sudo fuser /var/log/unattended-upgrades/unattended-upgrades.log >/dev/null 2>&1 ; do
echo "Waiting for unattended-upgrades to be unlocked for sudo..."

sleep 5
done
fi

while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
echo "Waiting for dpkg/lock to be unlocked for user..."
sleep 5
done

while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1 ; do
echo "Waiting for dpkg/lock-frontend to be unlocked for user..."
sleep 5
done

while fuser /var/lib/apt/lists/lock >/dev/null 2>&1 ; do
echo "Waiting for lists/lock to be unlocked for user..."
sleep 5
done

if [ -f /var/log/unattended-upgrades/unattended-upgrades.log ]; then
while fuser /var/log/unattended-upgrades/unattended-upgrades.log >/dev/null 2>&1 ; do
echo "Waiting for unattended-upgrades to be unlocked for user..."
sleep 5
done
fi
}

heading "Waiting for locks..."
apt_wait

sudo sed -i "s/#precedence ::ffff:0:0\/96 100/precedence ::ffff:0:0\/96 100/" /etc/gai.conf
if [ -f /etc/needrestart/needrestart.conf ]; then
# Ubuntu 22 has this set to (i)nteractive, but we want (a)utomatic.
sudo sed -i "s/^#\$nrconf{restart} = 'i';/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf
fi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
heading "Installing jemalloc..."

apt_wait
sudo apt-get install -y libjemalloc-dev

success "Installed jemalloc!"
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}
sudo rm -rf ~/{.npm,.forever,.node*,.cache,.nvm}

sudo wget --quiet -O - https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
(echo "deb https://deb.nodesource.com/node_14.x $(lsb_release -s -c) main" | sudo tee /etc/apt/sources.list.d/nodesource.list)
(echo -e "Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 999" | sudo tee /etc/apt/preferences.d/nodesource)
curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/nodesource.gpg >/dev/null
(echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x ${DEB_ID} main" | sudo tee /etc/apt/sources.list.d/nodesource.list)

apt_wait
sudo apt-get update
sudo apt-get install nodejs -y

apt_wait
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install nodejs -yq

success "Installed node.js & npm!"
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

sudo timedatectl set-ntp off > /dev/null 2>&1 # disable the default systemd timesyncd service

apt_wait
sudo apt-get install ntp -yyq

sudo ntpd -gq
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
heading "Installing PostgreSQL..."

apt_wait
sudo apt-get update

apt_wait
sudo apt-get install postgresql postgresql-contrib -y

success "Installed PostgreSQL!"
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
heading "Installing program dependencies..."

apt_wait
sudo apt-get install build-essential libcairo2-dev pkg-config libtool autoconf automake python libpq-dev jq zip unzip -y

{{-- We need to install jq-1.6 because it contains fixes that we need later on --}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

echo 'libssl1.1 libraries/restart-without-asking boolean true' | sudo debconf-set-selections

apt_wait
sudo apt-get update
sudo apt-get install -y curl apt-transport-https update-notifier

apt_wait
sudo apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y --force-yes curl apt-transport-https update-notifier bc wget gnupg net-tools zip make build-essential

success "Installed system dependencies!"
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
heading "Installing Yarn..."

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
(echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list)
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
(echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list)

apt_wait
sudo apt-get update
sudo apt-get install -y yarn

apt_wait
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install yarn -yq

success "Installed Yarn!"
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# Detect SystemV / SystemD
SYS=$([[ -L "/sbin/init" ]] && echo 'SystemD' || echo 'SystemV')

DEB_ID=$( (grep DISTRIB_CODENAME /etc/upstream-release/lsb-release || grep DISTRIB_CODENAME /etc/lsb-release || grep VERSION_CODENAME /etc/os-release) 2>/dev/null | cut -d'=' -f2 )

if [[ -n $DEB ]]; then
success "Running install for Debian derivate"
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
heading "Installing system updates..."

apt_wait
sudo apt-get update

apt_wait
sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -yqq

apt_wait
sudo apt-get dist-upgrade -yqq

apt_wait
sudo apt-get autoremove -yyq

apt_wait
sudo apt-get autoclean -yq

success "Installed system updates!"
Original file line number Diff line number Diff line change
@@ -1,7 +1,60 @@
# Wait For Apt To Unlock

while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
echo "Waiting for other software managers to finish..."
apt_wait () {
while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
echo "Waiting for dpkg/lock to be unlocked for sudo..."

sleep 1
done
sleep 5
done

while sudo fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1 ; do
echo "Waiting: dpk for lock-frontend to be unlocked for sudo..."

sleep 5
done

while sudo fuser /var/lib/apt/lists/lock >/dev/null 2>&1 ; do
echo "Waiting for lists/lock to be unlocked for sudo..."

sleep 5
done

if [ -f /var/log/unattended-upgrades/unattended-upgrades.log ]; then
while sudo fuser /var/log/unattended-upgrades/unattended-upgrades.log >/dev/null 2>&1 ; do
echo "Waiting for unattended-upgrades to be unlocked for sudo..."

sleep 5
done
fi

while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
echo "Waiting for dpkg/lock to be unlocked for user..."
sleep 5
done

while fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1 ; do
echo "Waiting for dpkg/lock-frontend to be unlocked for user..."
sleep 5
done

while fuser /var/lib/apt/lists/lock >/dev/null 2>&1 ; do
echo "Waiting for lists/lock to be unlocked for user..."
sleep 5
done

if [ -f /var/log/unattended-upgrades/unattended-upgrades.log ]; then
while fuser /var/log/unattended-upgrades/unattended-upgrades.log >/dev/null 2>&1 ; do
echo "Waiting for unattended-upgrades to be unlocked for user..."
sleep 5
done
fi
}

heading "Waiting for locks..."
apt_wait

sudo sed -i "s/#precedence ::ffff:0:0\/96 100/precedence ::ffff:0:0\/96 100/" /etc/gai.conf
if [ -f /etc/needrestart/needrestart.conf ]; then
# Ubuntu 22 has this set to (i)nteractive, but we want (a)utomatic.
sudo sed -i "s/^#\$nrconf{restart} = 'i';/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf
fi
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

heading "Installing Docker..."

apt_wait
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

apt_wait
sudo apt-get update

apt_wait
sudo apt-get -y install docker-ce
sudo usermod -aG docker ${USER}
sudo chmod 666 /var/run/docker.sock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

heading "Installing jemalloc..."

apt_wait
sudo apt-get install -y libjemalloc-dev

success "Installed jemalloc!"
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}
sudo rm -rf ~/{.npm,.forever,.node*,.cache,.nvm}

sudo wget --quiet -O - https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
(echo "deb https://deb.nodesource.com/node_14.x $(lsb_release -s -c) main" | sudo tee /etc/apt/sources.list.d/nodesource.list)
(echo -e "Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 999" | sudo tee /etc/apt/preferences.d/nodesource)
curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/nodesource.gpg >/dev/null
(echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x ${DEB_ID} main" | sudo tee /etc/apt/sources.list.d/nodesource.list)

apt_wait
sudo apt-get update
sudo apt-get install nodejs -y

apt_wait
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install nodejs -yq

success "Installed node.js & npm!"
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

sudo timedatectl set-ntp off > /dev/null 2>&1 # disable the default systemd timesyncd service

apt_wait
sudo apt-get install ntp -yyq

sudo ntpd -gq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

heading "Installing PostgreSQL..."

apt_wait
sudo apt-get update

apt_wait
sudo apt-get install postgresql postgresql-contrib -y

success "Installed PostgreSQL!"
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

heading "Installing program dependencies..."

apt_wait
sudo apt-get install build-essential libcairo2-dev pkg-config libtool autoconf automake python libpq-dev jq zip unzip -y

{{-- We need to install jq-1.6 because it contains fixes that we need later on --}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

echo 'libssl1.1 libraries/restart-without-asking boolean true' | sudo debconf-set-selections

apt_wait
sudo apt-get update
sudo apt-get install -y git curl apt-transport-https update-notifier

apt_wait
sudo apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y --force-yes git curl apt-transport-https update-notifier bc wget gnupg net-tools zip make build-essential

success "Installed system dependencies!"
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

heading "Installing Yarn..."

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
(echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list)
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
(echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list)

apt_wait
sudo apt-get update
sudo apt-get install -y yarn

apt_wait
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install yarn -yq

success "Installed Yarn!"
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# Detect SystemV / SystemD
SYS=$([[ -L "/sbin/init" ]] && echo 'SystemD' || echo 'SystemV')

DEB_ID=$( (grep DISTRIB_CODENAME /etc/upstream-release/lsb-release || grep DISTRIB_CODENAME /etc/lsb-release || grep VERSION_CODENAME /etc/os-release) 2>/dev/null | cut -d'=' -f2 )

if [[ -n $DEB ]]; then
success "Running install for Debian derivate"
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cat << EOF | sudo tee /etc/apt/apt.conf.d/50unattended-upgrades > /dev/null
Unattended-Upgrade::Allowed-Origins {
"Ubuntu zesty-security";
"Ubuntu jammy-security";
};
Unattended-Upgrade::Package-Blacklist {
//
Expand Down
Loading

0 comments on commit a4aba7e

Please sign in to comment.