Skip to content

Commit 5b4e0b1

Browse files
authored
Merge pull request #2570 from shlinkio/develop
Release 5.0.0
2 parents 0d83390 + 1cb93f6 commit 5b4e0b1

File tree

191 files changed

+2024
-3296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+2024
-3296
lines changed

.github/workflows/ci-db-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
runs-on: ubuntu-24.04
1414
strategy:
1515
matrix:
16-
php-version: ['8.3', '8.4', '8.5']
16+
php-version: ['8.4', '8.5']
1717
env:
1818
LC_ALL: C
1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v5
2121
- name: Install MSSQL ODBC
2222
if: ${{ inputs.platform == 'ms' }}
2323
run: sudo ./data/infra/ci/install-ms-odbc.sh
@@ -35,8 +35,8 @@ jobs:
3535
- name: Run tests
3636
run: composer test:db:${{ inputs.platform }}
3737
- name: Upload code coverage
38-
uses: actions/upload-artifact@v4
39-
if: ${{ matrix.php-version == '8.3' && inputs.platform == 'sqlite:ci' }}
38+
uses: actions/upload-artifact@v5
39+
if: ${{ matrix.php-version == '8.4' && inputs.platform == 'sqlite:ci' }}
4040
with:
4141
name: coverage-db
4242
path: |

.github/workflows/ci-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
runs-on: ubuntu-24.04
1414
strategy:
1515
matrix:
16-
php-version: ['8.3', '8.4', '8.5']
16+
php-version: ['8.4', '8.5']
1717
env:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # rr get-binary picks this env automatically
1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v5
2121
- name: Start postgres database server
2222
if: ${{ inputs.test-group == 'api' }}
2323
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_postgres
@@ -32,8 +32,8 @@ jobs:
3232
if: ${{ inputs.test-group == 'api' }}
3333
run: ./vendor/bin/rr get --no-interaction --no-config --location bin/ && chmod +x bin/rr
3434
- run: composer test:${{ inputs.test-group }}:ci
35-
- uses: actions/upload-artifact@v4
36-
if: ${{ matrix.php-version == '8.3' }}
35+
- uses: actions/upload-artifact@v5
36+
if: ${{ matrix.php-version == '8.4' }}
3737
with:
3838
name: coverage-${{ inputs.test-group }}
3939
path: |

.github/workflows/ci.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
runs-on: ubuntu-24.04
2828
strategy:
2929
matrix:
30-
php-version: ['8.3']
30+
php-version: ['8.4']
3131
command: ['cs', 'stan', 'openapi:validate']
3232
steps:
33-
- uses: actions/checkout@v4
33+
- uses: actions/checkout@v5
3434
- uses: './.github/actions/ci-setup'
3535
with:
3636
php-version: ${{ matrix.php-version }}
@@ -69,16 +69,15 @@ jobs:
6969
runs-on: ubuntu-24.04
7070
strategy:
7171
matrix:
72-
php-version: ['8.3']
72+
php-version: ['8.4']
7373
steps:
74-
- name: Checkout code
75-
uses: actions/checkout@v4
74+
- uses: actions/checkout@v5
7675
- name: Use PHP
7776
uses: './.github/actions/ci-setup'
7877
with:
7978
php-version: ${{ matrix.php-version }}
8079
extensions-cache-key: tests-extensions-${{ matrix.php-version }}
81-
- uses: actions/download-artifact@v4
80+
- uses: actions/download-artifact@v6
8281
with:
8382
path: build
8483
- run: mv build/coverage-unit/coverage-unit.cov build/coverage-unit.cov
@@ -87,9 +86,9 @@ jobs:
8786
- run: mv build/coverage-cli/coverage-cli.cov build/coverage-cli.cov
8887
- run: vendor/bin/phpcov merge build --clover build/clover.xml
8988
- name: Publish coverage
90-
uses: codecov/codecov-action@v4
89+
uses: codecov/codecov-action@v5
9190
with:
92-
file: ./build/clover.xml
91+
files: ./build/clover.xml
9392

9493
delete-artifacts:
9594
needs:

.github/workflows/publish-openapi-spec.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
runs-on: ubuntu-24.04
1111
strategy:
1212
matrix:
13-
php-version: ['8.3']
13+
php-version: ['8.4']
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616
- name: Determine version
1717
id: determine_version
1818
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

.github/workflows/publish-release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ jobs:
1010
runs-on: ubuntu-24.04
1111
strategy:
1212
matrix:
13-
php-version: ['8.3', '8.4', '8.5']
13+
php-version: ['8.4', '8.4', '8.5']
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616
- uses: './.github/actions/ci-setup'
1717
with:
1818
php-version: ${{ matrix.php-version }}
1919
extensions-cache-key: publish-swagger-spec-extensions-${{ matrix.php-version }}
2020
install-deps: 'no'
2121
- run: ./build.sh ${GITHUB_REF#refs/tags/v}
22-
- uses: actions/upload-artifact@v4
22+
- uses: actions/upload-artifact@v5
2323
with:
2424
name: dist-files-${{ matrix.php-version }}
2525
path: build
@@ -28,8 +28,8 @@ jobs:
2828
needs: ['build']
2929
runs-on: ubuntu-24.04
3030
steps:
31-
- uses: actions/checkout@v4
32-
- uses: actions/download-artifact@v4
31+
- uses: actions/checkout@v5
32+
- uses: actions/download-artifact@v6
3333
with:
3434
path: build
3535
- name: Publish release with assets

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,51 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org).
66

7+
## [5.0.0] - 2026-01-09
8+
### Added
9+
* [#2431](https://github.com/shlinkio/shlink/issues/2431) Add new date-based conditions for the dynamic rules redirections system, that allow to perform redirections based on an ISO-8601 date value.
10+
11+
* `before-date`: matches when current date and time is earlier than the defined threshold.
12+
* `after-date`: matches when current date and time is later than the defined threshold.
13+
14+
* [#2513](https://github.com/shlinkio/shlink/issues/2513) Add support for redis connections via unix socket (e.g. `REDIS_SERVERS=unix:/path/to/redis.sock`).
15+
* Visits generated in the command line can now be formatted in CSV, via `--format=csv`.
16+
17+
### Changed
18+
* [#2522](https://github.com/shlinkio/shlink/issues/2522) Shlink no longer tries to detect trusted proxies automatically, when resolving the visitor's IP address, as this is a potential security issue.
19+
20+
Instead, if you have more than 1 proxy in front of Shlink, you should provide `TRUSTED_PROXIES` env var, with either a comma-separated list of the IP addresses of your proxies, or a number indicating how many proxies are there in front of Shlink.
21+
22+
* [#2311](https://github.com/shlinkio/shlink/issues/2311) All visits-related commands now return more information, and columns are arranged slightly differently.
23+
24+
Among other things, they now always return the type of the visit, region, visited URL, redirected URL and whether the visit comes from a potential bot or not.
25+
26+
* [#2540](https://github.com/shlinkio/shlink/issues/2540) Update Symfony packages to 8.0.
27+
* [#2512](https://github.com/shlinkio/shlink/issues/2512) Make all remaining console commands invokable.
28+
29+
### Deprecated
30+
* *Nothing*
31+
32+
### Removed
33+
* [#2507](https://github.com/shlinkio/shlink/issues/2507) Drop support for PHP 8.3.
34+
* [#2514](https://github.com/shlinkio/shlink/issues/2514) Remove support to generate QR codes. This functionality is now handled by Shlink Web Client and Shlink Dashboard.
35+
* [#2517](https://github.com/shlinkio/shlink/issues/2517) Remove `REDIRECT_APPEND_EXTRA_PATH` env var. Use `REDIRECT_EXTRA_PATH_MODE=append` instead.
36+
* [#2519](https://github.com/shlinkio/shlink/issues/2519) Disabling API keys by their plain-text key is no longer supported. When calling `api-key:disable`, the first argument is now always assumed to be the name.
37+
* [#2520](https://github.com/shlinkio/shlink/issues/2520) Remove deprecated `--including-all-tags` and `--show-api-key-name` options from `short-url:list` command. Use `--tags-all` and `--show-api-key` instead.
38+
* [#2521](https://github.com/shlinkio/shlink/issues/2521) Remove deprecated `--tags` option in all commands using it. Use `--tag` multiple times instead, one per tag.
39+
* [#2543](https://github.com/shlinkio/shlink/issues/2543) Remove support for `--order-by=field,dir` option `short-url:list` command. Use `--order-by=field-dir` instead.
40+
* Remove support to provide redis database index via URI path. Use `?database=3` query instead.
41+
* [#2565](https://github.com/shlinkio/shlink/issues/2565) Remove explicit dependency in ext-json, since it's part of PHP since v8.0
42+
43+
### Fixed
44+
* [#2564](https://github.com/shlinkio/shlink/issues/2564) Fix error when trying to persist non-utf-8 title without being able to determine its original charset for parsing.
45+
46+
Now, when resolving a website's charset, two improvements have been introduced:
47+
48+
1. If the `Content-Type` header does not define the charset, we fall back to `<meta charset>` or `<meta http-equiv="Content-Type">`.
49+
2. If it's still not possible to determine the charset, we ignore the auto-resolved title, to avoid other encoding errors further down the line.
50+
51+
752
## [4.6.0] - 2025-11-01
853
### Added
954
* [#2327](https://github.com/shlinkio/shlink/issues/2327) Allow filtering short URL lists by those not including certain tags.
@@ -29,6 +74,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
2974
This is done via the `domain` query parameter in API endpoints, and via the `--domain` option in console commands.
3075

3176
* [#2472](https://github.com/shlinkio/shlink/issues/2472) Add support for PHP 8.5
77+
* [#2291](https://github.com/shlinkio/shlink/issues/2291) Add `api-key:delete` console command to delete API keys.
3278

3379
### Changed
3480
* [#2424](https://github.com/shlinkio/shlink/issues/2424) Make simple console commands invokable.

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ WORKDIR /etc/shlink
1515

1616
# Install required PHP extensions
1717
RUN \
18-
# Temp install dev dependencies needed to compile the extensions
19-
# FIXME Deprecated image-related extensions. They can be removed with QR-code support
20-
apk add --no-cache --virtual .dev-deps sqlite-dev postgresql-dev icu-dev libzip-dev zlib-dev libpng-dev linux-headers && \
21-
docker-php-ext-install -j"$(nproc)" pdo_mysql pdo_pgsql intl calendar sockets bcmath zip gd && \
18+
# Temp install dev dependencies needed to compile the extensions \
19+
apk add --no-cache --virtual .dev-deps sqlite-dev postgresql-dev icu-dev libzip-dev zlib-dev linux-headers && \
20+
docker-php-ext-install -j"$(nproc)" pdo_mysql pdo_pgsql intl calendar sockets bcmath zip && \
2221
apk add --no-cache sqlite-libs && \
2322
docker-php-ext-install -j"$(nproc)" pdo_sqlite && \
24-
# Remove temp dev extensions, and install prod equivalents that are required at runtime
23+
# Remove temp dev extensions, and install prod equivalents that are required at runtime \
2524
apk del .dev-deps && \
2625
apk add --no-cache postgresql icu libzip libpng
2726

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ The idea is that you can just generate a container using the image and provide t
3636

3737
First, make sure the host where you are going to run shlink fulfills these requirements:
3838

39-
* PHP 8.3 or 8.4
39+
* PHP 8.4 or 8.5
4040
* The next PHP extensions: json, curl, pdo, intl, gd and gmp/bcmath.
4141
* apcu extension is recommended if you don't plan to use RoadRunner.
42-
* xml extension is required if you want to generate QR codes in svg format.
4342
* sockets and bcmath extensions are required if you want to integrate with a RabbitMQ instance.
4443
* MySQL, MariaDB, PostgreSQL, MicrosoftSQL or SQLite.
4544
* You will also need the corresponding pdo variation for the database you are planning to use: `pdo_mysql`, `pdo_pgsql`, `pdo_sqlsrv` or `pdo_sqlite`.

UPGRADE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Upgrading
22

3+
## From v4.x to v5.x
4+
5+
### General
6+
7+
* Generating QR codes by appending `/qr-code` to a short URL is no longer possible. Use external services to generate QR codes from a short URL, or the logic embedded in Shlink Web Client and Shlink Dashboard.
8+
* Shlink no longer tries to detect trusted proxies automatically, when resolving the visitor's IP address.
9+
Instead, if you have more than 1 proxy in front of Shlink, you should provide `TRUSTED_PROXIES` env var, with either a comma-separated list of the IP addresses of your proxies, or a number indicating how many proxies are there in front of Shlink.
10+
* PHP 8.3 is no longer supported. Only 8.4 and 8.5 are officially supported as of Shlink 5.0.0.
11+
12+
### Changes in CLI
13+
14+
* Disabling API keys by their plain-text key is no longer supported. When calling `api-key:disable`, the first argument is now always assumed to be the name.
15+
* All visits-related commands (`short-url:visits`, `tag:visits`, `domain:visits`, `visit:orphan` and `visit:non-orphan`) now return more information, and columns are arranged slightly differently.
16+
* The `short-url:list` command no longer accepts `--including-all-tags` and `--show-api-key-name` options. Use `--tags-all` and `--show-api-key` instead.
17+
* The `short-url:list` command no longer allows ordering using the `--order-by=field,dir` format. Use `--order-by=field-dir` instead.
18+
* All commands which used to accept the `--tags` flag, no longer accept it. Pass `--tag` multiple times instead, one per tag.
19+
20+
### Changes in env vars
21+
22+
* The `REDIRECT_APPEND_EXTRA_PATH` env var is no longer supported. Use `REDIRECT_EXTRA_PATH_MODE=append` to enable the same behavior.
23+
324
## From v3.x to v4.x
425

526
### General

composer.json

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@
1212
}
1313
],
1414
"require": {
15-
"php": "^8.3",
15+
"php": "^8.4",
1616
"ext-curl": "*",
17-
"ext-gd": "*",
18-
"ext-json": "*",
1917
"ext-mbstring": "*",
2018
"ext-pdo": "*",
2119
"akrabat/ip-address-middleware": "^2.6",
2220
"cakephp/chronos": "^3.1",
23-
"doctrine/dbal": "^4.3",
21+
"doctrine/dbal": "^4.4",
2422
"doctrine/migrations": "^3.9",
25-
"doctrine/orm": "^3.5",
26-
"donatj/phpuseragentparser": "^1.10",
27-
"endroid/qr-code": "^6.0.5",
23+
"doctrine/orm": "^3.6",
24+
"donatj/phpuseragentparser": "^1.11",
2825
"friendsofphp/proxy-manager-lts": "^1.0",
2926
"geoip2/geoip2": "^3.1",
3027
"guzzlehttp/guzzle": "^7.9",
@@ -35,6 +32,7 @@
3532
"laminas/laminas-inputfilter": "^2.31",
3633
"laminas/laminas-servicemanager": "^3.23",
3734
"laminas/laminas-stdlib": "^3.20",
35+
"league/csv": "^9.28",
3836
"matomo/matomo-php-tracker": "^3.3",
3937
"mezzio/mezzio": "^3.20",
4038
"mezzio/mezzio-fastroute": "^3.12",
@@ -43,22 +41,22 @@
4341
"pagerfanta/core": "^3.8",
4442
"ramsey/uuid": "^4.7",
4543
"shlinkio/doctrine-specification": "^2.2",
46-
"shlinkio/shlink-common": "^7.2",
47-
"shlinkio/shlink-config": "^4.0",
48-
"shlinkio/shlink-event-dispatcher": "^4.3",
49-
"shlinkio/shlink-importer": "^5.6",
50-
"shlinkio/shlink-installer": "^9.7",
51-
"shlinkio/shlink-ip-geolocation": "^4.4",
52-
"shlinkio/shlink-json": "^1.2",
44+
"shlinkio/shlink-common": "dev-main#d4ae052 as 8.0.0",
45+
"shlinkio/shlink-config": "dev-main#fb186e4 as 4.1.0",
46+
"shlinkio/shlink-event-dispatcher": "dev-main#54d4701 as 4.4.0",
47+
"shlinkio/shlink-importer": "dev-main#63753cf as 5.7.0",
48+
"shlinkio/shlink-installer": "dev-develop#a225b16 as 10.0.0",
49+
"shlinkio/shlink-ip-geolocation": "dev-main#e0c45b2 as 5.0.0",
50+
"shlinkio/shlink-json": "^1.3",
5351
"spiral/roadrunner": "^2025.1",
5452
"spiral/roadrunner-cli": "^2.7",
55-
"spiral/roadrunner-http": "^3.5",
56-
"spiral/roadrunner-jobs": "^4.6",
57-
"symfony/console": "^7.3",
58-
"symfony/filesystem": "^7.3",
59-
"symfony/lock": "^7.3.2",
60-
"symfony/process": "^7.3",
61-
"symfony/string": "^7.3"
53+
"spiral/roadrunner-http": "^3.6",
54+
"spiral/roadrunner-jobs": "^4.7",
55+
"symfony/console": "^8.0",
56+
"symfony/filesystem": "^8.0",
57+
"symfony/lock": "^8.0",
58+
"symfony/process": "^8.0",
59+
"symfony/string": "^8.0"
6260
},
6361
"require-dev": {
6462
"devizzent/cebe-php-openapi": "^1.1.2",
@@ -70,10 +68,9 @@
7068
"phpunit/php-code-coverage": "^12.0",
7169
"phpunit/phpcov": "^11.0",
7270
"phpunit/phpunit": "^12.0.10",
73-
"roave/security-advisories": "dev-master",
7471
"shlinkio/php-coding-standard": "~2.5.0",
75-
"shlinkio/shlink-test-utils": "^4.3.1",
76-
"symfony/var-dumper": "^7.3",
72+
"shlinkio/shlink-test-utils": "^4.4",
73+
"symfony/var-dumper": "^8.0",
7774
"veewee/composer-run-parallel": "^1.4"
7875
},
7976
"conflict": {
@@ -147,12 +144,12 @@
147144
"test:cli:ci": [
148145
"@putenv GENERATE_COVERAGE=yes",
149146
"@test:cli",
150-
"vendor/bin/phpcov merge build/coverage-cli --php build/coverage-cli.cov && rm build/coverage-cli/*.cov"
147+
"@php -d memory_limit=-1 vendor/bin/phpcov merge build/coverage-cli --php build/coverage-cli.cov && rm build/coverage-cli/*.cov"
151148
],
152149
"test:cli:pretty": [
153150
"@putenv GENERATE_COVERAGE=yes",
154151
"@test:cli",
155-
"phpcov merge build/coverage-cli --html build/coverage-cli/coverage-html && rm build/coverage-cli/*.cov"
152+
"@php -d memory_limit=-1 phpcov merge build/coverage-cli --html build/coverage-cli/coverage-html && rm build/coverage-cli/*.cov"
156153
],
157154
"openapi:validate": "php-openapi validate docs/swagger/swagger.json",
158155
"openapi:inline": "php-openapi inline docs/swagger/swagger.json docs/swagger/openapi-inlined.json",

0 commit comments

Comments
 (0)