Fix FLEXIAPI-206 Upgrade to Laravel 10, PHP 8.1 minimum and bump all the related dependencies

This commit is contained in:
Timothée Jaussoin 2024-11-14 16:12:57 +00:00
parent 0ec0986b9b
commit 0d6bc37207
14 changed files with 1323 additions and 1357 deletions

View file

@ -38,6 +38,14 @@ remi-rocky8-deploy:
- remi-rocky8-package
- remi-rocky8-test
remi-rocky9-deploy:
extends: .deploy
script:
- ./deploy_packages.sh rockylinux
needs:
- remi-rocky9-package
- remi-rocky9-test
.deploy:
stage: deploy
tags: ["docker"]

View file

@ -5,7 +5,7 @@ rocky8-package:
# We install this dependency only for the pipeline
- dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
- dnf -y module reset php
- dnf -y module enable php:remi-8.0
- dnf -y module enable php:remi-8.2
- dnf -y update php\*
- dnf -y install php-sodium
- make rpm-el8
@ -14,6 +14,12 @@ rocky9-package:
extends: .package
image: gitlab.linphone.org:4567/bc/public/docker/rocky9-php:$ROCKY_9_IMAGE_VERSION
script:
# We install this dependency only for the pipeline
- dnf -y install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
- dnf -y module reset php
- dnf -y module enable php:remi-8.2
- dnf -y update php\*
- dnf -y install php-sodium
- make rpm-el9
debian11-package:
@ -31,32 +37,48 @@ debian12-package:
remi-rocky8-package:
image: gitlab.linphone.org:4567/bc/public/docker/rocky8-php:$ROCKY_8_IMAGE_VERSION
extends: .remi-rocky-package
variables:
ROCKY_RELEASE: 8
before_script:
- dnf -y module reset redis
- dnf -y install @redis:6
remi-rocky9-package:
image: gitlab.linphone.org:4567/bc/public/docker/rocky9-php:$ROCKY_9_IMAGE_VERSION
extends: .remi-rocky-package
variables:
ROCKY_RELEASE: 9
before_script:
- dnf -y install redis
.remi-rocky-package:
extends: .package
script:
# Remi
- mkdir -p $CI_PROJECT_DIR/build
- dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
- dnf -y install https://rpms.remirepo.net/enterprise/remi-release-$ROCKY_RELEASE.rpm
- yum -y install wget php-devel gcc liblzf php-pear lz4-devel liblzf-devel libzstd-devel php-pecl-apcu-devel
# igbinary
- wget https://rpms.remirepo.net/SRPMS/$PHP_IGBINARY_REMI_VERSION.remi.src.rpm
- rpmbuild --rebuild $PHP_IGBINARY_REMI_VERSION.remi.src.rpm
- rm /root/rpmbuild/RPMS/*/*debug*.rpm
- mv /root/rpmbuild/RPMS/*/*devel*.rpm $CI_PROJECT_DIR/build/$PHP_IGBINARY_REMI_VERSION-devel.el8.x86_64.rpm || true # Rename to fit our naming format
- mv /root/rpmbuild/RPMS/*/*.rpm $CI_PROJECT_DIR/build/$PHP_IGBINARY_REMI_VERSION.el8.x86_64.rpm # Rename to fit our naming format
- mv /root/rpmbuild/RPMS/*/*devel*.rpm $CI_PROJECT_DIR/build/$PHP_IGBINARY_REMI_VERSION-devel.el$ROCKY_RELEASE.x86_64.rpm || true # Rename to fit our naming format
- mv /root/rpmbuild/RPMS/*/*.rpm $CI_PROJECT_DIR/build/$PHP_IGBINARY_REMI_VERSION.el$ROCKY_RELEASE.x86_64.rpm # Rename to fit our naming format
# msgpack
- wget https://rpms.remirepo.net/SRPMS/$PHP_MSGPACK_REMI_VERSION.remi.src.rpm
- rpmbuild --rebuild $PHP_MSGPACK_REMI_VERSION.remi.src.rpm
- rm /root/rpmbuild/RPMS/*/*debug*.rpm
- mv /root/rpmbuild/RPMS/*/*devel*.rpm $CI_PROJECT_DIR/build/$PHP_MSGPACK_REMI_VERSION-devel.el8.x86_64.rpm || true
- mv /root/rpmbuild/RPMS/*/*.rpm $CI_PROJECT_DIR/build/$PHP_MSGPACK_REMI_VERSION.el8.x86_64.rpm
- mv /root/rpmbuild/RPMS/*/*devel*.rpm $CI_PROJECT_DIR/build/$PHP_MSGPACK_REMI_VERSION-devel.el$ROCKY_RELEASE.x86_64.rpm || true
- mv /root/rpmbuild/RPMS/*/*.rpm $CI_PROJECT_DIR/build/$PHP_MSGPACK_REMI_VERSION.el$ROCKY_RELEASE.x86_64.rpm
# install and cleanup the dependencies
- yum -y localinstall build/*.rpm
- rm build/*.rpm
# phpredis
- wget https://rpms.remirepo.net/SRPMS/$PHP_REDIS_REMI_VERSION.remi.src.rpm
- rpmbuild --rebuild $PHP_REDIS_REMI_VERSION.remi.src.rpm
- rm /root/rpmbuild/RPMS/*/*debug*.rpm
- mv /root/rpmbuild/RPMS/*/*devel*.rpm $CI_PROJECT_DIR/build/$PHP_REDIS_REMI_VERSION-devel.el8.x86_64.rpm || true
- mv /root/rpmbuild/RPMS/*/*.rpm $CI_PROJECT_DIR/build/$PHP_REDIS_REMI_VERSION.el8.x86_64.rpm
- mv /root/rpmbuild/RPMS/*/*devel*.rpm $CI_PROJECT_DIR/build/$PHP_REDIS_REMI_VERSION-devel.el$ROCKY_RELEASE.x86_64.rpm || true
- mv /root/rpmbuild/RPMS/*/*.rpm $CI_PROJECT_DIR/build/$PHP_REDIS_REMI_VERSION.el$ROCKY_RELEASE.x86_64.rpm
- rm -r /root/rpmbuild # Cleanup

View file

@ -3,16 +3,19 @@ rocky8-test:
image: gitlab.linphone.org:4567/bc/public/docker/rocky8-php:$ROCKY_8_IMAGE_VERSION
needs:
- rocky8-package
- remi-rocky8-package
rocky9-test:
extends: .rocky-test
image: gitlab.linphone.org:4567/bc/public/docker/rocky9-php:$ROCKY_9_IMAGE_VERSION
needs:
- rocky9-package
- remi-rocky9-package
.rocky-test:
extends: .test
script:
- ls build
- yum -y localinstall build/*.rpm
- cd /opt/belledonne-communications/share/flexisip-account-manager/flexiapi
- composer install --ignore-platform-req=ext-sodium # Rocky 8 use the external library
@ -39,7 +42,10 @@ debian12-test:
- apt update
- apt install -y ./build/*.deb
- cd /opt/belledonne-communications/share/flexisip-account-manager/flexiapi
- composer install --dev
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php
- php -r "unlink('composer-setup.php');"
- php composer.phar install
- vendor/bin/phpcs
- vendor/bin/phpmd . ansi phpmd.xml
- php artisan key:generate
@ -53,6 +59,14 @@ remi-rocky8-test:
script:
- yum -y localinstall build/*.rpm
remi-rocky9-test:
extends: .test
image: gitlab.linphone.org:4567/bc/public/docker/rocky9-php:$ROCKY_9_IMAGE_VERSION
needs:
- remi-rocky9-package
script:
- yum -y localinstall build/*.rpm
mysql-latest-test:
extends: .test
image: gitlab.linphone.org:4567/bc/public/docker/debian12-php:$DEBIAN_12_IMAGE_VERSION

View file

@ -1,11 +1,11 @@
variables:
ROCKY_8_IMAGE_VERSION: 20241112_111033_update_package_and_dependencies
ROCKY_9_IMAGE_VERSION: 20241112_115442_add_php_sodium
ROCKY_8_IMAGE_VERSION: 20241113_143521_update_php_82
ROCKY_9_IMAGE_VERSION: 20241114_161138_remove_redis
DEBIAN_11_IMAGE_VERSION: 20241112_113527_update_package_and_dependencies
DEBIAN_12_IMAGE_VERSION: 20241112_113948_update_package_and_dependencies
PHP_REDIS_REMI_VERSION: php-pecl-redis5-5.3.6-1
PHP_IGBINARY_REMI_VERSION: php-pecl-igbinary-3.2.14-1
PHP_MSGPACK_REMI_VERSION: php-pecl-msgpack-2.2.0-1
PHP_REDIS_REMI_VERSION: php-pecl-redis6-6.1.0-1
PHP_IGBINARY_REMI_VERSION: php-pecl-igbinary-3.2.16-2
PHP_MSGPACK_REMI_VERSION: php-pecl-msgpack-2.2.0-3
include:
- '.gitlab-ci-files/package.yml'

View file

@ -1,5 +1,9 @@
# Flexisip Account Manager Changelog
v1.7
----
- Fix FLEXIAPI-206 Upgrade to Laravel 10, PHP 8.1 minimum and bump all the related dependencies
v1.6
----
- Fix FLEXIAPI-192 Add DotEnv configuration to allow the expiration of tokens and codes in the app

View file

@ -25,7 +25,7 @@ use Illuminate\Http\Request;
use Endroid\QrCode\Builder\Builder;
use Endroid\QrCode\Encoding\Encoding;
use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelHigh;
use Endroid\QrCode\ErrorCorrectionLevel;
use Endroid\QrCode\Writer\PngWriter;
use Illuminate\Support\Facades\Auth;
@ -46,7 +46,7 @@ class AuthTokenController extends Controller
: route('account.auth_tokens.auth.external', ['token' => $authToken->token])
)
->encoding(new Encoding('UTF-8'))
->errorCorrectionLevel(new ErrorCorrectionLevelHigh())
->errorCorrectionLevel(ErrorCorrectionLevel::High)
->size(300)
->margin(10)
->build();

View file

@ -27,6 +27,7 @@ use Illuminate\Support\Str;
use Endroid\QrCode\Builder\Builder;
use Endroid\QrCode\Encoding\Encoding;
use Endroid\QrCode\ErrorCorrectionLevel;
use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelHigh;
use Endroid\QrCode\Writer\PngWriter;
@ -66,7 +67,7 @@ class ProvisioningController extends Controller
->writer(new PngWriter())
->data($url)
->encoding(new Encoding('UTF-8'))
->errorCorrectionLevel(new ErrorCorrectionLevelHigh())
->errorCorrectionLevel(ErrorCorrectionLevel::High)
->size(300)
->margin(10)
->build();

View file

@ -69,7 +69,7 @@ class Kernel extends HttpKernel
*
* @var array
*/
protected $routeMiddleware = [
protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.admin' => \App\Http\Middleware\AuthenticateAdmin::class,
'auth.super_admin' => \App\Http\Middleware\AuthenticateSuperAdmin::class,

View file

@ -23,8 +23,6 @@ class AuthServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->registerPolicies();
//
}
}

View file

@ -8,34 +8,33 @@
],
"license": "MIT",
"require": {
"php": ">=8.0.2",
"awobaz/compoships": "^2.2",
"doctrine/dbal": "^3.6",
"endroid/qr-code": "^4.8",
"php": ">=8.1",
"awobaz/compoships": "^2.3",
"doctrine/dbal": "^3.0",
"endroid/qr-code": "^5.0",
"fakerphp/faker": "^1.23",
"laravel/framework": "^9.52",
"laravel/tinker": "^2.8",
"laravel/framework": "^10.0",
"laravel/tinker": "^2.9",
"lcobucci/jwt": "^4.3",
"namoshek/laravel-redis-sentinel": "^0.1",
"ovh/ovh": "^3.2",
"namoshek/laravel-redis-sentinel": "^0.5",
"ovh/ovh": "^3.3",
"parsedown/laravel": "^1.2",
"phpunit/phpunit": "^9.6",
"propaganistas/laravel-phone": "^5.1",
"react/socket": "^1.14",
"respect/validation": "^2.2",
"phpunit/phpunit": "^10.0",
"propaganistas/laravel-phone": "^5.3",
"react/socket": "^1.16",
"respect/validation": "^2.3",
"sabre/vobject": "^4.5",
"scyllaly/hcaptcha": "^4.4"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.9",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^6.4",
"phpmd/phpmd": "^2.13",
"nunomaduro/collision": "^7.0",
"phpmd/phpmd": "^2.15",
"squizlabs/php_codesniffer": "^3.7"
},
"config": {
"platform": {
"php": "8.0.2"
"php": "8.1"
},
"optimize-autoloader": true,
"preferred-install": "dist",
@ -59,7 +58,6 @@
"database/factories"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [

2545
flexiapi/composer.lock generated

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
@ -25,4 +20,9 @@
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
</php>
<source>
<include>
<directory suffix=".php">./app</directory>
</include>
</source>
</phpunit>

View file

@ -33,7 +33,7 @@ License: GPL
URL: http://www.linphone.org
Source0: flexisip-account-manager.tar.gz
Requires: php >= 8.0, php-gd, php-pdo, php-redis, php-mysqlnd, php-mbstring, php-sodium
Requires: php >= 8.0, php-gd, php-pdo, php-redis, php-mysqlnd, php-mbstring
%description
PHP server for Linphone and Flexisip providing module for account creation.