From ed57e13b406309d8a12640c4c87af9d18c2cc3b2 Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Thu, 19 Feb 2026 16:23:20 +0000 Subject: [PATCH] feat: set min PHP version to 8.5 + upgrade CI4 to 4.7 update all dependencies to latest --- .devcontainer/Dockerfile | 2 +- .gitlab-ci.yml | 2 +- app/Config/CURLRequest.php | 13 ++ app/Config/Cache.php | 48 ++++++- app/Config/ContentSecurityPolicy.php | 53 ++++++- app/Config/Email.php | 5 + app/Config/Encryption.php | 17 +++ app/Config/Format.php | 9 ++ app/Config/Hostnames.php | 42 ++++++ app/Config/Images.php | 2 + app/Config/Migrations.php | 15 ++ app/Config/Optimize.php | 2 + app/Config/Routing.php | 9 ++ app/Config/Session.php | 1 + app/Config/Toolbar.php | 25 ++++ app/Config/UserAgents.php | 10 ++ app/Config/View.php | 17 +++ app/Config/WorkerMode.php | 52 +++++++ app/Controllers/EpisodeCommentController.php | 8 +- app/Controllers/EpisodeController.php | 6 +- app/Controllers/PodcastController.php | 6 +- app/Libraries/RssFeed.php | 2 +- app/Models/ActorModel.php | 2 +- app/Models/CategoryModel.php | 2 +- app/Models/CreditModel.php | 2 +- app/Models/EpisodeCommentModel.php | 2 +- app/Models/EpisodeModel.php | 2 +- app/Models/LanguageModel.php | 2 +- app/Models/LikeModel.php | 2 +- app/Models/PageModel.php | 2 +- app/Models/PersonModel.php | 2 +- app/Models/PodcastModel.php | 2 +- app/Models/PostModel.php | 2 +- composer.json | 8 +- composer.lock | 55 ++++---- docker/ci/Dockerfile | 2 +- docker/production/Dockerfile | 2 +- docker/production/app/Dockerfile | 44 ------ docker/production/castopod/Dockerfile | 57 -------- .../docs/ar/getting-started/install.mdx | 6 +- .../docs/br/getting-started/install.mdx | 6 +- .../docs/ca/getting-started/install.mdx | 6 +- .../docs/da/getting-started/install.mdx | 6 +- .../docs/de/getting-started/install.mdx | 6 +- .../docs/el/getting-started/install.mdx | 6 +- .../docs/en/getting-started/install.mdx | 6 +- .../docs/es/getting-started/install.mdx | 6 +- .../docs/eu/getting-started/install.mdx | 6 +- .../docs/fa/getting-started/install.mdx | 6 +- .../docs/fr-ca/getting-started/install.mdx | 6 +- .../docs/fr/getting-started/install.mdx | 6 +- .../docs/fr2/getting-started/install.mdx | 6 +- .../docs/gd/getting-started/install.mdx | 6 +- .../docs/gl/getting-started/install.mdx | 6 +- .../docs/id/getting-started/install.mdx | 6 +- .../docs/it/getting-started/install.mdx | 6 +- .../docs/ja/getting-started/install.mdx | 6 +- .../docs/kk/getting-started/install.mdx | 6 +- .../docs/ko/getting-started/install.mdx | 6 +- .../docs/nl/getting-started/install.mdx | 6 +- .../docs/nn-no/getting-started/install.mdx | 6 +- .../docs/oc/getting-started/install.mdx | 6 +- .../docs/pl/getting-started/install.mdx | 6 +- .../docs/pt-br/getting-started/install.mdx | 6 +- .../docs/pt/getting-started/install.mdx | 6 +- .../docs/ro/getting-started/install.mdx | 6 +- .../docs/ru/getting-started/install.mdx | 6 +- .../docs/sk/getting-started/install.mdx | 6 +- .../docs/sr-latn/getting-started/install.mdx | 6 +- .../docs/sv/getting-started/install.mdx | 6 +- .../docs/uk/getting-started/install.mdx | 6 +- .../docs/zh-hans/getting-started/install.mdx | 6 +- .../docs/zh-hant/getting-started/install.mdx | 6 +- .../Controllers/VideoClipsController.php | 2 + .../Models/AnalyticsPodcastByCountryModel.php | 2 +- .../Models/AnalyticsPodcastByEpisodeModel.php | 2 +- .../Models/AnalyticsPodcastByHourModel.php | 2 +- .../Models/AnalyticsPodcastByPlayerModel.php | 2 +- .../Models/AnalyticsPodcastByRegionModel.php | 2 +- .../Models/AnalyticsPodcastByServiceModel.php | 2 +- .../AnalyticsPodcastBySubscriptionModel.php | 2 +- .../Models/AnalyticsPodcastModel.php | 2 +- .../AnalyticsUnknownUserAgentsModel.php | 2 +- .../Models/AnalyticsWebsiteByBrowserModel.php | 2 +- .../AnalyticsWebsiteByEntryPageModel.php | 2 +- .../Models/AnalyticsWebsiteByRefererModel.php | 2 +- .../Fediverse/Controllers/ActorController.php | 6 + .../Fediverse/Controllers/PostController.php | 8 +- .../Fediverse/Helpers/fediverse_helper.php | 2 +- modules/Fediverse/Models/ActivityModel.php | 2 +- modules/Fediverse/Models/ActorModel.php | 2 +- .../Fediverse/Models/BlockedDomainModel.php | 2 +- modules/Fediverse/Models/FavouriteModel.php | 2 +- modules/Fediverse/Models/FollowModel.php | 2 +- .../Fediverse/Models/NotificationModel.php | 2 +- modules/Fediverse/Models/PostModel.php | 2 +- modules/Fediverse/Models/PreviewCardModel.php | 2 +- .../Objects/OrderedCollectionObject.php | 2 +- modules/Media/Helpers/media_helper.php | 1 - modules/Media/TranscriptParser.php | 2 +- modules/MediaClipper/VideoClipper.php | 3 - modules/Platforms/Models/PlatformModel.php | 2 +- package.json | 6 +- phpstan.neon | 1 - pnpm-lock.yaml | 133 +++++++++--------- public/index.php | 2 +- rector.php | 4 +- spark | 2 +- tests/_support/Models/ExampleModel.php | 2 +- 109 files changed, 577 insertions(+), 381 deletions(-) create mode 100644 app/Config/Hostnames.php create mode 100644 app/Config/WorkerMode.php delete mode 100644 docker/production/app/Dockerfile delete mode 100644 docker/production/castopod/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index fc088395..cca42fb0 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -4,7 +4,7 @@ # ⚠️ NOT optimized for production # should be used only for development purposes #--------------------------------------------------- -FROM php:8.4-fpm +FROM php:8.5-fpm LABEL maintainer="Yassine Doghri " diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e200a4c6..32076043 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: code.castopod.org:5050/adaures/castopod:ci-php8.4 +image: code.castopod.org:5050/adaures/castopod:ci-php8.5 stages: - prepare diff --git a/app/Config/CURLRequest.php b/app/Config/CURLRequest.php index 040800df..4dbb7afa 100644 --- a/app/Config/CURLRequest.php +++ b/app/Config/CURLRequest.php @@ -8,6 +8,19 @@ use CodeIgniter\Config\BaseConfig; class CURLRequest extends BaseConfig { + /** + * -------------------------------------------------------------------------- + * CURLRequest Share Connection Options + * -------------------------------------------------------------------------- + * + * Share connection options between requests. + * + * @var list + * + * @see https://www.php.net/manual/en/curl.constants.php#constant.curl-lock-data-connect + */ + public array $shareConnectionOptions = [CURL_LOCK_DATA_CONNECT, CURL_LOCK_DATA_DNS]; + /** * -------------------------------------------------------------------------- * CURLRequest Share Options diff --git a/app/Config/Cache.php b/app/Config/Cache.php index e0b9009e..bbf812f9 100644 --- a/app/Config/Cache.php +++ b/app/Config/Cache.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Config; use CodeIgniter\Cache\CacheInterface; +use CodeIgniter\Cache\Handlers\ApcuHandler; use CodeIgniter\Cache\Handlers\DummyHandler; use CodeIgniter\Cache\Handlers\FileHandler; use CodeIgniter\Cache\Handlers\MemcachedHandler; @@ -113,14 +114,24 @@ class Cache extends BaseConfig * Your Redis server can be specified below, if you are using * the Redis or Predis drivers. * - * @var array{host?: string, password?: string|null, port?: int, timeout?: int, database?: int} + * @var array{ + * host?: string, + * password?: string|null, + * port?: int, + * timeout?: int, + * async?: bool, + * persistent?: bool, + * database?: int + * } */ public array $redis = [ - 'host' => '127.0.0.1', - 'password' => null, - 'port' => 6379, - 'timeout' => 0, - 'database' => 0, + 'host' => '127.0.0.1', + 'password' => null, + 'port' => 6379, + 'timeout' => 0, + 'async' => false, // specific to Predis and ignored by the native Redis extension + 'persistent' => false, + 'database' => 0, ]; /** @@ -134,6 +145,7 @@ class Cache extends BaseConfig * @var array> */ public array $validHandlers = [ + 'apcu' => ApcuHandler::class, 'dummy' => DummyHandler::class, 'file' => FileHandler::class, 'memcached' => MemcachedHandler::class, @@ -160,4 +172,28 @@ class Cache extends BaseConfig * @var bool|list */ public $cacheQueryString = false; + + /** + * -------------------------------------------------------------------------- + * Web Page Caching: Cache Status Codes + * -------------------------------------------------------------------------- + * + * HTTP status codes that are allowed to be cached. Only responses with + * these status codes will be cached by the PageCache filter. + * + * Default: [] - Cache all status codes (backward compatible) + * + * Recommended: [200] - Only cache successful responses + * + * You can also use status codes like: + * [200, 404, 410] - Cache successful responses and specific error codes + * [200, 201, 202, 203, 204] - All 2xx successful responses + * + * WARNING: Using [] may cache temporary error pages (404, 500, etc). + * Consider restricting to [200] for production applications to avoid + * caching errors that should be temporary. + * + * @var list + */ + public array $cacheStatusCodes = []; } diff --git a/app/Config/ContentSecurityPolicy.php b/app/Config/ContentSecurityPolicy.php index 6c08b13c..99fa0b0a 100644 --- a/app/Config/ContentSecurityPolicy.php +++ b/app/Config/ContentSecurityPolicy.php @@ -26,14 +26,24 @@ class ContentSecurityPolicy extends BaseConfig */ public ?string $reportURI = null; + /** + * Specifies a reporting endpoint to which violation reports ought to be sent. + */ + public ?string $reportTo = null; + /** * Instructs user agents to rewrite URL schemes, changing HTTP to HTTPS. This directive is for websites with large * numbers of old URLs that need to be rewritten. */ public bool $upgradeInsecureRequests = false; + // ------------------------------------------------------------------------- + // CSP DIRECTIVES SETTINGS + // NOTE: once you set a policy to 'none', it cannot be further restricted + // ------------------------------------------------------------------------- + /** - * Will default to self if not overridden + * Will default to `'self'` if not overridden * * @var list|string|null */ @@ -46,6 +56,21 @@ class ContentSecurityPolicy extends BaseConfig */ public string | array $scriptSrc = 'self'; + /** + * Specifies valid sources for JavaScript