diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b2b1d187d..3d18cd1f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,7 +62,7 @@ jobs: include: - runs-on: ubuntu-18.04 php-version: "7.2" - - runs-on: ubuntu-latest + - runs-on: ubuntu-20.04 php-version: "7.4" runs-on: ${{ matrix.runs-on }} @@ -146,8 +146,7 @@ jobs: fail-fast: false matrix: context: [analyzer, api_client] - release: [bionic, buster] - + release: [bionic, buster, focal] container: ghcr.io/libretime/libretime-dev:${{ matrix.release }} defaults: run: diff --git a/Vagrantfile b/Vagrantfile index 532406b3e..69da99376 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -85,6 +85,11 @@ Vagrant.configure('2') do |config| end # Define all the OS boxes we support + config.vm.define "ubuntu-focal" do |os| + os.vm.box = "bento/ubuntu-20.04" + provision_libretime(os, "debian.sh", installer_args) + end + config.vm.define 'ubuntu-bionic' do |os| os.vm.box = 'bento/ubuntu-18.04' setup_nfs(config) diff --git a/analyzer/tests/cuepoint_analyzer_test.py b/analyzer/tests/cuepoint_analyzer_test.py index 9541ee509..3851449fd 100644 --- a/analyzer/tests/cuepoint_analyzer_test.py +++ b/analyzer/tests/cuepoint_analyzer_test.py @@ -19,8 +19,8 @@ def test_analyze(filepath, length, cuein, cueout): if filepath.endswith("m4a"): return - # Silan does not work with mp3 on debian buster - if filepath.endswith("mp3") and "buster" == distro.codename(): + # Silan does not work with mp3 on debian buster or Ubuntu Focal + if filepath.endswith("mp3") and distro.codename() in ("buster", "focal"): return assert float(metadata["cuein"]) == pytest.approx(cuein, abs=0.5) diff --git a/analyzer/tests/playability_analyzer_test.py b/analyzer/tests/playability_analyzer_test.py index 7c5074e4e..b6d14d751 100644 --- a/analyzer/tests/playability_analyzer_test.py +++ b/analyzer/tests/playability_analyzer_test.py @@ -30,8 +30,8 @@ def test_analyze_invalid_filepath(): def test_analyze_invalid_wma(): - # Liquisoap does not fail with wma files on debian buster - if "buster" == distro.codename(): + # Liquisoap does not fail with wma files on debian buster or Ubuntu Focal + if distro.codename() in ("buster", "focal"): return with pytest.raises(UnplayableFileError): diff --git a/api/packages.ini b/api/packages.ini index ebfdf9585..145ce6f83 100644 --- a/api/packages.ini +++ b/api/packages.ini @@ -1,14 +1,14 @@ # This file contains a list of package dependencies. [common] -python3 = buster, bionic -python3-pip = buster, bionic -python3-venv = buster, bionic +python3 = buster, bionic, focal +python3-pip = buster, bionic, focal +python3-venv = buster, bionic, focal [django] -uwsgi = buster, bionic -uwsgi-plugin-python3 = buster, bionic +uwsgi = buster, bionic, focal +uwsgi-plugin-python3 = buster, bionic, focal [psycopg2] # See https://www.psycopg.org/docs/install.html#install-from-source -python3-dev = buster, bionic -libpq-dev = buster, bionic +python3-dev = buster, bionic, focal +libpq-dev = buster, bionic, focal diff --git a/docs/_docs/vagrant.md b/docs/_docs/vagrant.md index 72c46bcb4..0fe03d7af 100644 --- a/docs/_docs/vagrant.md +++ b/docs/_docs/vagrant.md @@ -94,6 +94,7 @@ offers the option to choose a different operation system according to you needs. | OS | Command | Comment | | ------------ | -------------------------- | ----------------------------------------------------------- | | Debian 10 | `vagrant up debian-buster` | Install on Debian Buster. | +| Ubuntu 20.04 | `vagrant up ubuntu-focal` | Install on Ubuntu Focal Fossa. | | Ubuntu 18.04 | `vagrant up ubuntu-bionic` | Install on Ubuntu Bionic Beaver. | | CentOS | `vagrant up centos` | CentOS 8 with native systemd support and activated SELinux. | diff --git a/install b/install index 049f17c46..7bd9eeba4 100755 --- a/install +++ b/install @@ -648,6 +648,7 @@ fi is_debian_dist=false is_debian_buster=false is_ubuntu_dist=false +is_ubuntu_focal=false is_ubuntu_bionic=false is_centos_dist=false # shellcheck disable=SC2034 @@ -659,6 +660,11 @@ code="${code:-$VERSION_ID}" code="${code,,}" verbose "Validating dist-code: ${dist}-${code}" case "${dist}-${code}" in + ubuntu-20.04) + code="focal" + is_ubuntu_dist=true + is_ubuntu_focal=true + ;; ubuntu-18.04) code="bionic" is_ubuntu_dist=true @@ -1075,6 +1081,7 @@ loud " * Configuring PHP in Apache * " loud "-----------------------------------------------------" # Test common locations for php conf directory php_conf_dirs=( + "/etc/php/7.4/apache2/conf.d" # Ubuntu Focal "/etc/php/7.3/apache2/conf.d" # Debian Buster "/etc/php/7.2/apache2/conf.d" # Ubuntu Bionic "/etc/php/7.0/apache2/conf.d" # Ubuntu Xenial @@ -1099,7 +1106,9 @@ else fi # Enable Apache modules -if $is_debian_buster; then +if $is_ubuntu_focal; then + loudCmd "a2enmod rewrite php7.4 proxy proxy_http" +elif $is_debian_buster; then loudCmd "a2enmod rewrite php7.3 proxy proxy_http" elif $is_ubuntu_bionic; then loudCmd "a2enmod rewrite php7.2 proxy proxy_http" @@ -1260,7 +1269,7 @@ verbose "...Done" echo -e "\n-----------------------------------------------------" echo " * Basic Setup DONE! * " echo " " -echo " To get started with Libretime, visit ${IP} " +echo " To get started with Libretime, visit ${IP} " echo " or, if you've set up your own web configuration, " -echo " the Libretime webroot on your webserver " +echo " the Libretime webroot on your webserver " echo "-----------------------------------------------------" diff --git a/legacy/packages.ini b/legacy/packages.ini index 10ccc6a9d..59b95a867 100644 --- a/legacy/packages.ini +++ b/legacy/packages.ini @@ -1,10 +1,10 @@ # This file contains a list of package dependencies. [common] -apache2 = buster, bionic +apache2 = buster, bionic, focal # The php-pear package depends on php-(cli|common|xml), be sure to # install the dependencies with the right php version. -php-pear = buster, bionic -php-amqplib = buster, bionic +php-pear = buster, bionic, focal +php-amqplib = buster, bionic, focal # Bionic [php7.2] @@ -38,3 +38,19 @@ php7.3-gd = buster php7.3-mbstring = buster php7.3-pgsql = buster php7.3-xml = buster + +# Focal +[php7.4] +libapache2-mod-php7.4 = focal +php7.4 = focal +php7.4-apcu = focal +php7.4-apcu-bc = focal +php7.4-bcmath = focal +php7.4-cli = focal +php7.4-common = focal +php7.4-curl = focal +php7.4-dev = focal +php7.4-gd = focal +php7.4-mbstring = focal +php7.4-pgsql = focal +php7.4-xml = buster, focal diff --git a/packages.ini b/packages.ini index 8ceed0c85..ad437d912 100644 --- a/packages.ini +++ b/packages.ini @@ -1,16 +1,16 @@ # This file contains a list of package dependencies. [common] -icecast2 = buster, bionic -postgresql = buster, bionic -postgresql-client = buster, bionic -rabbitmq-server = buster, bionic +icecast2 = buster, bionic, focal +postgresql = buster, bionic, focal +postgresql-client = buster, bionic, focal +rabbitmq-server = buster, bionic, focal -curl = buster, bionic +curl = buster, bionic, focal # See https://github.com/Libretime/libretime/commits/71ce3082c5e0611f77eb423a15b4b36267ebfda4/installer/lib -unzip = buster, bionic -zip = buster, bionic +unzip = buster, bionic, focal +zip = buster, bionic, focal [installer] -lsb-release = buster, bionic -xmlstarlet = buster, bionic +lsb-release = buster, bionic, focal +xmlstarlet = buster, bionic, focal diff --git a/playout/liquidsoap/main.py b/playout/liquidsoap/main.py index 0c34cbbcd..100a84034 100644 --- a/playout/liquidsoap/main.py +++ b/playout/liquidsoap/main.py @@ -27,7 +27,7 @@ def run(): generate_liquidsoap_cfg.run() """ check liquidsoap version so we can run a scripts matching the liquidsoap minor version """ liquidsoap_version = subprocess.check_output( - "liquidsoap --force-start 'print(liquidsoap.version) shutdown()'", + "liquidsoap 'print(liquidsoap.version) shutdown()'", shell=True, universal_newlines=True, )[0:3] @@ -37,9 +37,8 @@ def run(): exec_args = [ "/usr/bin/liquidsoap", "libretime-liquidsoap", - script_path, "--verbose", - "-f", + script_path, ] if args.debug: print(f"Liquidsoap {liquidsoap_version} using script: {script_path}") diff --git a/tools/packages_test.py b/tools/packages_test.py index f4d095f74..b28fed5da 100644 --- a/tools/packages_test.py +++ b/tools/packages_test.py @@ -4,29 +4,32 @@ from tools.packages import list_packages, load_packages PACKAGE_INI = """ [common] -postgresql = buster +postgresql = buster, focal # Some comment curl = buster, bionic [legacy] -apache2 = bionic +apache2 = bionic, focal [=development] -ffmpeg = buster, bionic +ffmpeg = buster, bionic, focal """ -result1 = {"curl", "postgresql"} -result2 = {"apache2", "curl", "ffmpeg"} +result_buster = {"curl", "postgresql"} +result_bionic = {"apache2", "curl", "ffmpeg"} +result_focal = {"postgresql", "apache2", "ffmpeg"} def test_load_packages(): - assert load_packages(PACKAGE_INI, "buster", False) == result1 - assert load_packages(PACKAGE_INI, "bionic", True) == result2 + assert load_packages(PACKAGE_INI, "buster", False) == result_buster + assert load_packages(PACKAGE_INI, "bionic", True) == result_bionic + assert load_packages(PACKAGE_INI, "focal", True) == result_focal def test_list_packages(tmp_path: Path): package_file = tmp_path / "packages.ini" package_file.write_text(PACKAGE_INI) - assert list_packages([tmp_path, package_file], "buster", False) == result1 - assert list_packages([tmp_path, package_file], "bionic", True) == result2 + assert list_packages([tmp_path, package_file], "buster", False) == result_buster + assert list_packages([tmp_path, package_file], "bionic", True) == result_bionic + assert list_packages([tmp_path, package_file], "focal", True) == result_focal