From 123d04ff7bc14438147e07333096af957ff6cec9 Mon Sep 17 00:00:00 2001 From: Jeremy Price Date: Thu, 30 Nov 2023 11:28:13 -0800 Subject: [PATCH] split-out ubuntu 23* versions since 2023 didn't produce and LTS ubuntu versions the Ondrej repo we use for installing arbitrary PHP versions doesn't (easily) support non-LTS versions of ubuntu, which means that 23.04 and 23.10 are problematic using the repo However, these versions ship with php8.1 and php8.2 (respectively), so we don't even need the Ondrej repo for these, so we'll remove it In general, we'll only support LTS Ubuntu repos because of this, but if they happen to ship with our preferred PHP versions and otherwise work w/o heroics, we'll include nominal support in the script --- snipeit.sh | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/snipeit.sh b/snipeit.sh index 11141361d0..659c47ac00 100755 --- a/snipeit.sh +++ b/snipeit.sh @@ -541,16 +541,52 @@ case $distro in fi ;; Ubuntu) - if [ "${version//./}" -ge "2204" ]; then + if [ "${version//./}" -ge "2304" ]; then # Install for Ubuntu 22.04 set_fqdn set_dbpass tzone=$(cat /etc/timezone) - echo "* Set up Ondrej PHP repository" - echo "# Odrej PHP repo for ability to choose non-distro PHP versions" > /etc/apt/sources.list.d/ppa_ondrej_php_$codename.list - echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu $codename main" >> /etc/apt/sources.list.d/ppa_ondrej_php_$codename.list - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C + echo -n "* Updating installed packages." + log "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y upgrade" & pid=$! + progress + + echo "* Installing Apache httpd, PHP, MariaDB and other requirements." + PACKAGES="cron mariadb-server mariadb-client apache2 libapache2-mod-php php8.2 php8.2-mcrypt php8.2-curl php8.2-mysql php8.2-gd php8.2-ldap php8.2-zip php8.2-mbstring php8.2-xml php8.2-bcmath curl git unzip" + install_packages + + echo "* Configuring Apache." + create_virtualhost + log "phpenmod mcrypt" + log "phpenmod mbstring" + log "a2enmod rewrite" + log "a2ensite $APP_NAME.conf" + rename_default_vhost + + set_hosts + + echo "* Starting MariaDB." + log "systemctl start mariadb.service" + + install_snipeit + + echo "* Restarting Apache httpd." + log "systemctl restart apache2" + + echo "* Clearing cache and setting final permissions." + chmod 777 -R $APP_PATH/storage/framework/cache/ + log "run_as_app_user php $APP_PATH/artisan cache:clear" + chmod 775 -R $APP_PATH/storage/ + elif [ "${version//./}" -eq "2204" ]; then + # Install for Ubuntu 22.04 + set_fqdn + set_dbpass + tzone=$(cat /etc/timezone) + + echo "* Set up Ondrej PHP repository" + echo "# Odrej PHP repo for ability to choose non-distro PHP versions" > /etc/apt/sources.list.d/ppa_ondrej_php_$codename.list + echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu $codename main" >> /etc/apt/sources.list.d/ppa_ondrej_php_$codename.list + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C echo -n "* Updating installed packages." log "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y upgrade" & pid=$!