Compare commits

...

1651 Commits

Author SHA1 Message Date
Alejandro Celaya
c8acb5de68 Merge pull request #1549 from shlinkio/develop
Release 3.3.0
2022-09-18 19:36:55 +02:00
Alejandro Celaya
53b9e3ddc1 Merge pull request #1548 from acelaya-forks/feature/deferred-geolite-download
Feature/deferred geolite download
2022-09-18 19:35:00 +02:00
Alejandro Celaya
68e1c61e7f Removed unnecessary ADR entry 2022-09-18 19:28:14 +02:00
Alejandro Celaya
8605b35b57 Removed unneeded injected dependency 2022-09-18 19:22:57 +02:00
Alejandro Celaya
36680e82aa Reduced duplication in LocateVisitsCommand by reusing VisitToLocationHelper 2022-09-18 19:21:59 +02:00
Alejandro Celaya
83b7d5a5f1 Extracted logic to geolocate a visit, handling possible domain errors 2022-09-18 18:44:01 +02:00
Alejandro Celaya
fe41e9d573 Updated changelog 2022-09-18 17:12:21 +02:00
Alejandro Celaya
d76e6647d2 Added real version for composer dependencies 2022-09-18 17:10:11 +02:00
Alejandro Celaya
6f17f70137 Allowed to delay GeoLite2 db download on docker images 2022-09-18 17:00:03 +02:00
Alejandro Celaya
ef01754ad5 Added event dispatching to UpdateGeoLiteDb dispatcher so that it locates visits when file has just been created 2022-09-18 11:17:17 +02:00
Alejandro Celaya
eab9347522 Created enum to determine what was the result of updating a geolite DB 2022-09-18 10:31:14 +02:00
Alejandro Celaya
59bcd62717 Moved Geolocation services to its own namespace inside CLI module 2022-09-18 10:01:22 +02:00
Alejandro Celaya
3f01fad12f Ensured empty initial PAI keys are discarded 2022-09-18 09:29:38 +02:00
Alejandro Celaya
c7f0d14c1b Merge pull request #1546 from acelaya-forks/feature/immutable-options
Feature/immutable options
2022-09-17 16:02:36 +02:00
Alejandro Celaya
2408829627 Updated changelog 2022-09-17 15:55:54 +02:00
Alejandro Celaya
8d244c8d34 Migrated UrlShortenerOptions to immutable object 2022-09-17 15:54:43 +02:00
Alejandro Celaya
42af057316 Migrated RedirectOptions to immutable object 2022-09-17 15:36:40 +02:00
Alejandro Celaya
8f68078835 Migrated RabbitMqOptions to immutable object 2022-09-17 13:56:59 +02:00
Alejandro Celaya
0c34032fd3 Migrated QrCodeOptions to immutable object 2022-09-17 13:45:09 +02:00
Alejandro Celaya
20f457a3e9 Migrated NotFoundRedirectOptions to immutable object 2022-09-17 13:32:40 +02:00
Alejandro Celaya
39693ca1fe Added --thread=max to infection command 2022-09-17 13:19:17 +02:00
Alejandro Celaya
784908420e Migrated DeleteShortUrlsOptions to immutable object 2022-09-17 13:04:49 +02:00
Alejandro Celaya
9685929824 Migrated AppOptions to immutable object 2022-09-17 13:01:28 +02:00
Alejandro Celaya
fe4b2c4ae4 Migrated TrackingOptions to immutable object 2022-09-17 12:57:04 +02:00
Alejandro Celaya
5f87bb13f8 Fixed tracking config 2022-09-17 11:27:56 +02:00
Alejandro Celaya
a87f6c6709 Merge pull request #1541 from acelaya-forks/feature/initial-api-key
Feature/initial api key
2022-09-11 13:23:44 +02:00
Alejandro Celaya
da3ee6b65e Updated installer with support for API key generation 2022-09-11 13:14:36 +02:00
Alejandro Celaya
c5eda37bda Updated changelog 2022-09-11 12:36:47 +02:00
Alejandro Celaya
1966367caf Fixed ApiKeyRepository for MS and Postgres 2022-09-11 12:33:28 +02:00
Alejandro Celaya
eed7b6e565 Added db test for ApiKeyRepository 2022-09-11 12:18:04 +02:00
Alejandro Celaya
0e54ed691d Created InitialApiKeyDelegatorTest 2022-09-11 12:11:39 +02:00
Alejandro Celaya
997289da02 Changed all public setUp methods in tests to be protected 2022-09-11 12:02:49 +02:00
Alejandro Celaya
c841e57db5 Reduced duplication in ApiKeyRepository 2022-09-11 11:59:49 +02:00
Alejandro Celaya
f5138385be Created new env var to programatically provide an initial API key 2022-09-11 10:45:03 +02:00
Alejandro Celaya
63ceba199d Removed mention to improvement on mutation tests in changelog 2022-09-11 09:03:25 +02:00
Alejandro Celaya
e6ee4ceae2 Simplified mapping of TagInfo objects 2022-09-08 20:50:11 +02:00
Alejandro Celaya
19a9d815eb Merge pull request #1538 from acelaya-forks/feature/doctrine-cli
Feature/doctrine cli
2022-09-08 17:42:38 +02:00
Alejandro Celaya
5b78b363f0 Updated changelog 2022-09-08 14:11:01 +02:00
Alejandro Celaya
b078c00492 Migrated to custom doctrine cli entry point, as the built-in is deprecated 2022-09-08 14:10:09 +02:00
Alejandro Celaya
e712efd008 Simplified exception 2022-09-06 21:56:18 +02:00
Alejandro Celaya
ab27c0ce53 Merge pull request #1532 from acelaya-forks/feature/trailing-slash-support
Feature/trailing slash support
2022-09-05 21:21:09 +02:00
Alejandro Celaya
d97cabbe79 Updated changelog 2022-09-05 21:14:53 +02:00
Alejandro Celaya
c3c7ffad25 Updated to installer supporting trailing slash option 2022-09-05 21:12:05 +02:00
Alejandro Celaya
fe4329d730 Allowed trailing slashes support to be enabled for the short URLs route 2022-09-05 20:59:16 +02:00
Alejandro Celaya
c53ba7b119 Exported defaults for env vars in docker only when the runtime is RoadRunner 2022-09-03 17:02:57 +02:00
Alejandro Celaya
025eec6c70 Merge remote-tracking branch 'upstream/develop' into develop 2022-08-28 10:20:26 +02:00
Alejandro Celaya
40e1670314 Fixed default port in docker entry point 2022-08-28 10:18:02 +02:00
Alejandro Celaya
2bca260627 What're RoadRunner docker images is not tried to build for arm/v7 2022-08-27 21:49:20 +02:00
Alejandro Celaya
463d8e8950 Updated changelog 2022-08-27 19:51:59 +02:00
Alejandro Celaya
e2eed8a728 Merge pull request #1523 from acelaya-forks/feature/roadrunner-support
Feature/roadrunner support
2022-08-27 19:48:48 +02:00
Alejandro Celaya
f97effcfe0 Fixed rr E2E tests 2022-08-27 19:40:52 +02:00
Alejandro Celaya
2cf21ab3bd Fixed openswoole E2E tests 2022-08-27 19:38:05 +02:00
Alejandro Celaya
7daa602630 Removed accidental flag in build script 2022-08-27 17:51:14 +02:00
Alejandro Celaya
7b637d6a61 Ensured RoadRunner deps are removed when building openswoole dist file 2022-08-27 17:48:59 +02:00
Alejandro Celaya
a4f979be08 Enabled support for static files from public dir via RoadRunner 2022-08-27 17:27:54 +02:00
Alejandro Celaya
8852739111 Ensured some dynamic RR config for prod env, based on env vars 2022-08-27 17:17:37 +02:00
Alejandro Celaya
2099ea16ec Added stage to build docker images for roadrunner 2022-08-27 13:14:27 +02:00
Alejandro Celaya
a739eb6d60 Added support to build the docker image with RoadRunner instead of openswoole 2022-08-27 13:01:38 +02:00
Alejandro Celaya
529ddacafe Removed usage of bash again from tests in CI, as it does nothing really 2022-08-27 09:54:15 +02:00
Alejandro Celaya
f71c95b74a Another attempt to make API tests script sh compatible 2022-08-27 09:49:32 +02:00
Alejandro Celaya
8260a0843b Undone changes for sh on API tests 2022-08-27 09:43:20 +02:00
Alejandro Celaya
bfbeb7b1fb Improved run-api-tests.sh script to make it compatible with sh 2022-08-27 09:36:37 +02:00
Alejandro Celaya
df70810aa6 Ensured tests are run in bash in CI 2022-08-27 09:23:45 +02:00
Alejandro Celaya
aca5804f98 Fixed usage of inputs instead of matrix on CI workflow 2022-08-27 09:21:17 +02:00
Alejandro Celaya
b7f7288a4b Fixed reference to unknown job in CI workflow 2022-08-27 09:19:55 +02:00
Alejandro Celaya
d54a2bde0f Fixed reference to unknown job in CI workflow 2022-08-27 09:18:46 +02:00
Alejandro Celaya
679bb8d357 Added API tests over roadrunner on CI 2022-08-27 09:15:58 +02:00
Alejandro Celaya
ca515998e4 Added support to run API tests on roadrunner 2022-08-27 09:09:14 +02:00
Alejandro Celaya
c5b6d203f5 Simplified RoadRunner worker, and fixed RoadRunner reloading config 2022-08-27 08:01:57 +02:00
Alejandro Celaya
86159c5d86 Updated to latest event dispatcher lib 2022-08-26 19:17:10 +02:00
Alejandro Celaya
846802c003 Slight improvements on RoadRunner config 2022-08-26 17:58:25 +02:00
Alejandro Celaya
e9ec32b3c3 Added support to dispatch async event listeners as RoadRunner jobs 2022-08-26 14:59:27 +02:00
Alejandro Celaya
4882bec118 Added roadrunner to the project 2022-08-21 13:19:27 +02:00
Alejandro Celaya
89ff259be0 Merge pull request #1517 from acelaya-forks/feature/reusable-docker-build
Moved to docker build on reusable workflow
2022-08-19 15:18:20 +02:00
Alejandro Celaya
60ece7fbf7 Moved to docker build on reusable workflow 2022-08-19 15:11:46 +02:00
Alejandro Celaya
0c110f574a Merge pull request #1516 from acelaya-forks/feature/reduce-ci-artifact-download
Ensured every mutation test job only downloads the specific coverage …
2022-08-17 19:27:52 +02:00
Alejandro Celaya
dbca5b2a7e Ensured every mutation test job only downloads the specific coverage report 2022-08-17 19:16:33 +02:00
Alejandro Celaya
3088298e6b Merge pull request #1515 from acelaya-forks/feature/reusable-docker-build
Migrated docker build to a reusable workflow
2022-08-14 18:35:59 +02:00
Alejandro Celaya
a9c6a12182 Migrated docker build to a reusable workflow 2022-08-14 17:36:58 +02:00
Alejandro Celaya
fa5b512629 Merge pull request #1514 from acelaya-forks/feature/ghcr-support
Feature/ghcr support
2022-08-14 17:12:56 +02:00
Alejandro Celaya
5c2061a6e6 Updated changelog 2022-08-14 17:07:07 +02:00
Alejandro Celaya
cf0fc956c9 Added publishing of the docker image in GHCR 2022-08-14 17:05:13 +02:00
Alejandro Celaya
a0517dfbeb Merge pull request #1512 from acelaya-forks/feature/api-v3
Feature/api v3
2022-08-14 14:07:32 +02:00
Alejandro Celaya
39c71638e6 Updated changelog 2022-08-14 14:02:09 +02:00
Alejandro Celaya
672b728379 Updated swagger docs, with new API v3 error types 2022-08-14 13:55:43 +02:00
Alejandro Celaya
750a546faf Disabled mutation tests filtering until it properly works 2022-08-14 13:18:29 +02:00
Alejandro Celaya
a41835573b Centralized prefix for problem detail types 2022-08-14 13:12:10 +02:00
Alejandro Celaya
2650cb89b5 Created BackwardsCompatibleProblemDetailsExceptionTest 2022-08-14 12:39:05 +02:00
Alejandro Celaya
4a122e0209 Added remaining API tests covering error type convertions 2022-08-14 10:51:12 +02:00
Alejandro Celaya
ce4bf62d75 Added more granular resolution of arguments for infection based on branch 2022-08-14 10:34:27 +02:00
Alejandro Celaya
40bbcb3250 Added some API tests for v3 API errors 2022-08-13 17:49:00 +02:00
Alejandro Celaya
905f51fbd0 Added logic to properly map all existing errors from v3 to v2 in the API 2022-08-13 17:15:04 +02:00
Alejandro Celaya
cd4fe4362b Created middleware to keep backwards compatibility on errors when using v1 and 2 of the API 2022-08-13 16:50:19 +02:00
Alejandro Celaya
ed7be6eb99 Updated changelog 2022-08-13 12:37:15 +02:00
Alejandro Celaya
555007ab16 Merge pull request #1511 from acelaya-forks/feature/only-changed-mutants
Ensured only mutants for changed lines are executed in CI mutation tests
2022-08-13 12:34:52 +02:00
Alejandro Celaya
bd31b99324 Ensured only mutants for changed lines are executed in CI mutation tests 2022-08-13 12:31:12 +02:00
Alejandro Celaya
60237c3c0b Merge pull request #1509 from acelaya-forks/feature/local-composed-action
Extracted all steps for setting up to a reusable action
2022-08-13 12:02:28 +02:00
Alejandro Celaya
eb21833d94 Used ci-setup composite action as much as possible in ci workflow 2022-08-13 11:56:46 +02:00
Alejandro Celaya
763002ae14 Fixed typo when reading etxnesions input on ci-setup action 2022-08-13 11:18:50 +02:00
Alejandro Celaya
ae2dc39a78 Fixed ci-setup local composite action 2022-08-13 11:16:33 +02:00
Alejandro Celaya
fe4ced2709 Moved checkout step back to workflow 2022-08-13 11:06:41 +02:00
Alejandro Celaya
9075d68b7c Fixed reference to local composed action 2022-08-13 11:03:40 +02:00
Alejandro Celaya
759c0ea957 Extracted all steps for setting up to a reusable action 2022-08-13 10:53:24 +02:00
Alejandro Celaya
67b393d4a3 Merge pull request #1508 from acelaya-forks/feature/improve-cache-key-ci
Improved cache keys for extensions in CI workflow to support several …
2022-08-13 10:27:13 +02:00
Alejandro Celaya
de71821759 Updated to latest actions/checkout version 2022-08-13 10:19:38 +02:00
Alejandro Celaya
0c2bcaee34 Fixed typo 2022-08-13 10:12:52 +02:00
Alejandro Celaya
1613975e0e Improved cache keys for extensions in CI workflow to support several PHP versions when needed 2022-08-13 10:11:41 +02:00
Alejandro Celaya
be82204df2 Merge pull request #1507 from acelaya-forks/feature/improve-ci-uploads
Feature/improve ci uploads
2022-08-12 20:52:50 +02:00
Alejandro Celaya
14c2ff5545 Ensured unique cache key 2022-08-12 20:35:59 +02:00
Alejandro Celaya
d7d0e11f2c Added cache for PHP extensions in CI pipeline 2022-08-12 20:32:16 +02:00
Alejandro Celaya
6654f45cb8 Updated upload/download artifact actions 2022-08-12 18:19:12 +02:00
Alejandro Celaya
23f92179ad Optimized how and when code coverage reports are generated for different types of tests 2022-08-12 18:10:45 +02:00
Alejandro Celaya
7377917642 Merge pull request #1506 from acelaya-forks/feature/local-reusable-workflows
Extracted definition of unit tests job to local reusable workflow
2022-08-12 09:52:01 +02:00
Alejandro Celaya
0f796859f2 Fixed typo in ci workflow 2022-08-12 09:32:30 +02:00
Alejandro Celaya
6383230678 Extracted DB tests and mutation tests to reusable workflows 2022-08-12 09:30:52 +02:00
Alejandro Celaya
51536f8746 Moved reusable ci tests workflow to workflows folder 2022-08-12 09:13:04 +02:00
Alejandro Celaya
e3b6c061c4 Extracted definition of unit tests job to local reusable workflow 2022-08-12 08:35:10 +02:00
Alejandro Celaya
4bd3fa74d1 Merge pull request #1502 from acelaya-forks/feature/cli-tests
Feature/cli tests
2022-08-10 17:39:27 +02:00
Alejandro Celaya
71553988d5 Added cli mutation tests to pipeline, and referenced CLI tests in CONTRIBUTING file 2022-08-10 17:21:55 +02:00
Alejandro Celaya
761b24e614 Added CLI tests to to CI pipeline 2022-08-10 17:13:21 +02:00
Alejandro Celaya
10974902b5 Updated changelog 2022-08-10 17:09:54 +02:00
Alejandro Celaya
474407dbc2 Ensured proper coverage is generated during CLI tests 2022-08-10 17:08:42 +02:00
Alejandro Celaya
95d84f354d Simplified tests config 2022-08-09 19:48:43 +02:00
Alejandro Celaya
db47a9a253 Added mutation tests for CLI E2E tests 2022-08-09 19:15:49 +02:00
Alejandro Celaya
709a4639b3 Fixed merge conflicts 2022-08-09 18:59:55 +02:00
Alejandro Celaya
28b9cd02ef Merge pull request #1501 from shlinkio/develop
Release 3.2.1
2022-08-08 19:51:00 +02:00
Alejandro Celaya
af9ea13933 Merge pull request #1500 from acelaya-forks/feature/fix-env-var-loading
Feature/fix env var loading
2022-08-08 19:46:53 +02:00
Alejandro Celaya
bd2cd18916 Tagged stable releases for all shlink teps 2022-08-08 19:33:59 +02:00
Alejandro Celaya
23138dc0b4 Updated changelog 2022-08-08 19:24:51 +02:00
Alejandro Celaya
a2f9742cfc Fix loading of config options as env vars 2022-08-08 19:23:16 +02:00
Alejandro Celaya
6378e614b0 Merge pull request #1498 from acelaya-forks/feature/update-shlink-deps
Feature/update shlink deps
2022-08-07 10:04:23 +02:00
Alejandro Celaya
b116a57aa7 Updated changelog 2022-08-07 09:37:49 +02:00
Alejandro Celaya
a03f32f521 Updated to latest shlink dependencies 2022-08-07 09:36:51 +02:00
Alejandro Celaya
b9180be685 Merge pull request #1496 from acelaya-forks/feature/centralize-multi-segment
Feature/centralize multi segment
2022-08-06 09:54:09 +02:00
Alejandro Celaya
334aee64ad Updated changelog 2022-08-06 09:37:15 +02:00
Alejandro Celaya
16bd368a58 Centralized how routes are configured to support multi-segment slugs 2022-08-06 09:30:13 +02:00
Alejandro Celaya
3266a0f85c Merge pull request #1494 from shlinkio/develop
Release 3.2.0
2022-08-05 19:04:45 +02:00
Alejandro Celaya
4629f1b03f Merge pull request #1493 from acelaya-forks/feature/update-deps
Updated to latest PHP version and native dependencies
2022-08-05 16:44:29 +02:00
Alejandro Celaya
fbd0c6cbea Merge pull request #1491 from acelaya-forks/feature/multi-segment-slugs
Feature/multi segment slugs
2022-08-05 16:31:38 +02:00
Alejandro Celaya
8260051c30 Updated to latest PHP version and native dependencies 2022-08-05 16:31:15 +02:00
Alejandro Celaya
c061c9c3ff Added v3.2.0 to changelog 2022-08-05 16:19:40 +02:00
Alejandro Celaya
8961191b2e Documented ADR for multi-segment slugs 2022-08-05 16:18:53 +02:00
Alejandro Celaya
fc0d99be41 Ensure filtering of custom-slug is different depending on the multi-sement lugsfeature flag 2022-08-05 08:38:05 +02:00
Alejandro Celaya
6834e72c4a Updated changelog 2022-08-04 17:15:35 +02:00
Alejandro Celaya
efe655f880 Enhanced ExtraPathRedirectMiddleware so that it supports multi-segment slugs 2022-08-04 17:03:08 +02:00
Alejandro Celaya
3d5ddce621 Ensured multi-segment feature flag affects how append_extra_path is checked 2022-08-04 16:10:54 +02:00
Alejandro Celaya
a3de3e15cb Updated installer with support for multi-segment slugs flag 2022-08-04 13:00:09 +02:00
Alejandro Celaya
619999d4f8 Added feature flag to enable/disable multi-segment support 2022-08-04 11:49:33 +02:00
Alejandro Celaya
7acf27dd38 Replaced usage of deprecated methods in DateRange class 2022-08-04 11:27:33 +02:00
Alejandro Celaya
ba517eeeb5 Moved routes config together, and ensure they are loaded last 2022-08-04 11:14:26 +02:00
Alejandro Celaya
fdd3e24967 Added support for multi-segment slugs 2022-08-03 19:32:59 +02:00
Alejandro Celaya
a570ce202a Updated to latest common 2022-08-03 12:59:09 +02:00
Alejandro Celaya
0a220bbc7a Allowed slashes on custom slugs during short URL creation 2022-08-01 17:32:54 +02:00
Alejandro Celaya
e0e511f56d Some improvements and comments in preparation of multi-segment slugs 2022-08-01 17:32:54 +02:00
Alejandro Celaya
d375dece0e Updated required deps 2022-08-01 17:32:54 +02:00
Alejandro Celaya
f801f265ed Added comments on places to change 2022-08-01 17:32:54 +02:00
Alejandro Celaya
1b4fc89b07 Merge pull request #1490 from acelaya-forks/feature/ci-composer-cache
Added cache for composer dependencies during CI
2022-08-01 17:32:07 +02:00
Alejandro Celaya
3ac2b77bf0 Removed composer cache due to a bug in github runner making it fail 2022-08-01 17:23:51 +02:00
Alejandro Celaya
b2ca4ad66b Migrated all workflows to ubuntu-22.04 2022-08-01 17:13:34 +02:00
Alejandro Celaya
25a7c7bc7f Added cache for composer dependencies during CI 2022-08-01 16:56:25 +02:00
Alejandro Celaya
6b009a4de4 Merge pull request #1489 from acelaya-forks/feature/command-error
Feature/command error
2022-08-01 12:25:05 +02:00
Alejandro Celaya
0b80a86e88 Updated changelog 2022-08-01 12:07:50 +02:00
Alejandro Celaya
b03f24d59a Ensured no arguments are passed form locate visits command to download geolite command, is it does not expect any 2022-08-01 12:06:38 +02:00
Alejandro Celaya
78ea13d366 Merge pull request #1488 from acelaya-forks/feature/redis-pub-sub
Feature/redis pub sub
2022-07-28 11:04:19 +02:00
Alejandro Celaya
8c2bdfba1c Refactored match to ifs with eary returns 2022-07-28 10:51:48 +02:00
Alejandro Celaya
3289968a93 Updated changelog 2022-07-28 10:46:24 +02:00
Alejandro Celaya
73ae754aa7 Created NotifyVisitToRedisTest 2022-07-28 10:36:52 +02:00
Alejandro Celaya
20a6e7e210 Created NotifyNewShortUrlToRedisTest 2022-07-28 10:33:26 +02:00
Alejandro Celaya
4cf433a994 Defined enum with supported remote systems 2022-07-28 10:25:55 +02:00
Alejandro Celaya
e36c4d397c Moved duplicated code in visit listeners to an abstract class 2022-07-27 18:18:36 +02:00
Alejandro Celaya
26037327f9 Moved duplicated code in short URL listeners to an abstract class 2022-07-27 18:06:47 +02:00
Alejandro Celaya
da6aa1d697 Integrated PublishUpdatesGenerator in NotifyVisitToRabbitMq listener 2022-07-27 17:41:48 +02:00
Alejandro Celaya
dada6aa3d1 Integrated PublishUpdatesGenerator in NotifyVisitToRedis listener 2022-07-27 16:55:19 +02:00
Alejandro Celaya
fa5ebb1677 Integrated PublishUpdatesGenerator in NotifyNewShortUrlToRedis listener 2022-07-27 16:47:21 +02:00
Alejandro Celaya
f071df325d Fixed NotifyNewShortUrlToRabbitMqTest 2022-07-27 10:26:18 +02:00
Alejandro Celaya
3c042c4011 Integrated PublishUpdatesGenerator in NotifyNewShortUrlToRabbitMq listener 2022-07-27 10:18:28 +02:00
Alejandro Celaya
7e8109caa3 Renamed MercureUpdatesGenerator to PublishingUpdatesGenerator to make it general purpose 2022-07-27 09:38:47 +02:00
Alejandro Celaya
d3add6d8e4 Added TODO 2022-07-26 12:18:58 +02:00
Alejandro Celaya
1b089749c0 Migrated mercure event listeners to use new publishing helper from shlink-common 2022-07-26 12:17:37 +02:00
Alejandro Celaya
791d6b7e57 Updated to latest common, with unified publishing API 2022-07-26 12:07:27 +02:00
Alejandro Celaya
233bb603cf Updated local redis config 2022-07-26 10:25:16 +02:00
Alejandro Celaya
db8a816524 Implemented redis pub/sub listeners 2022-07-26 10:17:50 +02:00
Alejandro Celaya
eff50ca202 Created new event listeners to send events to redis pub/sub 2022-07-25 18:23:13 +02:00
Alejandro Celaya
ceabb5ab2c Merge pull request #1486 from acelaya-forks/feature/backwards-compatible-rabbit-mq
Feature/backwards compatible rabbit mq
2022-07-25 12:55:28 +02:00
Alejandro Celaya
122c2fd5e6 Updated changelog 2022-07-25 12:34:40 +02:00
Alejandro Celaya
cd27a72982 Reduced duplicated code in NotifyNewShortUrlToRabbitMqTest 2022-07-25 12:31:32 +02:00
Alejandro Celaya
19b0f0d7dc Extended NotifyVisitToRabbitMqTest covering legacy and non-legacy use-cases 2022-07-25 12:30:28 +02:00
Alejandro Celaya
6ce2049935 Added support for legacy and new publishing of visits in RabbitMQ 2022-07-25 12:08:22 +02:00
Alejandro Celaya
53b937be63 Updated coding standard 2022-07-25 09:49:14 +02:00
Alejandro Celaya
71c8f99dab Merge pull request #1484 from acelaya-forks/feature/short-url-created-event
Feature/short url created event
2022-07-25 09:48:44 +02:00
Alejandro Celaya
9eb3fca726 Updated changelog 2022-07-25 09:32:09 +02:00
Alejandro Celaya
019bd4dec8 Created NotifyNewShortUrlToMercureTest 2022-07-25 09:30:25 +02:00
Alejandro Celaya
be1ce06c00 Updated asyn API spec 2022-07-25 09:04:15 +02:00
Alejandro Celaya
074bfe3db2 Updated MercureUpdatesGeneratorTest 2022-07-25 09:02:05 +02:00
Alejandro Celaya
34e72b42dc Implemented listener to publish new short URL events in Mercure 2022-07-24 19:00:48 +02:00
Alejandro Celaya
97d24d76d8 Fixed new short URL event payload to RabbitMQ, and started to add logic for Mercure 2022-07-24 12:37:57 +02:00
Alejandro Celaya
4d1af867a4 Extracted real-time update topic names to an enum 2022-07-24 12:06:00 +02:00
Alejandro Celaya
fc6b4c12b2 Configured publishing of new short URL events in RabbitMQ 2022-07-24 11:07:20 +02:00
Alejandro Celaya
405c6de591 Created NotifyNewShortUrlToRabbitMq test 2022-07-24 10:53:42 +02:00
Alejandro Celaya
47bfa5fcc0 Simplified NotifyNewShortUrlToRabbitMq 2022-07-24 10:18:19 +02:00
Alejandro Celaya
67d91d5fc5 Migrated rabbit integration to RabbitMqPublishingHelper from shlink-common 2022-07-24 10:12:26 +02:00
Alejandro Celaya
f832c56adb Moved Mercure and RabbitMq event listeners to their own subnamespaces 2022-07-21 20:07:28 +02:00
Alejandro Celaya
1aa9ae680e Merge pull request #1479 from acelaya-forks/feature/unknown-visits
Added missing implements JsonSerializable on VisitLocation that got l…
2022-07-18 20:43:02 +02:00
Alejandro Celaya
c4b30db82d Added missing implements JsonSerializable on VisitLocation that got lost when VisitLocationInterface was removed 2022-07-18 20:23:27 +02:00
Alejandro Celaya
abd9f3c6be Removed style checks disabling due to bug on php code sniffer 2022-07-04 17:12:38 +02:00
Alejandro Celaya
3de3594282 Merge pull request #1465 from jsoref/spelling
Spelling
2022-06-08 07:31:25 +02:00
Alejandro Celaya
ed5816d464 Fixed merge conflicts 2022-06-04 11:43:02 +02:00
Alejandro Celaya
3d43bdbb49 Merge pull request #1462 from acelaya-forks/feature/search-with-all-tags
Fixed error when filtering short URLs by ALL tags and search term
2022-06-04 11:37:14 +02:00
Alejandro Celaya
1ab492ce5b Added missing test case 2022-06-04 11:22:10 +02:00
Alejandro Celaya
de30c6ad79 Fixed error when filtering short URLs by ALL tags and search term 2022-06-04 11:20:08 +02:00
Alejandro Celaya
f5a48ff98d Merge pull request #1460 from acelaya-forks/feature/monolog3
Feature/monolog3
2022-06-04 09:11:31 +02:00
Alejandro Celaya
8493ee5b83 Updated changelog 2022-06-04 09:00:00 +02:00
Alejandro Celaya
52a6d55e5d Updated to monolog 3 2022-06-04 08:59:17 +02:00
Josh Soref
7142295aa5 spelling: urls
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-30 23:36:42 -04:00
Josh Soref
8b65be26a6 spelling: the
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-30 23:36:42 -04:00
Josh Soref
60f5deb494 spelling: received
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-30 23:36:42 -04:00
Josh Soref
0fc09e6dd3 spelling: monolog
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-30 23:36:42 -04:00
Josh Soref
0c4ccf4e3e spelling: middleware
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-30 23:36:42 -04:00
Josh Soref
a0e79bf446 spelling: microsoft
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-30 23:36:42 -04:00
Josh Soref
aa356ad7c7 spelling: github
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-30 23:36:42 -04:00
Josh Soref
9e0e384d46 spelling: campaign
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-30 22:39:08 -04:00
Alejandro Celaya
a20b99e643 Merge pull request #1451 from acelaya-forks/feature/missing-visits-commands
Feature/missing visits commands
2022-05-24 18:44:56 +02:00
Alejandro Celaya
fe4237b2b1 Updated changelog 2022-05-24 18:00:17 +02:00
Alejandro Celaya
4146835f6f Created GetOrhanVisitsCommand test 2022-05-24 17:59:06 +02:00
Alejandro Celaya
5201ea4516 Created tests for short-url-visits commands 2022-05-24 17:54:44 +02:00
Alejandro Celaya
fba7b36245 Improved GetShortUrlVisitsCommand test 2022-05-24 17:44:12 +02:00
Alejandro Celaya
353ac0fc0c Added logic to resolve extra columns on visits commands 2022-05-23 21:19:59 +02:00
Alejandro Celaya
00002b1e24 Renamed some visits commands 2022-05-23 20:47:37 +02:00
Alejandro Celaya
aa32830671 Added note to readme 2022-05-23 07:55:33 +02:00
Alejandro Celaya
12b8100d89 Created visits commands for orphan, non-orphan and domain 2022-05-22 19:34:08 +02:00
Alejandro Celaya
72e56d271d Created tags visits command, with abstract class wrapping common logic for visits lists commands 2022-05-22 19:22:29 +02:00
Alejandro Celaya
2b69f5eff4 Merge pull request #1449 from acelaya-forks/feature/title-html-entities
Feature/title html entities
2022-05-22 10:12:54 +02:00
Alejandro Celaya
f224bb98c4 Updated changelog 2022-05-22 08:30:46 +02:00
Alejandro Celaya
ec17eb3fbc Ensured html entities are parsed when auto-resolving titles 2022-05-22 08:29:26 +02:00
Alejandro Celaya
358b600713 Fixed merge conflicts 2022-05-09 08:21:19 +02:00
Alejandro Celaya
aacb5c39ba Merge pull request #1445 from acelaya-forks/feature/update-openswoole
Updated to openswoole 4.11.1 in docker images
2022-05-09 08:17:01 +02:00
Alejandro Celaya
9ae8804095 Updated to openswoole 4.11.1 in docker images 2022-05-09 08:00:54 +02:00
Alejandro Celaya
2d51bd895d Merge pull request #1440 from acelaya-forks/feature/url-validation-memory-issue
Feature/url validation memory issue
2022-05-01 12:14:52 +02:00
Alejandro Celaya
18f656fed2 Changed logic when resolving the title of a URL, to ensure only html content is tried to be downloaded, and only until the title tag has been parsed 2022-05-01 11:48:20 +02:00
Alejandro Celaya
eea76999b2 Ensured URL validation is doe via HEAD method when the title does not need to be resolved 2022-05-01 09:51:15 +02:00
Alejandro Celaya
bd495adf22 Set SemVer versions for some shlink package versions 2022-05-01 08:40:20 +02:00
Alejandro Celaya
e8c7bee924 Added SemVer constraints for some deps which were left with specific commits by mistake 2022-04-23 19:30:33 +02:00
Alejandro Celaya
24b06c24dc Merge pull request #1434 from acelaya-forks/feature/drop-php-8.0
Feature/drop php 8.0
2022-04-23 19:26:02 +02:00
Alejandro Celaya
6fdd764a35 Updated to phpcov 8.2.1 2022-04-23 19:11:23 +02:00
Alejandro Celaya
2400d1f265 Removed unused method 2022-04-23 19:07:36 +02:00
Alejandro Celaya
cdef430b0b Set ShortUrlIdentifier constructor to private 2022-04-23 19:01:02 +02:00
Alejandro Celaya
6074e4ae2c Updated changelog 2022-04-23 18:57:39 +02:00
Alejandro Celaya
6ada704bc3 Moved TagsMode to its own enum 2022-04-23 18:56:27 +02:00
Alejandro Celaya
e8f7daac6f Converted Role constants to enum 2022-04-23 18:41:16 +02:00
Alejandro Celaya
404455928e Converted visit types into enum 2022-04-23 18:19:16 +02:00
Alejandro Celaya
bca3e62ced Updated to readonly public props on as many models as possible 2022-04-23 14:00:47 +02:00
Alejandro Celaya
e79391907a Added some PHP 8.1 features 2022-04-23 13:08:21 +02:00
Alejandro Celaya
54a23cc7fa Converted EnvVars to enum 2022-04-23 12:44:17 +02:00
Alejandro Celaya
e8ebe77923 Dropped PHP 8.0 support 2022-04-23 12:08:01 +02:00
Alejandro Celaya
68e0aa1ea9 Merge pull request #1433 from shlinkio/develop
Release 3.1.0
2022-04-23 11:39:27 +02:00
Alejandro Celaya
ceaf64c9b3 Fixed typo in changelog 2022-04-23 11:35:55 +02:00
Alejandro Celaya
e015b1bec5 Improved changelog 2022-04-23 11:34:40 +02:00
Alejandro Celaya
ca9726c997 Merge pull request #1432 from acelaya-forks/feature/domain-visits
Feature/domain visits
2022-04-23 11:33:04 +02:00
Alejandro Celaya
85c79abd30 Updated changelog 2022-04-23 11:19:14 +02:00
Alejandro Celaya
54c1c7ad84 Created DomainVisits API test 2022-04-23 11:17:32 +02:00
Alejandro Celaya
af15e31b42 Created DomainVisitsActionTest 2022-04-23 11:07:10 +02:00
Alejandro Celaya
99b4f9f4dd Improved VisitsStatsHelperTest covering visitsForDomain method 2022-04-23 11:02:51 +02:00
Alejandro Celaya
9a0e5ea626 Created method to check if domain exists based on authority and API key 2022-04-23 10:58:33 +02:00
Alejandro Celaya
984205e02c Extended VisitRepositoryTest with domain visits functions 2022-04-23 10:45:42 +02:00
Alejandro Celaya
e11bf6ac67 Created endpoint to get visits for one specific domain 2022-04-23 10:32:07 +02:00
Alejandro Celaya
e029d91544 Documented new domain visits endpoint 2022-04-23 09:27:52 +02:00
Alejandro Celaya
011856cbfa Removed redundant var 2022-04-23 09:15:01 +02:00
Alejandro Celaya
9ce8164013 Merge pull request #1431 from acelaya-forks/feature/update-deps
Updated docker images and dependencies
2022-04-23 09:13:47 +02:00
Alejandro Celaya
dca6b7bbf5 Updated docker images and dependencies 2022-04-23 08:56:25 +02:00
Alejandro Celaya
2511ec3395 Merge pull request #1424 from acelaya-forks/feature/skip-invalid-imports
Added errorhandling for individual imported URLs, so that one failing…
2022-04-23 08:35:21 +02:00
Alejandro Celaya
9f6ffc7186 Added errorhandling for individual imported URLs, so that one failing doe snot make the whole process fail 2022-04-18 14:45:37 +02:00
Alejandro Celaya
622f0217fa Merge pull request #1421 from acelaya-forks/feature/cast-incoming-dates
Feature/cast incoming dates
2022-04-15 20:20:26 +02:00
Alejandro Celaya
09eba49bab Updated changelog 2022-04-15 20:06:51 +02:00
Alejandro Celaya
c20c3801a8 Ensured all input dates are changed to the default timezone before being used on any inner layer 2022-04-15 19:57:27 +02:00
Alejandro Celaya
f8208b7288 Merge pull request #1420 from acelaya-forks/feature/timezone
Feature/timezone
2022-04-15 09:27:17 +02:00
Alejandro Celaya
3db8a65ddb Fixed test 2022-04-14 16:00:15 +02:00
Alejandro Celaya
0495b6f298 Updated changelog 2022-04-14 14:24:01 +02:00
Alejandro Celaya
52c55f385d Added support to set the timezone via config/env vars 2022-04-14 14:22:48 +02:00
Alejandro Celaya
fe28d6fba0 Merge pull request #1417 from acelaya-forks/feature/kutt-import
Updated importer with support for Kutt.it
2022-04-14 12:51:56 +02:00
Alejandro Celaya
0294e49d4a Added dist local config for app options 2022-04-14 11:35:12 +02:00
Alejandro Celaya
cbaf51d3ef Updated importer with support for Kutt.it 2022-04-14 11:31:50 +02:00
Alejandro Celaya
efb604a381 Merge pull request #1415 from acelaya-forks/feature/yourls-domain
Feature/yourls domain
2022-04-13 12:54:12 +02:00
Alejandro Celaya
da87f05126 Updated changelog 2022-04-13 12:41:09 +02:00
Alejandro Celaya
21534b78cb Updated to latest shlink-importer, with support to import on a specific domain for YOURLS 2022-04-13 12:40:21 +02:00
Alejandro Celaya
ab65593f7d Merge pull request #1414 from acelaya-forks/feature/postgres-db-error
Feature/postgres db error
2022-04-12 19:27:35 +02:00
Alejandro Celaya
3a82691503 Small improvements on CreateDatabaseCommand 2022-04-10 19:48:32 +02:00
Alejandro Celaya
430e2ff0b5 Ensured db and api tests can be run without the need of creating the database beforehand 2022-04-09 17:46:13 +02:00
Alejandro Celaya
7d572e7988 Merge pull request #1404 from acelaya-forks/feature/fix-double-paths
Feature/fix double paths
2022-03-14 19:56:58 +01:00
Alejandro Celaya
1449e24b66 Improved some tests 2022-03-14 19:41:33 +01:00
Alejandro Celaya
6a671760da Updated changelog 2022-03-14 19:28:55 +01:00
Alejandro Celaya
613bdd82b0 Ensured base path is not prefixed more than it should 2022-03-14 19:26:02 +01:00
Alejandro Celaya
01bae358f9 Merge pull request #1399 from shlinkio/feature/improve-db-create
Feature/improve db create
2022-03-05 11:03:39 +01:00
Alejandro Celaya
3a8e560dc5 Increased required mutation score for unit tests to 85% 2022-03-05 10:51:48 +01:00
Alejandro Celaya
a0c538d9ee Updated changelog 2022-03-05 10:48:02 +01:00
Alejandro Celaya
07c30f86e9 Excluded migrations table when checking if the database schema exists 2022-03-05 10:41:13 +01:00
Alejandro Celaya
c22e38f9a0 Removed deprecated method call 2022-03-05 10:32:05 +01:00
Alejandro Celaya
4d082a87a1 Added preliminary config to export coverage for CLI tests 2022-02-27 08:11:33 +01:00
Alejandro Celaya
1b6512fc8d Replaced deprecated transactional function with wrapTransaction 2022-02-27 08:10:18 +01:00
Alejandro Celaya
7502e8a1e4 Merge pull request #1386 from acelaya-forks/feature/mercure-error
Feature/mercure error
2022-02-20 15:58:49 +01:00
Alejandro Celaya
5a25211371 Created NotConfiguredMercureErrorHandlerTest 2022-02-20 10:50:21 +01:00
Alejandro Celaya
6983f9b2bf Added middleware that mitigates big error traces being logged for those not using mercure 2022-02-20 10:36:54 +01:00
Alejandro Celaya
5affe64b61 Removed references in CONTRIBUTING.md file to no longer existing assets 2022-02-19 19:55:36 +01:00
Alejandro Celaya
c52f3c396b Fixed merge conflicts 2022-02-19 19:47:34 +01:00
Alejandro Celaya
e1ebbaa52f Merge pull request #1384 from acelaya-forks/feature/default-domain-role
Feature/default domain role
2022-02-19 19:42:12 +01:00
Alejandro Celaya
7abe6af5ec Updated changelog 2022-02-19 19:24:43 +01:00
Alejandro Celaya
c98ea6055b Ensured API keys cannot be generated with domain-only roles linked to default domain 2022-02-19 19:23:36 +01:00
Alejandro Celaya
3e3d255edf Merge pull request #1383 from acelaya-forks/feature/fixes
Updated docker images to PHP 8.1.3
2022-02-19 19:11:30 +01:00
Alejandro Celaya
816d4851e7 Updated docker images to PHP 8.1.3 2022-02-19 18:57:36 +01:00
Alejandro Celaya
9e32886f60 Created first CLI E2E tests 2022-02-13 12:20:02 +01:00
Alejandro Celaya
79af315b9f Fixed merge conflicts 2022-02-10 21:48:21 +01:00
Alejandro Celaya
4110c702c0 Merge pull request #1376 from acelaya-forks/feature/release-3.0.2
Feature/release 3.0.2
2022-02-10 21:44:30 +01:00
Roy-Orbison
57eb29c3c8 Optimise RewriteRules/Conds
From upstream changes on Mezzio Skeleton.

Closes #1369.
2022-02-10 21:31:45 +01:00
Alejandro Celaya
5267c4eee6 Updated changelog 2022-02-10 21:31:30 +01:00
Alejandro Celaya
1453ebe8ca Updated to shlink-installer 7.0.1 2022-02-10 21:29:28 +01:00
Alejandro Celaya
3b5cea5768 Updated changelog 2022-02-07 18:49:22 +01:00
Roy-Orbison
a89f67348d Optimise RewriteRules/Conds
From upstream changes on Mezzio Skeleton.

Closes #1369.
2022-02-07 18:45:27 +01:00
Alejandro Celaya
af1ae0399c Fixed merge conflicts 2022-02-04 18:03:29 +01:00
Alejandro Celaya
5bf84144e7 Tagged v3.0.1 in changelog 2022-02-04 17:53:29 +01:00
Alejandro Celaya
d9adff5749 Merge pull request #1368 from acelaya-forks/feature/stable-pdo-sqlsrv
Updated to stable pdo_sqlsrv in docker images
2022-02-03 22:17:07 +01:00
Alejandro Celaya
a1cd8baf3e Updated to stable pdo_sqlsrv in docker images 2022-02-03 22:03:20 +01:00
Alejandro Celaya
87cadce0ac Merge pull request #1366 from acelaya-forks/feature/fix-autoresolve-titles
Feature/fix autoresolve titles
2022-02-01 20:00:49 +01:00
Alejandro Celaya
f22f50afa2 Updated changelog 2022-02-01 19:46:36 +01:00
Alejandro Celaya
d0fa6f7e03 Added missing test covering URL validation with valid URL but title resolutio is disabled 2022-02-01 19:44:14 +01:00
Alejandro Celaya
d29c58dce5 Unified test:unit:pretty command 2022-02-01 19:25:18 +01:00
Alejandro Celaya
9ea8f3b590 Fixed URL validation still being true by default 2022-02-01 19:12:53 +01:00
Alejandro Celaya
ffffc68144 Updated readme 2022-02-01 07:36:44 +01:00
Alejandro Celaya
086de9f2a0 Merge pull request #1362 from acelaya-forks/feature/deprecate-webhooks
Deprecated webhooks
2022-01-31 12:41:44 +01:00
Alejandro Celaya
1b731aa4a3 Deprecated webhooks 2022-01-31 12:30:29 +01:00
Alejandro Celaya
12913f6b90 Merge pull request #1360 from acelaya-forks/feature/hide-db-commands
Marked database commands as hidden
2022-01-30 13:04:10 +01:00
Alejandro Celaya
1d4186392c Marked database commands as hidden 2022-01-30 12:15:53 +01:00
Alejandro Celaya
48d3ab0cb4 Changed file name used for inlined OAS 2022-01-30 09:37:57 +01:00
Alejandro Celaya
a9d04729eb Merge pull request #1351 from shlinkio/develop
Release 3.0.0
2022-01-28 16:31:55 +01:00
Alejandro Celaya
7adf2292bd Merge pull request #1353 from acelaya-forks/feature/profiling
Feature/profiling
2022-01-28 16:12:27 +01:00
Alejandro Celaya
c8f55f9c05 Added release date for Shlink 3.0.0 2022-01-28 16:00:40 +01:00
Alejandro Celaya
93de62f81d Fixed typo in UPGRADE.md 2022-01-28 13:06:56 +01:00
Alejandro Celaya
9766231d41 Added v3.0.0 to changelog 2022-01-27 20:59:05 +01:00
Alejandro Celaya
9df80e5bec Added explicit versions for shlink dependencies 2022-01-27 20:56:52 +01:00
Alejandro Celaya
81b00e4302 Merge branch 'develop' into feature/profiling 2022-01-27 20:20:15 +01:00
Alejandro Celaya
25ac7c31c4 Minor doc improvements 2022-01-25 20:39:31 +01:00
Alejandro Celaya
11c6c9a2b8 Removed unneeded lines 2022-01-23 18:17:39 +01:00
Alejandro Celaya
066268765a Fixed merge conflicts 2022-01-23 18:17:13 +01:00
Alejandro Celaya
356b33ced0 Merge pull request #1350 from acelaya-forks/feature/fix-memory-leak
Updated to shlink-common 4.4, which no longer uses doctrine/cache
2022-01-23 18:14:00 +01:00
Alejandro Celaya
77088d55f9 Updated to shlink-common 4.4, which no longer uses doctrine/cache 2022-01-23 17:54:49 +01:00
Alejandro Celaya
8d965655a8 Merge pull request #1348 from acelaya-forks/feature/drop-swoole-support
Feature/drop swoole support
2022-01-23 11:52:19 +01:00
Alejandro Celaya
3ace4952e6 Changed swoole with openswoole in issue templates 2022-01-23 11:37:46 +01:00
Alejandro Celaya
299f9f3a10 Documented support on swoole being dropped 2022-01-23 11:36:05 +01:00
Alejandro Celaya
0e6790cdab Replaced references to regular swoole by openswoole 2022-01-23 11:29:53 +01:00
Alejandro Celaya
1f90af3aec Merge pull request #1345 from acelaya-forks/feature/extended-tags-ordering
Feature/extended tags ordering
2022-01-23 11:08:02 +01:00
Alejandro Celaya
cdb18a5baf Documented performance issue when sorting by visits or short URLs count 2022-01-23 10:48:38 +01:00
Alejandro Celaya
8adb6596fb Refactored TagInfo to wrap the raw tag name instead of a Tag entity 2022-01-23 09:37:02 +01:00
Alejandro Celaya
dd6bcd68cc Removed not-needed extra line 2022-01-22 20:36:50 +01:00
Alejandro Celaya
1c9ce0ede0 Fixed default/fallback tags with stats ordering 2022-01-21 22:22:55 +01:00
Alejandro Celaya
6b409b06cc Simplified TagRepository test for tags info list, making it more predictable 2022-01-21 22:04:53 +01:00
Alejandro Celaya
361e864415 Added fallback ordering to tags list 2022-01-21 20:12:16 +01:00
Alejandro Celaya
d5606114cd Documented new ordering fields supported on tags list 2022-01-21 20:02:52 +01:00
Alejandro Celaya
afca66d655 Added tests covering tags info with counted ordering and limit 2022-01-21 19:58:56 +01:00
Alejandro Celaya
33a6c9fda7 Added support to order tags with stats by short URLs or visits count. In a non-performant way 2022-01-21 19:52:25 +01:00
Alejandro Celaya
a198484ab6 Updated test utils lib 2022-01-21 19:21:30 +01:00
Alejandro Celaya
dd5bce9694 Merge pull request #1344 from acelaya-forks/feature/strinct-env-vars
Feature/strinct env vars
2022-01-20 21:08:33 +01:00
Alejandro Celaya
bef17ff76d Fixed inverted condition when determining locks 2022-01-20 20:56:38 +01:00
Alejandro Celaya
7202605fc8 Created EnvVarsTest 2022-01-20 20:40:34 +01:00
Alejandro Celaya
747dac531d Added a more strict way to handle valid and expected env vars 2022-01-20 20:16:37 +01:00
Alejandro Celaya
07d24f70e1 Merge pull request #1343 from acelaya-forks/feature/inline-specs-improvements
Feature/inline specs improvements
2022-01-18 20:27:02 +01:00
Alejandro Celaya
d0546a2ea2 Split spec to join ApiKey spec with short URLs, into inlined and regular versions 2022-01-18 20:14:24 +01:00
Alejandro Celaya
9e9621e7b2 Standardized how inlined or regular specs are applied to query builders 2022-01-18 20:06:32 +01:00
Alejandro Celaya
d39f3b4265 Enhanced TagRepositoryTest and replaced inlined quoting by doctrine connection quoting 2022-01-18 19:50:48 +01:00
Alejandro Celaya
223339cd61 Merge pull request #1337 from acelaya-forks/feature/short-urls-filtering
Feature/short urls filtering
2022-01-17 20:33:40 +01:00
Alejandro Celaya
dc430bae10 Refactored method in ShortUrlsRepository 2022-01-17 20:21:35 +01:00
Alejandro Celaya
661b07e12f Refactored ShortUrlRepository to wrap args into DTOs 2022-01-17 20:10:41 +01:00
Alejandro Celaya
0727c7bdfb Updated readme file 2022-01-17 19:12:50 +01:00
Alejandro Celaya
b4c52116b4 Enabled stryker report for infection 2022-01-17 07:41:33 +01:00
Alejandro Celaya
89dc6108b7 Merge pull request #1334 from acelaya-forks/feature/tackle-todos
Feature/tackle todos
2022-01-16 16:06:21 +01:00
Alejandro Celaya
492eba3a8b Fixed duplicated slashes generated in path when doing not-found redirects with placeholders 2022-01-16 15:54:22 +01:00
Alejandro Celaya
77fee1390f Renamed class to a more appropriate name 2022-01-16 15:41:20 +01:00
Alejandro Celaya
bfb54189b8 Moved some config to the proper namespace, now that config is no longer part of the public contract 2022-01-16 15:34:13 +01:00
Alejandro Celaya
fb43885d85 Merge pull request #1333 from acelaya-forks/feature/all-visits-endpoint
Feature/all visits endpoint
2022-01-16 12:49:01 +01:00
Alejandro Celaya
7c1f705e64 Created NonOrphanVisitsPaginatorAdapter test 2022-01-16 12:29:36 +01:00
Alejandro Celaya
fe1fa7689a Created endpoint to list non-orphan visits 2022-01-16 12:24:02 +01:00
Alejandro Celaya
8b79eee081 Updated changelog 2022-01-16 12:08:11 +01:00
Alejandro Celaya
4a3e04ced9 Added tests covering count non orphan visits with different combinations of filters 2022-01-16 11:44:12 +01:00
Alejandro Celaya
61618250ec Renamed countVisits to countNonOrphanVisits, and updated its signature to expect a VisitsCountFiltering DTO 2022-01-16 11:15:39 +01:00
Alejandro Celaya
60c0ca3ae5 Changed VisitsCountFiltering and VisitsListFiltering so that they encapsulate an ApiKey instead of a Spec 2022-01-16 10:56:37 +01:00
Alejandro Celaya
3436405c55 Merge branch 'develop' into feature/all-visits-endpoint 2022-01-16 10:23:22 +01:00
Alejandro Celaya
d43c3ec865 Merge pull request #1326 from acelaya-forks/feature/high-priority-env-vars
Feature/high priority env vars
2022-01-15 17:46:03 +01:00
Alejandro Celaya
545da96d15 Updated env vars ADR 2022-01-15 17:21:36 +01:00
Alejandro Celaya
f53305c404 Added ADR for the changes to load env vars on top of installer config 2022-01-15 17:17:22 +01:00
Alejandro Celaya
199d976e3d Updated changelog and upgrading doc 2022-01-15 16:55:57 +01:00
Alejandro Celaya
a1366f0ef1 Exposed port 8888 on php container for experimentation 2022-01-15 16:52:48 +01:00
Alejandro Celaya
91192a8a8f Updated to latest shlink-installer and shlink-config, ensuring env vars are properly loaded 2022-01-15 16:06:24 +01:00
Alejandro Celaya
c6f16b0558 Updated to latest installer with support for env vars 2022-01-15 11:34:17 +01:00
Alejandro Celaya
0d37eb65c9 Used PhpFileProvider to load installer generated config 2022-01-13 17:11:23 +01:00
Alejandro Celaya
f7e3a74794 Merge pull request #1323 from acelaya-forks/feature/doctrine-2.11
Updated to doctrine 2.11
2022-01-12 21:03:02 +01:00
Alejandro Celaya
976b07cd61 Updated to doctrine 2.11 2022-01-12 20:48:42 +01:00
Alejandro Celaya
cff9cd5fb8 Documented endpoint to get all non-orphan visits 2022-01-10 22:23:00 +01:00
Alejandro Celaya
f0fd947046 Moved existing paginator adapters that are related with visits to the Visits namespace 2022-01-10 22:16:33 +01:00
Alejandro Celaya
7f4ada9c4b Created method in VisitRepository to fetch all non-orphan visits 2022-01-10 21:43:32 +01:00
Alejandro Celaya
db4ef328b1 Renamed some visits paginator adapters for consistency 2022-01-10 20:26:33 +01:00
Alejandro Celaya
b438802e71 Merge pull request #1321 from acelaya-forks/feature/update-docker-deps
Feature/update docker deps
2022-01-10 17:30:34 +01:00
Alejandro Celaya
632a19ceeb Updated changelog 2022-01-10 17:12:09 +01:00
Alejandro Celaya
629f8ece7a Updated to latest docker images and openswoole 2022-01-10 17:10:36 +01:00
Alejandro Celaya
9215f9beb5 Merge pull request #1320 from acelaya-forks/feature/infection-update
Updated to infection 0.26
2022-01-10 15:37:05 +01:00
Alejandro Celaya
154431e86c Updated to infection 0.26 2022-01-10 15:15:16 +01:00
Alejandro Celaya
8cfb14198b Merge pull request #1319 from acelaya-forks/feature/emoji-support
Feature/emoji support
2022-01-10 14:51:13 +01:00
Alejandro Celaya
2ed475fc76 Ensure database fields are created with proper charset and collation in MySQL 2022-01-10 14:37:44 +01:00
Alejandro Celaya
34512da2fb Fixed indentation 2022-01-10 13:21:12 +01:00
Alejandro Celaya
5b3c6f7752 Fixed charset in local entity manager config 2022-01-10 13:09:24 +01:00
Alejandro Celaya
f4dd27ca3f Updated changelog 2022-01-10 13:05:40 +01:00
Alejandro Celaya
ce47d8c591 Added full support for emojis 2022-01-10 13:04:16 +01:00
Alejandro Celaya
b941ee9aa9 Removed usage of deprecated methods from migrations 2022-01-10 12:05:01 +01:00
Alejandro Celaya
45de3f0128 Ensured emojis in short URLs are not URL-encoded 2022-01-10 11:13:16 +01:00
Alejandro Celaya
41d3826c1a Ensured bars are replaced by dashes in custom slugs 2022-01-10 10:43:20 +01:00
Alejandro Celaya
f2ff6e6a70 Merge pull request #1318 from acelaya-forks/feature/custom-slug-simplification
Simplified how the custom slugs are processed, allowing more characte…
2022-01-10 10:28:17 +01:00
Alejandro Celaya
e47c90c645 Simplified how the custom slugs are processed, allowing more characters in the process 2022-01-09 21:02:23 +01:00
Alejandro Celaya
d2fef20239 Merge pull request #1317 from acelaya-forks/feature/tag-stats-endpoint
Feature/tag stats endpoint
2022-01-09 18:02:03 +01:00
Alejandro Celaya
3b359cfc4f Reduced amount of duplicated code in API tests 2022-01-09 17:47:19 +01:00
Alejandro Celaya
acfc5a4676 Updated changelog 2022-01-09 17:38:45 +01:00
Alejandro Celaya
a6b1647f27 Created TagStatsActionTest 2022-01-09 17:37:00 +01:00
Alejandro Celaya
d5851bbb6a Created TagsStats endpoint 2022-01-09 17:24:07 +01:00
Alejandro Celaya
397bbe2655 Merge pull request #1316 from acelaya-forks/feature/tags-ordering
Feature/tags ordering
2022-01-09 14:10:34 +01:00
Alejandro Celaya
95d8d3ef72 Added ordering by name support for tags list with stats 2022-01-09 13:38:59 +01:00
Alejandro Celaya
1b51a1aedd Added ordering support for tags list when not requesting stats 2022-01-09 13:31:08 +01:00
Alejandro Celaya
ff75b3cd1f Enhanced test covering list short URLs with invalid params 2022-01-09 11:28:32 +01:00
Alejandro Celaya
2abcaf02e2 Standardized ordering field handling and added validation for short URLs list 2022-01-09 11:23:27 +01:00
Alejandro Celaya
d0c9f5a776 Fixed merge conflicts 2022-01-08 17:40:49 +01:00
Alejandro Celaya
a46d510e2b Merge pull request #1314 from acelaya-forks/feature/paginated-tags-performance
Feature/paginated tags performance
2022-01-08 17:37:01 +01:00
Alejandro Celaya
2d861b4077 Improved performance when loading paginated tags, by using an ugly compound of native queries and DQL 2022-01-08 17:25:09 +01:00
Alejandro Celaya
470c62d993 Merge pull request #1313 from acelaya-forks/feature/redis-memory-usage
Added a default lifetime for cache entries when using redis
2022-01-07 21:50:31 +01:00
Alejandro Celaya
364734094b Added a default lifetime for cache entries when using redis 2022-01-07 21:37:24 +01:00
Alejandro Celaya
a667c957ee Added Twitter follow badge to readme 2022-01-07 16:15:47 +01:00
Alejandro Celaya
dc648b0142 Merge pull request #1311 from acelaya-forks/feature/ip-in-logs
Ensured remote IP address is not logged when using swoole/openswoole
2022-01-07 14:44:19 +01:00
Alejandro Celaya
1d14140986 Ensured remote IP address is not logged when using swoole/openswoole 2022-01-07 14:30:06 +01:00
Alejandro Celaya
2b693dc492 Merge pull request #1310 from acelaya-forks/feature/title-max-length
Feature/title max length
2022-01-07 14:24:58 +01:00
Alejandro Celaya
38bea6c086 Added edge case tests for SHortUrlMetaTest on title field 2022-01-07 14:07:07 +01:00
Alejandro Celaya
cbdc5f121e Updated changelog 2022-01-07 14:04:21 +01:00
Alejandro Celaya
562763199a Ensured URL titles are trimmed to avoid error when persisted in database 2022-01-07 13:13:45 +01:00
Alejandro Celaya
107c09604a Fixed performance issues on list tags endpoint when requesting it with stats 2022-01-06 19:01:00 +01:00
Alejandro Celaya
2b0567b368 Fixed typo 2022-01-06 18:35:50 +01:00
Alejandro Celaya
d00a56bec0 Fixed query to count tags when a search term is present 2022-01-06 12:22:05 +01:00
Alejandro Celaya
ead8cc6cec Merge pull request #1302 from acelaya-forks/feature/paginated-tags
Feature/paginated tags
2022-01-06 11:54:30 +01:00
Alejandro Celaya
806ff9daaf Updated changelog 2022-01-06 11:40:20 +01:00
Alejandro Celaya
b3863a3e10 Improved TagServiceTest, covering tagsInfo method with params 2022-01-06 11:36:08 +01:00
Alejandro Celaya
5559107776 Changed namespace for database tests to ShlinkioDbTest 2022-01-06 11:01:21 +01:00
Alejandro Celaya
af1cf806f0 Created tag paginator adapter tests 2022-01-06 10:55:57 +01:00
Alejandro Celaya
0cf33c6119 Added DB test for TagsPaginator 2022-01-06 10:35:01 +01:00
Alejandro Celaya
b38b8a3365 Extended TagRepositoryTest, covering filterings on tags 2022-01-06 10:13:37 +01:00
Alejandro Celaya
e998c8434d Extracted tags filtering params to a DTO 2022-01-06 09:50:43 +01:00
Alejandro Celaya
4b90cf93d3 Created DB-level paginator for tags with stats 2022-01-05 23:44:14 +01:00
Alejandro Celaya
3dd4e33758 Created DB-level paginator for tags without stats 2022-01-05 23:30:35 +01:00
Alejandro Celaya
6caeb11598 Added output logs for swoole during API tests 2022-01-05 22:14:09 +01:00
Alejandro Celaya
11a383b7e5 Extracted common logic from TagService to a private method 2022-01-05 19:25:50 +01:00
Alejandro Celaya
fd2a2530b1 Documented pagination for tags endpoint 2022-01-05 19:21:32 +01:00
Alejandro Celaya
2f42b2d072 Added API tests covering pagination for tags 2022-01-05 19:16:49 +01:00
Alejandro Celaya
775f58f972 Added support for pagination in tags lists 2022-01-05 19:12:08 +01:00
Alejandro Celaya
5c0abb3d96 Created TagsParams class 2022-01-05 18:19:29 +01:00
Alejandro Celaya
3dc46bc5a3 Updated to latest shlink-common and shlink-config 2022-01-05 17:46:38 +01:00
Alejandro Celaya
e2871fc048 Merge pull request #1301 from acelaya-forks/feature/desc-default-order
Changed default ordering of short URLs, returning newest first
2022-01-05 15:15:44 +01:00
Alejandro Celaya
44e3f9b49f Changed default ordering of short URLs, returning newest first 2022-01-05 14:10:24 +01:00
Alejandro Celaya
d3f4263639 Merge pull request #1298 from acelaya-forks/feature/filter-all-tags
Feature/filter all tags
2022-01-04 14:59:22 +01:00
Alejandro Celaya
9dec05f62d Added API test covering invalid tagsMode 2022-01-04 14:42:31 +01:00
Alejandro Celaya
0447aa07fa Added more API tests covering the new tagsMode param on short URLs list 2022-01-04 14:34:31 +01:00
Alejandro Celaya
0e25af790d Updated changelog 2022-01-04 14:28:00 +01:00
Alejandro Celaya
d8484e777f Added logic to actually filter short URLs by any tag or all tags 2022-01-04 14:23:21 +01:00
Alejandro Celaya
665a3dbcbf Documented tagsMode param for short URLs list 2022-01-04 12:22:36 +01:00
Alejandro Celaya
103af2e2c1 Added support for a new tagsMode param when listing short URLs 2022-01-04 12:11:47 +01:00
Alejandro Celaya
d0daeb0078 Merge pull request #1297 from acelaya-forks/feature/docker-image-size
Feature/docker image size
2022-01-03 19:49:12 +01:00
Alejandro Celaya
a9aa49c2e5 Updated changelog 2022-01-03 19:37:05 +01:00
Alejandro Celaya
aad24389a7 Slightly reduced docker image size by merging mssql and openswoole installation steps 2022-01-03 19:34:36 +01:00
Alejandro Celaya
4b4f6f3201 Removed gmp extension as bcmath does the same 2022-01-03 19:10:58 +01:00
Alejandro Celaya
81f82d3b73 Reduced docker image size by ensuring dev native libs are not included in final image 2022-01-03 18:48:08 +01:00
Alejandro Celaya
4103ccf791 Merge pull request #1292 from acelaya-forks/feature/simplify-matches
Simplified some match expressions
2022-01-01 21:15:45 +01:00
Alejandro Celaya
e2ed11f960 Updated installer 2022-01-01 18:43:41 +01:00
Alejandro Celaya
8e1cd67a3d Simplified some match expressions 2022-01-01 18:40:48 +01:00
Alejandro Celaya
18b4caa55e Fixed merge conflicts 2021-12-21 14:48:06 +01:00
Alejandro Celaya
30207ce0c2 Merge pull request #1287 from acelaya-forks/bugfix/db-error
Bugfix/db error
2021-12-21 14:43:13 +01:00
Alejandro Celaya
0f37f1cb23 Updated changelog 2021-12-21 14:25:21 +01:00
Alejandro Celaya
99a905cdee Updated to latest shlink-common with support to close EM on middleware 2021-12-21 14:22:11 +01:00
Alejandro Celaya
6eac079440 Ensured EM is closed and not cleared after running an async task 2021-12-21 14:10:06 +01:00
Alejandro Celaya
4a1e7b8d5a Changed condition to pipe RequestIdMiddleware, so that it applies to non-rest requests too 2021-12-19 10:23:55 +01:00
Alejandro Celaya
5e781a9010 Merge pull request #1284 from acelaya-forks/feature/visits-threshold-change
Feature/visits threshold change
2021-12-19 09:41:34 +01:00
Alejandro Celaya
277d817429 Removed API test which is no longer relevant 2021-12-18 18:41:11 +01:00
Alejandro Celaya
970f202757 Updated changelog 2021-12-18 18:26:27 +01:00
Alejandro Celaya
2c6b2b47a4 Updated installer 2021-12-18 18:23:27 +01:00
Alejandro Celaya
5c8be4b21f Updated logic to handle visits threshold env var so that it is disabled if not provided 2021-12-18 18:18:30 +01:00
Alejandro Celaya
558a4a2b30 Merge pull request #1281 from acelaya-forks/feature/update-deps
Updated dependencies
2021-12-16 22:08:17 +01:00
Alejandro Celaya
203ad7d594 Updated dependencies 2021-12-16 21:46:52 +01:00
Alejandro Celaya
04cf1aed9c Merge pull request #1279 from acelaya-forks/feature/remove-deprecated-stuff
Feature/remove deprecated stuff
2021-12-14 23:02:38 +01:00
Alejandro Celaya
8c14526f85 Fixed tests and updated changelog 2021-12-14 22:30:09 +01:00
Alejandro Celaya
1ff241411b Removed everything that was deprecated 2021-12-14 22:21:53 +01:00
Alejandro Celaya
351e36b273 Added missing 8.1 to clean-artifacts job in publish-release pipeline 2021-12-12 17:45:56 +01:00
Alejandro Celaya
ca06040efc Fixed publish-release and publish-swagger-spec pipelines 2021-12-12 17:38:50 +01:00
Alejandro Celaya
2102cc4e9a Merge pull request #1270 from shlinkio/develop
Release 2.10.0
2021-12-12 17:27:21 +01:00
Alejandro Celaya
14d3493db8 Merge pull request #1269 from acelaya-forks/feature/replace-ip-lib
Feature/replace ip lib
2021-12-12 17:21:08 +01:00
Alejandro Celaya
d082d208e1 Tagged specific versions for shlink packages 2021-12-12 17:08:26 +01:00
Alejandro Celaya
959efd17c8 Updated changelog 2021-12-12 13:31:08 +01:00
Alejandro Celaya
30a7c55e84 Migrated to a new lib to match IP addresses with ranges 2021-12-12 13:30:18 +01:00
Alejandro Celaya
2aec759857 Merge pull request #1267 from acelaya-forks/feature/rabbitmq
Feature/rabbitmq
2021-12-12 11:43:43 +01:00
Alejandro Celaya
54dcaaac0c Updated to an installer version with support for RabbitMQ 2021-12-12 11:24:58 +01:00
Alejandro Celaya
8e5730f374 Renamed Rabbit instances to use RabbitMq 2021-12-12 10:32:57 +01:00
Alejandro Celaya
cb1705b6e8 Created NotifyVisitToRabbitTest 2021-12-11 22:18:46 +01:00
Alejandro Celaya
0bcefda60d Added sockets and bcmath extensions to docker image 2021-12-11 21:44:56 +01:00
Alejandro Celaya
966620f840 Created event listener to send visits to a RabbitMQ instance 2021-12-11 21:04:16 +01:00
Alejandro Celaya
bd3bb67949 Added dependencies and config to integrate with Rabbit MQ 2021-12-11 17:07:40 +01:00
Alejandro Celaya
69f4daa9d2 Added dev container with RabbitMQ 2021-12-11 16:19:38 +01:00
Alejandro Celaya
ec11155c9c Updated publish swagger workflow to be triggered for tags 2021-12-11 13:17:45 +01:00
Alejandro Celaya
c48a3a24f7 Fix yet another typo in pipeline 2021-12-11 13:09:39 +01:00
Alejandro Celaya
1b8bc9f0ff Ensured version subfolder is preserved when publishing swagger spec 2021-12-11 13:04:45 +01:00
Alejandro Celaya
5bf25c7eca Added custom token for swagger publishing 2021-12-11 12:55:50 +01:00
Alejandro Celaya
5a7f0ad340 Fixed another typo... 2021-12-11 12:35:34 +01:00
Alejandro Celaya
8a93922da0 Added missing space in mv command 2021-12-11 12:27:45 +01:00
Alejandro Celaya
295de5be8e Changed how version is determined 2021-12-11 12:18:55 +01:00
Alejandro Celaya
5c114b584d Fixed typo 2021-12-11 12:11:22 +01:00
Alejandro Celaya
dad58b7610 Disabled env step on publis-swagger workflow 2021-12-11 11:53:18 +01:00
Alejandro Celaya
23c1dadb4c Merge pull request #1265 from acelaya-forks/feature/publish-swagger-workflow
Feature/publish swagger workflow
2021-12-11 11:44:12 +01:00
Alejandro Celaya
05332e0606 Created workflow to publish swagger specs 2021-12-11 11:40:59 +01:00
Alejandro Celaya
453842246f Ensured docker publish is run under ubuntu 20.04 2021-12-11 11:30:03 +01:00
Alejandro Celaya
38280b9027 Merge pull request #1264 from acelaya-forks/feature/unify-ci-jobs
Unified jobs in ci pipeline as much as possible
2021-12-11 10:47:10 +01:00
Alejandro Celaya
7d7c0011bb Fixed references to test:api and test:api:ci inside composer.json and added missing driver for MS SQL 2021-12-11 10:33:00 +01:00
Alejandro Celaya
de2d87a6d9 Unified jobs in ci pipeline as much as possible 2021-12-11 10:26:23 +01:00
Alejandro Celaya
537152450f Merge pull request #1263 from acelaya-forks/feature/api-tests-coverage
Feature/api tests coverage
2021-12-10 18:25:38 +01:00
Alejandro Celaya
87f6b19207 Updated changelog 2021-12-10 18:12:46 +01:00
Alejandro Celaya
064fef5d8a Added comment to explain why API tests coverage is generated the way it is 2021-12-10 18:12:00 +01:00
Alejandro Celaya
6aebaa94af Added mutations to API tests 2021-12-10 17:45:55 +01:00
Alejandro Celaya
a1a6ac9c08 Merge pull request #1262 from acelaya-forks/feature/env-var-fix
Added new IS_HTTPS_ENABLED env var and deprecated USE_HTTPS
2021-12-10 16:55:58 +01:00
Alejandro Celaya
0d936425c2 Added new IS_HTTPS_ENABLED env var and deprecated USE_HTTPS 2021-12-10 16:24:38 +01:00
Alejandro Celaya
00f867c6ee Merge pull request #1259 from acelaya-forks/feature/83-msi
Feature/83 msi
2021-12-10 14:17:20 +01:00
Alejandro Celaya
bfea3f35f0 Updated changelog 2021-12-10 14:01:58 +01:00
Alejandro Celaya
3f3cf5e20e Explicitly required an MSI of 83 for unit tests 2021-12-10 14:00:59 +01:00
Alejandro Celaya
0786a962e7 Increased MIS to 83% 2021-12-10 13:42:33 +01:00
Alejandro Celaya
f7c0486101 Added swagger:validate to ci and ci:parallel commands 2021-12-10 12:52:36 +01:00
Alejandro Celaya
2e3798b282 Merge pull request #1256 from acelaya-forks/feature/api-examples
Feature/api examples
2021-12-09 19:09:02 +01:00
Alejandro Celaya
181740c3e9 Fixed typo in swagger docs 2021-12-09 18:55:17 +01:00
Alejandro Celaya
23c51a1d5f Updated changelog 2021-12-09 18:52:27 +01:00
Alejandro Celaya
15ce529c09 Added swagger validation to CI pipeline 2021-12-09 18:51:26 +01:00
Alejandro Celaya
0fd941401b Added extra examples for error responses in swagger docs 2021-12-09 18:28:52 +01:00
Alejandro Celaya
808ae6a442 Fixed existing examples for API 2021-12-09 15:27:18 +01:00
Alejandro Celaya
ada8d18fa1 Merge pull request #1255 from acelaya-forks/feature/consistent-default-domain-redirects
Feature/consistent default domain redirects
2021-12-09 13:03:08 +01:00
Alejandro Celaya
9752abff19 Refactored method in DomainRepo, as one fo their arguments was no longer used 2021-12-09 12:43:49 +01:00
Alejandro Celaya
ee43e68a57 Changed behavior of domains list so that it does not return configured redirects as redirects for default domain 2021-12-09 12:32:53 +01:00
Alejandro Celaya
348ac78f5a Enhanced ListDomainsAction so that it returns default redirects in the response 2021-12-09 12:11:09 +01:00
Alejandro Celaya
0b22fb933c Defined new env vars for not-found redirects, deprecating old ones 2021-12-09 10:30:33 +01:00
Alejandro Celaya
cbd4b4849f Ensured default domain is stripped when creating short URLs from CLI 2021-12-09 10:24:58 +01:00
Alejandro Celaya
f8a48c16f0 Renamed GenerateShortUrlCommand to CreateShortUrlCommand 2021-12-09 09:45:15 +01:00
Alejandro Celaya
8cc4e4bfca Merge branch 'develop' into feature/consistent-default-domain-redirects 2021-12-09 09:18:17 +01:00
Alejandro Celaya
6c01bb87bf Replaced tabs by spaces in phpstan.neon config 2021-12-08 17:52:17 +01:00
Alejandro Celaya
02d5a6f15e Merge pull request #1253 from acelaya-forks/feature/php8.1
Feature/php8.1
2021-12-08 17:49:15 +01:00
Alejandro Celaya
f361403888 Updated paginator types 2021-12-08 17:36:40 +01:00
Alejandro Celaya
3a4550fe24 Updated dependencies to corresponding versions supporting PHP 8.1 2021-12-08 09:40:43 +01:00
Alejandro Celaya
5e722c830f Allowed to set redirects for default domain via command line or API 2021-12-07 21:13:47 +01:00
Alejandro Celaya
5a56982ad9 Merge pull request #1252 from acelaya-forks/feature/docker-debug-fix
Updated docker entry point to make sure debugging and verbosity of co…
2021-12-07 19:27:43 +01:00
Alejandro Celaya
13d70cd12a Updated docker entry point to make sure debugging and verbosity of commands works as expected 2021-12-07 19:14:56 +01:00
Alejandro Celaya
bb87bdce8a Updated docker images to use PHP 8.1 2021-12-07 10:43:36 +01:00
Alejandro Celaya
cc7ded1be7 Removed allowed failures in CI pipeline for PHP 8.1 2021-12-07 09:55:06 +01:00
Alejandro Celaya
d8735e6a91 Merge pull request #1250 from acelaya-forks/feature/qr-round-block-size
Feature/qr round block size
2021-12-06 18:19:53 +01:00
Alejandro Celaya
813ae71aad Added test checking if auto margin is added to QR codes 2021-12-06 18:06:29 +01:00
Alejandro Celaya
1a75bd87d8 Updated installer with support for QR code block size rounding 2021-12-06 17:35:32 +01:00
Alejandro Celaya
bdc89e2056 Fixed execution on non-swoole contexts 2021-12-06 17:15:19 +01:00
Alejandro Celaya
bf09990f9c Added support to disable rounding on block size for QR codes 2021-12-06 17:10:10 +01:00
Alejandro Celaya
81ba8dc518 Merge pull request #1249 from acelaya-forks/feature/yourls-import
Added support to import from YOURLS
2021-12-05 15:38:41 +01:00
Alejandro Celaya
e519aaaf1e Added support to import from YOURLS 2021-12-05 15:16:41 +01:00
Alejandro Celaya
5a90a5e6c7 Merge pull request #1248 from acelaya-forks/feature/openswoole
Feature/openswoole
2021-12-05 10:21:20 +01:00
Alejandro Celaya
b855ea92a9 Updated changelog 2021-12-05 10:09:06 +01:00
Alejandro Celaya
7e74d06cdd Added support for openswoole and migrated docker images from swoole to openswoole 2021-12-05 10:08:10 +01:00
Alejandro Celaya
1e7602bc36 Merge pull request #1247 from acelaya-forks/feature/mutation-badge
Added mutation score badge
2021-12-05 09:24:44 +01:00
Alejandro Celaya
7477e672fe Added mutation score badge 2021-12-05 08:55:05 +01:00
Alejandro Celaya
4a4522dfa3 Merge pull request #1246 from acelaya-forks/feature/mssql-updates
Updated dependencies
2021-12-02 21:11:39 +01:00
Alejandro Celaya
8afe058cfc Updated dependencies 2021-12-02 20:57:06 +01:00
Alejandro Celaya
e13103a925 Merge pull request #1245 from acelaya-forks/feature/mssqlsrv-beta2
Update ci.yml
2021-12-02 19:44:32 +01:00
Alejandro Celaya
8e167ff174 Merge pull request #1244 from acelaya-forks/feature/missing-domain-in-error
Added domain to DeleteShortUrlException
2021-12-02 19:34:02 +01:00
Alejandro Celaya
c0dcd31819 Update ci.yml 2021-12-02 19:33:01 +01:00
Alejandro Celaya
a83ae996db Ensured a formatter is resolved 2021-11-30 21:47:23 +01:00
Alejandro Celaya
a66ddabe8a Added domain to DeleteShortUrlException 2021-11-30 21:38:09 +01:00
Alejandro Celaya
cdab1e9cae Pulled 2021-11-15 19:56:10 +01:00
Alejandro Celaya
f2140d1eb0 Fixed merge conflicts 2021-11-15 19:55:07 +01:00
Alejandro Celaya
4a3fa85b5f Merge pull request #1234 from acelaya-forks/feature/sql-injection
Enforced doctrine/dbal 3.1.4
2021-11-15 19:53:01 +01:00
Alejandro Celaya
ade23a9650 Enforced doctrine/dbal 3.1.4 2021-11-15 19:41:38 +01:00
Alejandro Celaya
fc547e6c47 Merge pull request #1224 from acelaya-forks/feature/phpstan-1.0
Updated to phpstan 1.0
2021-11-04 21:38:31 +01:00
Alejandro Celaya
f532b5edee Added LC_ALL: C env var during ms db tests 2021-11-04 21:31:51 +01:00
Alejandro Celaya
da76eb5cf4 Updated to phpstan 1.0 2021-11-04 21:17:31 +01:00
Alejandro Celaya
ac89f352ce Updated shlink libs 2021-11-01 11:27:44 +01:00
Alejandro Celaya
198b2a2ace Merge pull request #1220 from acelaya-forks/feature/update-dev-mercure
Updated mercure on dev env from v0.10 to 0.13
2021-10-31 20:00:46 +01:00
Alejandro Celaya
93a3d78111 Updated mercure on dev env from v0.10 to 0.13 2021-10-31 19:42:40 +01:00
Alejandro Celaya
494997d021 Merge pull request #1219 from acelaya-forks/feature/symfony-mercure-0.6
Updated to symfony/mercure 0.6
2021-10-31 13:24:34 +01:00
Alejandro Celaya
eb1345e5c3 Updated to symfony/mercure 0.6 2021-10-31 13:02:58 +01:00
Alejandro Celaya
dc8f5d002d Merge pull request #1215 from shlinkio/develop
Release 2.9.2
2021-10-23 16:52:47 +02:00
Alejandro Celaya
9030e5e6eb Merge pull request #1214 from acelaya-forks/feature/min-task-workers
Feature/min task workers
2021-10-23 16:47:18 +02:00
Alejandro Celaya
2b827baeed Updated changelog 2021-10-23 16:35:38 +02:00
Alejandro Celaya
cc6fa312f0 Ensured minimum amount of task workers provided via config option or env var is 4 2021-10-23 16:32:06 +02:00
Alejandro Celaya
b8eba5b643 Merge pull request #1213 from acelaya-forks/feature/migrations-3.3
Feature/migrations 3.3
2021-10-23 16:18:39 +02:00
Alejandro Celaya
0c3f98cc37 Replaced implicit false in migration by a check on the platform 2021-10-23 16:04:54 +02:00
Alejandro Celaya
cd35770d26 Ensured migrations are not transactional when run in mysql 2021-10-23 16:02:29 +02:00
Alejandro Celaya
bd3a59e9ca Updated to doctrine-migrations 3.3 2021-10-23 15:44:56 +02:00
Alejandro Celaya
ff50d601b3 Merge pull request #1212 from acelaya-forks/feature/wrong-transactionality
Removed transactionality when dispatching async events
2021-10-23 13:49:09 +02:00
Alejandro Celaya
a4fde0f9e6 Changed mechanism to determine if connection to database worked for health endpoint 2021-10-23 13:36:27 +02:00
Alejandro Celaya
c7a621cb31 Removed transactionality when dispatching async events, as they run in different processes with different db connections 2021-10-23 13:22:42 +02:00
Alejandro Celaya
6f62d62909 Merge pull request #1203 from shlinkio/develop
Release 2.9.1
2021-10-11 09:03:16 +02:00
Alejandro Celaya
c3aa2df4e9 Merge pull request #1202 from acelaya-forks/feature/fix-use-https
Fixed crash when trying to resolve schema based on USE_HTTPS env var
2021-10-11 09:01:38 +02:00
Alejandro Celaya
f4fbf2da75 Tagged version in changelog 2021-10-11 08:47:41 +02:00
Alejandro Celaya
288de8acaa Fixed crash when trying to resolve schema based on USE_HTTPS env var 2021-10-11 08:46:40 +02:00
Alejandro Celaya
750e6cff45 Merge pull request #1200 from shlinkio/develop
Release 2.9.0
2021-10-10 22:45:17 +02:00
Alejandro Celaya
f49e94052d Merge pull request #1199 from acelaya-forks/feature/address-based-tracking
Feature/address based tracking
2021-10-10 22:42:27 +02:00
Alejandro Celaya
ceb642b745 Updated to latest installer and changelog 2021-10-10 22:31:26 +02:00
Alejandro Celaya
ed1d886f01 Added option to disable tracking based on IP address patterns 2021-10-10 22:00:22 +02:00
Alejandro Celaya
db98d811b0 Merge pull request #1198 from acelaya-forks/feature/orphan-visits-webhook
Feature/orphan visits webhook
2021-10-09 13:08:05 +02:00
Alejandro Celaya
14ba11e1ab Enhanced changelog 2021-10-09 12:36:37 +02:00
Alejandro Celaya
483bdddb18 Updated to installer version with support for orphan visits webhooks 2021-10-09 12:35:45 +02:00
Alejandro Celaya
d16fda3f16 Added option to send orphan visits to webhooks 2021-10-09 10:53:21 +02:00
Alejandro Celaya
c718b94937 Fixed crash when notifying orphan visits to a webhook 2021-10-09 10:35:37 +02:00
Alejandro Celaya
bb21ab073f Merge pull request #1196 from acelaya-forks/feature/redis-sentinels
Feature/redis sentinels
2021-10-08 19:05:17 +02:00
Alejandro Celaya
3ffe530461 Updated changelog 2021-10-08 18:52:53 +02:00
Alejandro Celaya
95cf0d86bc Added support to provide redis sentinel when using redis cache 2021-10-08 18:52:17 +02:00
Alejandro Celaya
9899a5fc56 Merge pull request #1195 from acelaya-forks/feature/not-found-redirect-placeholders
Feature/not found redirect placeholders
2021-10-03 17:04:17 +02:00
Alejandro Celaya
952648185c Removed duplicated space 2021-10-03 16:48:39 +02:00
Alejandro Celaya
69740493b7 Updated changelog 2021-10-03 16:47:43 +02:00
Alejandro Celaya
994a28f31d Ensured NotFoundRedirectResolver replaces placeholders from the URL 2021-10-03 16:45:13 +02:00
Alejandro Celaya
b0a8a03f0a Refactored NotFoundRedirectResolver to remove duplicated lines and non-strict code 2021-10-03 10:35:35 +02:00
Alejandro Celaya
36e740f4cc Added logic to forward path and domain to not-found redirects when they contain placeholders 2021-10-02 17:30:25 +02:00
Alejandro Celaya
a5874a3f80 Merge pull request #1194 from acelaya-forks/feature/optinally-forward-query
Feature/optinally forward query
2021-10-02 10:56:48 +02:00
Alejandro Celaya
0c95b978b4 Added option in CLI to disable query forwarding when creating Short URLs 2021-10-02 10:45:00 +02:00
Alejandro Celaya
e21f9dd1fb Added forwardQuery prop to the SHortUrl serialization 2021-10-02 10:31:23 +02:00
Alejandro Celaya
74a08b86ce Estended ShortUrlRedirectionBuilderTest covering short URLS withput query forwarding 2021-10-02 10:16:56 +02:00
Alejandro Celaya
8212d3c540 Allowed to set and update the forwardQuery param on short URLs 2021-10-02 10:02:47 +02:00
Alejandro Celaya
1ed6458b39 Added forwardQuery property in short URLs, that determines if the query should be forwarded to the long URL 2021-10-02 09:32:04 +02:00
Alejandro Celaya
60c8f23a63 Merge pull request #1193 from acelaya-forks/feature/api-key-visits
Added extra DB tests ensuring proper short URL visits are resolved fr…
2021-10-01 19:59:30 +02:00
Alejandro Celaya
5e627641ea Added more tests ensuring any short URL can be fetched by using an admin API key 2021-10-01 19:32:34 +02:00
Alejandro Celaya
abc954aa47 Added extra DB tests ensuring proper short URL visits are resolved from an API key 2021-09-30 22:57:24 +02:00
Alejandro Celaya
3bfa27e682 Merge pull request #1191 from acelaya-forks/feature/default-qr-codes-config
Feature/default qr codes config
2021-09-26 20:39:09 +02:00
Alejandro Celaya
4b7e122254 Updated changelog 2021-09-26 20:15:00 +02:00
Alejandro Celaya
cfd3c13751 Updated to latest installer 2021-09-26 20:13:50 +02:00
Alejandro Celaya
6a1ee2b894 Added new config to set custom defaults for QR codes 2021-09-26 13:25:02 +02:00
Alejandro Celaya
cbec4a4e81 Moved constants to its own file inside config folder 2021-09-26 11:26:26 +02:00
Alejandro Celaya
c7d8c1cab5 Merge pull request #1189 from acelaya-forks/feature/roll-back-domain-redirects-logic
Reolled-back logic that would have made domains with no specific redi…
2021-09-26 11:22:58 +02:00
Alejandro Celaya
c39e1e649d Reolled-back logic that would have made domains with no specific redirects to not fall back to the default redirects 2021-09-26 11:10:00 +02:00
Alejandro Celaya
95ab64ba77 Merge pull request #1187 from acelaya-forks/feature/build-8.1
Feature/build 8.1
2021-09-26 10:43:55 +02:00
Alejandro Celaya
1f8fcdb0f3 Fixed typo in ci workflow 2021-09-26 10:20:09 +02:00
Alejandro Celaya
fb26a8ae50 Downgraded pdo_sqlsrv version for PHP 8.0 2021-09-26 10:19:26 +02:00
Alejandro Celaya
42dbeaa1a5 Updated MS native deps in swoole dev container 2021-09-26 10:06:35 +02:00
Alejandro Celaya
3305f4c03a Updated pdo_sqlsrv version used in CI workflow 2021-09-26 10:04:50 +02:00
Alejandro Celaya
f5beec70c8 Updated MS native deps 2021-09-26 10:03:07 +02:00
Alejandro Celaya
c2cd21c15e Updated swoole version used in CI workflow 2021-09-26 09:53:58 +02:00
Alejandro Celaya
633e389275 Updated changelog 2021-09-26 09:50:35 +02:00
Alejandro Celaya
f5aaf298e1 Added experimental builds under PHP 8.1 2021-09-26 09:49:51 +02:00
Alejandro Celaya
7db6136436 Simplified how the not-found redirects are resolved 2021-09-26 09:40:24 +02:00
Alejandro Celaya
ce7296eebb Merge pull request #1186 from acelaya-forks/feature/deprecate-domain-env-vars
Feature/deprecate domain env vars
2021-09-26 09:23:01 +02:00
Alejandro Celaya
c6226547f7 Updated changelog 2021-09-26 09:12:26 +02:00
Alejandro Celaya
e7ec8f0489 Deprecated SHORT_DOMAIN_* env vars with replacements 2021-09-26 09:10:54 +02:00
Alejandro Celaya
dc466f238b Updated changelog 2021-09-12 08:32:24 +02:00
Alejandro Celaya
f164656874 Merge pull request #1172 from NReilingh/patch-1
Slight misuse of VOLUME in Dockerfile
2021-09-12 08:30:28 +02:00
Nick Reilingh
ef3c59152f Dockerfile -- remove unneeded VOLUME instructions 2021-09-11 16:40:09 -04:00
Nick Reilingh
14c6ead389 Dockerfile - comment misused VOLUME instructions
Issuing a VOLUME instruction in a production Dockerfile requires the Docker engine to create a volume whether or not it is mapped to the host or a named volume. Neither of these paths have data that needs to be persisted for production use, so their inclusion under a typical `docker run` example forces the engine to create extraneous volumes which quickly become orphaned whenever the container is recreated.
2021-09-11 13:46:52 -04:00
Alejandro Celaya
b0d33f3a85 Merge pull request #1166 from acelaya-forks/feature/fix-undefined-var
Feature/fix undefined var
2021-08-26 10:06:33 +02:00
Alejandro Celaya
066cc20ee6 Updated changelog 2021-08-26 09:53:10 +02:00
Alejandro Celaya
0f51b5b1ce Fixed warning displayed when trying to late visits and there are no pending 2021-08-26 09:52:11 +02:00
Alejandro Celaya
ebcf3e0119 Merge pull request #1158 from acelaya-forks/feature/global-cors
Feature/global cors
2021-08-16 13:02:18 +02:00
Alejandro Celaya
6ee248d656 Updated changelog 2021-08-16 12:50:18 +02:00
Alejandro Celaya
8a46b410f6 Ensured Cors middleware applies for all routes, not only rest ones 2021-08-16 12:49:15 +02:00
Alejandro Celaya
cd06cea153 Fixed merge conflicts 2021-08-15 19:32:27 +02:00
Alejandro Celaya
8393d44c50 Merge pull request #1156 from acelaya-forks/feature/query-num-keys
Fixed numeric query params being replaced by 0 in long URLs
2021-08-15 19:25:13 +02:00
Alejandro Celaya
3e8ce80f80 Fixed numeric query params being replaced by 0 in long URLs 2021-08-15 19:13:26 +02:00
Alejandro Celaya
80e033c91d Fixed local dev config for db 2021-08-14 19:23:08 +02:00
Alejandro Celaya
a7dd441333 Added missing double quote. Closes #1151 2021-08-09 22:16:12 +02:00
Alejandro Celaya
48efaa9fd7 Merge pull request #1150 from acelaya-forks/feature/env-config
Feature/env config
2021-08-07 14:13:26 +02:00
Alejandro Celaya
92e831175f Ensure no DB driver config falls back to SQLite 2021-08-07 13:32:59 +02:00
Alejandro Celaya
9b75e076b5 Updated changelog 2021-08-07 11:08:52 +02:00
Alejandro Celaya
2c5d6d1651 Moved env vars to common global config files, so that theycan be used in non-docker contexts too 2021-08-07 11:05:20 +02:00
Alejandro Celaya
c5cf116f33 Fixed changelog message 2021-08-06 19:59:35 +02:00
Alejandro Celaya
66a4a9bce6 Moved bugfix from Unreleased to v2.8.0, as it's already fixed there 2021-08-06 13:57:39 +02:00
Alejandro Celaya
7e7ef64c79 Merge pull request #1146 from acelaya-forks/feature/coding-standard
Updated to coding standard v2.2.0
2021-08-05 19:58:34 +02:00
Alejandro Celaya
9a31f53d4d Updated to coding standard v2.2.0 2021-08-05 19:47:17 +02:00
Alejandro Celaya
60d6314262 Merge pull request #1145 from acelaya-forks/feature/update-cache
Feature/update cache
2021-08-05 17:07:41 +02:00
Alejandro Celaya
eff7445804 Updated changelog 2021-08-05 16:50:50 +02:00
Alejandro Celaya
2bfe21aef4 Documented architectural decission on what component to pick for caching 2021-08-05 16:47:30 +02:00
Alejandro Celaya
6ae0c7dcfc Updated to latest common with symfony/cache support 2021-08-05 14:05:44 +02:00
Alejandro Celaya
883ac1007a Updated to provisional hero-common v4.0 2021-08-04 18:46:19 +02:00
Alejandro Celaya
ff6747dab5 Merge pull request #1143 from shlinkio/develop
Release 2.8.0
2021-08-04 15:43:59 +02:00
Alejandro Celaya
555e6f804c Merge pull request #1141 from acelaya-forks/feature/update-deps
Feature/update deps
2021-08-04 15:36:28 +02:00
Alejandro Celaya
98c5c7990f Updated changelog 2021-08-04 13:29:33 +02:00
Alejandro Celaya
27dcdb517d Updated dockerfile dependencies 2021-08-04 13:28:14 +02:00
Alejandro Celaya
916d75d161 Updated project dependencies 2021-08-04 13:22:16 +02:00
Alejandro Celaya
57bd16f4f5 Updated test utils lib to v2.2 2021-08-04 11:11:00 +02:00
Alejandro Celaya
444a1756a2 Merge pull request #1140 from acelaya-forks/feature/domain-redirects-endpoint
Feature/domain redirects endpoint
2021-08-03 19:59:54 +02:00
Alejandro Celaya
0c97c8f04f Updated changelog 2021-08-03 19:47:44 +02:00
Alejandro Celaya
de81e81ecb Created API test for Domain redirects 2021-08-03 19:43:30 +02:00
Alejandro Celaya
40a7d5a112 Documented error when trying to edit default domain redirects through endpoint 2021-08-03 18:33:50 +02:00
Alejandro Celaya
7c06633a67 Ensured default domain redirects cannot be edited through regular approach 2021-08-03 18:28:09 +02:00
Alejandro Celaya
9abf611d63 Created DomainResirectsAction unit test 2021-08-03 18:09:39 +02:00
Alejandro Celaya
565fe4c348 Added redirects to the list of domains 2021-08-03 17:00:26 +02:00
Alejandro Celaya
7b43403b1c Fixed error when editing domain redirects for a new domain 2021-08-03 16:48:17 +02:00
Alejandro Celaya
9f25979b4c Added validation to not found redirects for domain 2021-08-03 14:08:36 +02:00
Alejandro Celaya
20f70b8b07 Created new table with row separators for CLI, to use with multi-line rows 2021-08-03 10:21:42 +02:00
Alejandro Celaya
8fbf05acd4 Added deprecated keyword to ensure something is changed for v3.0.0 2021-08-03 10:02:44 +02:00
Alejandro Celaya
6860855c71 Prevent double flush when editing domain redirects 2021-08-03 09:55:21 +02:00
Alejandro Celaya
b78660c685 Updated installer 2021-08-02 20:50:35 +02:00
Alejandro Celaya
6a40bbdcb5 Created new action to set redirects for a domain 2021-08-02 20:49:39 +02:00
Alejandro Celaya
5a1a4f5594 Added support to configure domain redirects but taking into consideration the permissions on an API key 2021-08-02 20:49:39 +02:00
Alejandro Celaya
2ac7be4363 Extended DomainNotFoundException to allow creating from an authority 2021-08-02 20:49:39 +02:00
Alejandro Celaya
4ef5ab7a90 Fixed wrong domains getting resolved for an API key roles 2021-08-02 20:49:39 +02:00
Alejandro Celaya
192308a6a3 Added swagger docs for endpoint do edit domain redirects 2021-08-02 20:49:39 +02:00
Alejandro Celaya
c9ce111643 Fixed merge conflicts 2021-08-02 20:39:33 +02:00
Alejandro Celaya
32fda231ad Merge pull request #1138 from acelaya-forks/feature/fix-import-with-no-visits
Feature/fix import with no visits
2021-08-02 20:34:06 +02:00
Alejandro Celaya
e4d4686717 Ensure visits lists where the page is lower than 1, fall back to page 1 to avoid errors 2021-08-02 20:22:07 +02:00
Alejandro Celaya
ca6c6a1b6e Updated importer to v2.3.1 2021-08-02 18:29:16 +02:00
Alejandro Celaya
806c4ce168 Merge pull request #1134 from acelaya-forks/feature/infection24
Feature/infection24
2021-08-01 10:11:53 +02:00
Alejandro Celaya
9d14597be0 Added --only-covering-test-cases flag when running infection commands 2021-08-01 10:00:24 +02:00
Alejandro Celaya
dc68bb907c Updated infection to v0.24 2021-08-01 09:57:34 +02:00
Alejandro Celaya
e4598c058a Merge pull request #1133 from acelaya-forks/feature/docker-cron-permissions
Disabled user change on Dockerfile, as it produces some issues
2021-08-01 09:11:06 +02:00
Alejandro Celaya
377562cdff Disabled user change on Dockerfile, as it produces some issues 2021-08-01 08:55:39 +02:00
Alejandro Celaya
969fcccc1f Merge pull request #1131 from acelaya-forks/feature/clean-workarounds-from-fix
Removed hardcoded dependency
2021-07-30 18:54:45 +02:00
Alejandro Celaya
4c00764146 Removed hardcoded dependency 2021-07-30 18:40:26 +02:00
Alejandro Celaya
e98ee64695 Merge branch 'main' into develop 2021-07-30 18:25:48 +02:00
Alejandro Celaya
51c7d0ed3e Removed deprecated env var for publish release 2021-07-30 18:25:00 +02:00
Alejandro Celaya
db93498ee6 Fixed merge conflicts 2021-07-30 18:19:32 +02:00
Alejandro Celaya
b3af493758 Merge pull request #1130 from acelaya-forks/feature/docker-memory-limit
Fixed memory too low limit on docker image
2021-07-30 18:16:40 +02:00
Alejandro Celaya
7b9ebbbb5f Fixed use of ImplicitOptionsMiddleware with its new signature 2021-07-30 18:05:03 +02:00
Alejandro Celaya
ea735fc0a0 Ensured guzzle/psr7 1.7 is used as the project still has deprecated calls 2021-07-30 17:48:43 +02:00
Alejandro Celaya
06227e97d0 Fixed memory too low limit on docker image 2021-07-30 17:39:45 +02:00
Alejandro Celaya
dbc50b6d4f Merge pull request #1124 from acelaya-forks/feature/domain-specific-redirects
Feature/domain specific redirects
2021-07-23 18:59:24 +02:00
Alejandro Celaya
8b75ad1e7f Covered detached domains with redirects in domains list API test 2021-07-23 13:11:09 +02:00
Alejandro Celaya
8f3c740b57 Ensured domains not used in short URLs but with redirects configured are returned in domains list 2021-07-23 13:06:03 +02:00
Alejandro Celaya
24a6a0c23f Added test for DomainRedirectCommand 2021-07-22 20:48:58 +02:00
Alejandro Celaya
267d72a76c Improved unit tests covering new not found redirects for domains capability 2021-07-22 17:49:37 +02:00
Alejandro Celaya
021cecc216 Created command that allows configuring not found redirects for every domain 2021-07-21 21:09:33 +02:00
Alejandro Celaya
4642480bbb Updated changelog 2021-07-21 09:41:58 +02:00
Alejandro Celaya
4d48482d1e Added support to define differnet not-found redirects per domain 2021-07-21 09:28:21 +02:00
Alejandro Celaya
2054784a4a Merge pull request #1123 from acelaya-forks/feature/match-in-db-tests
Replaced map with match
2021-07-20 14:04:19 +02:00
Alejandro Celaya
57d816b862 Replaced map with match 2021-07-20 14:03:19 +02:00
Alejandro Celaya
32bb66c42b Merge pull request #1122 from acelaya-forks/feature/phpstan-level
Feature/phpstan level
2021-07-20 14:01:45 +02:00
Alejandro Celaya
e4d15e64b6 Ensured static analysis is run with APP_ENV=test 2021-07-20 13:50:14 +02:00
Alejandro Celaya
b11daeae7d Fixed version constraint in composer.json 2021-07-20 13:41:55 +02:00
Alejandro Celaya
8e78f8527e Updated changelog 2021-07-20 13:37:00 +02:00
Alejandro Celaya
bc385744db Temporarely ignored some phpstan errors until a custom rule is defined 2021-07-20 13:36:09 +02:00
Alejandro Celaya
02fd28edec Installed phpstan-dcotrine and fixed more static analysis errors 2021-07-20 13:29:50 +02:00
Alejandro Celaya
95770ac104 Increased phpstan level to 8 2021-07-20 12:51:07 +02:00
Alejandro Celaya
2eeb762cd9 Moved specific phpstan ignore to their own lines 2021-07-19 22:50:32 +02:00
Alejandro Celaya
de5666d262 Resolved all phpstan errors 2021-07-19 22:47:12 +02:00
Alejandro Celaya
934d266880 Added phpstan-symfony plugin to improve inspections on getArgument and getOption 2021-07-19 20:00:53 +02:00
Alejandro Celaya
b8fa234dbb Fixed some phpstan errors 2021-07-19 18:35:42 +02:00
Alejandro Celaya
bceea090ed Increaed phpstan level to 7 2021-07-17 20:58:24 +02:00
Alejandro Celaya
8efda2ef56 Merge pull request #1108 from kanadaj/develop
Change the Docker user to non-root
2021-07-15 20:19:42 +02:00
Alejandro Celaya
f86cda6730 Removed deprecated env var for publish release 2021-07-15 19:53:42 +02:00
Alejandro Celaya
43f59a19fb Merge pull request #1120 from acelaya-forks/feature/redirect-with-extra-path
Feature/redirect with extra path
2021-07-15 19:48:16 +02:00
Alejandro Celaya
eabaa94e06 Created ExtraPathRedirectMiddleware test 2021-07-15 19:37:09 +02:00
Alejandro Celaya
20575a2b0f Added support to provide append_extra_path config from installer or env vars for docker 2021-07-15 18:57:32 +02:00
Alejandro Celaya
0096a778ac Created RequestTracker test 2021-07-15 17:43:29 +02:00
Alejandro Celaya
050f83e3bb Wrapped logic to track requests to a new RequestTracker service 2021-07-15 17:23:09 +02:00
Alejandro Celaya
32f7b4fbf6 Created new middleware that redirects to short URLs with an extra path 2021-07-15 16:54:54 +02:00
Alejandro Celaya
265e8cdeaf Refactored tracking actions 2021-07-15 13:28:31 +02:00
Alejandro Celaya
fe5460e0c5 Created ShortUrlRedirectBuilder test 2021-07-14 16:44:21 +02:00
Alejandro Celaya
d4cad337fc Created component wrapping the logic to determine what's the URL to redirect to for a ShortUrl 2021-07-14 16:36:03 +02:00
Alejandro Celaya
0af6ecbd34 Merge pull request #1115 from acelaya-forks/feature/qr-code-correction
Feature/qr code correction
2021-07-13 14:13:34 +02:00
Alejandro Celaya
6466045363 Updated changelog 2021-07-13 14:00:54 +02:00
Alejandro Celaya
67c7e503d9 Used lowercase values when trying to match the QR code error level 2021-07-13 13:55:00 +02:00
Alejandro Celaya
01e06f0503 Improved swagger docs for QR code endpoint 2021-07-13 13:53:10 +02:00
Alejandro Celaya
d6e155d874 Extracted logic to determine QR code params to its own data object 2021-07-13 13:46:01 +02:00
Alejandro Celaya
5a2350bac1 Added suport for error correction level to QR codes 2021-07-13 13:22:50 +02:00
kanadaj
2b97f9ac9e Update Dockerfile
Security update
2021-06-13 23:54:35 +01:00
kanadaj
090b215179 Update Dockerfile 2021-06-13 23:51:16 +01:00
Alejandro Celaya
32f483c333 Merge pull request #1107 from PxSonny/patch-1
Update CONTRIBUTING.md
2021-06-13 21:21:44 +02:00
Sonny Alves Dias
655652f94f Update CONTRIBUTING.md
Fixing a typo
2021-06-13 22:24:20 +08:00
Alejandro Celaya
53b84c147c Merge branch 'develop' of github.com:shlinkio/shlink into develop 2021-05-30 17:55:37 +02:00
Alejandro Celaya
d8b4827601 Updated changelog 2021-05-30 17:55:30 +02:00
Alejandro Celaya
5737acf759 Merge pull request #1099 from mikafouenski/develop
Run periodic `visit:locate` as opt-in
2021-05-30 17:55:13 +02:00
Alejandro Celaya
58262e8604 Update docker/docker-entrypoint.sh 2021-05-30 17:41:40 +02:00
Alejandro Celaya
b9e5eaf689 Update docker/docker-entrypoint.sh 2021-05-30 17:41:00 +02:00
Alejandro Celaya
6d78cd59e9 Fixed merge conflicts 2021-05-30 13:31:37 +02:00
Alejandro Celaya
aa00e33b6d Added v2.7.1 to changelog 2021-05-30 13:25:37 +02:00
Alejandro Celaya
4ef04c641e Merge pull request #1101 from acelaya-forks/feature/disable-geolite-download
Feature/disable geolite download
2021-05-30 13:02:30 +02:00
Alejandro Celaya
bfcccd8c33 Added test to check for GeoLite db update disabling based on tracking options 2021-05-30 12:36:58 +02:00
Alejandro Celaya
f7d3c73c4a Skip downloading GeoLite db if global tracking or IP tracking are disabled 2021-05-30 12:30:03 +02:00
Mickaël Bernardini
bfdece1c23 add ENABLE_PERIODIC_VISIT_LOCATE opt-in
This will trigger `visit:locate` every hour
2021-05-26 15:45:24 +02:00
Alejandro Celaya
a68f450d36 Merge pull request #1097 from acelaya-forks/feature/php8
Feature/php8
2021-05-23 12:54:12 +02:00
Alejandro Celaya
d1df225e47 Moved changelog line 2021-05-23 12:39:00 +02:00
Alejandro Celaya
9c6ba4bc61 More PHP 8 syntactic sugar 2021-05-23 12:37:53 +02:00
Alejandro Celaya
c01121d61a Added nullsafe operator to simplify conditions 2021-05-23 12:31:10 +02:00
Alejandro Celaya
e0f0bb5523 Migrated all constructor props to property promotion when possible 2021-05-23 11:57:31 +02:00
Alejandro Celaya
a3b7742992 Merge pull request #1096 from shlinkio/develop
Release 2.7.0
2021-05-23 09:31:01 +02:00
Alejandro Celaya
4b5fa6ddad Merge pull request #1095 from acelaya-forks/feature/update-docker-deps
Updated docker dependencies
2021-05-23 09:16:54 +02:00
Alejandro Celaya
b6aca82da6 Updated docker dependencies 2021-05-23 09:05:35 +02:00
Alejandro Celaya
8ee3bb4d58 Merge pull request #1094 from acelaya-forks/feature/improve-locks
Feature/improve locks
2021-05-23 08:54:10 +02:00
Alejandro Celaya
46bea241e6 Updated changelog 2021-05-23 08:42:26 +02:00
Alejandro Celaya
5e6d2881bc Used ShorturlIdentifier model whenever possible 2021-05-23 08:41:42 +02:00
Alejandro Celaya
cd19876419 Removed methods to create tags and domains with lock, as they do not really lock as expected 2021-05-23 08:21:40 +02:00
Alejandro Celaya
f82e103bc5 Added locks to tag and domain creation during short URL creation 2021-05-22 22:06:40 +02:00
Alejandro Celaya
3ff4ac84c4 Added locking to short URL creation when checking if URL exists 2021-05-22 22:06:40 +02:00
Alejandro Celaya
bf0c679a48 Added real versions from some shlink dependencies 2021-05-22 22:06:08 +02:00
Alejandro Celaya
96c5bc164a Merge pull request #1093 from acelaya-forks/feature/improve-mutation-ci
Split execution of db and unit mutation tests during ci workflow
2021-05-22 21:50:59 +02:00
Alejandro Celaya
73aead01b4 Split execution of db and unit mutation tests during ci workflow 2021-05-22 21:35:32 +02:00
Alejandro Celaya
e19b3cc45d Merge pull request #1092 from acelaya-forks/feature/bot-detection
Feature/bot detection
2021-05-22 21:34:59 +02:00
Alejandro Celaya
a1cab4ca7d Fixed typos 2021-05-22 21:22:15 +02:00
Alejandro Celaya
4b89687e45 Updated changelog 2021-05-22 21:17:00 +02:00
Alejandro Celaya
1c861fecfc Documented the excludeBots query param for visits endpoints 2021-05-22 21:14:15 +02:00
Alejandro Celaya
a12c9f54c4 Added API tests covering the excludion of bot visits 2021-05-22 21:05:54 +02:00
Alejandro Celaya
69d72e754f Added logic to exclude bots from visits when requested 2021-05-22 20:49:24 +02:00
Alejandro Celaya
db3c5a3031 Added new models to pass to repositories when listing visits of any kind 2021-05-22 20:32:30 +02:00
Alejandro Celaya
6327ed814a Added new models to pass to repositories when counting visits of any kind 2021-05-22 20:16:32 +02:00
Alejandro Celaya
9fa32b5b6b Added detection of visits from potential bots 2021-05-22 15:09:14 +02:00
Alejandro Celaya
663ae9f6bb Merge pull request #1091 from acelaya-forks/feature/improved-crawling
Feature/improved crawling
2021-05-22 11:48:55 +02:00
Alejandro Celaya
70c73bc5d6 Removed no-longer valid false positive for static analysis 2021-05-22 10:08:33 +02:00
Alejandro Celaya
05d73552cf Used PHP 8.0 in ci workflow when running against just one PHP version 2021-05-22 09:49:24 +02:00
Alejandro Celaya
70384237c1 Updated changelog 2021-05-22 09:42:24 +02:00
Alejandro Celaya
36e4a0dd32 Added tests for findCrawlableShortCodes 2021-05-22 09:41:12 +02:00
Alejandro Celaya
3ef02d46c0 Added logic to resolve crawlable short codes 2021-05-22 09:34:42 +02:00
Alejandro Celaya
e6ce84aa14 Added more missing API spec docs 2021-05-22 07:40:21 +02:00
Alejandro Celaya
348e34d52e Added new crawlable flag to Short URLs 2021-05-22 07:35:47 +02:00
Alejandro Celaya
2e6b3c0561 Documented crawlable prop in API specs 2021-05-22 07:32:47 +02:00
Alejandro Celaya
7280b48cdc Created action to dynamically build the robots.txt 2021-05-22 07:15:34 +02:00
Alejandro Celaya
2803f65479 Merge pull request #1087 from acelaya-forks/feature/granular-tracking
Feature/granular tracking
2021-05-16 13:26:52 +02:00
Alejandro Celaya
3535688c3b Updated to latest installer with support for all tracking options 2021-05-16 13:21:12 +02:00
Alejandro Celaya
9cff570c45 Updated changelog 2021-05-16 10:12:35 +02:00
Alejandro Celaya
15c028e151 Ensured visitor is normalized before creating the visit 2021-05-16 10:08:05 +02:00
Alejandro Celaya
f0dc32b6e5 Added logic for new tracking options 2021-05-16 09:53:44 +02:00
Alejandro Celaya
d423d18249 Defined new structure for tracking config, together with new options 2021-05-16 09:30:15 +02:00
Alejandro Celaya
8a8e3c3fc8 Merge pull request #1076 from acelaya-forks/feature/import-from-shlink
Feature/import from shlink
2021-04-18 17:43:48 +02:00
Alejandro Celaya
111fc3c37d Updated changelog 2021-04-18 17:09:06 +02:00
Alejandro Celaya
e9a5284dde Encapsulated logic to get rid of nested ifs 2021-04-18 17:07:56 +02:00
Alejandro Celaya
b277f431c2 Added test covering imported short URLs with visits 2021-04-18 12:44:02 +02:00
Alejandro Celaya
c8b8947b1f Allowed to import visits to existing already imported short URLs 2021-04-18 11:58:59 +02:00
Alejandro Celaya
9a78d1585d Ensured only pending visits are imported when processing a short URL which already has imported visits 2021-04-11 20:00:08 +02:00
Alejandro Celaya
09414a8834 Allowed to optionally import visits from other shlink instance 2021-04-11 13:30:12 +02:00
Alejandro Celaya
1efa973507 Updated ImportedLinksProcessor to support importing visits if provided 2021-04-11 11:44:10 +02:00
Alejandro Celaya
e23cd6a856 Removed old MySQL connection options 2021-04-11 11:44:10 +02:00
Alejandro Celaya
743bb7a6ee Updated ShortUrl importing to take metadata into account 2021-04-11 11:44:10 +02:00
Alejandro Celaya
086efe3c63 Merge pull request #1064 from KetchupBomb/develop
Feature/show API key info in short-url CLI
2021-04-11 11:42:51 +02:00
Alejandro Celaya
d751df70fd Updated changelog 2021-04-11 11:30:43 +02:00
Alejandro Celaya
334d95c843 Improved test covering ListSHortUrlsCommand with optional tags 2021-04-11 11:29:42 +02:00
Alejandro Celaya
5ddac7866b Ensured short URL transformation happens only once per short URL when listing from CLI 2021-04-11 11:06:29 +02:00
Alejandro Celaya
a896fbbb90 Fixed coding styles 2021-04-11 10:50:35 +02:00
Alejandro Celaya
a478699fe8 Merge pull request #1068 from acelaya-forks/feature/dependency-persistence
Feature/dependency persistence
2021-04-10 12:15:31 +02:00
Alejandro Celaya
6387e50276 Updated changelog 2021-04-10 12:03:40 +02:00
Alejandro Celaya
28c06de685 Fixed issue when trying to persist several short URLs which include the same new tag/domain at once 2021-04-10 11:59:43 +02:00
Alejandro Celaya
823573cea7 Updated PersistenceShortUrlRelationResolver to prevent duplicated tags 2021-04-10 10:16:09 +02:00
KetchupBomb
5d0f306bcc Feature/show API key info in short-url CLI 2021-04-10 07:10:22 +00:00
Alejandro Celaya
f30e922074 Merge pull request #1065 from acelaya-forks/feature/split-db-update-and-location
Feature/split db update and location
2021-04-08 17:13:29 +02:00
Alejandro Celaya
96ff0bffda Updated changelog 2021-04-08 17:00:57 +02:00
Alejandro Celaya
d9b675fc8b Updated to an installer version with support to download the GeoLite db file 2021-04-08 16:56:55 +02:00
Alejandro Celaya
104b7390da Updated docker entry point so that it tries to download the GeoLite2 db file when the license key was provided 2021-04-08 14:32:19 +02:00
Alejandro Celaya
7b4456e73f Ensured events triggered as a result of a new visit are never skipped 2021-04-08 14:09:26 +02:00
Alejandro Celaya
86230d9bf3 Removed duplicated code during CLI command tests 2021-04-08 13:44:24 +02:00
Alejandro Celaya
1f8994ca8b Created DownloadGeoLiteDbCommandTest 2021-04-08 13:34:14 +02:00
Alejandro Celaya
f7b6f4ba19 Created new command containing the logic to download the GeoLite2 db file 2021-04-08 13:12:37 +02:00
Alejandro Celaya
74ea5969be Created new listener to update the GeoLite db after a visit occurs 2021-04-07 16:29:29 +02:00
Alejandro Celaya
c4718e7523 Extended error handling on LocateVisit handler 2021-04-07 12:53:53 +02:00
Alejandro Celaya
5de706e0fe Fixed LocateVisitTest 2021-04-07 11:52:50 +02:00
Alejandro Celaya
77d06b4b03 Renamed argument to have a more clear intention 2021-04-07 11:48:01 +02:00
Alejandro Celaya
b4d137375a Flipped events triggered when locating a visit, so that geolocation is done synchronously 2021-04-07 11:35:02 +02:00
Alejandro Celaya
0621ae7735 Ensured visits tracking is run transactionally together with the event dispatched afterwards 2021-04-07 11:33:23 +02:00
Alejandro Celaya
3a6a1f25a7 Updated to latest doctrine/orm without security issues 2021-04-06 17:34:31 +02:00
Alejandro Celaya
731dc64f44 Merge pull request #1061 from acelaya-forks/feature/update-mercure
Updated to symfony/mercure 0.5
2021-04-02 09:59:31 +02:00
Alejandro Celaya
d72b9cf646 Updated to symfony/mercure 0.5 2021-04-02 09:46:02 +02:00
Alejandro Celaya
0f0c4dc549 Fixed comment 2021-03-30 18:18:38 +02:00
Alejandro Celaya
ea0820d881 Merge pull request #1060 from LeagueRaINi/patch-1
Create volume for /etc/shlink/data
2021-03-30 18:11:50 +02:00
RaINi_
312f20d2f1 Create volume for /etc/shlink/data
Makes it so shlink can be used as a docker service without losing ur data every time
2021-03-29 12:46:45 +02:00
Alejandro Celaya
f8289fa4be Merge pull request #1054 from acelaya-forks/feature/migrations-fix
Updated to latest migrations patch and removed workaround
2021-03-14 12:45:23 +01:00
Alejandro Celaya
554209d644 Updated to latest migrations patch and removed workaround 2021-03-14 12:28:30 +01:00
Alejandro Celaya
4ce44034cb Ensured API key name appears in the proper color in the console, for disabled or expired API keys 2021-03-14 10:20:05 +01:00
Alejandro Celaya
221b62ea57 Merge pull request #1053 from acelaya-forks/feature/api-key-improvements
Feature/api key improvements
2021-03-14 10:14:45 +01:00
Alejandro Celaya
0a5c265b12 Extracted ApiKey metadata to the ApiKeyMeta object 2021-03-14 09:59:35 +01:00
Alejandro Celaya
9b55389538 First steps to create ApiKeyMeta 2021-03-14 09:15:52 +01:00
Alejandro Celaya
60a8d6e986 Merge pull request #1052 from acelaya-forks/feature/api-test-logs
Feature/api test logs
2021-03-14 09:15:10 +01:00
Alejandro Celaya
d7523bcb57 Reduced duplication by creating a function that builds test logger config 2021-03-14 09:01:11 +01:00
Alejandro Celaya
562110fac4 Updated changelog 2021-03-14 08:55:39 +01:00
Alejandro Celaya
d104265f04 Updated CONTRIBUTING file, explaining how the logs are dumped during API tests 2021-03-14 08:54:05 +01:00
Alejandro Celaya
4439685403 Fixed logs generated by shlink during API tests 2021-03-14 08:49:38 +01:00
Alejandro Celaya
9feb72235a Added config to log in filesystem while running API tests 2021-03-14 08:33:00 +01:00
Alejandro Celaya
c372a498cc Fixed merge conflicts 2021-03-12 16:34:00 +01:00
Alejandro Celaya
be35349350 Fixed typo 2021-03-12 16:22:53 +01:00
Alejandro Celaya
771fd74978 Merge pull request #1049 from acelaya-forks/feature/mysql-migrations-error
Feature/mysql migrations error
2021-03-12 16:22:13 +01:00
Alejandro Celaya
3ba9ee7bf1 Updated changelog 2021-03-12 11:56:41 +01:00
Alejandro Celaya
a0062a62e8 Ensured all migrations are non-transactional, which allows woring around an issue in doctrine-migrations 2021-03-12 11:52:43 +01:00
Alejandro Celaya
0f2bd77ebc Fixed dependencies pinned to older versions 2021-03-12 08:54:23 +01:00
Alejandro Celaya
744b368cc1 Updated changelog 2021-03-08 19:50:43 +01:00
Alejandro Celaya
a03c4519c9 Updated CONTRIBUTING doc 2021-03-08 07:00:25 +01:00
Alejandro Celaya
66327881d5 Merge pull request #1045 from KetchupBomb/develop
Feature/name api keys
2021-03-07 23:14:53 +01:00
KetchupBomb
b93b14986e Feature/name api keys 2021-03-07 21:30:37 +00:00
Alejandro Celaya
1ade4e9917 Updated CONTRIBUTING doc mentioning API tests are run using Postgres 2021-03-07 09:22:04 +01:00
Alejandro Celaya
65f2ab6720 Changed approach to ensure the default value for the version while building the docker image is latest 2021-03-01 21:17:32 +01:00
Alejandro Celaya
7d38ba12bd Merge pull request #1042 from acelaya-forks/feature/fix-latest-docker-version
Ensured latest docker image is built with SHLINK_VERSION=latest
2021-03-01 17:21:30 +01:00
Alejandro Celaya
8128e85b6b Ensured latest docker image is built with SHLINK_VERSION=latest 2021-03-01 17:04:16 +01:00
Alejandro Celaya
3d99819be4 Merge pull request #1040 from acelaya-forks/feature/endroid-4.0
Feature/endroid 4.0
2021-02-28 16:56:11 +01:00
Alejandro Celaya
a2ca1618ea Updated changelog 2021-02-28 16:42:25 +01:00
Alejandro Celaya
b244c56862 Updated to endroid/qr-code 4 2021-02-28 16:41:52 +01:00
Alejandro Celaya
c931874bac Merge pull request #1038 from acelaya-forks/feature/happyr-spec-2
Feature/happyr spec 2
2021-02-26 20:47:29 +01:00
Alejandro Celaya
1b168ac3d2 Updated changelog 2021-02-26 20:34:04 +01:00
Alejandro Celaya
0fc123b249 Fixed coding styles 2021-02-26 20:28:41 +01:00
Alejandro Celaya
c622804950 Fixed unit tests 2021-02-26 20:27:41 +01:00
Alejandro Celaya
e093480a5b Fixed API tests 2021-02-26 20:24:57 +01:00
Alejandro Celaya
1498b72966 Updated to happyr/doctrine-specification 2, with some fixes 2021-02-26 20:01:16 +01:00
Alejandro Celaya
51e1c7cd50 Merge pull request #1035 from shlinkio/develop
Release 2.6.1
2021-02-22 22:18:02 +01:00
Alejandro Celaya
40040b627f Added v2.6.1 to changelog 2021-02-22 22:02:45 +01:00
Alejandro Celaya
b752f8a357 Updated to latest mezzio-swoole to fix warning when stopping shlink with swoole 2021-02-20 11:26:42 +01:00
Alejandro Celaya
5b93cf42b1 Merge pull request #1032 from acelaya-forks/feature/twitter-validation
Feature/twitter validation
2021-02-18 21:47:43 +01:00
Alejandro Celaya
fa8145df9f Updated changelog 2021-02-18 21:35:11 +01:00
Alejandro Celaya
5ddb6a7f99 Added e2e tests covering shortening of twitter URLs with url validatio enabled 2021-02-18 21:33:30 +01:00
Alejandro Celaya
8ad34357d3 Added User-Agent to UrlValidator, so that remote servers don't consider Shlink a bot 2021-02-18 21:27:46 +01:00
Alejandro Celaya
81eb2684bf Merge pull request #1027 from acelaya-forks/feature/remove-non-inclusive-terms
Feature/remove non inclusive terms
2021-02-16 17:31:37 +01:00
Alejandro Celaya
d2c0745efa Updated changelog 2021-02-16 15:32:11 +01:00
Alejandro Celaya
3f2d38a86a Removed all uses of the 'whitelist' term 2021-02-16 15:28:03 +01:00
Alejandro Celaya
4df4db05f4 Merge pull request #1025 from acelaya-forks/feature/wrong-skip-migration
Feature/wrong skip migration
2021-02-15 22:51:45 +01:00
Alejandro Celaya
6526fda960 Updated changelog 2021-02-15 22:22:07 +01:00
Alejandro Celaya
32fdb257a3 Fixed migration that could be incorrectly skipped due to wrong condition being used 2021-02-15 22:16:58 +01:00
Alejandro Celaya
9247cd874e Fixed wrong indentation in changelog 2021-02-14 08:30:17 +01:00
Alejandro Celaya
4ceb42b88d Small readme improvement 2021-02-14 08:28:37 +01:00
Alejandro Celaya
3d99fc1708 Merge pull request #1023 from shlinkio/develop
Release 2.6.0
2021-02-13 18:04:09 +01:00
Alejandro Celaya
656346bd04 Ensured mezzio-swoole config provider is dynamically loaded 2021-02-13 17:48:03 +01:00
Alejandro Celaya
6b5217ece2 Added v2.6.0 to changelog 2021-02-13 15:33:56 +01:00
Alejandro Celaya
0a2b388f6b Updated to stable shlink-installer 5.4 2021-02-13 14:57:15 +01:00
Alejandro Celaya
25b3de84ec Fixed pattern to resolve release artifacts 2021-02-13 14:33:36 +01:00
Alejandro Celaya
5c4e348078 Ensured repo si cloned durin publish workflow 2021-02-13 14:18:49 +01:00
Alejandro Celaya
2ac84ac8c4 Ensured generated dist files do not conflict 2021-02-13 14:12:38 +01:00
Alejandro Celaya
f0249346b0 Fixed version numbers 2021-02-13 14:05:31 +01:00
Alejandro Celaya
86651d7992 Merge pull request #1022 from acelaya-forks/feature/mutiple-dist-files
Feature/mutiple dist files
2021-02-13 14:04:42 +01:00
Alejandro Celaya
5cd5fb0071 Updated changelog 2021-02-13 13:49:53 +01:00
Alejandro Celaya
e3bf046c30 Documented new system with multiple dist files 2021-02-13 13:44:52 +01:00
Alejandro Celaya
d9af0a5547 Improved publish-release workflow to generate files for all supported PHP versions and with/without swoole 2021-02-13 13:29:38 +01:00
Alejandro Celaya
ede7551856 Updated build script so that it allows building a dist file for non-swoole envs 2021-02-13 12:56:41 +01:00
Alejandro Celaya
a2030b6c27 Updated to shlink-event-dispatcher 2.1 2021-02-13 11:39:51 +01:00
Alejandro Celaya
9a951589dc Updated year in license 2021-02-13 09:38:34 +01:00
Alejandro Celaya
c766cfad89 Updated to shlink-common 3.5 2021-02-12 23:40:29 +01:00
Alejandro Celaya
bd25572e08 Merge pull request #1021 from acelaya-forks/feature/migrate-command-timeout
Feature/migrate command timeout
2021-02-12 23:35:46 +01:00
Alejandro Celaya
4e00c950cc Created ProcessRunnerTest 2021-02-12 23:23:34 +01:00
Alejandro Celaya
d932f0a204 Increased timeout on db commands to 10 minutes 2021-02-12 22:59:40 +01:00
Alejandro Celaya
08507272ed Merge pull request #1019 from acelaya-forks/feature/simplified-content-length
Removed mezzio-helpers and used ContentLengthMiddleware from shlink-c…
2021-02-12 09:55:20 +01:00
Alejandro Celaya
9c48e6578d Removed mezzio-helpers and used ContentLengthMiddleware from shlink-common 2021-02-12 09:24:13 +01:00
Alejandro Celaya
db6c83eefd Merge pull request #1017 from acelaya-forks/feature/not-found-tracking
Feature/not found tracking
2021-02-11 22:55:08 +01:00
Alejandro Celaya
cc68cb944f Updated changelog 2021-02-11 22:43:23 +01:00
Alejandro Celaya
a0d8d237d7 Gitignored helper file 2021-02-11 22:23:30 +01:00
Alejandro Celaya
7d6d8e3a68 Added support to publish orphan visits in mercure 2021-02-11 22:12:38 +01:00
Alejandro Celaya
cc42f037c7 Merge branch 'develop' into feature/not-found-tracking 2021-02-11 13:53:21 +01:00
Alejandro Celaya
f4623ed028 Merge branch 'develop' of github.com:shlinkio/shlink into develop 2021-02-11 13:52:58 +01:00
Alejandro Celaya
bec467c703 Fixed issue with swoole 4.6.3 2021-02-11 13:52:36 +01:00
Alejandro Celaya
bd09b1571a Updated shlink-installer with support for orphan visits tracking option 2021-02-10 20:42:42 +01:00
Alejandro Celaya
3ed6953d0b Merge branch 'develop' of github.com:shlinkio/shlink into feature/not-found-tracking 2021-02-10 20:26:33 +01:00
Alejandro Celaya
2fc6fb0a9a Added option to disable orphan visitstracking 2021-02-10 20:09:25 +01:00
Alejandro Celaya
4b73bd907e Updated changelog 2021-02-10 08:23:29 +01:00
Alejandro Celaya
a18486cc2e Created OrphanVisits API test 2021-02-09 23:56:46 +01:00
Alejandro Celaya
82f4e22f69 Created OrphanVisitsActionTest 2021-02-09 23:41:51 +01:00
Alejandro Celaya
3497165ebd Created OrphanVisitsPaginatorAdapterTest 2021-02-09 23:34:29 +01:00
Alejandro Celaya
d5794a3dcb Created OrphanVisitDataTransformerTest 2021-02-09 23:09:42 +01:00
Alejandro Celaya
bd9ec53e7b Added test for VisitsStatsHelper::orphanVisits 2021-02-09 23:09:42 +01:00
Alejandro Celaya
5d98316c4e Created new REST API action to list orphan visits 2021-02-09 23:09:42 +01:00
Alejandro Celaya
dcf2526aad Documented swagger for new orphan visits endpoint 2021-02-09 23:09:42 +01:00
Alejandro Celaya
85dd023c0e Created methods to get orphan visits lists 2021-02-09 23:09:42 +01:00
Alejandro Celaya
1fbcb44136 Enhanced VisitsTrackerTest 2021-02-09 23:09:42 +01:00
Alejandro Celaya
ab9042db24 Ensured orphan visits are located ASAP when using swoole 2021-02-09 23:09:42 +01:00
Alejandro Celaya
b01487ac91 Ensured IP address is resolved when tracking orphan visits 2021-02-09 23:09:42 +01:00
Alejandro Celaya
5278d7668c Added orphan visits count to visits stats endpoint 2021-02-09 23:09:42 +01:00
Alejandro Celaya
f7215fc2c5 Documented ADR decision outcome 2021-02-09 23:09:42 +01:00
Alejandro Celaya
d2e0413a48 Added NotFoundTrackerMiddlewareTest 2021-02-09 23:09:42 +01:00
Alejandro Celaya
0e165bc7e0 Created NotFoundTypeResolverMiddlewareTest 2021-02-09 23:09:42 +01:00
Alejandro Celaya
55e7f7ccb0 Improved VisitRepository tests 2021-02-09 23:09:42 +01:00
Alejandro Celaya
15061d3e0d Created new middlewares to track not found visits 2021-02-09 23:09:42 +01:00
Alejandro Celaya
36be44e7b5 Moved VisitsTracker service to Visit namespace 2021-02-09 23:09:42 +01:00
Alejandro Celaya
1b4e62b823 Separated methods to track visits and list visits 2021-02-09 23:09:42 +01:00
Alejandro Celaya
12b07bb0ac Created named constructors for Visit entity and added tracking of the visited URL 2021-02-09 23:09:42 +01:00
Alejandro Celaya
f5666c9451 Added new columns for extra tracking in visits table 2021-02-09 23:09:42 +01:00
Alejandro Celaya
23cffce861 Updated Visit entity so that the short URL is nullable 2021-02-09 23:09:42 +01:00
Alejandro Celaya
a1fb44f2a6 Added ADR for not-found visits tracking 2021-02-09 23:09:42 +01:00
Alejandro Celaya
4d5dd8c8de Merge pull request #1012 from acelaya-forks/feature/swoole-update
Updated to swoole 4.6.3
2021-02-09 23:08:42 +01:00
Alejandro Celaya
1c492881e1 Updated to swoole 4.6.3 2021-02-09 22:55:30 +01:00
Alejandro Celaya
d310c53cce Merge pull request #1007 from acelaya-forks/feature/php-8.0.2
Updated docker images to PHP 8.0.2
2021-02-07 10:17:51 +01:00
Alejandro Celaya
2289eebd91 Updated docker images to PHP 8.0.2 2021-02-07 09:24:01 +01:00
Alejandro Celaya
e259bd62ab Merge pull request #1006 from acelaya-forks/feature/qr-margin
Feature/qr margin
2021-02-07 08:49:10 +01:00
Alejandro Celaya
9f512705fa Documented margin param on QR code endpoint 2021-02-07 08:35:52 +01:00
Alejandro Celaya
383fde488b Added support to define the margin when generating the QR codes 2021-02-07 08:32:12 +01:00
Alejandro Celaya
b54350674c Merge pull request #1005 from acelaya-forks/feature/fix-string-epoch
Feature/fix string epoch
2021-02-06 22:23:09 +01:00
Alejandro Celaya
1e2b88496c Updated changelog 2021-02-06 21:51:05 +01:00
Alejandro Celaya
919b567d46 Added tests covering new logic to parse GeolLite 2 build epoch param 2021-02-06 21:49:49 +01:00
Alejandro Celaya
da65c05c4f Added double check when parsing build epoch from the GeoLite db file in case it is not an integer 2021-02-06 21:38:09 +01:00
Alejandro Celaya
2f8ca6cf11 Merge pull request #1004 from acelaya-forks/feature/import-csv
Feature/import csv
2021-02-06 21:04:23 +01:00
Alejandro Celaya
7121ff340a Updated changelog 2021-02-06 20:47:26 +01:00
Alejandro Celaya
37f4d18d34 Updated to shlink-importer v2.2 2021-02-06 20:45:45 +01:00
Alejandro Celaya
a8b424003c Merge pull request #1003 from acelaya-forks/feature/title
Feature/title
2021-02-05 18:54:22 +01:00
Alejandro Celaya
de4e677f18 Fixed database started for API tests in GitHub workflow 2021-02-05 18:33:36 +01:00
Alejandro Celaya
bc632fd644 Updated changelog 2021-02-05 18:26:22 +01:00
Alejandro Celaya
d386e1405c Ensure request is not performed if both title resolution and URL validation are disabled 2021-02-05 18:22:54 +01:00
Alejandro Celaya
608742c2e2 Added helper service to avoid code duplication when resolving short URLs titles 2021-02-05 17:59:34 +01:00
Alejandro Celaya
71e91a541f Allowed to resolve title during short URL edition if it has to 2021-02-04 23:02:26 +01:00
Alejandro Celaya
ed18f10b94 Added support to order short URLs by title 2021-02-04 22:07:54 +01:00
Alejandro Celaya
4330a09793 Removed use of deprecated approach for ordering in ListShort 2021-02-04 21:33:26 +01:00
Alejandro Celaya
16873201e9 Added support to search short URLs by title 2021-02-04 21:27:16 +01:00
Alejandro Celaya
2640c7b43c Updated to a shlink-importer version that supports titles 2021-02-04 15:24:27 +01:00
Alejandro Celaya
7824dddef7 Added tracking to tell if short URL titles were autogenerated or not 2021-02-03 19:22:47 +01:00
Alejandro Celaya
7192480751 Update installer version 2021-02-03 18:26:50 +01:00
Alejandro Celaya
1da66f272c Added AUTO_RESOLVE_TITLES env var for the docker image 2021-02-03 13:41:37 +01:00
Alejandro Celaya
0ef1e347e7 Enhanced UrlShortenerTest 2021-02-03 13:28:51 +01:00
Alejandro Celaya
bfba05c863 Enhanced UrlValidatorTest 2021-02-03 11:53:08 +01:00
Alejandro Celaya
71f85350da Fixed regex to parse title from URL to consider possible attributes 2021-02-03 11:28:40 +01:00
Alejandro Celaya
8b54098299 Added option to automatically resolve url titles 2021-02-03 11:07:47 +01:00
Alejandro Celaya
356e68ca3e Documented new title prop in swagger docs 2021-02-02 21:20:09 +01:00
Alejandro Celaya
430c407106 Added support for an optional title field in short URLs 2021-02-02 21:20:09 +01:00
Alejandro Celaya
31a7212a71 Improvements in CONTRIBUTING doc 2021-02-02 21:19:38 +01:00
Alejandro Celaya
36a172308a Merge pull request #998 from acelaya-forks/feature/fix-base-path-with-domain
Feature/fix base path with domain
2021-02-01 23:32:16 +01:00
Alejandro Celaya
e20df481a4 Updated changelog 2021-02-01 23:20:48 +01:00
Alejandro Celaya
8fa0c95f5a Ensured base path is honored when stringifying short URLs with a custom domain 2021-02-01 23:18:52 +01:00
Alejandro Celaya
4b4a859722 Created ShortUrlStringifierTest 2021-02-01 23:18:52 +01:00
Alejandro Celaya
9cddedcdba Extracted logic to stringify ShortUrls to its own service 2021-02-01 23:18:52 +01:00
Alejandro Celaya
01aebd90d5 Added 988 link in changelog 2021-02-01 10:45:31 +01:00
Alejandro Celaya
c00105607c Merge pull request #997 from Roy-Orbison/patch-1
Allow serving of 0-byte, real files
2021-02-01 10:36:49 +01:00
Roy-Orbison
79ff12a1b0 Allow serving of 0-byte, real files
Essential for many HTTP challenges for domain verification, SSL cert issuance, etc.
2021-02-01 14:47:11 +10:30
Alejandro Celaya
e30c9c86ff Merge pull request #995 from acelaya-forks/feature/improve-url-relations
Feature/improve url relations
2021-01-31 16:26:50 +01:00
Alejandro Celaya
c61e1e1c0e Updated EditShortUrlAction so that it returns the parsed short URL instead of an empty response 2021-01-31 13:21:23 +01:00
Alejandro Celaya
85bc5ce595 Moved transformer to constructor in some actions, to avoid creating it over and over 2021-01-31 13:12:56 +01:00
Alejandro Celaya
ef12e90ae7 Removed non-used deprecated method and added missing tests 2021-01-31 13:05:21 +01:00
Alejandro Celaya
6b0f6e4541 Updated changelog 2021-01-31 12:27:35 +01:00
Alejandro Celaya
cdfd14e63f Deprecated action and endpoint to edit short URL tags 2021-01-31 12:24:26 +01:00
Alejandro Celaya
977058d219 Updated short URL edition so that it supports editing tags 2021-01-31 12:12:21 +01:00
Alejandro Celaya
c58fa586e1 Removed use of deprecated methods in DB tests 2021-01-31 11:51:00 +01:00
Alejandro Celaya
1cd6fdeede Centralized logic to normalize tag names and removed references to deprecated setTags method in unit tests 2021-01-31 11:09:00 +01:00
Alejandro Celaya
09f25d78b7 Refactored API tests fixtures to avoid using deprecated methods 2021-01-31 11:01:38 +01:00
Alejandro Celaya
82091c7951 Added logic to resolve tags during short URL creation through ShortUrlRelationResolver 2021-01-31 10:53:18 +01:00
Alejandro Celaya
1081211439 Merge pull request #994 from acelaya-forks/feature/input-filter-improvements
Renamed ShortUrlInputFilter and added named constructors to it
2021-01-31 08:18:17 +01:00
Alejandro Celaya
7e90fd45a7 Renamed ShortUrlInputFilter and added named constructors to it 2021-01-31 07:47:58 +01:00
Alejandro Celaya
08f4a424e6 Merge pull request #993 from acelaya-forks/feature/short-url-meta-refactoring
Feature/short url meta refactoring
2021-01-30 23:26:49 +01:00
Alejandro Celaya
063ee9c195 Inlcuded tags as part of the ShortUrlMeta 2021-01-30 19:17:12 +01:00
Alejandro Celaya
3f2bd657e1 Used input factory methods from shlink-common when possible 2021-01-30 18:58:39 +01:00
Alejandro Celaya
903ef8e249 Normalized some filtering 2021-01-30 18:24:14 +01:00
Alejandro Celaya
07b12fac3c Refactored short URL creation so that the long URL is part of the ShortUrlMeta 2021-01-30 14:18:44 +01:00
Alejandro Celaya
56a2253535 Merge pull request #992 from acelaya-forks/feature/kebab-case-cli
Feature/kebab case cli
2021-01-30 11:37:24 +01:00
Alejandro Celaya
752ded2f80 Changed to kebab-case for CLI flags in command tests 2021-01-30 11:25:20 +01:00
Alejandro Celaya
248d5e2fe5 Updated changelog 2021-01-30 11:19:21 +01:00
Alejandro Celaya
158e981970 Deprecated camelCase options in rest of CLI commands 2021-01-30 11:17:13 +01:00
Alejandro Celaya
96d07c4b4e Deprecated camelCase options in some CLI commands 2021-01-30 10:54:11 +01:00
Alejandro Celaya
28afb8944f Merge pull request #991 from acelaya-forks/feature/php8-dockers
Feature/php8 dockers
2021-01-30 10:09:31 +01:00
Alejandro Celaya
0d59ebfe55 Recovered ARG to ENV in Dockerfile 2021-01-30 10:08:33 +01:00
Alejandro Celaya
bc38ecf6de Fixed image which checks if Dockerfile changed by making sure it fetches more commits 2021-01-30 09:54:47 +01:00
Alejandro Celaya
755a52b78e Updated official docker image to PHP 8 2021-01-30 09:45:47 +01:00
Alejandro Celaya
4c008f1672 Updated dev docker images to PHP 8 2021-01-30 09:31:08 +01:00
Alejandro Celaya
eb268fb856 Updated changelog 2021-01-24 23:26:28 +01:00
Alejandro Celaya
b0e390ced1 Merge pull request #985 from acelaya-forks/feature/php8-deps
Feature/php8 deps
2021-01-24 23:25:43 +01:00
Alejandro Celaya
741e8f625c No longer allow errors on any step during CI 2021-01-24 23:09:46 +01:00
Alejandro Celaya
17eb6dc4ce Updated remaining dependencies without PHP 8 support 2021-01-24 23:00:10 +01:00
Alejandro Celaya
db997fe6f5 Do not allow ignoring platform reqs anymore during CI 2021-01-24 22:59:19 +01:00
Alejandro Celaya
3b1fc2a27d Updated link to PHPUnit's xsd to use local one 2021-01-24 22:56:43 +01:00
Alejandro Celaya
0cbd965010 Fixed merge conflicts 2021-01-24 14:21:21 +01:00
Alejandro Celaya
f3c3979eec Merge pull request #984 from shlinkio/release/2.5.2
Release/2.5.2
2021-01-24 14:17:51 +01:00
Alejandro Celaya
bf26f5baa1 Added v2.5.2 to changelog 2021-01-24 14:05:09 +01:00
Alejandro Celaya
164462d536 Merge pull request #983 from acelaya-forks/feature/cors-allowed-methods
Feature/cors allowed methods
2021-01-24 14:04:23 +01:00
Alejandro Celaya
239af85dd4 Updated changelog 2021-01-24 13:51:29 +01:00
Alejandro Celaya
f585cfe02e Fixed CrossDomainMiddleware not inferring proper allowed methods 2021-01-24 13:49:57 +01:00
Alejandro Celaya
ef54caab85 Merge pull request #982 from acelaya-forks/feature/roles-adr
Feature/roles adr
2021-01-24 12:34:38 +01:00
Alejandro Celaya
aaaa3010ab Updated changelog 2021-01-24 12:32:19 +01:00
Alejandro Celaya
cfdf866c3f Added architectural decision record for the API key roles 2021-01-24 12:31:08 +01:00
Alejandro Celaya
2a1a386b9c Created ADR for API key roles 2021-01-24 10:56:15 +01:00
Alejandro Celaya
a4de8cee7d Merge pull request #981 from acelaya-forks/feature/cors-fix
Feature/cors fix
2021-01-24 09:54:14 +01:00
Alejandro Celaya
a9d6c463ed Updated changelog 2021-01-24 09:30:21 +01:00
Alejandro Celaya
b8a725d60c Added missing itemsPerPage param for short URLs endpoint to swagger docs 2021-01-24 09:27:40 +01:00
Alejandro Celaya
927fb51313 Removed Action sufix from API tests 2021-01-24 09:25:36 +01:00
Alejandro Celaya
76aa6502db Changed value returned in Access-Control-Allow-Origin so that it is always set to '*' 2021-01-24 09:22:46 +01:00
Alejandro Celaya
7d908b6545 Merge pull request #978 from acelaya-forks/feature/pagerfanta
Feature/pagerfanta
2021-01-23 14:55:55 +01:00
Alejandro Celaya
83a29d6ed0 Updated changelog 2021-01-23 14:38:58 +01:00
Alejandro Celaya
55ddc4ae75 Replaced laminas-paginator with pagerfanta 2021-01-23 14:37:34 +01:00
Alejandro Celaya
088e361228 Merge pull request #976 from acelaya-forks/feature/fix-qr-php8
Added package fixing PHP 8 error
2021-01-23 09:40:56 +01:00
Alejandro Celaya
80012b8ee8 Do not allow unit tests to fail 2021-01-23 06:16:04 +01:00
Alejandro Celaya
a61235a5d1 Removed dependency on acelaya/qrcode-detector-decoder 2021-01-23 06:07:16 +01:00
Alejandro Celaya
823242a6c2 Updated endroid 2021-01-23 06:01:12 +01:00
Alejandro Celaya
0670a4dc3c Added package fixing PHP 8 error 2021-01-23 05:46:15 +01:00
Alejandro Celaya
f57303f8c0 Merge pull request #974 from shlinkio/develop
Release 2.5.1
2021-01-21 20:10:57 +01:00
Alejandro Celaya
2eff9929d8 Merge pull request #973 from acelaya-forks/feature/inline-creation-fix
Feature/inline creation fix
2021-01-21 19:59:49 +01:00
Alejandro Celaya
92d7dc2595 Added v2.5.1 to changelog 2021-01-21 19:44:56 +01:00
Alejandro Celaya
4a5cc9a986 Added API test for single-step short URL creation action 2021-01-21 19:43:34 +01:00
Alejandro Celaya
da9896a28b Fixed single step shortening endpoint 2021-01-21 19:26:19 +01:00
Alejandro Celaya
b5b3a50bb2 Added missing mention to xml extension
Closes #970
2021-01-19 15:42:14 +01:00
Alejandro Celaya
ea99b88c44 Merge pull request #969 from acelaya-forks/feature/fix-role-name-length
Feature/fix role name length
2021-01-18 17:34:49 +01:00
Alejandro Celaya
45d162e71a Updated roleName col length in entity metadata definition 2021-01-18 17:22:09 +01:00
Alejandro Celaya
8132113ed9 Updated changelog 2021-01-18 17:16:38 +01:00
Alejandro Celaya
eef49478fc Fixed migrations so that api_key_roles index does not fail 2021-01-18 17:14:46 +01:00
Alejandro Celaya
60cdd8b198 Merge pull request #967 from shlinkio/develop
Release 2.5.0
2021-01-17 20:14:52 +01:00
Alejandro Celaya
47d86b58a3 Added v2.5.0 to CHANGELOG 2021-01-17 20:00:02 +01:00
Alejandro Celaya
e6663aeb20 Merge pull request #964 from acelaya-forks/feature/docs-improvements
Feature/docs improvements
2021-01-17 17:57:44 +01:00
Alejandro Celaya
b321af6d03 Updated changelog 2021-01-17 17:42:02 +01:00
Alejandro Celaya
78038b3141 Simplified docker image docs, linking to the website for anything other than the very basics 2021-01-17 17:40:47 +01:00
Alejandro Celaya
89fd782dd3 Simplified README, linking to the website for advanced info 2021-01-17 17:26:51 +01:00
Alejandro Celaya
37c68c39b0 Updated to stable shlink-common 2021-01-17 16:48:28 +01:00
Alejandro Celaya
1309290a2f Merge pull request #963 from acelaya-forks/feature/mezzio-swoole-3
Feature/mezzio swoole 3
2021-01-17 13:31:04 +01:00
Alejandro Celaya
3e2701f136 Updated how to copy mezzio helper script to dist file 2021-01-17 13:03:44 +01:00
Alejandro Celaya
5ad1a12457 Updated changelog 2021-01-17 11:43:21 +01:00
Alejandro Celaya
2e8f5202d0 Moved event objects to a sub-namespace inside Core\EventDispatcher 2021-01-17 11:42:35 +01:00
Alejandro Celaya
6b6d751d54 Updated to shlinkio/shlink-event-dispatcher 2 2021-01-17 11:40:30 +01:00
Alejandro Celaya
a9704c6e2f Improved mezzio-swoole helper script to ensure it only applies to mezzio:swoole commands 2021-01-14 20:23:44 +01:00
Alejandro Celaya
e3ff447152 Updated to mezzio-swoole 3 2021-01-14 20:19:38 +01:00
Alejandro Celaya
c5fc8fbf00 Simplified database tests by updating to shlinkio/shlink-test-utils 2 2021-01-13 20:21:24 +01:00
Alejandro Celaya
da9e9df4ba Merge pull request #960 from acelaya-forks/feature/api-roles-cli
Feature/api roles cli
2021-01-11 20:35:48 +01:00
Alejandro Celaya
1c75519f9b Displayed 'Admin' as default role in API keys list 2021-01-11 20:23:28 +01:00
Alejandro Celaya
fca19f265b Removed duplicated lines in GenerateKeyCommand 2021-01-11 20:14:18 +01:00
Alejandro Celaya
75dab92225 Improved tests covering ListKeysCommand 2021-01-11 17:01:01 +01:00
Alejandro Celaya
9e9d213f20 Added roles info to api key generation and api key list 2021-01-11 16:32:59 +01:00
Alejandro Celaya
c49a0ca040 Added list of roles to print after an API is generated 2021-01-11 15:20:26 +01:00
Alejandro Celaya
1f2e16184c Extracted function to render arrays from inside ValidationException 2021-01-10 20:28:52 +01:00
Alejandro Celaya
7a19b8765d Created RoleResolverTest 2021-01-10 20:24:13 +01:00
Alejandro Celaya
a639a4eb94 Added role capabilities to api-key:generate command 2021-01-10 20:14:06 +01:00
Alejandro Celaya
c9ff2b3834 Updated services required to initialize API keys with roles 2021-01-10 20:05:14 +01:00
Alejandro Celaya
95e51665b1 Merge pull request #958 from acelaya-forks/feature/api-key-permissions
Feature/api key permissions
2021-01-10 11:25:29 +01:00
Alejandro Celaya
91da241434 Updated changelog 2021-01-10 11:12:22 +01:00
Alejandro Celaya
5bec9f5b65 Extended swagger docs with errors on delete/rename tags 2021-01-10 11:07:17 +01:00
Alejandro Celaya
34bb023b7d Created API tests to cover deletion and renaming of tags with non-admin API keys 2021-01-10 10:28:00 +01:00
Alejandro Celaya
2be0050f3d Improved tag list api test to cover different API key cases 2021-01-10 10:17:27 +01:00
Alejandro Celaya
ff1af82ffd Improved tag visits api test to cover different API key cases 2021-01-10 10:00:00 +01:00
Alejandro Celaya
13cc70e6d4 Added more tags to more fixture short URLs in API keys 2021-01-10 09:54:19 +01:00
Alejandro Celaya
fa5934b8b6 Improved global visits api test to cover different API key cases 2021-01-10 09:36:10 +01:00
Alejandro Celaya
c8eb956778 Improved list domains api test to cover different API key cases 2021-01-10 09:32:19 +01:00
Alejandro Celaya
5283ee2c6b Moved common data provider for core unit tests to trait 2021-01-10 09:31:51 +01:00
Alejandro Celaya
c56d56d38c Added api tests to cover implicit domain when creating short URLs with proper API key 2021-01-10 09:09:56 +01:00
Alejandro Celaya
ea05259bbe Improved api tests where a short URL needs to be resolved, covering cases where API key lacks permissions 2021-01-10 09:02:05 +01:00
Alejandro Celaya
f17873b527 Added api tests for short URLs lists using API keys with permissions 2021-01-10 08:49:31 +01:00
Alejandro Celaya
f827186c77 Updated API test fixtures to include API keys with roles 2021-01-10 08:40:32 +01:00
Alejandro Celaya
380915948b Improved TagRepositoryTest 2021-01-09 18:00:08 +01:00
Alejandro Celaya
14eeb91c58 Added db test for VisitRepository::countVisits 2021-01-09 17:54:04 +01:00
Alejandro Celaya
01dceca9ef Enhanced ShorturlRepository::findOneMatching test to cover ApiKey use cases 2021-01-09 14:39:19 +01:00
Alejandro Celaya
ba32366b0b Added tagExists to TagRepositoryTest 2021-01-09 13:44:47 +01:00
Alejandro Celaya
bef1b13a33 Enhanced DomainRepositoryTest covering API key permissions 2021-01-09 13:16:33 +01:00
Alejandro Celaya
caa1ae0de8 Added all missing unit tests covering API key permissions 2021-01-09 12:38:06 +01:00
Alejandro Celaya
b0c4582f3f Used EntitySpecificationRepository as default entity repository 2021-01-09 10:56:02 +01:00
Alejandro Celaya
a8b68f07b5 Ensured delete/rename tags cannot be done with non-admin API keys 2021-01-06 17:31:49 +01:00
Alejandro Celaya
b5710f87e2 Created value object to wrap the renaming of a tag 2021-01-06 13:11:28 +01:00
Alejandro Celaya
041f231ff2 Implemented mechanism to add/remove roles from API keys 2021-01-06 10:59:08 +01:00
Alejandro Celaya
01b3c504f8 Ensured fixed commit for happyr/doctrine-specification is installed, until a stable v2.0 is released 2021-01-05 19:32:18 +01:00
Alejandro Celaya
f821dea06c Fixed typo on fixture 2021-01-05 19:29:42 +01:00
Alejandro Celaya
4b67d41362 Applied API role specs to short URL creation 2021-01-04 20:15:42 +01:00
Alejandro Celaya
19834f6715 Applied API role specs to domains list 2021-01-04 15:55:59 +01:00
Alejandro Celaya
262a06f624 Renamed method to be more consistent to what it actually does 2021-01-04 15:16:51 +01:00
Alejandro Celaya
a01e0ba337 Changed logic to list domains to centralize conditions in service 2021-01-04 15:02:37 +01:00
Alejandro Celaya
364be2420b Applied API role specs to short URL creation when findIfExists is provided 2021-01-04 13:54:38 +01:00
Alejandro Celaya
29cdfaed39 Changed ShortUrlMeta so that it expects an ApiKey instance instead of the key as string 2021-01-04 13:32:44 +01:00
Alejandro Celaya
24f7fb9c4f Applied API role specs to tags list without stats 2021-01-04 12:44:29 +01:00
Alejandro Celaya
68c601a5a8 Applied API role specs to global visits 2021-01-04 11:27:55 +01:00
Alejandro Celaya
8aa6bdb934 Applied API role specs to tag visits 2021-01-04 11:14:28 +01:00
Alejandro Celaya
4a1e7b761a Applied API role specs to short URL visits 2021-01-03 17:48:32 +01:00
Alejandro Celaya
25ee9b5daf Applied API role specs to single short URL tags edition 2021-01-03 16:50:47 +01:00
Alejandro Celaya
fff10ebee4 Applied API role specs to single short URL edition 2021-01-03 16:41:44 +01:00
Alejandro Celaya
65797b61a0 Applied API role specs to single short URL deletion 2021-01-03 14:03:10 +01:00
Alejandro Celaya
3e565d3830 Removed unnecesary if statements 2021-01-03 13:52:08 +01:00
Alejandro Celaya
dc08286a72 Applied API role specs to single short URL resolution 2021-01-03 13:33:07 +01:00
Alejandro Celaya
940383646b Applied API role specs to short URLs list 2021-01-03 13:05:21 +01:00
Alejandro Celaya
6e1d6ab795 Changed point in which specs are applied for tags list 2021-01-03 12:00:25 +01:00
Alejandro Celaya
df53e6c6f2 Created specs for API key roles 2021-01-02 20:08:49 +01:00
Alejandro Celaya
7e6882960e Added a system to set roles to API keys 2021-01-02 19:35:16 +01:00
Alejandro Celaya
ecf22ae4b6 Added happyr/doctrine-specification to support dunamically applying specs to queries 2021-01-02 17:14:42 +01:00
Alejandro Celaya
90551ff3bc Added used API key to request 2021-01-02 10:34:35 +01:00
Alejandro Celaya
598f2d8622 Merge pull request #950 from acelaya-forks/feature/run-parallel
Feature/run parallel
2021-01-01 11:32:21 +01:00
Alejandro Celaya
f3b4e94def Documented missing composer commands 2021-01-01 11:19:57 +01:00
Alejandro Celaya
6eb3dae8c3 Added dependency on composer parallel to speed-up dev commnds 2021-01-01 11:13:51 +01:00
Alejandro Celaya
09029dff37 Merge pull request #948 from acelaya-forks/feature/cors-improvements
Feature/cors improvements
2020-12-31 15:54:31 +01:00
Alejandro Celaya
9e7f2aea0d Updated changelog 2020-12-31 15:42:00 +01:00
Alejandro Celaya
850a5b412c Removed Access-Control-Expose-Headers header from CrossDomainM;iddleware, as it's actually not correct 2020-12-31 15:41:02 +01:00
Alejandro Celaya
84331135f7 Created API tests for CORS 2020-12-31 13:28:06 +01:00
Alejandro Celaya
202a7327d3 Updated more deps to increase PHP 8 compatibility 2020-12-24 10:37:07 +01:00
Alejandro Celaya
f42e2d87b3 Small update in docker docs 2020-12-22 16:12:39 +01:00
Alejandro Celaya
22124aced7 Updated more dependencies for PHP 8 compatibility 2020-12-22 09:34:58 +01:00
Alejandro Celaya
40676f2167 Removed scrutinizer coverage 2020-12-19 10:37:28 +01:00
Alejandro Celaya
d7b4720327 Merge pull request #936 from acelaya-forks/feature/php8-on-mutation
Added PHP 8 on mutation tests
2020-12-19 10:36:53 +01:00
Alejandro Celaya
3a4a2e4483 Replaced scrutinizer with codecov 2020-12-19 10:25:19 +01:00
Alejandro Celaya
71a83aa384 Added PHP 8 on mutation tests 2020-12-19 10:04:00 +01:00
Alejandro Celaya
291393eeeb Fixed branch for build badge 2020-12-13 18:07:13 +01:00
Alejandro Celaya
ea06c369b0 Merge pull request #933 from acelaya-forks/feature/ci-github-action
Feature/ci GitHub action
2020-12-13 17:56:50 +01:00
Alejandro Celaya
625c870417 Added step to build docker image, and deleted travis config file 2020-12-13 17:45:48 +01:00
Alejandro Celaya
a9e9f89799 Ensured code is cloned before using ocular to upload code coverage to scrutinizer during ci workflow 2020-12-13 17:31:22 +01:00
Alejandro Celaya
f2210ca0cb Added coverage driver to upload coverage job 2020-12-13 17:23:58 +01:00
Alejandro Celaya
1a42ca9239 Added missing dependency between upload coverage job and test jobs 2020-12-13 17:17:16 +01:00
Alejandro Celaya
53726bc679 Added steps to upload code coverage and delete artifacts to ci workflow 2020-12-13 13:34:22 +01:00
Alejandro Celaya
d8a7f3e08c Added mutation-tests step in ci workflow 2020-12-13 13:11:41 +01:00
Alejandro Celaya
ac5a22a3d0 Added static analysis and generation of code coverage artifacts 2020-12-13 12:59:06 +01:00
Alejandro Celaya
5dc2c1640a Added command to create mssql database for tests 2020-12-13 12:47:17 +01:00
Alejandro Celaya
7fe7354a27 Ensured mssql odbc installation is done as super user 2020-12-13 12:38:12 +01:00
Alejandro Celaya
ac85b913c2 Added other database test envs to ci workflow 2020-12-13 12:31:34 +01:00
Alejandro Celaya
0e58d1a242 Added pcov as code coverage driver in github action 2020-12-13 11:37:45 +01:00
Alejandro Celaya
5040f5b177 Changed condition to determine if tests are run in CI 2020-12-13 11:07:37 +01:00
Alejandro Celaya
77deb9c111 Created first version of the ci workflow 2020-12-13 10:44:02 +01:00
Alejandro Celaya
74bafefa68 Merge pull request #931 from acelaya-forks/feature/installer-update-option
Feature/installer update option
2020-12-11 22:00:27 +01:00
Alejandro Celaya
d564404bfe Updated changelog 2020-12-11 21:43:43 +01:00
Alejandro Celaya
b2658073b3 Created script to update config options 2020-12-11 21:42:40 +01:00
Alejandro Celaya
63bd95a123 Merge pull request #928 from acelaya-forks/feature/php8-support
Feature/php8 support
2020-12-06 12:00:45 +01:00
Alejandro Celaya
40105d7aaf Updated to latest swoole and pdo_sqlsrv extensions 2020-12-06 11:41:27 +01:00
Alejandro Celaya
c78991761f Fixed quotes in travis config 2020-12-06 11:29:23 +01:00
Alejandro Celaya
b7a0d319b3 Updated more dependencies to support PHP8 2020-12-04 18:50:00 +01:00
Alejandro Celaya
55bfa9776a Updated to shlinkio/shlink-event-dispatcher 1.6 2020-12-03 23:25:27 +01:00
Alejandro Celaya
d3a4ed607c Replaced --ignore-platform-reqs by --ignore-platform-req=php when running build on PHP 8 2020-12-03 22:27:25 +01:00
Alejandro Celaya
8c79619ff2 Updated to PHP8 compatible versions of symfony/mercure and pugx/shortid-php 2020-12-03 22:26:33 +01:00
Alejandro Celaya
6bedca4ee6 Added more tests covering unicode in custom slugs 2020-12-02 18:45:57 +01:00
Alejandro Celaya
9857f105ec Merge pull request #926 from acelaya-forks/feature/custom-slug-unicode
Feature/custom slug unicode
2020-12-02 12:12:31 +01:00
Alejandro Celaya
7ac1c32ad6 Fixed typo 2020-12-02 12:02:49 +01:00
Alejandro Celaya
6e9fa6553d Updated changelog 2020-12-02 12:01:35 +01:00
Alejandro Celaya
55ea8a6912 #896 Added support for unicode characters in custom slugs 2020-12-02 12:00:47 +01:00
Alejandro Celaya
179ddc5bd7 Merge pull request #925 from acelaya-forks/feature/db-socket-connection
Feature/db socket connection
2020-11-29 20:08:51 +01:00
Alejandro Celaya
bfd886604e Updated changelog 2020-11-29 19:50:39 +01:00
Alejandro Celaya
f34033aa9c Documented how to provide the unix socket to connect to mysql, maria and postgres databases 2020-11-29 19:46:34 +01:00
Alejandro Celaya
e54745b250 #833 Enabled unix socket option during installation 2020-11-29 14:01:26 +01:00
Alejandro Celaya
1975a35837 Updated to lcobucci/json 4.0 stable 2020-11-29 12:54:22 +01:00
Alejandro Celaya
5db66dcf0e Merge pull request #923 from acelaya-forks/feature/qr-codes-query-size
Feature/qr codes query size
2020-11-27 18:00:01 +01:00
Alejandro Celaya
cfdf2f9480 #917 Updated changelog 2020-11-27 17:50:09 +01:00
Alejandro Celaya
c13adb04ef #917 Documented QR endpoint with query size and path size 2020-11-27 17:47:52 +01:00
Alejandro Celaya
4f1ab977a1 #917 Added tests covering the different ways to provide sizes to the QR codes 2020-11-27 17:42:33 +01:00
Alejandro Celaya
fe59a5ad86 #917 Fixed cast to int on QR code action 2020-11-27 17:16:54 +01:00
Alejandro Celaya
a72dc16d85 #917 2020-11-27 17:05:13 +01:00
Alejandro Celaya
74108a19e5 Merge pull request #915 from acelaya-forks/feature/remove-plates
Feature/remove plates
2020-11-22 18:42:19 +01:00
Alejandro Celaya
abe0fc16df #912 Updated changelog 2020-11-22 18:13:12 +01:00
Alejandro Celaya
39bda5113b #912 Fixed unit tests 2020-11-22 18:11:31 +01:00
Alejandro Celaya
49ea5cc78b #912 Removed dependency on league/plates 2020-11-22 18:03:27 +01:00
Alejandro Celaya
8acde332b2 Merge pull request #914 from acelaya-forks/feature/mercure-10-compat
Feature/mercure 10 compat
2020-11-22 16:41:26 +01:00
Alejandro Celaya
600f7a7388 #869 Updated changelog 2020-11-22 16:27:24 +01:00
Alejandro Celaya
fd007ea4a9 #869 Updated dependencies to support mercure 0.10 2020-11-22 16:26:17 +01:00
Alejandro Celaya
d945c28a75 Merge pull request #911 from shlinkio/develop
Release 2.4.2
2020-11-22 11:01:00 +01:00
Alejandro Celaya
b66922b3d5 Ensured lcobucci/jwt stays in alpha 2020-11-22 10:44:13 +01:00
Alejandro Celaya
7d981434e1 Merge pull request #910 from acelaya-forks/feature/swoole-bug
Feature/swoole bug
2020-11-22 10:41:10 +01:00
Alejandro Celaya
c672d35b4a #827 Updated changelog 2020-11-22 10:26:18 +01:00
Alejandro Celaya
6259c73b33 #827 Fixed swoole config getting loaded on non-swoole contexts when running CLI command first 2020-11-22 10:24:06 +01:00
Alejandro Celaya
e4b00e832a Merge pull request #909 from acelaya-forks/feature/geolite-temp-dir
Feature/geolite temp dir
2020-11-21 12:48:28 +01:00
Alejandro Celaya
a452aeaf7e #899 Updated changelog 2020-11-21 12:38:14 +01:00
Alejandro Celaya
6e83b90028 #899 Changed temp directory in which geolite DB files are downloaded 2020-11-21 12:36:30 +01:00
Alejandro Celaya
45ffdce312 Merge pull request #908 from acelaya-forks/feature/domains-list
Feature/domains list
2020-11-21 09:46:16 +01:00
Alejandro Celaya
5485efc9ae #901 Fixed condition type 2020-11-21 08:51:30 +01:00
Alejandro Celaya
850360dd2b #901 Updated changelog 2020-11-21 08:45:57 +01:00
Alejandro Celaya
8d3ceaf462 #901 Ensured only domains in use are returned to lists 2020-11-21 08:44:28 +01:00
Alejandro Celaya
bb6c5de697 Merge pull request #907 from acelaya-forks/feature/missing-swagger-info
Feature/missing swagger info
2020-11-21 08:18:14 +01:00
Alejandro Celaya
ca4c1b00dc #904 Updated changelog 2020-11-21 08:16:22 +01:00
Alejandro Celaya
dda6d30c12 #904 Explicitly added missing Domains and Integrations tags to swagger docs 2020-11-21 08:13:29 +01:00
Alejandro Celaya
7bb40c74c1 Merge pull request #895 from shlinkio/develop
Release 2.4.1
2020-11-10 20:00:26 +01:00
Alejandro Celaya
4515a83e9b Fixed github action syntax 2020-11-10 19:06:50 +01:00
Alejandro Celaya
907a282b73 Merge pull request #894 from acelaya-forks/feature/docker-publish-action
Feature/docker publish action
2020-11-10 19:05:24 +01:00
Alejandro Celaya
5154638ddf Added v2.4.1 to changelog 2020-11-10 19:04:08 +01:00
Alejandro Celaya
52c9994eb4 #890 Migrated to official docker actions for docker-image-build workflow 2020-11-10 19:03:14 +01:00
Alejandro Celaya
912f287a27 Merge pull request #893 from acelaya-forks/feature/wrong-redirect-status
Feature/wrong redirect status
2020-11-10 18:59:09 +01:00
Alejandro Celaya
e99ab66afd Updated changelog 2020-11-10 18:33:33 +01:00
Alejandro Celaya
fb022eae68 #867 Changed use of deprecated functions by their replacements 2020-11-10 18:13:24 +01:00
Alejandro Celaya
259c52a698 #867 Ensured status code config is honored when doing not-found redirects 2020-11-10 18:08:25 +01:00
Alejandro Celaya
deeca582db #867 Small refactoring on NotFoundRedirecthandler 2020-11-10 17:30:14 +01:00
Alejandro Celaya
4dbcf6857e Merge pull request #892 from acelaya-forks/feature/fix-typehint
Feature/fix typehint
2020-11-10 17:28:10 +01:00
Alejandro Celaya
5190a03113 #846 Fixed base image used for PHP-FPM dev container 2020-11-10 16:08:22 +01:00
Alejandro Celaya
d60c3a4aa9 #891 Updated changelog 2020-11-10 15:51:04 +01:00
Alejandro Celaya
ce1c70fd7c #891 Fixed wrong return type hint on method inside migration when using postgres 2020-11-10 15:49:05 +01:00
Alejandro Celaya
29bb201581 Merge pull request #889 from shlinkio/develop
Release v2.4.0
2020-11-08 12:27:50 +01:00
Alejandro Celaya
006ec7c1d0 Added v2.4 to changelog 2020-11-08 12:14:41 +01:00
Alejandro Celaya
1bc9e0643d Merge pull request #888 from acelaya-forks/feature/simplify-auth-checks
Deleted everything related with authentication plugins, as shlink onl…
2020-11-07 13:02:51 +01:00
Alejandro Celaya
d6395a3de8 Deleted everything related with authentication plugins, as shlink only supports API key auth since v2.0.0 2020-11-07 12:53:14 +01:00
Alejandro Celaya
098751d256 Fixed link in changelog 2020-11-07 10:54:21 +01:00
Alejandro Celaya
8577d6bd99 Merge pull request #887 from acelaya-forks/feature/track-url-creator
Feature/track url creator
2020-11-07 10:40:43 +01:00
Alejandro Celaya
fe4e171ecb Removed unused mock 2020-11-07 10:30:25 +01:00
Alejandro Celaya
d99ea82761 Added migrations folder to the static analysis 2020-11-07 10:27:35 +01:00
Alejandro Celaya
27bc8d4823 Ensured API key is tracked when creating short URLs from the REST API 2020-11-07 10:23:08 +01:00
Alejandro Celaya
7c9f572eb1 Deleted old domain resolvers and added tests for new short url relation resolvers 2020-11-07 09:49:09 +01:00
Alejandro Celaya
2732b05834 Added mechanisms to be able to provide the API key when creating a short URL 2020-11-07 09:34:10 +01:00
Alejandro Celaya
97f89bcede Simplified transactional URL shortening 2020-11-06 20:05:57 +01:00
Alejandro Celaya
00255b04eb Added migration to create new author_api_key_id in short_urls 2020-11-06 19:43:05 +01:00
Alejandro Celaya
f90ea4bd98 Updated dependencies 2020-11-06 18:58:07 +01:00
Alejandro Celaya
0d7fb1163a Merge pull request #886 from acelaya-forks/feature/update-dependencies
Updated dependencies
2020-11-02 12:17:55 +01:00
Alejandro Celaya
cb340b5867 Updated phpunit configs to use new schema introduced in v9.3 2020-11-02 12:07:45 +01:00
Alejandro Celaya
1621f3a943 Updated dependencies 2020-11-02 11:53:14 +01:00
Alejandro Celaya
ae636aef5a Merge pull request #885 from acelaya-forks/feature/deprecate-create-tag
Feature/deprecate create tag
2020-11-02 11:17:30 +01:00
Alejandro Celaya
1346d7902e Updated changelog 2020-11-02 11:06:41 +01:00
Alejandro Celaya
544836b986 Deprecated tags creation 2020-11-02 11:05:14 +01:00
Alejandro Celaya
397f7d09e3 Merge pull request #884 from acelaya-forks/feature/missing-docker-extension
Feature/missing docker extension
2020-11-02 09:50:52 +01:00
Alejandro Celaya
efa707c676 Updated changelog 2020-11-02 09:25:17 +01:00
Alejandro Celaya
51c8b80489 Changed to for consistency in the Dockerfile 2020-11-02 09:24:14 +01:00
Alejandro Celaya
e71fb0ac7f Added gmp extension to docker images, as it seems to be required by geolite in some cases 2020-11-02 09:02:00 +01:00
Alejandro Celaya
681b7c836d Added swoole extension to publish-release github action 2020-11-01 11:47:04 +01:00
Alejandro Celaya
7c2c90fc49 Merge pull request #879 from acelaya-forks/feature/github-release-action
Feature/GitHub release action
2020-11-01 11:42:08 +01:00
Alejandro Celaya
ebe6a5f4aa Moved github release creation from travis to github action 2020-11-01 11:23:11 +01:00
Alejandro Celaya
65651e4bbd Updated changelog to more strictly endorse to keepachangelog spec 2020-11-01 11:22:29 +01:00
Alejandro Celaya
33190c07c7 Updated references from travis-ci.org to travis-ci.com 2020-10-31 08:25:03 +01:00
Alejandro Celaya
f651b0e5a1 Merge pull request #873 from acelaya-forks/feature/disable-platform-checks
Disabled platform checks in composer
2020-10-29 17:28:18 +01:00
Alejandro Celaya
c85eb84b4c Disabled platform checks in composer 2020-10-29 17:24:12 +01:00
Alejandro Celaya
86d428184e Merge pull request #866 from acelaya-forks/feature/composer-2
Updated to composer 2
2020-10-26 19:47:35 +01:00
Alejandro Celaya
c1529b7d6c Updated to composer 2 2020-10-25 17:59:37 +01:00
Alejandro Celaya
7ecc3aacc4 Merge pull request #865 from acelaya-forks/feature/importer
Feature/importer
2020-10-25 14:17:50 +01:00
Alejandro Celaya
b091bd4e2a Ensured composer 1 for now 2020-10-25 13:46:39 +01:00
Alejandro Celaya
90b4bc9b1a Updated changelog 2020-10-25 13:36:21 +01:00
Alejandro Celaya
de7096010e Created DoctrineBatchHelperTest 2020-10-25 13:30:18 +01:00
Alejandro Celaya
03a9697298 Created ImportedLinksProcessorTest 2020-10-25 13:20:34 +01:00
Alejandro Celaya
fdcf88de67 Added database tests for ShortUrlRepository::importedUrlExists 2020-10-25 12:06:48 +01:00
Alejandro Celaya
7c343f42c1 Improved how existing imported short URLs are checked by tracking its original short code 2020-10-25 11:57:26 +01:00
Alejandro Celaya
786e4f642b Moved short code uniqueness checks to external helper class that is used in UrlShortener and ImportedLinksProcessor 2020-10-25 11:16:42 +01:00
Alejandro Celaya
b1a073b1ab Ensured uniqueness on imported short URLs short code 2020-10-25 10:26:11 +01:00
Alejandro Celaya
2256f6a9e7 Added feedback to ImportedLinksProcessor 2020-10-24 15:09:46 +02:00
Alejandro Celaya
ec3e7212b2 Basic short-úrl import implementation 2020-10-24 13:55:54 +02:00
Alejandro Celaya
554d9b092f Added import_source column in ShortUrls 2020-10-23 12:59:39 +02:00
Alejandro Celaya
33d3837795 Added dependency on shlinkio/shlink-importer 2020-10-22 18:12:22 +02:00
Alejandro Celaya
0686ac2fb1 Merge pull request #857 from acelaya-forks/feature/php8
Feature/php8
2020-10-16 20:14:57 +02:00
Alejandro Celaya
ce3d267572 Updated changelog 2020-10-16 19:54:09 +02:00
Alejandro Celaya
4ec90e02c9 Updated to latest infection 2020-10-16 19:53:05 +02:00
Alejandro Celaya
e7bccb088d Updated to latest swoole and pdo_sqlsrv versions which are compatible with PHP8 2020-10-16 19:28:57 +02:00
Alejandro Celaya
cbc9f1257d Enabled Diactoros as module 2020-10-16 19:21:40 +02:00
Alejandro Celaya
c7f15b77fd Merge pull request #853 from dlondero/phpunit-static-assertions
PHPUnit static assertions
2020-10-04 09:44:18 +02:00
Daniel Londero
a8b0c46142 Fix typo 2020-10-04 00:35:29 +02:00
Daniel Londero
065d314608 Invoke PHPUnit's assertions statically 2020-10-04 00:35:14 +02:00
Alejandro Celaya
d426dbc684 Merge pull request #850 from acelaya-forks/feature/env-docker-port
Feature/env docker port
2020-10-03 12:12:25 +02:00
Alejandro Celaya
c6c78f383f Updated changelog 2020-10-03 11:56:09 +02:00
Alejandro Celaya
450eea64aa Added support for port option in SimplifiedConfigParser 2020-10-03 11:54:31 +02:00
Alejandro Celaya
c8d7413dd4 Documented support for PORT env var in Docker image 2020-10-03 11:52:27 +02:00
Alejandro Celaya
00a96e6215 Allowed to change swoole port in docker image by using the PORT env var 2020-10-03 11:49:25 +02:00
Alejandro Celaya
b15e90408f Merge pull request #849 from acelaya-forks/feature/domains-endpoint
Feature/domains endpoint
2020-09-27 12:59:54 +02:00
Alejandro Celaya
34c10c0bc9 Updated changelog 2020-09-27 12:50:03 +02:00
Alejandro Celaya
63a24342e3 Created unit test for ListDomainsCommand 2020-09-27 12:48:24 +02:00
Alejandro Celaya
073e4eeac8 Created command to list domains 2020-09-27 12:39:02 +02:00
Alejandro Celaya
06eda073bf Added API test for /domains endpoint 2020-09-27 10:23:17 +02:00
Alejandro Celaya
614e1c37f8 Added database test for Domainrepository 2020-09-27 10:18:49 +02:00
Alejandro Celaya
24aab5cc0e Created unit tests for new Domain-related elements 2020-09-27 10:11:41 +02:00
Alejandro Celaya
76d6d9a7a9 Created rest endpoint to list existing domains 2020-09-27 09:53:12 +02:00
Alejandro Celaya
8109ceb7eb Merge pull request #845 from acelaya-forks/feature/api-test-coverage
Feature/api test coverage
2020-09-26 11:33:36 +02:00
Alejandro Celaya
6163e34327 Directly run API tests on travis, because they get stuck when run through composer 2020-09-26 11:16:35 +02:00
Alejandro Celaya
84b291e310 Added message with exit code in API tests script 2020-09-26 11:07:02 +02:00
Alejandro Celaya
20cd5cd752 Updated changelog 2020-09-26 10:54:52 +02:00
Alejandro Celaya
d9d57743e6 Fixed code copverage on API tests being exported as Clover instead of PHP 2020-09-26 10:49:56 +02:00
Alejandro Celaya
cc57dcd01a Added code coverage to API tests 2020-09-26 10:43:50 +02:00
Alejandro Celaya
10fbf8f8ff Merge pull request #843 from acelaya-forks/feature/runtime-validation-flag
Feature/runtime validation flag
2020-09-24 22:29:32 +02:00
Alejandro Celaya
cfc9a1b772 Ensure string casting safety 2020-09-24 22:15:26 +02:00
Alejandro Celaya
2555424124 Updated changelog 2020-09-24 22:04:38 +02:00
Alejandro Celaya
405369824b Added hability to override URL validation from the CLI 2020-09-24 21:54:03 +02:00
Alejandro Celaya
cdd87f5962 Documented validateUrl params on create/edit short URL endpoints 2020-09-23 19:24:15 +02:00
Alejandro Celaya
d5eac3b1c3 Added validateUrl optional flag for create/edit short URLs 2020-09-23 19:19:17 +02:00
Alejandro Celaya
1f78f5266a Merge pull request #842 from acelaya-forks/feature/find-if-exists-performance
Feature/find if exists performance
2020-09-23 08:01:02 +02:00
Alejandro Celaya
aa0124f4e9 Moved API tests back to composer ci command 2020-09-23 07:49:59 +02:00
Alejandro Celaya
641f35ae05 Updated changelog 2020-09-23 07:46:25 +02:00
Alejandro Celaya
4e94f07050 Added tests for new ShortUrlRepository::findOneMatching method 2020-09-23 07:34:36 +02:00
Alejandro Celaya
460ca032d2 Drastically improved performance when creating new short URLs with findIfExists by moving logic to DB query 2020-09-23 00:22:29 +02:00
Alejandro Celaya
8d438aa6aa Merge pull request #841 from acelaya-forks/feature/svg-qr-codes
Feature/svg qr codes
2020-09-21 23:05:11 +02:00
Alejandro Celaya
504d08101a Updated changelog 2020-09-21 22:55:18 +02:00
Alejandro Celaya
4b7184ac85 Added tests for new QR code format 2020-09-21 22:54:05 +02:00
Alejandro Celaya
55d9f2a4a1 Added support to return the QR code in SVG format 2020-09-21 22:48:52 +02:00
Alejandro Celaya
319b790628 Merge pull request #840 from acelaya-forks/feature/extended-ordering-support
Feature/extended ordering support
2020-09-21 22:19:55 +02:00
Alejandro Celaya
ee563978ac Updated changelog 2020-09-21 22:06:41 +02:00
Alejandro Celaya
be71a6eeb4 Replaced colon by hyphen as the ordering field-dir separator as it's a valid URL character 2020-09-21 22:03:43 +02:00
Alejandro Celaya
25fbbee883 Added support to order short urls liusts using the <field>:<dir> notaiton as string 2020-09-20 13:21:21 +02:00
Alejandro Celaya
8dbd9ca33d Merge pull request #824 from shlinkio/develop
Release v2.3.0
2020-08-09 11:47:57 +02:00
Alejandro Celaya
cad8c7ed48 Added v2.3.0 to changelog 2020-08-09 11:42:26 +02:00
Alejandro Celaya
c11c731bef Merge pull request #823 from acelaya-forks/feature/docker-updates
Feature/docker updates
2020-08-09 11:41:16 +02:00
Alejandro Celaya
a79362d520 Updated changelog 2020-08-09 11:14:50 +02:00
Alejandro Celaya
c708df2029 Updated to latest docker 2020-08-09 11:13:14 +02:00
Alejandro Celaya
e0760c371a Merge pull request #821 from acelaya-forks/feature/slug-regex
Feature/slug regex
2020-08-09 10:55:32 +02:00
Alejandro Celaya
714a58945e Fixed access to magic method that no longer exists 2020-08-09 10:46:44 +02:00
Alejandro Celaya
87e8ae7af6 Moved custom salugs regex to constant 2020-08-09 10:24:59 +02:00
Alejandro Celaya
a66dca4f07 Merge branch 'develop' of github.com:shlinkio/shlink into develop 2020-07-31 21:44:18 +02:00
Alejandro Celaya
9853b0916f Merge pull request #817 from acelaya-forks/feature/gh-action-docker-build
Feature/gh action docker build
2020-07-31 21:43:21 +02:00
Alejandro Celaya
18afd92fc3 Fixed how docker image version is extracted from github ref 2020-07-31 21:32:06 +02:00
Alejandro Celaya
0474b32c34 Recovered real docker image on docker build script 2020-07-31 21:25:42 +02:00
Alejandro Celaya
ca6fb1c656 Merge pull request #15 from acelaya-forks/feature/gh-action-docker-build
Feature/gh action docker build
2020-07-31 20:42:30 +02:00
Alejandro Celaya
a7a69506a0 Fixed how docker credentials are read from secrets 2020-07-31 20:41:39 +02:00
Alejandro Celaya
a32651aab3 Replace -u by --username on docker login command 2020-07-31 20:30:30 +02:00
Alejandro Celaya
977af0ee43 Fixed pattern for tags on github action 2020-07-31 20:24:44 +02:00
Alejandro Celaya
53bbcd34a6 Replaced built image by lab one while testing functionality 2020-07-31 20:19:46 +02:00
Alejandro Celaya
1eb9ef0361 Moved docker image build to github actions 2020-07-31 20:17:14 +02:00
Alejandro Celaya
1ac05fd3a4 Update CONTRIBUTING.md 2020-07-26 22:10:26 +02:00
Alejandro Celaya
4aef0fa728 Merge pull request #813 from acelaya-forks/feature/php8-ci
Added Builds on PHP nightly
2020-07-24 11:00:43 +02:00
Alejandro Celaya
f4da1b0a2e Fixed wrong regexes in phpstan.neon 2020-07-23 16:53:28 +02:00
Alejandro Celaya
163839494b Added Builds on PHP nightly 2020-07-23 16:34:25 +02:00
Alejandro Celaya
8a811c5b33 Merge pull request #809 from acelaya-forks/feature/list-all-command
Feature/list all command
2020-07-14 15:50:29 +02:00
Alejandro Celaya
007139e4ff Updated changelog 2020-07-14 15:37:21 +02:00
Alejandro Celaya
6be0310933 Improved command flag description 2020-07-14 15:31:18 +02:00
Alejandro Celaya
5f9b629676 Added test for short URLs with all items 2020-07-14 13:28:38 +02:00
Alejandro Celaya
8e84b0e8ac Ensured page footer on list short URLs is not displayed when printing all URLs 2020-07-14 13:14:53 +02:00
Alejandro Celaya
3ff9e101a8 Added support to print all short URLs at once from CLI 2020-07-14 13:00:56 +02:00
Alejandro Celaya
71570af7db Merge pull request #808 from acelaya-forks/feature/trailing-question-mark
Fixed issue introduced with league/uri library
2020-07-10 23:36:16 +02:00
Alejandro Celaya
1401dd9156 Fixed issue introduced with league/uri library 2020-07-10 23:25:31 +02:00
Alejandro Celaya
36c12a69b1 Added project structure explanation to CONTRIBUTING doc 2020-07-08 15:38:12 +02:00
Alejandro Celaya
742e2d724e Updated comment on issue templates 2020-07-06 09:28:31 +02:00
Alejandro Celaya
f74851b0d8 Merge pull request #804 from acelaya-forks/feature/document-tests
Added project tests section to the CONTRIBUTING file
2020-07-01 16:38:46 +02:00
Alejandro Celaya
dd5dcf6ec1 Fixed typo 2020-07-01 16:38:19 +02:00
Alejandro Celaya
a448972e3c Added project tests section to the CONTRIBUTING file 2020-07-01 16:35:25 +02:00
Alejandro Celaya
f784a4f794 Merge pull request #799 from acelaya-forks/feature/guzzle7
Feature/guzzle7
2020-06-28 10:23:20 +02:00
Alejandro Celaya
554a66503f Updated changelog 2020-06-28 10:07:43 +02:00
Alejandro Celaya
73c6c52b2a Updated to guzzle 7 2020-06-28 10:06:49 +02:00
Alejandro Celaya
509672f4c7 Added intl to required PHP extensions 2020-06-27 16:42:17 +02:00
Alejandro Celaya
e4f01e4cf8 Merge pull request #797 from acelaya-forks/feature/deeplinks-support
Feature/deeplinks support
2020-06-27 11:26:35 +02:00
Alejandro Celaya
156eae56d0 Fixed typo in contributing doc 2020-06-27 11:16:59 +02:00
Alejandro Celaya
2df6e694ea Updated changelog 2020-06-27 11:15:17 +02:00
Alejandro Celaya
78b838f6b6 Used league/uri to validate URLs including deeplinks, and fixed tests 2020-06-27 11:14:10 +02:00
Alejandro Celaya
08950f6433 Replaced UriInterface by string when creating a short URL 2020-06-27 10:48:35 +02:00
Alejandro Celaya
a74e1df55c Merge pull request #796 from acelaya-forks/feature/contributing
Feature/contributing
2020-06-27 10:45:09 +02:00
Alejandro Celaya
bf1c6e3d43 Referenced CONTRIBUTING doc from README 2020-06-27 10:43:43 +02:00
Alejandro Celaya
d234e114db Added description on how to create pull requests to CONTRIBUTING file 2020-06-27 10:41:29 +02:00
Alejandro Celaya
035743ef6a Added minor imporovements to CONTRIBUTING file 2020-06-27 10:34:26 +02:00
Alejandro Celaya
c7c9ab71ff Created first draft of the contributing file 2020-06-26 21:22:54 +02:00
Alejandro Celaya
e107aa9ed8 Removed commented migrations option 2020-06-23 19:23:33 +02:00
Alejandro Celaya
e9191732bd Merge pull request #794 from acelaya-forks/feature/migrations3
Feature/migrations3
2020-06-21 13:21:14 +02:00
Alejandro Celaya
f44540f95e Updated changelog 2020-06-21 13:01:10 +02:00
Alejandro Celaya
6b3fd2ac83 Commented out name config option for migrations, since it makes it fail 2020-06-21 13:00:32 +02:00
Alejandro Celaya
eed353fedf Updated migration template 2020-06-21 12:29:56 +02:00
Alejandro Celaya
b4e58cc1bb Updated doctrine config for v3 2020-06-21 12:24:47 +02:00
Alejandro Celaya
56d690d9a6 Removed references to master branch 2020-06-21 12:21:39 +02:00
Alejandro Celaya
bffc044bc7 Fixed typo 2020-06-20 11:34:09 +02:00
Alejandro Celaya
58dd1c54f9 Merge pull request #792 from acelaya-forks/feature/configurable-redirect
Feature/configurable redirect
2020-06-20 11:33:48 +02:00
Alejandro Celaya
5c163490c7 Allowed new redirect config options to be pased as env vars to the docker image 2020-06-20 11:21:37 +02:00
Alejandro Celaya
f2f07be11f Updated to latest installer, supporting redirects customizations 2020-06-20 11:07:15 +02:00
Alejandro Celaya
0bea843e7f Added test covering how redirects config works 2020-06-20 09:50:56 +02:00
Alejandro Celaya
83cc11030d Updated changelog 2020-06-20 09:30:23 +02:00
Alejandro Celaya
cb70dc5389 Removed stuff from local config file which already comes on third party config 2020-06-20 09:20:01 +02:00
Alejandro Celaya
68db52679b Added support to serve redirects with status 301 and Cache-Control 2020-06-17 19:01:56 +02:00
Alejandro Celaya
186168b26c Merge pull request #789 from acelaya-forks/feature/simplified-travis-config
Simplified travis configuration, by removing all env vars checks
2020-06-10 18:05:31 +02:00
Alejandro Celaya
e9c64b46b7 Removed condition from travis that is now implicit 2020-06-10 17:54:41 +02:00
Alejandro Celaya
f476cfc30f Simplified travis configuration, by removing all env vars checks 2020-06-10 17:51:20 +02:00
Alejandro Celaya
3706d6c82d Merge pull request #783 from acelaya-forks/feature/extended-mutation-checks
Feature/extended mutation checks
2020-06-09 12:11:56 +02:00
Alejandro Celaya
248209ab41 Updated changelog 2020-06-08 23:30:19 +02:00
Alejandro Celaya
2867a9b7b0 Added commands to run infection checks on database tests 2020-06-08 23:26:27 +02:00
Alejandro Celaya
68919c19b8 Added deprecation in BodyParserMiddleware 2020-06-08 23:25:54 +02:00
Alejandro Celaya
ee1aa42900 Improved titles on error templates 2020-06-08 23:25:54 +02:00
Alejandro Celaya
c3de39d313 Merge pull request #787 from shlinkio/develop
Release v2.2.2
2020-06-08 23:09:28 +02:00
Alejandro Celaya
8ecc9c69a2 Added v2.2.2 to changelog 2020-06-08 22:49:40 +02:00
Alejandro Celaya
e814f3afcf Merge pull request #784 from acelaya-forks/feature/tag-visits-many-short-urls
Feature/tag visits many short urls
2020-06-08 22:48:52 +02:00
Alejandro Celaya
a4eda9d761 Moved execution of API tests outside composer script 2020-06-08 22:38:51 +02:00
Alejandro Celaya
f3f3ef5c18 Removed unused import 2020-06-08 18:37:45 +02:00
Alejandro Celaya
296134078c Updated changelog 2020-06-08 18:37:45 +02:00
Alejandro Celaya
527faf27a8 Changed how visits for a tag are fetched, avoiding thousands of values to be loaded in memory 2020-06-08 18:37:22 +02:00
Alejandro Celaya
9c339b9c4f Merge pull request #785 from acelaya-forks/feature/improve-custom-slugs
Improved custom slug sluggification, allowing valid URL characters
2020-06-08 18:36:36 +02:00
Alejandro Celaya
f274cafa7c Updated changelog 2020-06-08 18:10:34 +02:00
Alejandro Celaya
371f246c41 Improved custom slug sluggification, allowing valid URL characters 2020-06-08 18:08:53 +02:00
Alejandro Celaya
95ae540799 Defined docker image to build in a var 2020-05-17 10:19:54 +02:00
Alejandro Celaya
f340e0e76e Temporary disabled ARM docker images to reduce build times 2020-05-17 09:37:05 +02:00
Alejandro Celaya
14e0766f72 Merge pull request #773 from acelaya-forks/feature/temporal-build-fix
Going back to single travis job for docker image building
2020-05-16 22:18:03 +02:00
Alejandro Celaya
17f3897746 Going back to single travis job for docker image building 2020-05-16 22:01:20 +02:00
Alejandro Celaya
3c3a30cc0e Merge pull request #772 from acelaya-forks/feature/separate-docker-builds
Separated docker builds in different platforms
2020-05-16 15:15:47 +02:00
Alejandro Celaya
726811f91f Separated docker builds in different platforms 2020-05-16 15:06:37 +02:00
Alejandro Celaya
75f5da5846 Fixed docker install in travis 2020-05-16 14:05:39 +02:00
Alejandro Celaya
489c739be2 Updated condition to run docker publish 2020-05-16 14:00:03 +02:00
Alejandro Celaya
9d6f14c81a Merge pull request #771 from acelaya-forks/feature/build-time-improvements
Changed travis build so that docker image publishing runs on its own …
2020-05-16 13:50:54 +02:00
Alejandro Celaya
788f9635dd Fixed travis config syntax error 2020-05-16 13:40:59 +02:00
Alejandro Celaya
09aa4cc977 Changed travis build so that docker image publishing runs on its own separated job 2020-05-16 13:28:29 +02:00
Alejandro Celaya
9252cc269b Merge pull request #770 from acelaya-forks/feature/multi-arch-improvements
Feature/multi arch improvements
2020-05-16 11:35:56 +02:00
Alejandro Celaya
65e6676c00 Removed docker image building on non-PR builds 2020-05-16 11:25:50 +02:00
Alejandro Celaya
135b62a9cc Documented multi-architecture on docker image 2020-05-16 10:39:47 +02:00
Alejandro Celaya
2ea58acde2 Updated changelog 2020-05-16 10:28:09 +02:00
Alejandro Celaya
e1085f3ef5 Merge pull request #756 from Starbix/multi-arch
Add multi arch support
2020-05-16 10:22:59 +02:00
Cédric Laubacher
f1db195a06 Merge branch 'develop' into multi-arch 2020-05-15 20:37:41 +02:00
Cédric Laubacher
fa646b0176 Add multi arch support 2020-05-15 18:32:35 +02:00
Alejandro Celaya
21ef1dfee8 Merge pull request #765 from acelaya-forks/feature/fix-dates-match
Feature/fix dates match
2020-05-11 13:27:38 +02:00
Alejandro Celaya
5ef548bc2a Updated changelog with v2.2.1 2020-05-11 13:19:01 +02:00
Alejandro Celaya
1fa9896524 Fixed error when trying to match creteria on a Short URL with dates 2020-05-11 13:12:55 +02:00
Alejandro Celaya
cb6756d801 Merge pull request #763 from shlinkio/develop
Release 2.2.0
2020-05-09 11:10:31 +02:00
Alejandro Celaya
cf605407ad Used definitive dependency versions for shlink-common and shlñink-installer 2020-05-09 10:56:07 +02:00
Alejandro Celaya
1a4eee1c81 Merge pull request #762 from acelaya-forks/feature/visits-by-tag
Feature/visits by tag
2020-05-09 10:52:33 +02:00
Alejandro Celaya
4c5cd88041 Updated changelog 2020-05-09 10:38:18 +02:00
Alejandro Celaya
4d346d1fea Created API test for tags visits endpoint 2020-05-09 10:31:39 +02:00
Alejandro Celaya
7f39e6d768 Created TagVisitsActionTest 2020-05-09 10:22:07 +02:00
Alejandro Celaya
9b9de8e290 Updated VisitsTrackerTest 2020-05-09 10:14:26 +02:00
Alejandro Celaya
e1e3c7f061 Created paginator adapter tests 2020-05-09 10:10:48 +02:00
Alejandro Celaya
3218f8c283 Added Created endpoint to serve visits by tag 2020-05-09 09:53:45 +02:00
Alejandro Celaya
f0acce1be0 Updated to latest common 2020-05-09 09:34:59 +02:00
Alejandro Celaya
dd4b4277c9 Added test for VisitRepository tag methods 2020-05-08 20:11:37 +02:00
Alejandro Celaya
baf77b6ffb Implemented methods to get paginated list of visits by tag, reusing methods used for short code filtering 2020-05-08 19:55:05 +02:00
Alejandro Celaya
5be882a31b Improved parameter definition in some private queries in VisitRepository 2020-05-08 19:41:21 +02:00
Alejandro Celaya
ae060f3b13 Merge pull request #761 from acelaya-forks/feature/optional-obfuscation
Feature/optional obfuscation
2020-05-08 16:03:11 +02:00
Alejandro Celaya
e8ab664561 Updated changelog 2020-05-08 15:54:50 +02:00
Alejandro Celaya
f4bf3551f6 Updated shlink-installer to a version supporting IP anonymization param 2020-05-08 15:50:16 +02:00
Alejandro Celaya
8f06e4b20f Replaced references to obfuscate by anonymize 2020-05-08 15:43:09 +02:00
Alejandro Celaya
bfdd6e0c50 Ensured SimplifiedConfigParser properly handles obfuscate_remote_addr option 2020-05-08 13:21:49 +02:00
Alejandro Celaya
ba13d99a71 Allowed remote addr obfuscation to be configured on docker image by using the OBFUSCATE_REMOTE_ADDR env var 2020-05-08 13:19:40 +02:00
Alejandro Celaya
eac468514b Allow to determine if remote addresses should be obfuscated at configuration level 2020-05-08 13:10:58 +02:00
Alejandro Celaya
7da00fbc8c Updated Visit entity so that the address can be optionally obfuscated 2020-05-08 12:58:49 +02:00
Alejandro Celaya
4b7c54d7a9 Merge pull request #760 from acelaya-forks/feature/list-tags-command
Updated ListTagsCommand so that it displays extended information
2020-05-08 12:57:35 +02:00
Alejandro Celaya
c336bb1901 Updated ListTagsCommand so that it displays extended information 2020-05-08 12:39:02 +02:00
Alejandro Celaya
fbb1c449da Merge pull request #759 from acelaya-forks/feature/improved-tags-endpoint
Feature/improved tags endpoint
2020-05-08 12:17:32 +02:00
Alejandro Celaya
252cc7f49d Updated changelog 2020-05-08 11:53:26 +02:00
Alejandro Celaya
00cac4ba72 Created rest test for list tags action 2020-05-08 11:51:28 +02:00
Alejandro Celaya
91aaffc6db Updated ListTagsActionTest 2020-05-08 11:32:06 +02:00
Alejandro Celaya
2e269bcacd Updated TagServiceTest 2020-05-08 11:14:39 +02:00
Alejandro Celaya
bdd14427d9 Added tests for TagRepository::findTagsWithInfo 2020-05-08 11:09:28 +02:00
Alejandro Celaya
06c59fe2dd Fixed invalid imports after class refactoring 2020-05-08 10:29:24 +02:00
Alejandro Celaya
9a78fd1a26 Fixed definition of inversed many to many entity relationship 2020-05-08 10:25:33 +02:00
Alejandro Celaya
626c92460b Enhanced list tags endpoint so that it can also return stats foir every tag 2020-05-08 10:15:33 +02:00
Alejandro Celaya
7e0a14493e Documented updates on the tags endpoint to return more detailed information 2020-05-08 10:14:38 +02:00
Alejandro Celaya
8d23e60d3a Merge pull request #758 from acelaya-forks/feature/non-stable-alpha
Ensured stable tag is not pushed when building docker image for alpha or beta versions
2020-05-07 10:57:52 +02:00
Alejandro Celaya
5f0293bc21 Ensured stable tag is not pushed when building docker image for alpha or beta versions 2020-05-07 10:45:53 +02:00
Alejandro Celaya
afe7381263 Merge pull request #757 from acelaya-forks/feature/docker-img-impr
Feature/docker img impr
2020-05-07 10:31:32 +02:00
Alejandro Celaya
b75922f1d3 Updated changelog 2020-05-07 10:17:34 +02:00
Alejandro Celaya
d9ae83a92b Updated everything related with dependencies in docker images 2020-05-07 10:16:20 +02:00
Alejandro Celaya
22cc9ace4d Merge pull request #755 from acelaya-forks/feature/fix-logged-remote-ip
Feature/fix logged remote ip
2020-05-05 13:04:02 +02:00
Alejandro Celaya
53a37feafe Updated changelogs 2020-05-05 12:54:08 +02:00
Alejandro Celaya
0cab51b01b Enforced mezzio-swoole 2.6.4 or greater 2020-05-05 12:51:47 +02:00
Alejandro Celaya
5f258b6a28 Merge pull request #752 from acelaya-forks/feature/travis-db-tests
Feature/travis db tests
2020-05-04 22:06:04 +02:00
Alejandro Celaya
cc41c51f77 Removed duplicated pdo_sqlsrv enabling on travis config 2020-05-04 21:55:18 +02:00
Alejandro Celaya
5f42266cf2 Moved ms odbc commands to a script 2020-05-04 21:48:54 +02:00
Alejandro Celaya
522d8ed236 Ensured some commands are run as sudo during travis CI 2020-05-04 21:33:19 +02:00
Alejandro Celaya
78359c28c7 Added MS ODBC package installation to travis 2020-05-04 21:22:41 +02:00
Alejandro Celaya
13bb48d068 Installed pdo_sqlsrv extension in travis 2020-05-04 21:12:49 +02:00
Alejandro Celaya
f6d9a83202 Moved initial ci databases to specific docker-compose file 2020-05-04 21:00:09 +02:00
Alejandro Celaya
dfdae96da5 Added commands to initially create all testing database for all database engines in travis 2020-05-04 20:34:28 +02:00
Alejandro Celaya
9f13063b1f Fixed docker-compose command run in travis 2020-05-04 20:02:48 +02:00
Alejandro Celaya
1e8c36b5f1 Updated changelog 2020-05-04 19:55:52 +02:00
Alejandro Celaya
e747a0b250 Updated how database tests are run in travis, so that all DB engines are covered 2020-05-04 19:55:03 +02:00
Alejandro Celaya
79b8834c61 Merge pull request #748 from acelaya-forks/feature/visits-perf-improvements
Feature/visits perf improvements
2020-05-03 20:11:40 +02:00
Alejandro Celaya
313b6a59b9 Updated changelog 2020-05-03 20:02:50 +02:00
Alejandro Celaya
d5288f756e Fixed entity mapping for visits without a visit location 2020-05-03 19:52:40 +02:00
Alejandro Celaya
867659ea25 Created index on visits.date column 2020-05-03 19:15:26 +02:00
Alejandro Celaya
74ad3553cb Hardcoded types on date fields when filtering visits lists 2020-05-03 19:02:13 +02:00
Alejandro Celaya
8b0ce8e6f3 Improved performance when loading visits chuncks at high offsets 2020-05-03 18:20:01 +02:00
Alejandro Celaya
0e4bccc4bb Cached result of the count query on VisitsPaginatorAdapter 2020-05-03 10:44:01 +02:00
Alejandro Celaya
c4ae89a279 Removed DISTINCT when counting visits for a short URL 2020-05-03 10:22:00 +02:00
Alejandro Celaya
80d41db901 Improved performance on query that returns the list of visits for a short URL 2020-05-02 22:47:59 +02:00
Alejandro Celaya
6c30fc73ee Added swoole reverse proxy container 2020-05-02 12:04:42 +02:00
Alejandro Celaya
56932e4ea6 Disabled swoole coroutines 2020-05-01 18:24:48 +02:00
Alejandro Celaya
84b38c4940 Merge pull request #745 from acelaya-forks/feature/general-visits
Feature/general visits
2020-05-01 12:16:22 +02:00
Alejandro Celaya
aece9e68ba Removed logger dependency from rest actions 2020-05-01 12:08:44 +02:00
Alejandro Celaya
d067f52ac2 Updated changelog 2020-05-01 11:58:59 +02:00
Alejandro Celaya
b5947d1642 Created more unit tests 2020-05-01 11:57:46 +02:00
Alejandro Celaya
3232ab401f Documented new visits endpoint 2020-05-01 11:44:55 +02:00
Alejandro Celaya
1ef10f11cb Created new action to get default visit stats 2020-05-01 11:40:02 +02:00
Alejandro Celaya
5beaab85ac Renamed GetVisitsAction to ShortUrlVisitsAction 2020-05-01 11:17:07 +02:00
Alejandro Celaya
4498386f56 Fixed merge conflicts 2020-04-30 20:26:00 +02:00
Alejandro Celaya
a30f796100 Merge pull request #743 from acelaya-forks/feature/geolite-license
Feature/geolite license
2020-04-30 19:34:44 +02:00
Alejandro Celaya
93a2c83652 Enabled GeoLite installer config option 2020-04-29 20:31:06 +02:00
Alejandro Celaya
4d4423413d Added GEOLITE_LICENSE_KEY env var to basic docker example, to encourage using it 2020-04-29 19:44:08 +02:00
Alejandro Celaya
a1c74c4038 Updated changelog 2020-04-29 19:31:10 +02:00
Alejandro Celaya
f71bb5e307 Added support for GEOLITE_LICENSE_KEY env var for docker image 2020-04-29 19:27:35 +02:00
Alejandro Celaya
9190996e54 Added support for geolite_license_key config option 2020-04-29 19:26:34 +02:00
Alejandro Celaya
af8b6b7f96 Documented how to pass a GEOLITE license key 2020-04-29 19:24:18 +02:00
Alejandro Celaya
704958994d Merge pull request #738 from acelaya-forks/feature/health-fix
Feature/health fix
2020-04-25 20:07:09 +02:00
Alejandro Celaya
a6864bca7c Updated changelog 2020-04-25 20:00:01 +02:00
Alejandro Celaya
15a8305209 Fixed random 503 responses from the HealthAction when the database connection injected on it has expired 2020-04-25 19:58:49 +02:00
Alejandro Celaya
469b70d708 Merge pull request #737 from acelaya-forks/feature/installation-error
Fixed error when cleaning metadata cache during installation with APC…
2020-04-25 19:30:06 +02:00
Alejandro Celaya
4f988d223b Fixed error when cleaning metadata cache during installation with APCu enabled 2020-04-25 19:13:47 +02:00
Alejandro Celaya
e95abc4efb Merge pull request #736 from acelaya-forks/feature/mercure-proxy
Configured an nginx container acting as a reverse proxy for the mercu…
2020-04-25 13:56:07 +02:00
Alejandro Celaya
4917e53acd Configured an nginx container acting as a reverse proxy for the mercure container 2020-04-25 13:44:09 +02:00
Alejandro Celaya
45db4c321a Merge pull request #731 from acelaya-forks/feature/fix-local-sqlite-tests
Ensured mysql config is not loaded for sqlite test envs
2020-04-18 14:06:44 +02:00
Alejandro Celaya
e6d914cfe1 Ensured mysql config is not loaded for sqlite test envs 2020-04-18 14:01:24 +02:00
Alejandro Celaya
85714c931d Merge pull request #730 from acelaya-forks/feature/fix-mysql-buffered-error
Feature/fix mysql buffered error
2020-04-18 13:29:24 +02:00
Alejandro Celaya
66a7f279c2 Updated changelog 2020-04-18 13:22:51 +02:00
Alejandro Celaya
7c6827ea9f Added MYSQL_ATTR_USE_BUFFERED_QUERY driver option with value true for mysql/maria connections 2020-04-18 13:21:46 +02:00
Alejandro Celaya
078c8ea011 Changed default mercure token duration to 1 day 2020-04-18 11:29:49 +02:00
Alejandro Celaya
655fd58a9d Added async API spec file 2020-04-16 22:44:08 +02:00
Alejandro Celaya
6ba6b951bf Changed mercure topics to be dash-cased 2020-04-16 22:25:12 +02:00
Alejandro Celaya
8e0e11f3b3 Merge pull request #727 from acelaya-forks/feature/mercure-improvement
Feature/mercure improvement
2020-04-14 21:16:16 +02:00
Alejandro Celaya
18b12ab1e6 Updated NotifyVisitToMercure to send both an update for all short URLs and one specific short URL 2020-04-14 20:57:25 +02:00
Alejandro Celaya
3908f63b0d Updated to latest installer version 2020-04-14 20:30:05 +02:00
Alejandro Celaya
ca2c32fa8c Removed no-longer used dependencies 2020-04-14 20:24:36 +02:00
Alejandro Celaya
a3a3ac1859 Added missing escaped characters 2020-04-13 13:23:26 +02:00
Alejandro Celaya
f5e0d0c2b1 Merge pull request #726 from acelaya-forks/feature/mercure-integration
Feature/mercure integration
2020-04-13 10:03:12 +02:00
Alejandro Celaya
ba0678946f Updated installer to use a version supporting mercure options 2020-04-13 09:38:18 +02:00
Alejandro Celaya
934fa937b5 Updated config parsers for docker image to accept new mercure env vars and configs 2020-04-12 20:41:23 +02:00
Alejandro Celaya
8d888cb43d Documented how to use a mercure hub when using the docker image 2020-04-12 18:39:28 +02:00
Alejandro Celaya
7f888c49b4 Created MercureUpdatesGeneratorTest 2020-04-12 18:01:13 +02:00
Alejandro Celaya
e97dfbfdda Created NotifyVisitToMercureTest 2020-04-12 17:50:40 +02:00
Alejandro Celaya
b858d79b9e Fixed mercure hub URL returned by MercureInfoAction 2020-04-12 17:50:09 +02:00
Alejandro Celaya
72d8edf4ff Created event listener that notifies mercure hub for new visits 2020-04-12 17:05:59 +02:00
Alejandro Celaya
31db97228d Created MercureInfoActionTest 2020-04-12 14:22:23 +02:00
Alejandro Celaya
2ffbf03cf8 Created action to get mercure integration info 2020-04-12 13:59:10 +02:00
Alejandro Celaya
85440c1c5f Improved mercure-related configs 2020-04-12 12:21:05 +02:00
Alejandro Celaya
69962f1fe8 Added package to handle JWTs 2020-04-11 18:10:56 +02:00
Alejandro Celaya
10cad33248 Added configuration for mercure integration 2020-04-11 18:10:56 +02:00
Alejandro Celaya
0c9deca3f8 Added symfony/mercure package and a container for development 2020-04-11 18:10:56 +02:00
Alejandro Celaya
e1cd4a6ee3 Merge pull request #724 from acelaya-forks/feature/clean-tasks
Created decorator for database connection closing and reopening for s…
2020-04-11 18:09:26 +02:00
Alejandro Celaya
f915b97606 Created decorator for database connection closing and reopening for swoole tasks 2020-04-11 18:00:40 +02:00
Alejandro Celaya
e775b0f12f Merge pull request #722 from shlinkio/develop
Release 2.1.3
2020-04-09 12:50:46 +02:00
Alejandro Celaya
3ee5853b32 Merge pull request #721 from acelaya-forks/feature/qr-code-links
Feature/qr code links
2020-04-09 12:40:05 +02:00
Alejandro Celaya
832a24e4c7 Updated changelog 2020-04-09 12:33:00 +02:00
Alejandro Celaya
551368c30d Ensured QR code action respects configured domain 2020-04-09 12:31:03 +02:00
Alejandro Celaya
9f24b8eb76 Merge pull request #720 from acelaya-forks/feature/db-conn-recovery-task-workers
Feature/db conn recovery task workers
2020-04-09 12:01:47 +02:00
Alejandro Celaya
4c83ae2b22 Updated changelog 2020-04-09 11:55:47 +02:00
Alejandro Celaya
28e0fb049b Added check to ensure DB connection is gracefully recovered on swoole task workers 2020-04-09 11:54:54 +02:00
Alejandro Celaya
f79a369884 Merge pull request #719 from acelaya-forks/feature/handle-HEAD-requests
Feature/handle head requests
2020-04-09 00:06:28 +02:00
Alejandro Celaya
34c7b870a7 Removed unnecessary service registration, as it comes preregistered from third party config provider 2020-04-08 23:56:39 +02:00
Alejandro Celaya
ec9f874bb9 Updated changelog 2020-04-08 23:53:23 +02:00
Alejandro Celaya
1980d35691 Ensured redirect requests are not tracked when request is performed using method HEAD 2020-04-08 23:51:57 +02:00
Alejandro Celaya
ec8cbf82e5 Added HEAD request implicit handling 2020-04-08 17:27:26 +02:00
Alejandro Celaya
2b1011de52 Merge pull request #714 from acelaya-forks/feature/metadata-cache-clear
Feature/metadata cache clear
2020-04-06 21:08:46 +02:00
Alejandro Celaya
fa9ace83ad Fixed incorrect use of tilde 2020-04-06 20:59:10 +02:00
Alejandro Celaya
a9a53a9652 Ensured entities metadata cache is cleared during installation and docker start-up 2020-04-06 20:52:33 +02:00
Alejandro Celaya
afca8b2a62 Merge pull request #704 from shlinkio/develop
Release v2.1.2
2020-03-29 13:23:41 +02:00
Alejandro Celaya
daeb293fb9 Merge pull request #703 from acelaya-forks/feature/infection-0.16
Feature/infection 0.16
2020-03-29 13:14:07 +02:00
Alejandro Celaya
1ca50a4a8a Updated changelog 2020-03-29 13:08:21 +02:00
Alejandro Celaya
c6602a81ab Updated to infection 0.16 2020-03-29 13:07:27 +02:00
Alejandro Celaya
46da0e7824 Merge pull request #702 from acelaya-forks/feature/fix-tags-filtering
Feature/fix tags filtering
2020-03-29 13:00:06 +02:00
Alejandro Celaya
e790a38cea Updated changelog 2020-03-29 12:54:09 +02:00
Alejandro Celaya
11879ea377 Ensured tags are not sluggified when using them to filter short URL lists 2020-03-29 12:51:39 +02:00
Alejandro Celaya
7105add009 Merge pull request #701 from acelaya-forks/feature/fix-migration
Fixed query in migration for postgres
2020-03-29 12:25:19 +02:00
Alejandro Celaya
af61fdb52d Updated changelog 2020-03-29 12:15:52 +02:00
Alejandro Celaya
2b4fc354db Fixed query in migration for postgres 2020-03-29 12:13:52 +02:00
Alejandro Celaya
5b72001a8c Merge pull request #699 from shlinkio/develop
V2.1.1
2020-03-28 20:14:35 +01:00
Alejandro Celaya
7c79906ac4 Merge pull request #698 from acelaya-forks/feature/2.1.1
Feature/2.1.1
2020-03-28 20:03:09 +01:00
Alejandro Celaya
e30a724529 Make sure dist files include the htaccess file 2020-03-28 19:54:02 +01:00
Alejandro Celaya
73f97ea874 Ensured releases are published to github before the docker image is built 2020-03-28 19:48:06 +01:00
Alejandro Celaya
09c155b7d3 Merge pull request #695 from shlinkio/develop
v2.1.0
2020-03-28 12:23:41 +01:00
Alejandro Celaya
1e2d115768 Merge pull request #694 from acelaya-forks/feature/process-retry
Feature/process retry
2020-03-28 12:06:09 +01:00
Alejandro Celaya
53ba58d7e9 Moved initialization of the io object in LocateVisitsCommand to the initialize method 2020-03-28 10:37:41 +01:00
Alejandro Celaya
2a30afbe7d Updated changelog 2020-03-28 10:29:12 +01:00
Alejandro Celaya
4d39c7041b Improved LocateVisitsCommandtest so that it covers all possible workflows 2020-03-28 10:23:34 +01:00
Alejandro Celaya
c012b4740d Updated VisitLocator test so that it covers all public methods 2020-03-28 10:01:09 +01:00
Alejandro Celaya
55778eb810 Ensured old visit locations are deleted when relocating a visit that has already been located 2020-03-28 09:27:45 +01:00
Alejandro Celaya
fb8ab0b5fe Implemented how to reprocess the locations of all existing visits 2020-03-28 09:12:15 +01:00
Alejandro Celaya
fcce18b059 Changed VisitLocator signature so that it expects an object implementing an interface instead of two arbitrary callbacks 2020-03-28 08:05:15 +01:00
Alejandro Celaya
43a3d469e7 Improved how visits with some conditions are fetched from the database, so all internal logic is 100% transparent regardless the purpose 2020-03-27 22:01:26 +01:00
Alejandro Celaya
f730c24ecb Created method to return visits with empty location 2020-03-26 22:56:53 +01:00
Alejandro Celaya
b8522b8c17 Created new method to locate empty visits 2020-03-26 22:37:46 +01:00
Alejandro Celaya
b0d96040be Merge pull request #691 from Lynnesbian/develop
Update sample Nginx config to point to PHP 7.4
2020-03-25 08:49:36 +01:00
Lynne
5554675d03 Update sample Nginx config to point to PHP 7.4 2020-03-25 16:48:44 +10:00
Alejandro Celaya
c88401ef29 Added isEmpty column to VisitLocation 2020-03-23 20:42:03 +01:00
Alejandro Celaya
75f77ed929 Merge pull request #689 from acelaya-forks/feature/fake-class-constant
Moved hardcoded class alias to a namespaced constant
2020-03-22 17:50:57 +01:00
Alejandro Celaya
4539ab2dcf Moved hardcoded class alias to a namespaced constant 2020-03-22 17:42:56 +01:00
Alejandro Celaya
9ad0561cac Merge pull request #688 from acelaya-forks/feature/edit-long-url
Feature/edit long url
2020-03-22 17:38:00 +01:00
Alejandro Celaya
774052a983 Updated changelog 2020-03-22 17:31:16 +01:00
Alejandro Celaya
3beb27acc2 Added API tests for the edition of the longURL 2020-03-22 17:30:01 +01:00
Alejandro Celaya
5432eb7b77 Added URL validation to ShortUrl edition, as long URL can now be edited 2020-03-22 17:22:52 +01:00
Alejandro Celaya
181ff16409 Registered PersistenceDomainResolver as a service to avoid instantiating a new one on every ShortUrl creation 2020-03-22 17:05:59 +01:00
Alejandro Celaya
682a0768b7 Moved check for URL validation config option to the UrlValidator itself 2020-03-22 16:58:28 +01:00
Alejandro Celaya
d29ebb706e Documented longUrl param on PATCH short URL endpoint 2020-03-22 14:06:13 +01:00
Alejandro Celaya
4e6836c605 Long URLs can now be edited on existing short URLs 2020-03-22 14:04:01 +01:00
Alejandro Celaya
59c0d36c0b Merge pull request #687 from acelaya-forks/feature/real-ip-geolocation
Feature/real ip geolocation
2020-03-22 11:55:02 +01:00
Alejandro Celaya
e10b2884c0 Added more exclussions to dockerignore 2020-03-22 11:33:00 +01:00
Alejandro Celaya
8fb54e815e Ensured scrutinizer build ignores platform requirements when installing dependencies 2020-03-22 11:27:03 +01:00
Alejandro Celaya
3a14483568 Updated changelog 2020-03-22 11:13:33 +01:00
Alejandro Celaya
fdd8efc12d Added test covering case in which the original address is provided when locating visits 2020-03-22 11:12:30 +01:00
Alejandro Celaya
3fef4b4a28 Ensured non-obfuscated IP address is passed to event listener which geolocates it 2020-03-22 10:48:27 +01:00
Alejandro Celaya
cea50a860e Improved docker image generation 2020-03-22 10:01:34 +01:00
Alejandro Celaya
f9318bb1b3 Merge pull request #686 from acelaya-forks/feature/reduce-docker-image
Feature/reduce docker image
2020-03-21 16:21:25 +01:00
Alejandro Celaya
d22f020eb5 Ensured more non-prod files are ignored/deleted from the final docker image 2020-03-21 16:11:56 +01:00
Alejandro Celaya
c556d8123b Fixed name of the build arg passed when building docker for a specific tag 2020-03-21 15:43:52 +01:00
Alejandro Celaya
a592833bd0 Merge pull request #685 from acelaya-forks/feature/fix-docker-build
Ensured docker build happens in all branches
2020-03-21 15:36:18 +01:00
Alejandro Celaya
881da3db3b Ensured docker build happens in all branches 2020-03-21 15:31:14 +01:00
Alejandro Celaya
32eb9924e5 Merge pull request #684 from acelaya-forks/feature/travis-docker-build
Feature/travis docker build
2020-03-21 15:14:14 +01:00
Alejandro Celaya
d2c06dd0ab Initialized typed nullable props as null in all entities 2020-03-21 14:38:24 +01:00
Alejandro Celaya
75b8ed813f Enforced Swoole 4.4.15 to be installed during travis build, to match production one 2020-03-21 14:25:19 +01:00
Alejandro Celaya
f811002c2b Small adjustments on docker build 2020-03-21 09:37:31 +01:00
Alejandro Celaya
ca1b17863c Split Dockerfile into multiple stages, making the build be independent and then the released image just copy files from it 2020-03-21 09:10:15 +01:00
Alejandro Celaya
644f5be6fe Added scripts and configs to build docker image on travis 2020-03-21 08:42:13 +01:00
Alejandro Celaya
65fbb1dfb3 Merge pull request #680 from acelaya-forks/feature/non-interactive-db-commands
Feature/non interactive db commands
2020-03-15 17:32:57 +01:00
Alejandro Celaya
8597966187 Updated changelog 2020-03-15 17:26:34 +01:00
Alejandro Celaya
6ddd70d21d Added --no-interaction to commands run internally from shlink DB commands 2020-03-15 17:25:39 +01:00
Alejandro Celaya
d32112fe7e Updated shlink packages and installed shlink-config 2020-03-15 17:14:37 +01:00
Alejandro Celaya
da858f0353 Merge branch 'develop' of github.com:shlinkio/shlink into develop 2020-03-10 21:45:57 +01:00
Alejandro Celaya
ba8b041698 Updated API docs links 2020-03-10 21:45:20 +01:00
Alejandro Celaya
d9fee5582a Added docker pulls badge to main readme file 2020-03-07 08:44:12 +01:00
Alejandro Celaya
c9f17d54ee Merge pull request #676 from acelaya-forks/feature/bar-slug
Feature/bar slug
2020-03-06 20:09:59 +01:00
Alejandro Celaya
f5c1e12db4 Added more tests covering invalid custom slugs 2020-03-06 20:01:41 +01:00
Alejandro Celaya
18ceafeb60 Ensured only empty strings are checked while verifying empty value on custom slug 2020-03-06 19:25:05 +01:00
Alejandro Celaya
67e93a6874 Ensured empty values cannot be provided as the custom slug 2020-03-06 19:20:33 +01:00
Alejandro Celaya
f6a83a3062 Merge pull request #670 from acelaya-forks/feature/base-url-redirect
Feature/base url redirect
2020-02-25 18:06:47 +01:00
Alejandro Celaya
8a0e902bdd Updated changelog 2020-02-25 18:02:38 +01:00
Alejandro Celaya
590fc3fc92 Added tests covering redirect simplified config parsing 2020-02-25 18:01:06 +01:00
Alejandro Celaya
0d54b7696f Merge pull request #669 from jpatters/fix/base_url_redirect_to
fixed incorrect configuration option for base_url_redirect_to
2020-02-25 17:58:58 +01:00
Jordan Patterson
6b1dadc35c fixed incorrect configuration option for base_url_redirect_to 2020-02-25 06:47:02 -08:00
Alejandro Celaya
86009543ed Merge pull request #662 from acelaya-forks/feature/rest-request-id
Feature/rest request
2020-02-21 19:54:30 +01:00
Alejandro Celaya
b728a78673 Updated changelog 2020-02-21 19:47:30 +01:00
Alejandro Celaya
fb89cb80ac Added formatting to swoole logs, to avoid duplicating the date 2020-02-19 19:48:48 +01:00
Alejandro Celaya
d0a986dd5a Added request ID to logs with monolog 2020-02-19 19:37:47 +01:00
Alejandro Celaya
bb231e668b Registered middleware generating request ID 2020-02-19 18:58:25 +01:00
Alejandro Celaya
f53fa5c90f Merge pull request #660 from acelaya-forks/feature/short-codes-length
Feature/short codes length
2020-02-18 20:42:37 +01:00
Alejandro Celaya
1f3e0d1f73 Updated changelog 2020-02-18 20:35:41 +01:00
Alejandro Celaya
33a404f051 Updated CLI command to create short URLs so that it respects configs for short code length 2020-02-18 20:34:48 +01:00
Alejandro Celaya
51e130c7a0 Added env var that can be used to define default short codes length on docker image 2020-02-18 19:34:01 +01:00
Alejandro Celaya
343ee04acb Created middleware which injects default short code length from config when a value was not explicitly provided 2020-02-18 19:21:34 +01:00
Alejandro Celaya
9372d1739a Enforced short URLs length to be 4 at least 2020-02-18 18:57:24 +01:00
Alejandro Celaya
13555366e3 Short code lengths can now be customized 2020-02-18 18:54:40 +01:00
Alejandro Celaya
8162dafe16 Added separator in readme before MaxMind reference 2020-02-16 12:18:23 +01:00
Alejandro Celaya
0b6602b275 Merge pull request #659 from acelaya-forks/feature/phpunit9
Feature/phpunit9
2020-02-15 21:21:00 +01:00
Alejandro Celaya
2cf9f64e8e Updated changelog 2020-02-15 21:14:55 +01:00
Alejandro Celaya
37c0a813db Updated to PHPUnit 9 2020-02-15 21:14:14 +01:00
Alejandro Celaya
a9269811dc Added command to run api tests with code coverage 2020-02-15 20:55:04 +01:00
Alejandro Celaya
0b353737ea Merge pull request #658 from acelaya-forks/feature/mssql
Feature/mssql
2020-02-15 20:39:20 +01:00
Alejandro Celaya
a3fc1513e1 Updated Installer to include the one supporting MsSQL 2020-02-15 20:28:32 +01:00
Alejandro Celaya
5886d73093 Documented support for Microsoft SQL Server 2020-02-14 19:55:24 +01:00
Alejandro Celaya
12adce9ac2 Updated changelog 2020-02-14 19:51:58 +01:00
Alejandro Celaya
d8cbf0512b Added missing env var which fixes issues with mssql driver on alpine 2020-02-14 19:44:11 +01:00
Alejandro Celaya
2bb2c2cde3 Documented how to use mssql with the docker image 2020-02-14 19:27:21 +01:00
Alejandro Celaya
27fd9c5988 Added MSSQL driver to prod docker image 2020-02-14 19:20:54 +01:00
Alejandro Celaya
542673fcb0 Updated development docker images 2020-02-14 19:11:29 +01:00
Alejandro Celaya
bb9e57fa8b Added support for mssql on dev env 2020-02-09 18:01:11 +01:00
703 changed files with 31271 additions and 9975 deletions

View File

@@ -1,3 +1,4 @@
bin/rr
config/autoload/*local*
data/infra
data/cache/*
@@ -5,20 +6,21 @@ data/log/*
data/locks/*
data/proxies/*
data/migrations_template.txt
data/GeoLite2-City.*
data/GeoLite2-City*
data/database.sqlite
data/shlink-tests.db
**/.gitignore
CHANGELOG.md
CONTRIBUTING.md
UPGRADE.md
composer.lock
vendor
docs
indocker
docker-*
php*
infection.json
phpstan.neon
php*xml*
infection*
**/test*
build*
.github
hooks
**/.*
!config/roadrunner/.rr.yml

1
.gitattributes vendored
View File

@@ -10,7 +10,6 @@
.gitattributes export-ignore
.gitignore export-ignore
.phpstorm.meta.php export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore
build.sh export-ignore
CHANGELOG.md export-ignore

View File

@@ -1,6 +1,7 @@
<!--
Before opening an issue, just take into account that this is a completely free of charge open source project.
I'm always happy to help and provide support, but some understanding will be required.
Before opening an issue, just take into account that this is a completely free of charge and open source project.
I'm always happy to help and provide support, but some understanding will be expected.
I do this in my own free time, so expect some delays when implementing new features and fixing bugs, and don't take it personal if an issue gets eventually closed.
You may also be asked to provide tests or ways to reproduce reported bugs.
Try to be polite, and understand it is impossible for an OSS project to cover all use cases.
-->

View File

@@ -5,9 +5,10 @@ labels: bug
---
<!--
Before opening an issue, just take into account that this is a completely free of charge open source project.
I'm always happy to help and provide support, but some understanding will be required.
Before opening an issue, just take into account that this is a completely free of charge and open source project.
I'm always happy to help and provide support, but some understanding will be expected.
I do this in my own free time, so expect some delays when implementing new features and fixing bugs, and don't take it personal if an issue gets eventually closed.
You may also be asked to provide tests or ways to reproduce reported bugs.
Try to be polite, and understand it is impossible for an OSS project to cover all use cases.
With that said, please fill in the information requested next. More information might be requested next (like logs or system configs).
@@ -17,8 +18,8 @@ With that said, please fill in the information requested next. More information
* Shlink Version: x.y.z
* PHP Version: x.y.z
* How do you serve Shlink: Self-hosted Apache|Self-hosted nginx|Self-hosted swoole|Docker image
* Database engine used: MySQL|MariaDB|PostgreSQL|SQLite (x.y.z)
* How do you serve Shlink: Self-hosted Apache|Self-hosted nginx|Self-hosted openswoole|Docker image
* Database engine used: MySQL|MariaDB|PostgreSQL|MicrosoftSQL|SQLite (x.y.z)
#### Summary

View File

@@ -5,9 +5,10 @@ labels: feature
---
<!--
Before opening an issue, just take into account that this is a completely free of charge open source project.
I'm always happy to help and provide support, but some understanding will be required.
Before opening an issue, just take into account that this is a completely free of charge and open source project.
I'm always happy to help and provide support, but some understanding will be expected.
I do this in my own free time, so expect some delays when implementing new features and fixing bugs, and don't take it personal if an issue gets eventually closed.
You may also be asked to provide tests or ways to reproduce reported bugs.
Try to be polite, and understand it is impossible for an OSS project to cover all use cases.
With that said, please fill in the information requested next. More information might be requested next (like logs or system configs).

View File

@@ -5,9 +5,10 @@ labels: question
---
<!--
Before opening an issue, just take into account that this is a completely free of charge open source project.
I'm always happy to help and provide support, but some understanding will be required.
Before opening an issue, just take into account that this is a completely free of charge and open source project.
I'm always happy to help and provide support, but some understanding will be expected.
I do this in my own free time, so expect some delays when implementing new features and fixing bugs, and don't take it personal if an issue gets eventually closed.
You may also be asked to provide tests or ways to reproduce reported bugs.
Try to be polite, and understand it is impossible for an OSS project to cover all use cases.
With that said, please fill in the information requested next. More information might be requested next (like logs or system configs).
@@ -17,8 +18,8 @@ With that said, please fill in the information requested next. More information
* Shlink Version: x.y.z
* PHP Version: x.y.z
* How do you serve Shlink: Self-hosted Apache|Self-hosted nginx|Self-hosted swoole|Docker image
* Database engine used: MySQL|MariaDB|PostgreSQL|SQLite (x.y.z)
* How do you serve Shlink: Self-hosted Apache|Self-hosted nginx|Self-hosted openswoole|Docker image
* Database engine used: MySQL|MariaDB|PostgreSQL|MicrosoftSQL|SQLite (x.y.z)
#### Summary

47
.github/actions/ci-setup/action.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
name: CI setup
description: 'Sets up the environment to run CI actions for Shlink'
inputs:
install-deps:
description: 'Tells if dependencies should be installed with composer. Default value is "yes"'
required: true
default: 'yes'
php-version:
description: 'The PHP version to be setup'
required: true
php-extensions:
description: 'The PHP extensions to install'
required: false
default: ''
extensions-cache-key:
description: 'The key used to cache PHP extensions. If empty value is provided, extension caching is disabled'
required: true
runs:
using: composite
steps:
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ inputs.php-version }}
extensions: ${{ inputs.php-extensions }}
key: ${{ inputs.extensions-cache-key }}
- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Use PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
tools: composer
extensions: ${{ inputs.php-extensions }}
coverage: pcov
ini-values: pcov.directory=module
- name: Install dependencies
if: ${{ inputs.install-deps == 'yes' }}
run: composer install --no-interaction --prefer-dist
shell: bash

44
.github/workflows/ci-db-tests.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: Database tests
on:
workflow_call:
inputs:
platform:
type: string
required: true
description: One of sqlite:ci, mysql, maria, postgres or ms
jobs:
db-tests:
runs-on: ubuntu-22.04
strategy:
matrix:
php-version: [ '8.1' ]
env:
LC_ALL: C
steps:
- uses: actions/checkout@v3
- name: Install MSSQL ODBC
if: ${{ inputs.platform == 'ms' }}
run: sudo ./data/infra/ci/install-ms-odbc.sh
- name: Start database server
if: ${{ inputs.platform != 'sqlite:ci' }}
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_${{ inputs.platform }}
- uses: './.github/actions/ci-setup'
with:
php-version: ${{ matrix.php-version }}
php-extensions: openswoole-4.11.1, pdo_sqlsrv-5.10.1
extensions-cache-key: db-tests-extensions-${{ matrix.php-version }}-${{ inputs.platform }}
- name: Create test database
if: ${{ inputs.platform == 'ms' }}
run: docker-compose exec -T shlink_db_ms /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Passw0rd!' -Q "CREATE DATABASE shlink_test;"
- name: Run tests
run: composer test:db:${{ inputs.platform }}
- name: Upload code coverage
uses: actions/upload-artifact@v3
if: ${{ matrix.php-version == '8.1' && inputs.platform == 'sqlite:ci' }}
with:
name: coverage-db
path: |
build/coverage-db
build/coverage-db.cov

45
.github/workflows/ci-mutation-tests.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: Mutation tests
on:
workflow_call:
inputs:
test-group:
type: string
required: true
description: One of unit, db, api or cli
jobs:
mutation-tests:
runs-on: ubuntu-22.04
strategy:
matrix:
php-version: [ '8.1' ]
steps:
- uses: actions/checkout@v3
- uses: './.github/actions/ci-setup'
with:
php-version: ${{ matrix.php-version }}
php-extensions: openswoole-4.11.1
extensions-cache-key: mutation-tests-extensions-${{ matrix.php-version }}-${{ inputs.test-group }}
- uses: actions/download-artifact@v3
with:
name: coverage-${{ inputs.test-group }}
path: build
- name: Resolve infection args
id: infection_args
run: echo "::set-output name=args::--logger-github=false"
# TODO Try to filter mutation tests to improve execution times. Investigate why --git-diff-lines --git-diff-base=develop does not work
# run: |
# BRANCH="${GITHUB_REF#refs/heads/}" |
# if [[ $BRANCH == 'main' || $BRANCH == 'develop' ]]; then
# echo "::set-output name=args::--logger-github=false"
# else
# echo "::set-output name=args::--logger-github=false --git-diff-lines --git-diff-base=develop"
# fi;
shell: bash
- if: ${{ inputs.test-group == 'unit' }}
run: composer infect:ci:unit -- ${{ steps.infection_args.outputs.args }}
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
- if: ${{ inputs.test-group != 'unit' }}
run: composer infect:ci:${{ inputs.test-group }} -- ${{ steps.infection_args.outputs.args }}

37
.github/workflows/ci-tests.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: Tests
on:
workflow_call:
inputs:
test-group:
type: string
required: true
description: One of unit, api or cli
jobs:
tests:
runs-on: ubuntu-22.04
strategy:
matrix:
php-version: ['8.1']
steps:
- uses: actions/checkout@v3
- name: Start postgres database server
if: ${{ inputs.test-group == 'api' }}
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_postgres
- name: Start maria database server
if: ${{ inputs.test-group == 'cli' }}
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_maria
- uses: './.github/actions/ci-setup'
with:
php-version: ${{ matrix.php-version }}
php-extensions: openswoole-4.11.1
extensions-cache-key: tests-extensions-${{ matrix.php-version }}-${{ inputs.test-group }}
- run: composer test:${{ inputs.test-group }}:ci
- uses: actions/upload-artifact@v3
if: ${{ matrix.php-version == '8.1' }}
with:
name: coverage-${{ inputs.test-group }}
path: |
build/coverage-${{ inputs.test-group }}
build/coverage-${{ inputs.test-group }}.cov

175
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,175 @@
name: Continuous integration
on:
pull_request: null
push:
branches:
- main
- develop
- 2.x
jobs:
static-analysis:
runs-on: ubuntu-22.04
strategy:
matrix:
php-version: ['8.1']
command: ['cs', 'stan', 'swagger:validate']
steps:
- uses: actions/checkout@v3
- uses: './.github/actions/ci-setup'
with:
php-version: ${{ matrix.php-version }}
php-extensions: openswoole-4.11.1
extensions-cache-key: tests-extensions-${{ matrix.php-version }}-${{ matrix.command }}
- run: composer ${{ matrix.command }}
unit-tests:
uses: './.github/workflows/ci-tests.yml'
with:
test-group: unit
cli-tests:
uses: './.github/workflows/ci-tests.yml'
with:
test-group: cli
openswoole-api-tests:
uses: './.github/workflows/ci-tests.yml'
with:
test-group: api
roadrunner-api-tests:
runs-on: ubuntu-22.04
strategy:
matrix:
php-version: [ '8.1' ]
steps:
- uses: actions/checkout@v3
- run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_postgres
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer
- run: composer install --no-interaction --prefer-dist
- run: ./vendor/bin/rr get --no-interaction --location bin/ && chmod +x bin/rr
- run: composer test:api:rr
sqlite-db-tests:
uses: './.github/workflows/ci-db-tests.yml'
with:
platform: 'sqlite:ci'
mysql-db-tests:
uses: './.github/workflows/ci-db-tests.yml'
with:
platform: 'mysql'
maria-db-tests:
uses: './.github/workflows/ci-db-tests.yml'
with:
platform: 'maria'
postgres-db-tests:
uses: './.github/workflows/ci-db-tests.yml'
with:
platform: 'postgres'
ms-db-tests:
uses: './.github/workflows/ci-db-tests.yml'
with:
platform: 'ms'
unit-mutation-tests:
needs:
- unit-tests
uses: './.github/workflows/ci-mutation-tests.yml'
with:
test-group: unit
db-mutation-tests:
needs:
- sqlite-db-tests
uses: './.github/workflows/ci-mutation-tests.yml'
with:
test-group: db
api-mutation-tests:
needs:
- openswoole-api-tests
uses: './.github/workflows/ci-mutation-tests.yml'
with:
test-group: api
cli-mutation-tests:
needs:
- cli-tests
uses: './.github/workflows/ci-mutation-tests.yml'
with:
test-group: cli
upload-coverage:
needs:
- unit-tests
- openswoole-api-tests
- cli-tests
- sqlite-db-tests
runs-on: ubuntu-22.04
strategy:
matrix:
php-version: ['8.1']
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
ini-values: pcov.directory=module
- uses: actions/download-artifact@v3
with:
path: build
- run: mv build/coverage-unit/coverage-unit.cov build/coverage-unit.cov
- run: mv build/coverage-db/coverage-db.cov build/coverage-db.cov
- run: mv build/coverage-api/coverage-api.cov build/coverage-api.cov
- run: mv build/coverage-cli/coverage-cli.cov build/coverage-cli.cov
- run: wget https://phar.phpunit.de/phpcov-8.2.1.phar
- run: php phpcov-8.2.1.phar merge build --clover build/clover.xml
- name: Publish coverage
uses: codecov/codecov-action@v1
with:
file: ./build/clover.xml
delete-artifacts:
needs:
- unit-mutation-tests
- db-mutation-tests
- api-mutation-tests
- cli-mutation-tests
- upload-coverage
runs-on: ubuntu-22.04
steps:
- uses: geekyeggo/delete-artifact@v1
with:
name: |
coverage-unit
coverage-db
coverage-api
coverage-cli
build-docker-image:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 100
- uses: marceloprado/has-changed-path@v1
id: changed-dockerfile
with:
paths: ./Dockerfile
- if: ${{ steps.changed-dockerfile.outputs.changed == 'true' }}
run: docker build -t shlink-docker-image:temp .
- if: ${{ steps.changed-dockerfile.outputs.changed != 'true' }}
run: echo "Dockerfile didn't change. Skipped"

View File

@@ -0,0 +1,27 @@
name: Build and publish docker image
on:
push:
branches:
- develop
tags:
- 'v*'
jobs:
build-openswool:
uses: shlinkio/github-actions/.github/workflows/docker-build-and-publish.yml@main
secrets: inherit
with:
image-name: shlinkio/shlink
version-arg-name: SHLINK_VERSION
build-roadrunner:
uses: shlinkio/github-actions/.github/workflows/docker-build-and-publish.yml@main
secrets: inherit
with:
image-name: shlinkio/shlink
version-arg-name: SHLINK_VERSION
platforms: 'linux/arm64/v8,linux/amd64'
tags-suffix: roadrunner
extra-build-args: |
SHLINK_RUNTIME=rr

59
.github/workflows/publish-release.yml vendored Normal file
View File

@@ -0,0 +1,59 @@
name: Publish release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
php-version: ['8.1']
swoole: ['yes', 'no']
steps:
- uses: actions/checkout@v3
- uses: './.github/actions/ci-setup'
with:
php-version: ${{ matrix.php-version }}
php-extensions: openswoole-4.11.1
extensions-cache-key: publish-swagger-spec-extensions-${{ matrix.php-version }}
install-deps: 'no'
- if: ${{ matrix.swoole == 'yes' }}
run: ./build.sh ${GITHUB_REF#refs/tags/v}
- if: ${{ matrix.swoole == 'no' }}
run: ./build.sh ${GITHUB_REF#refs/tags/v} --no-swoole
- uses: actions/upload-artifact@v3
with:
name: dist-files-${{ matrix.php-version }}-${{ matrix.swoole }}
path: build
publish:
needs: ['build']
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: build
- name: Publish release with assets
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ALLOW_EMPTY_CHANGELOG: "true"
with:
args: |
build/*/shlink*_dist.zip
delete-artifacts:
needs: ['publish']
runs-on: ubuntu-22.04
strategy:
matrix:
php-version: ['8.1']
swoole: ['yes', 'no']
steps:
- uses: geekyeggo/delete-artifact@v1
with:
name: dist-files-${{ matrix.php-version }}-${{ matrix.swoole }}

View File

@@ -0,0 +1,36 @@
name: Publish swagger spec
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
php-version: ['8.1']
steps:
- uses: actions/checkout@v3
- name: Determine version
id: determine_version
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
shell: bash
- uses: './.github/actions/ci-setup'
with:
php-version: ${{ matrix.php-version }}
php-extensions: openswoole-4.11.1
extensions-cache-key: publish-swagger-spec-extensions-${{ matrix.php-version }}
- run: composer swagger:inline
- run: mkdir ${{ steps.determine_version.outputs.version }}
- run: mv docs/swagger/swagger-inlined.json ${{ steps.determine_version.outputs.version }}/open-api-spec.json
- name: Publish spec
uses: JamesIves/github-pages-deploy-action@4.1.7
with:
token: ${{ secrets.OAS_PUBLISH_TOKEN }}
repository-name: 'shlinkio/shlink-open-api-specs'
branch: main
folder: ${{ steps.determine_version.outputs.version }}
target-folder: specs/${{ steps.determine_version.outputs.version }}
clean: false

10
.gitignore vendored
View File

@@ -1,13 +1,17 @@
.idea
bin/.rr.*
bin/rr
config/roadrunner/.pid
build
!hooks/build
!docker/build
composer.lock
composer.phar
vendor/
data/database.sqlite
data/shlink-tests.db
data/GeoLite2-City.mmdb
data/GeoLite2-City.mmdb.*
data/GeoLite2-City.*
docs/swagger-ui*
docs/mercure.html
docker-compose.override.yml
.phpunit.result.cache
docs/swagger/swagger-inlined.json

View File

@@ -1,13 +0,0 @@
tools:
external_code_coverage:
timeout: 600
checks:
php:
code_rating: true
duplication: true
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run

View File

@@ -1,58 +0,0 @@
language: php
branches:
only:
- /.*/
php:
- '7.4'
services:
- mysql
- postgresql
- docker
cache:
directories:
- $HOME/.composer/cache/files
before_install:
- echo 'extension = apcu.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- yes | pecl install swoole
- phpenv config-rm xdebug.ini || return 0
install:
- composer self-update
- composer install --no-interaction --prefer-dist
before_script:
- mysql -e 'CREATE DATABASE shlink_test;'
- psql -c 'create database shlink_test;' -U postgres
- mkdir build
- export DOCKERFILE_CHANGED=$(git diff ${TRAVIS_COMMIT_RANGE:-origin/master} --name-only | grep Dockerfile)
script:
- composer ci
- if [[ ! -z "$DOCKERFILE_CHANGED" && "${TRAVIS_PHP_VERSION}" == "7.4" ]]; then docker build -t shlink-docker-image:temp . ; fi
after_success:
- rm -f build/clover.xml
- wget https://phar.phpunit.de/phpcov-6.0.1.phar
- phpdbg -qrr phpcov-6.0.1.phar merge build --clover build/clover.xml
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover build/clover.xml
# Before deploying, build dist file for current travis tag
before_deploy:
- rm -f ocular.phar
- ./build.sh ${TRAVIS_TAG#?}
deploy:
- provider: releases
api_key:
secure: a9dbZchocqeuOViwUeNH54bQR5Sz7rEYXx5b9WPFtnFn9LGKKUaLbA2U91UQ9QKPrcTpsALubUYbw2CnNmvCwzaY+R8lCD3gkU4ohsEnbpnw3deOeixI74sqBHJAuCH9FSaRDGILoBMtUKx2xlzIymFxkIsgIukkGbdkWHDlRWY3oTUUuw1SQ2Xk9KDsbJQtjIc1+G/O6gHaV4qv/R9W8NPmJExKTNDrAZbC1vIUnxqp4UpVo1hst8qPd1at94CndDYM5rG+7imGbdtxTxzamt819qdTO1OfvtctKawNAm7YXZrrWft6c7gI6j6SI4hxd+ZrrPBqbaRFHkZHjnNssO/yn4SaOHFFzccmu0MzvpPCf0qWZwd3sGHVYer1MnR2mHYqU84QPlW3nrHwJjkrpq3+q0JcBY6GsJs+RskHNtkMTKV05Iz6QUI5YZGwTpuXaRm036SmavjGc4IDlMaYCk/NmbB9BKpthJxLdUpczOHpnjXXHziotWD6cfEnbjU3byfD8HY5WrxSjsNT7SKmXN3hRof7bk985ewQVjGT42O3NbnfnqjQQWr/B7/zFTpLR4f526Bkq12CdCyf5lvrbq+POkLVdJ+uFfR7ds248Ue/jBQy6kM1tWmKF9QiwisFlA84eQ4CW3I93Rp97URv+AQa9zmbD0Ve3Udp+g6nF5I=
file: "./build/shlink_${TRAVIS_TAG#?}_dist.zip"
skip_cleanup: true
on:
tags: true
php: '7.4'

File diff suppressed because it is too large Load Diff

144
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,144 @@
# Contributing
This file will guide you through the process of getting to project up and running, in case you want to provide coding contributions.
You will also see how to ensure the code fulfills the expected code checks, and how to create a pull request.
## System dependencies
The project provides all its dependencies as docker containers through a docker-compose configuration.
Because of this, the only actual dependencies are [docker](https://docs.docker.com/get-docker/) and [docker-compose](https://docs.docker.com/compose/install/).
## Setting up the project
The first thing you need to do is fork the repository, and clone it in your local machine.
Then you will have to follow these steps:
* Copy all files with `.local.php.dist` extension from `config/autoload` by removing the dist extension.
For example the `common.local.php.dist` file should be copied as `common.local.php`.
* Copy the file `docker-compose.override.yml.dist` by also removing the `dist` extension.
* Start-up the project by running `docker-compose up`.
The first time this command is run, it will create several containers that are used during development, so it may take some time.
It will also create some empty databases and install the project dependencies with composer.
* Run `./indocker bin/cli db:create` to create the initial database.
* Run `./indocker bin/cli db:migrate` to get database migrations up to date.
* Run `./indocker bin/cli api-key:generate` to get your first API key generated.
Once you finish this, you will have the project exposed in ports `8000` through nginx+php-fpm and `8080` through openswoole.
> Note: The `indocker` shell script is a helper tool used to run commands inside the main docker container.
## Project structure
This project is structured as a modular application, using [laminas/laminas-config-aggregator](https://github.com/laminas/laminas-config-aggregator) to merge the configuration provided by every module.
All modules are inside the `module` folder, and each one has its own `src`, `test` and `config` folders, with the source code, tests and configuration. They also have their own `ConfigProvider` class, which is consumed by the config aggregator.
This is a simplified version of the project structure:
```
shlink
├── bin
│ └── cli
├── config
│ ├── autoload
│ ├── params
│ ├── config.php
│ └── container.php
├── data
│ ├── cache
│ ├── locks
│ ├── log
│ ├── migrations
│ └── proxies
├── docs
│ ├── adr
│ ├── async-api
│ └── swagger
├── module
│ ├── CLI
│ ├── Core
│ └── Rest
├── public
├── composer.json
└── README.md
```
The purposes of every folder are:
* `bin`: It contains the CLI tools. The `cli` one is the main entry point to run shlink from the command line.
* `config`: Contains application-wide configurations, which are later merged with the ones provided by every module.
* `data`: Common runtime-generated git-ignored assets, like logs, caches, etc.
* `docs`: Any project documentation is stored here, like API spec definitions or architectural decision records.
* `module`: Contains a sub-folder for every module in the project. Modules contain the source code, tests and configurations for every context in the project.
* `public`: Few assets (like `favicon.ico` or `robots.txt`) and the web entry point are stored here. This web entry point is not used when serving the app with openswoole.
## Project tests
In order to ensure stability and no regressions are introduced while developing new features, this project has different types of tests.
* **Unit tests**: These are the simplest to run, and usually test individual pieces of code, replacing any external dependency by mocks.
The code coverage of unit tests is pretty high, and only components which work closer to the database, like entity repositories, are excluded because of their nature.
* **Database tests**: These are integration tests that run against a real database, and only cover components which work closer to the database.
Its purpose is to verify all the database queries behave as expected and return what's expected.
The project provides some tooling to run them against any of the supported database engines.
* **API tests**: These are E2E tests that spin up an instance of the app with openswoole, and test it from the outside by interacting with the REST API.
These are the best tests to catch regressions, and to verify everything behaves as expected.
They use Postgres as the database engine, and include some fixtures that ensure the same data exists at the beginning of the execution.
Since the app instance is run on a process different from the one running the tests, when a test fails it might not be obvious why. To help debugging that, the app will dump all its logs inside `data/log/api-tests`, where you will find the `shlink.log` and `access.log` files.
* **CLI tests**: These are E2E tests too, but they test console commands instead of REST endpoints.
They use Maria DB as the database engine, and include the same fixtures as the API tests, that ensure the same data exists at the beginning of the execution.
Depending on the kind of contribution, maybe not all kinds of tests are needed, but the more you provide, the better.
## Running code checks
* Run `./indocker composer cs` to check coding styles are fulfilled.
* Run `./indocker composer cs:fix` to fix coding styles (some may not be fixable from the CLI)
* Run `./indocker composer stan` to statically analyze the code with [phpstan](https://phpstan.org/). This tool is the closest to "compile" PHP and verify everything would work as expected.
* Run `./indocker composer test:unit` to run the unit tests.
* Run `./indocker composer test:db` to run the database integration tests.
This command runs the same test suite against all supported database engines in parallel. If you just want to run one of them, you can add one of `:sqlite`, `:mysql`, `:maria`, `:postgres`, `:mssql` at the end of the command.
For example, `test:db:postgres`.
* Run `./indocker composer test:api` to run API E2E tests. For these, the Postgres database engine is used.
* Run `./indocker composer test:cli` to run CLI E2E tests. For these, the Maria DB database engine is used.
* Run `./indocker composer infect:test` to run both unit and database tests (over sqlite) and then apply mutations to them with [infection](https://infection.github.io/).
* Run `./indocker composer ci` to run all previous commands together, parallelizing non-conflicting tasks as much as possible.
## Pull request process
**Important!**: Before starting to work on a pull request, make sure you always [open an issue](https://github.com/shlinkio/shlink/issues/new/choose) first.
This is important because any contribution needs to be discussed first. Maybe there's someone else already working on something similar, or there are other considerations to have in mind.
Once everything is clear, to provide a pull request to this project, you should always start by creating a new branch, where you will make all desired changes.
The base branch should always be `develop`, and the target branch for the pull request should also be `develop`.
Before your branch can be merged, all the checks described in [Running code checks](#running-code-checks) have to be passing. You can verify that manually by running `./indocker composer ci`, or wait for the build to be run automatically after the pull request is created.
## Architectural Decision Records
The project includes logs for some architectural decisions, using the [adr](https://adr.github.io/) proposal.
If you are curious or want to understand why something has been built in some specific way, [take a look at them](docs/adr).

View File

@@ -1,57 +1,84 @@
FROM php:7.4.1-alpine3.10
LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>"
FROM php:8.1.9-alpine3.16 as base
ARG SHLINK_VERSION=2.0.0
ARG SHLINK_VERSION=latest
ENV SHLINK_VERSION ${SHLINK_VERSION}
ENV SWOOLE_VERSION 4.4.12
ENV COMPOSER_VERSION 1.9.1
ARG SHLINK_RUNTIME=openswoole
ENV SHLINK_RUNTIME ${SHLINK_RUNTIME}
ENV OPENSWOOLE_VERSION 4.11.1
ENV PDO_SQLSRV_VERSION 5.10.1
ENV MS_ODBC_SQL_VERSION 17.5.2.2
ENV LC_ALL "C"
WORKDIR /etc/shlink
# Install required PHP extensions
RUN \
# Install mysl and calendar
docker-php-ext-install -j"$(nproc)" pdo_mysql calendar && \
# Install sqlite
apk add --no-cache sqlite-libs sqlite-dev && \
# Temp install dev dependencies needed to compile the extensions
apk add --no-cache --virtual .dev-deps sqlite-dev postgresql-dev icu-dev libzip-dev zlib-dev libpng-dev && \
docker-php-ext-install -j"$(nproc)" pdo_mysql pdo_pgsql intl calendar sockets bcmath zip gd && \
apk add --no-cache sqlite-libs && \
docker-php-ext-install -j"$(nproc)" pdo_sqlite && \
# Install postgres
apk add --no-cache postgresql-dev && \
docker-php-ext-install -j"$(nproc)" pdo_pgsql && \
# Install intl
apk add --no-cache icu-dev && \
docker-php-ext-install -j"$(nproc)" intl && \
# Install zip and gd
apk add --no-cache libzip-dev zlib-dev libpng-dev && \
docker-php-ext-install -j"$(nproc)" zip gd
# Remove temp dev extensions, and install prod equivalents that are required at runtime
apk del .dev-deps && \
apk add --no-cache postgresql icu libzip libpng
# Install swoole
# First line fixes an error when installing pecl extensions. Found in https://github.com/docker-library/php/issues/233
RUN apk add --no-cache --virtual .phpize-deps ${PHPIZE_DEPS} && \
pecl install swoole-${SWOOLE_VERSION} && \
docker-php-ext-enable swoole && \
# Install openswoole and sqlsrv driver for x86_64 builds
RUN apk add --no-cache --virtual .phpize-deps ${PHPIZE_DEPS} unixodbc-dev && \
if [ "$SHLINK_RUNTIME" == 'openswoole' ]; then \
pecl install openswoole-${OPENSWOOLE_VERSION} && \
docker-php-ext-enable openswoole ; \
fi; \
if [ $(uname -m) == "x86_64" ]; then \
wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
apk add --no-cache --allow-untrusted msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
pecl install pdo_sqlsrv-${PDO_SQLSRV_VERSION} && \
docker-php-ext-enable pdo_sqlsrv && \
rm msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk ; \
fi; \
apk del .phpize-deps
# Install shlink
FROM base as builder
COPY . .
RUN rm -rf ./docker && \
wget https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar && \
php composer.phar install --no-dev --optimize-autoloader --prefer-dist --no-progress --no-interaction && \
COPY --from=composer:2 /usr/bin/composer ./composer.phar
RUN apk add --no-cache git && \
php composer.phar install --no-dev --prefer-dist --optimize-autoloader --no-progress --no-interaction && \
if [ "$SHLINK_RUNTIME" == 'openswoole' ]; then \
php composer.phar remove spiral/roadrunner spiral/roadrunner-jobs --with-all-dependencies --update-no-dev --optimize-autoloader --no-progress --no-interactionc ; \
elif [ $SHLINK_RUNTIME == 'rr' ]; then \
php composer.phar remove mezzio/mezzio-swoole --with-all-dependencies --update-no-dev --optimize-autoloader --no-progress --no-interaction ; \
fi; \
php composer.phar clear-cache && \
rm composer.*
rm -r docker composer.* && \
sed -i "s/%SHLINK_VERSION%/${SHLINK_VERSION}/g" config/autoload/app_options.global.php
# Add shlink to the path to ease running it after container is created
RUN ln -s /etc/shlink/bin/cli /usr/local/bin/shlink
RUN sed -i "s/%SHLINK_VERSION%/${SHLINK_VERSION}/g" config/autoload/app_options.global.php
# Expose swoole port
# Prepare final image
FROM base
LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>"
COPY --from=builder /etc/shlink .
RUN ln -s /etc/shlink/bin/cli /usr/local/bin/shlink && \
if [ "$SHLINK_RUNTIME" == 'rr' ]; then \
php ./vendor/bin/rr get --no-interaction --location bin/ && chmod +x bin/rr ; \
fi;
# Expose default port
EXPOSE 8080
# Expose params config dir, since the user is expected to provide custom config from there
VOLUME /etc/shlink/config/params
# Copy config specific for the image
COPY docker/docker-entrypoint.sh docker-entrypoint.sh
COPY docker/config/shlink_in_docker.local.php config/autoload/shlink_in_docker.local.php
COPY docker/config/php.ini ${PHP_INI_DIR}/conf.d/
# Change the ownership of /etc/shlink/data to be writable, then change the user to non-root
# FIXME Disabled for now, as it conflicts with ENABLE_PERIODIC_VISIT_LOCATE, which is used to configure a cron as root.
# Ref: https://github.com/shlinkio/shlink/issues/1132
#RUN chown 1001 /etc/shlink/data
#RUN chown 1001 /etc/shlink/data/locks
#RUN chown 1001 /etc/shlink/data/proxies
#RUN chown 1001 /etc/shlink/data/cache
#RUN chown 1001 /etc/shlink/data/log
#USER 1001
ENTRYPOINT ["/bin/sh", "./docker-entrypoint.sh"]

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016-2020 Alejandro Celaya
Copyright (c) 2016-2021 Alejandro Celaya
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

339
README.md
View File

@@ -1,43 +1,48 @@
![Shlink](https://raw.githubusercontent.com/shlinkio/shlink.io/master/public/images/shlink-hero.png)
![Shlink](https://raw.githubusercontent.com/shlinkio/shlink.io/main/public/images/shlink-hero.png)
[![Build Status](https://img.shields.io/travis/shlinkio/shlink.svg?style=flat-square)](https://travis-ci.org/shlinkio/shlink)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/shlinkio/shlink.svg?style=flat-square)](https://scrutinizer-ci.com/g/shlinkio/shlink/?branch=master)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/shlinkio/shlink.svg?style=flat-square)](https://scrutinizer-ci.com/g/shlinkio/shlink/?branch=master)
[![Build Status](https://img.shields.io/github/workflow/status/shlinkio/shlink/Continuous%20integration/develop?logo=github&style=flat-square)](https://github.com/shlinkio/shlink/actions?query=workflow%3A%22Continuous+integration%22)
[![Code Coverage](https://img.shields.io/codecov/c/gh/shlinkio/shlink/develop?style=flat-square)](https://app.codecov.io/gh/shlinkio/shlink)
[![Infection MSI](https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fshlinkio%2Fshlink%2Fdevelop)](https://dashboard.stryker-mutator.io/reports/github.com/shlinkio/shlink/develop)
[![Latest Stable Version](https://img.shields.io/github/release/shlinkio/shlink.svg?style=flat-square)](https://packagist.org/packages/shlinkio/shlink)
[![License](https://img.shields.io/github/license/shlinkio/shlink.svg?style=flat-square)](https://github.com/shlinkio/shlink/blob/master/LICENSE)
[![Paypal donate](https://img.shields.io/badge/Donate-paypal-blue.svg?style=flat-square&logo=paypal&colorA=aaaaaa)](https://acel.me/donate)
[![Docker pulls](https://img.shields.io/docker/pulls/shlinkio/shlink.svg?logo=docker&style=flat-square)](https://hub.docker.com/r/shlinkio/shlink/)
[![License](https://img.shields.io/github/license/shlinkio/shlink.svg?style=flat-square)](https://github.com/shlinkio/shlink/blob/main/LICENSE)
[![Twitter](https://img.shields.io/twitter/follow/shlinkio?color=blue&label=follow&logo=twitter&style=flat-square)](https://twitter.com/shlinkio)
[![Paypal donate](https://img.shields.io/badge/Donate-paypal-blue.svg?style=flat-square&logo=paypal&colorA=aaaaaa)](https://slnk.to/donate)
A PHP-based self-hosted URL shortener that can be used to serve shortened URLs under your own custom domain.
> This document references Shlink 2.x. If you are using an older version and want to upgrade, follow the [UPGRADE](UPGRADE.md) doc.
A PHP-based self-hosted URL shortener that can be used to serve shortened URLs under your own domain.
## Table of Contents
- [Installation](#installation)
- [Full documentation](#full-documentation)
- [Docker image](#docker-image)
- [Self-hosted](#self-hosted)
- [Download](#download)
- [Configure](#configure)
- [Serve](#serve)
- [Bonus](#bonus)
- [Update to new version](#update-to-new-version)
- [Using a docker image](#using-a-docker-image)
- [Using shlink](#using-shlink)
- [Shlink CLI Help](#shlink-cli-help)
- [Multiple domains](#multiple-domains)
- [Management](#management)
- [Visits](#visits)
- [Special redirects](#special-redirects)
- [Contributing](#contributing)
## Installation
## Full documentation
> These are the steps needed to install Shlink if you plan to manually host it.
>
> Alternatively, you can use the official docker image. If that's your intention, jump directly to [Using a docker image](#using-a-docker-image)
This document contains the very basics to get started with Shlink. If you want to learn everything you can do with it, visit the [full searchable documentation](https://shlink.io/documentation/).
## Docker image
You can learn how to use the official docker image by reading [the docs](https://shlink.io/documentation/install-docker-image/).
The idea is that you can just generate a container using the image and provide the custom config via env vars.
## Self hosted
First, make sure the host where you are going to run shlink fulfills these requirements:
* PHP 7.4 or greater with JSON, APCu, intl, curl, PDO and gd extensions enabled.
* MySQL, MariaDB, PostgreSQL or SQLite.
* The web server of your choice with PHP integration (Apache or Nginx recommended).
* PHP 8.1
* The next PHP extensions: json, curl, pdo, intl, gd and gmp/bcmath.
* apcu extension is recommended if you don't plan to use openswoole.
* xml extension is required if you want to generate QR codes in svg format.
* sockets and bcmath extensions are required if you want to integrate with a RabbitMQ instance.
* MySQL, MariaDB, PostgreSQL, MicrosoftSQL or SQLite.
* 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`.
* The [openswoole](https://openswoole.com/) PHP extension (if you plan to serve Shlink with openswoole) or the web server of your choice with PHP integration (like Apache or Nginx).
### Download
@@ -47,7 +52,7 @@ In order to run Shlink, you will need a built version of the project. There are
The easiest way to install shlink is by using one of the pre-bundled distributable packages.
Go to the [latest version](https://github.com/shlinkio/shlink/releases/latest) and download the `shlink_x.x.x_dist.zip` file you will find there.
Go to the [latest version](https://github.com/shlinkio/shlink/releases/latest) and download the `shlink*_dist.zip` file that suits your needs. You will find one for every supported PHP version and with/without openswoole integration.
Finally, decompress the file in the location of your choice.
@@ -57,291 +62,43 @@ In order to run Shlink, you will need a built version of the project. There are
* Clone the project with git (`git clone https://github.com/shlinkio/shlink.git`), or download it by clicking the **Clone or download** green button.
* Download the [Composer](https://getcomposer.org/download/) PHP package manager inside the project folder.
* Run `./build.sh 1.0.0`, replacing the version with the version number you are going to build (the version number is only used for the generated dist file).
* Run `./build.sh 3.0.0`, replacing the version with the version number you are going to build (the version number is used as part of the generated dist file name, and to set the value returned when running `shlink -V` from the command line).
After that, you will have a `shlink_x.x.x_dist.zip` dist file inside the `build` directory, that you need to decompress in the location fo your choice.
After that, you will have a dist file inside the `build` directory, that you need to decompress in the location of your choice.
> This is the process used when releasing new shlink versions. After tagging the new version with git, the Github release is automatically created by [travis](https://travis-ci.org/shlinkio/shlink), attaching the generated dist file to it.
> **Note**
>
> This is the process used when releasing new Shlink versions. After tagging the new version with git, the GitHub release is automatically created by a [GitHub workflow](https://github.com/shlinkio/shlink/actions?query=workflow%3A%22Publish+release%22), attaching the generated dist file to it.
### Configure
Despite how you built the project, you now need to configure it, by following these steps:
* If you are going to use MySQL, MariaDB or PostgreSQL, create an empty database with the name of your choice.
* If you are going to use MySQL, MariaDB, PostgreSQL or Microsoft SQL Server, create an empty database with the name of your choice.
* Recursively grant write permissions to the `data` directory. Shlink uses it to cache some information.
* Setup the application by running the `bin/install` script. It is a command line tool that will guide you through the installation process. **Take into account that this tool has to be run directly on the server where you plan to host Shlink. Do not run it before uploading/moving it there.**
* Generate your first API key by running `bin/cli api-key:generate`. You will need the key in order to interact with shlink's API.
### Serve
Once Shlink is configured, you need to expose it to the web, either by using a traditional web server + fast CGI approach, or by using a [swoole](https://www.swoole.co.uk/) non-blocking server.
* **Using a web server:**
For example, assuming your domain is doma.in and shlink is in the `/path/to/shlink` folder, these would be the basic configurations for Nginx and Apache.
*Nginx:*
```nginx
server {
server_name doma.in;
listen 80;
root /path/to/shlink/public;
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ /\.ht {
deny all;
}
}
```
*Apache:*
```apache
<VirtualHost *:80>
ServerName doma.in
DocumentRoot "/path/to/shlink/public"
<Directory "/path/to/shlink/public">
Options FollowSymLinks Includes ExecCGI
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
```
* **Using swoole:**
First you need to install the swoole PHP extension with [pecl](https://pecl.php.net/package/swoole), `pecl install swoole`.
Once installed, it's actually pretty easy to get shlink up and running with swoole. Run `./vendor/bin/mezzio-swoole start -d` and you will get shlink running on port 8080.
However, by doing it this way, you are loosing all the access logs, and the service won't be automatically run if the server has to be restarted.
For that reason, you should create a daemon script, in `/etc/init.d/shlink_swoole`, like this one, replacing `/path/to/shlink` by the path to your shlink installation:
```bash
#!/bin/bash
### BEGIN INIT INFO
# Provides: shlink_swoole
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Shlink non-blocking server with swoole
### END INIT INFO
SCRIPT=/path/to/shlink/vendor/bin/mezzio-swoole\ start
RUNAS=root
PIDFILE=/var/run/shlink_swoole.pid
LOGDIR=/var/log/shlink
LOGFILE=${LOGDIR}/shlink_swoole.log
start() {
if [[ -f "$PIDFILE" ]] && kill -0 $(cat "$PIDFILE"); then
echo 'Shlink with swoole already running' >&2
return 1
fi
echo 'Starting shlink with swoole' >&2
mkdir -p "$LOGDIR"
touch "$LOGFILE"
local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
su -c "$CMD" $RUNAS > "$PIDFILE"
echo 'Shlink started' >&2
}
stop() {
if [[ ! -f "$PIDFILE" ]] || ! kill -0 $(cat "$PIDFILE"); then
echo 'Shlink with swoole not running' >&2
return 1
fi
echo 'Stopping shlink with swoole' >&2
kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE"
echo 'Shlink stopped' >&2
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
```
Then run these commands to enable the service and start it:
* `sudo chmod +x /etc/init.d/shlink_swoole`
* `sudo update-rc.d shlink_swoole defaults`
* `sudo update-rc.d shlink_swoole enable`
* `/etc/init.d/shlink_swoole start`
Now again, you can access shlink on port 8080, but this time the service will be automatically run at system start-up, and all access logs will be written in `/var/log/shlink/shlink_swoole.log` (you will probably want to [rotate those logs](https://www.digitalocean.com/community/tutorials/how-to-manage-logfiles-with-logrotate-on-ubuntu-16-04). You can find an example logrotate config file [here](data/infra/examples/shlink-daemon-logrotate.conf)).
Finally access to [https://app.shlink.io](https://app.shlink.io) and configure your server to start creating short URLs.
### Bonus
Geo-locating visits to your short links is a time-consuming task. When serving Shlink with swoole, the geo-location task is automatically run asynchronously just after a visit to a short URL happens.
However, if you are not serving Shlink with swoole, you will have to schedule the geo-location task to be run regularly in the background (for example, using cron jobs):
The command you need to run is `/path/to/shlink/bin/cli visit:locate`, and you can optionally provide the `-q` flag to remove any output and avoid your cron logs to be polluted.
## Update to new version
When a new Shlink version is available, you don't need to repeat the entire process. Instead, follow these steps:
1. Rename your existing Shlink directory to something else (ie. `shlink` ---> `shlink-old`).
2. Download and extract the new version of Shlink, and set the directory name to that of the old version (ie. `shlink`).
3. Run the `bin/update` script in the new version's directory to migrate your configuration over. You will be asked to provide the path to the old instance (ie. `shlink-old`).
4. If you are using shlink with swoole, restart the service by running `/etc/init.d/shlink_swoole restart`.
The `bin/update` will use the location from previous shlink version to import the configuration. It will then update the database and generate some assets shlink needs to work.
**Important!** It is recommended that you don't skip any version when using this process. The update tool gets better on every version, but older versions might make assumptions.
## Using a docker image
Starting with version 1.15.0, an official docker image is provided. You can learn how to use it by reading [the docs](docker/README.md).
The idea is that you can just generate a container using the image and provide custom config via env vars.
* Set up the application by running the `vendor/bin/shlink-installer install` script. It is a command line tool that will guide you through the installation process. **Take into account that this tool has to be run directly on the server where you plan to host Shlink. Do not run it before uploading/moving it there.**
* Generate your first API key by running `bin/cli api-key:generate`. You will need the key in order to interact with Shlink's API.
## Using shlink
Once shlink is installed, there are two main ways to interact with it:
* **The command line**. Try running `bin/cli` and see all the [available commands](#shlink-cli-help).
* **The command line**: Try running `bin/cli` to see all the available commands.
All of those commands can be run with the `--help`/`-h` flag in order to see how to use them and all the available options.
All of them can be run with the `--help`/`-h` flag in order to see how to use them and all the available options.
It is probably a good idea to symlink the CLI entry point (`bin/cli`) to somewhere in your path, so that you can run shlink from any directory.
* **The REST API**. The complete docs on how to use the API can be found [here](https://shlink.io/api-docs), and a sandbox which also documents every endpoint can be found in the [API Spec](https://api-spec.shlink.io/) portal.
* **The REST API**: The complete docs on how to use the API can be found [here](https://shlink.io/documentation/api-docs), and a sandbox which also documents every endpoint can be found in the [API Spec](https://api-spec.shlink.io/) portal.
However, you probably don't want to consume the raw API yourself. That's why a nice [web client](https://github.com/shlinkio/shlink-web-client) is provided that can be directly used from [https://app.shlink.io](https://app.shlink.io), or you can host it yourself too.
However, you probably don't want to consume the raw API yourself. That's why a nice [web client](https://github.com/shlinkio/shlink-web-client) is provided that can be directly used from [https://app.shlink.io](https://app.shlink.io), or hosted by yourself.
Both the API and CLI allow you to do the same operations, except for API key management, which can be done from the command line interface only.
Both the API and CLI allow you to do mostly the same operations, except for API key management, which can be done from the command line interface only.
### Shlink CLI Help
## Contributing
```
Usage:
command [options] [arguments]
If you are trying to find out how to run the project in development mode or how to provide contributions, read the [CONTRIBUTING](CONTRIBUTING.md) doc.
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
help Displays help for a command
list Lists commands
api-key
api-key:disable Disables an API key.
api-key:generate Generates a new valid API key.
api-key:list Lists all the available API keys.
db
db:create Creates the database needed for shlink to work. It will do nothing if the database already exists
db:migrate Runs database migrations, which will ensure the shlink database is up to date.
short-url
short-url:delete Deletes a short URL
short-url:generate Generates a short URL for provided long URL and returns it
short-url:list List all short URLs
short-url:parse Returns the long URL behind a short code
short-url:visits Returns the detailed visits information for provided short code
tag
tag:create Creates one or more tags.
tag:delete Deletes one or more tags.
tag:list Lists existing tags.
tag:rename Renames one existing tag.
visit
visit:locate Resolves visits origin locations.
```
## Multiple domains
While in many cases you will just have one short domain and you'll want all your short URLs to be served from it, there are some cases in which you might want to have multiple short domains served from the same Shlink instance.
If that's the case, you need to understand how Shlink will behave when managing your short URLs or any of them is visited.
### Management
When you create a short URL it is possible to optionally pass a `domain` param. If you don't pass it, the short URL will be created for the default domain (the one provided during Shlink's installation or in the `SHORT_DOMAIN_HOST` env var when using the docker image).
However, if you pass it, the short URL will be "linked" to that domain.
> Note that, if the default domain is passed, Shlink will ignore it and will behave as if no `domain` param was provided.
The main benefit of being able to pass the domain is that Shlink will allow the same custom slug to be used in multiple short URLs, as long as the domain is different (like `example.com/my-compaign`, `another.com/my-compaign` and `foo.com/my-compaign`).
Then, each short URL will be tracked separately and you will be able to define specific tags and metadata for each one of them.
However, this has a side effect. When you try to interact with an existing short URL (editing tags, editing meta, resolving it or deleting it), either from the REST API or the CLI tool, you will have to provide the domain appropriately.
Let's imagine this situation. Shlink's default domain is `example.com`, and you have the next short URLs:
* `https://example.com/abc123` -> a regular short URL where no domain was provided.
* `https://example.com/my-campaign` -> a regular short URL where no domain was provided, but it has a custom slug.
* `https://another.com/my-campaign` -> a short URL where the `another.com` domain was provided, and it has a custom slug.
* `https://another.com/def456` -> a short URL where the `another.com` domain was provided.
These are some of the results you will get when trying to interact with them, depending on the params you provide:
* Providing just the `abc123` short code -> the first URL will be matched.
* Providing just the `my-campaign` short code -> the second URL will be matched, since you did not specify a domain, therefor, Shlink looks for the one with the short code/slug `my-campaign` which is also linked to default domain (or not linked to any domain, to be more accurate).
* Providing the `my-campaign` short code and the `another.com` domain -> The third one will be matched.
* Providing just the `def456` short code -> Shlink will fail/not find any short URL, since there's none with the short code `def456` linked to default domain.
* Providing the `def456` short code and the `another.com` domain -> The fourth short URL will be matched.
* Providing any short code and the `foo.com` domain -> Again, no short URL will be found, as there's none linked to `foo.com` domain.
### Visits
Before adding support for multiple domains, you could point as many domains as you wanted to Shlink, and they would have always worked for existing short codes/slugs.
In order to keep backwards compatibility, Shlink's behavior when a short URL is visited is slightly different, getting to fallback in some cases.
Let's continue with previous example, and also consider we have three domains that will resolve to our Shlink instance, which are `example.com`, `another.com` and `foo.com`.
With that in mind, this is how Shlink will behave when the next short URLs are visited:
* `https://another.com/abc123` -> There was no short URL specifically defined for domain `another.com` and short code `abc123`, but it exists for default domain (`example.com`), so it will fall back to it and redirect to where `example.com/abc123` is configured to redirect.
* `https://example.com/def456` -> The fall-back does not happen from default domain to specific ones, only the other way around (like in previous case). Because of that, this one will result in a not-found URL, even though the `def456` short code exists for `another.com` domain.
* `https://foo.com/abc123` -> This will also fall-back to `example.com/abc123`, like in the first case.
* `https://another.com/non-existing` -> The combination of `another.com` domain with the `non-existing` slug does not exist, so Shlink will try to fall-back to the same but for default domain (`example.com`). However, since that combination does not exist either, it will result in a not-found URL.
* Any other short URL visited exactly as it was configured will, of course, resolve as expected.
### Special redirects
It is currently possible to configure some special redirects when the base domain is visited, a URL does not match, or an invalid/disabled short URL is visited.
Those are configured during Shlink's installation or via env vars when using the docker image.
Currently those are all shared for all domains serving the same Shlink instance, but the plan is to update that and allow specific ones for every existing domain.
---
> This product includes GeoLite2 data created by MaxMind, available from [https://www.maxmind.com](https://www.maxmind.com)

View File

@@ -1,5 +1,53 @@
# Upgrading
## From v2.x to v3.x
### Changes in REST API
* The `type` property returned when trying to delete a URL that reached the visits threshold, when using the `DELETE /short-urls/{shortCode}` endpoint, is now `INVALID_SHORT_URL_DELETION` instead of `INVALID_SHORTCODE_DELETION`.
* The `INVALID_AUTHORIZATION` error no longer includes the `expectedTypes` property. Use `expectedHeaders` one instead.
* The `GET /rest/v2/short-urls` endpoint no longer allows ordering by `visitsCount`, `visitCount` or `originalUrl`. Use `visits` instead of the first two, and `longUrl` instead of the last one.
* The `GET /rest/v2/short-urls` endpoint no longer allows providing the ordering params with array notation, as in `/shortUrls?orderBy[longUrl]=DESC`. Instead, use the following notation `/shortUrls?orderBy=longUrl-DESC`.
* The `GET /rest/v2/short-urls` endpoint now has a default ordering of newest-to-oldest. Use `/shortUrls?orderBy=dateCreated-ASC` in order to keep the oldest-to-newest behavior.
* Requests expecting a body no longer support url-encoded payloads. Instead, always use JSON bodies with `Content-Type: application/json`.
* The next endpoints have been removed:
* `PUT /rest/v2/short-urls/{shortCode}/tags`: Use the `PATCH /rest/v2/short-urls/{shortCode}` endpoint to set the short URL tags.
* `POST /rest/v2/tags`: Use `POST /rest/v2/short-urls` or `PATCH /rest/v2/short-urls/{shortCodes}` to create new tags already attached to a short URL. Creating orphan tags makes no sense.
### Changes in CLI
* The next commands have been removed:
* `short-url:generate`: Use `short-url:create` instead.
* `tag:create`: Creating orphan tags makes no sense.
* Params in camelCase format are no longer supported. They all have an equivalent kebab-case replacement. (for example, from `--startDate` to `--start-date`).
* The `short-url:create` command no longer accepts the `--no-validate-url` flag. Now URLs are never validated, unless `--validate-url` is passed.
* The CLI installer tool entry-points have changed.
* `bin/install`: replaced by `vendor/bin/shlink-installer install`
* `bin/update`: replaced by `vendor/bin/shlink-installer update`
* `bin/set-option`: replaced by `vendor/bin/shlink-installer set-option`
### Changes in config
* The next env vars have been removed:
* `INVALID_SHORT_URL_REDIRECT_TO`: Replaced by `DEFAULT_INVALID_SHORT_URL_REDIRECT`.
* `REGULAR_404_REDIRECT_TO`: Replaced by `DEFAULT_REGULAR_404_REDIRECT`.
* `BASE_URL_REDIRECT_TO`: Replaced by `DEFAULT_BASE_URL_REDIRECT`.
* `SHORT_DOMAIN_HOST`: Replaced by `DEFAULT_DOMAIN`.
* `SHORT_DOMAIN_SCHEMA`: Replaced by `IS_HTTPS_ENABLED`.
* `USE_HTTPS`: Replaced by `IS_HTTPS_ENABLED`.
* `VALIDATE_URLS`: There's no replacement. URLs are not validated, unless explicitly requested during creation or edition.
* The next env vars behavior has changed:
* `DELETE_SHORT_URL_THRESHOLD`: Now, if this env var is not provided, the "visits threshold" won't be checked at all when deleting short URLs. Make sure you explicitly provide a value if you want to enable this feature.
* Environment variables now have precedence over configuration set via the installer tool.
### Other changes
* A default GeoLite2 license key is no longer provided. If you don't provide your own as explained in [the docs](https://shlink.io/documentation/geolite-license-key/), Shlink will not try to update the file anymore.
* The docker image no longer accepts providing configuration via json files mounted in the `config/params` folder. Only env vars are supported now.
* If you were manually serving Shlink with swoole, the entry script has to be changed from `/path/to/shlink/vendor/bin/mezzio-swoole start` to `/path/to/shlink/vendor/bin/laminas mezzio:swoole:start`
* The `GET /{shortCode}/qr-code/{size}` url has been removed. Use `GET /{shortCode}/qr-code?size={size}` instead.
* Regular swoole extension is no longer supported. Use openswoole instead, as a direct replacement. In most of the cases you just need to uninstall one and install the other, the rest is transparent.
## From v1.x to v2.x
### PHP 7.4 required
@@ -28,7 +76,7 @@ These routes have been removed, but have a direct replacement:
* `/qr/{shortCode}[/{size}]` -> `/{shortCode}/qr-code[/{size}]`
* `PUT /rest/v{version}/short-urls/{shortCode}` -> `PATCH /rest/v{version}/short-urls/{shortCode}`
When using the old ones, a 404 status will me returned now.
When using the old ones, a 404 status will be returned now.
### Removed command and route aliases

View File

@@ -3,5 +3,8 @@
declare(strict_types=1);
$run = require __DIR__ . '/../config/run.php';
$run(true);
use Symfony\Component\Console\Application;
/** @var Application $app */
$app = require __DIR__ . '/../config/cli-app.php';
$app->run();

12
bin/doctrine Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env php
<?php
declare(strict_types=1);
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Doctrine\ORM\Tools\Console\EntityManagerProvider\SingleManagerProvider;
/** @var EntityManager $app */
$em = require __DIR__ . '/../config/entity-manager.php';
ConsoleRunner::run(new SingleManagerProvider($em));

View File

@@ -1,12 +0,0 @@
#!/usr/bin/env php
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink;
use function chdir;
use function dirname;
chdir(dirname(__DIR__));
[$install] = require __DIR__ . '/../vendor/shlinkio/shlink-installer/bin/run.php';
$install();

32
bin/roadrunner-worker.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
use Mezzio\Application;
use Psr\Container\ContainerInterface;
use Shlinkio\Shlink\EventDispatcher\RoadRunner\RoadRunnerTaskConsumerToListener;
use Spiral\RoadRunner\Http\PSR7Worker;
use function Shlinkio\Shlink\Config\env;
(static function (): void {
/** @var ContainerInterface $container */
$container = include __DIR__ . '/../config/container.php';
$rrMode = env('RR_MODE');
if ($rrMode === 'http') {
// This was spin-up as a web worker
$app = $container->get(Application::class);
$worker = $container->get(PSR7Worker::class);
while ($req = $worker->waitRequest()) {
try {
$worker->respond($app->handle($req));
} catch (Throwable $e) {
$worker->getWorker()->error((string) $e);
}
}
} else {
$container->get(RoadRunnerTaskConsumerToListener::class)->listenForTasks();
}
})();

View File

@@ -1,18 +1,38 @@
#!/usr/bin/env sh
export APP_ENV=test
export DB_DRIVER=mysql
export TEST_ENV=api
export TEST_RUNTIME="${TEST_RUNTIME:-"openswoole"}"
export DB_DRIVER="${DB_DRIVER:-"postgres"}"
export GENERATE_COVERAGE="${GENERATE_COVERAGE:-"no"}"
# Reset logs
OUTPUT_LOGS=data/log/api-tests/output.log
rm -rf data/log/api-tests
mkdir data/log/api-tests
touch $OUTPUT_LOGS
# Try to stop server just in case it hanged in last execution
vendor/bin/mezzio-swoole stop
[ "$TEST_RUNTIME" = 'openswoole' ] && vendor/bin/laminas mezzio:swoole:stop
[ "$TEST_RUNTIME" = 'rr' ] && bin/rr stop -f
echo 'Starting server...'
vendor/bin/mezzio-swoole start -d
sleep 2
[ "$TEST_RUNTIME" = 'openswoole' ] && vendor/bin/laminas mezzio:swoole:start -d
[ "$TEST_RUNTIME" = 'rr' ] && bin/rr serve -p -c=config/roadrunner/.rr.dev.yml \
-o=http.address=0.0.0.0:9999 \
-o=logs.encoding=json \
-o=logs.channels.http.encoding=json \
-o=logs.channels.server.encoding=json \
-o=logs.output="${PWD}/${OUTPUT_LOGS}" \
-o=logs.channels.http.output="${PWD}/${OUTPUT_LOGS}" \
-o=logs.channels.server.output="${PWD}/${OUTPUT_LOGS}" &
sleep 2 # Let's give the server a couple of seconds to start
vendor/bin/phpunit --order-by=random -c phpunit-api.xml --testdox --colors=always $*
vendor/bin/phpunit --order-by=random -c phpunit-api.xml --testdox --colors=always --log-junit=build/coverage-api/junit.xml $*
testsExitCode=$?
vendor/bin/mezzio-swoole stop
[ "$TEST_RUNTIME" = 'openswoole' ] && vendor/bin/laminas mezzio:swoole:stop
[ "$TEST_RUNTIME" = 'rr' ] && bin/rr stop -c config/roadrunner/.rr.dev.yml -o=http.address=0.0.0.0:9999
# Exit this script with the same code as the tests. If tests failed, this script has to fail
exit $testsExitCode

View File

@@ -1,12 +0,0 @@
#!/usr/bin/env php
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink;
use function chdir;
use function dirname;
chdir(dirname(__DIR__));
[, $update] = require __DIR__ . '/../vendor/shlinkio/shlink-installer/bin/run.php';
$update();

View File

@@ -1,31 +1,46 @@
#!/usr/bin/env bash
set -e
if [[ "$#" -ne 1 ]]; then
if [ "$#" -lt 1 ] || [ "$#" -gt 2 ] || ([ "$#" == 2 ] && [ "$2" != "--no-swoole" ]); then
echo "Usage:" >&2
echo " $0 {version}" >&2
echo " $0 {version} [--no-swoole]" >&2
exit 1
fi
version=$1
builtcontent="./build/shlink_${version}_dist"
noSwoole=$2
phpVersion=$(php -r 'echo PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION;')
[[ $noSwoole ]] && swooleSuffix="" || swooleSuffix="_openswoole"
distId="shlink${version}_php${phpVersion}${swooleSuffix}_dist"
builtContent="./build/${distId}"
projectdir=$(pwd)
[[ -f ./composer.phar ]] && composerBin='./composer.phar' || composerBin='composer'
# Copy project content to temp dir
echo 'Copying project files...'
rm -rf "${builtcontent}"
mkdir -p "${builtcontent}"
rsync -av * "${builtcontent}" \
rm -rf "${builtContent}"
mkdir -p "${builtContent}"
rsync -av * "${builtContent}" \
--exclude=*docker* \
--exclude=Dockerfile \
--include=.htaccess \
--include=config/roadrunner/.rr.yml \
--exclude-from=./.dockerignore
cd "${builtcontent}"
cd "${builtContent}"
# Install dependencies
echo "Installing dependencies with $composerBin..."
composerFlags="--optimize-autoloader --no-progress --no-interaction"
${composerBin} self-update
${composerBin} install --no-dev --optimize-autoloader --no-progress --no-interaction
${composerBin} install --no-dev --prefer-dist $composerFlags
if [[ $noSwoole ]]; then
# If generating a dist not for openswoole, uninstall mezzio-swoole
${composerBin} remove mezzio/mezzio-swoole --with-all-dependencies --update-no-dev $composerFlags
else
# If generating a dist for openswoole, uninstall RoadRunner
${composerBin} remove spiral/roadrunner spiral/roadrunner-jobs --with-all-dependencies --update-no-dev $composerFlags
fi
# Delete development files
echo 'Deleting dev files...'
@@ -37,9 +52,9 @@ sed -i "s/%SHLINK_VERSION%/${version}/g" config/autoload/app_options.global.php
# Compressing file
echo 'Compressing files...'
cd "${projectdir}"/build
rm -f ./shlink_${version}_dist.zip
zip -ry ./shlink_${version}_dist.zip ./shlink_${version}_dist
rm -f ./${distId}.zip
zip -ry ./${distId}.zip ./${distId}
cd "${projectdir}"
rm -rf "${builtcontent}"
rm -rf "${builtContent}"
echo 'Done!'

View File

@@ -12,61 +12,70 @@
}
],
"require": {
"php": "^7.4",
"php": "^8.1",
"ext-curl": "*",
"ext-gd": "*",
"ext-json": "*",
"ext-pdo": "*",
"akrabat/ip-address-middleware": "^1.0",
"cakephp/chronos": "^1.2",
"cocur/slugify": "^3.0",
"doctrine/cache": "^1.9",
"doctrine/dbal": "^2.10",
"doctrine/migrations": "^2.2",
"doctrine/orm": "^2.7",
"endroid/qr-code": "^3.6",
"firebase/php-jwt": "^4.0",
"geoip2/geoip2": "^2.9",
"guzzlehttp/guzzle": "^6.5.1",
"laminas/laminas-config": "^3.3",
"laminas/laminas-config-aggregator": "^1.1",
"laminas/laminas-dependency-plugin": "^1.0",
"laminas/laminas-diactoros": "^2.1.3",
"laminas/laminas-inputfilter": "^2.10",
"laminas/laminas-paginator": "^2.8",
"laminas/laminas-servicemanager": "^3.4",
"laminas/laminas-stdlib": "^3.2",
"lstrojny/functional-php": "^1.9",
"mezzio/mezzio": "^3.2",
"mezzio/mezzio-fastroute": "^3.0",
"mezzio/mezzio-helpers": "^5.3",
"mezzio/mezzio-platesrenderer": "^2.1",
"mezzio/mezzio-problem-details": "^1.1",
"mezzio/mezzio-swoole": "^2.4",
"monolog/monolog": "^2.0",
"nikolaposa/monolog-factory": "^3.0",
"ocramius/proxy-manager": "^2.6.0",
"phly/phly-event-dispatcher": "^1.0",
"predis/predis": "^1.1",
"pugx/shortid-php": "^0.5",
"shlinkio/shlink-common": "^2.7.0",
"shlinkio/shlink-event-dispatcher": "^1.3",
"shlinkio/shlink-installer": "^4.0.1",
"shlinkio/shlink-ip-geolocation": "^1.3.1",
"symfony/console": "^5.0",
"symfony/filesystem": "^5.0",
"symfony/lock": "^5.0",
"symfony/process": "^5.0"
"akrabat/ip-address-middleware": "^2.1",
"cakephp/chronos": "^2.3",
"doctrine/migrations": "^3.5",
"doctrine/orm": "^2.12",
"endroid/qr-code": "^4.4",
"geoip2/geoip2": "^2.12",
"guzzlehttp/guzzle": "^7.4",
"happyr/doctrine-specification": "^2.0",
"jaybizzle/crawler-detect": "^1.2.110",
"laminas/laminas-config": "^3.7",
"laminas/laminas-config-aggregator": "^1.8",
"laminas/laminas-diactoros": "^2.14",
"laminas/laminas-inputfilter": "^2.19",
"laminas/laminas-servicemanager": "^3.16",
"laminas/laminas-stdlib": "^3.11",
"lcobucci/jwt": "^4.1",
"league/uri": "^6.7",
"lstrojny/functional-php": "^1.17",
"mezzio/mezzio": "^3.11",
"mezzio/mezzio-fastroute": "^3.5",
"mezzio/mezzio-problem-details": "^1.6",
"mezzio/mezzio-swoole": "^4.3",
"mlocati/ip-lib": "^1.18",
"ocramius/proxy-manager": "^2.14",
"pagerfanta/core": "^3.6",
"php-middleware/request-id": "^4.1",
"pugx/shortid-php": "^1.0",
"ramsey/uuid": "^4.3",
"shlinkio/shlink-common": "^5.1",
"shlinkio/shlink-config": "^2.1",
"shlinkio/shlink-event-dispatcher": "^2.6",
"shlinkio/shlink-importer": "^4.0",
"shlinkio/shlink-installer": "^8.2",
"shlinkio/shlink-ip-geolocation": "^3.1",
"spiral/roadrunner": "^2.11",
"spiral/roadrunner-jobs": "^2.3",
"symfony/console": "^6.1",
"symfony/filesystem": "^6.1",
"symfony/lock": "^6.1",
"symfony/process": "^6.1",
"symfony/string": "^6.1"
},
"require-dev": {
"devster/ubench": "^2.0",
"dms/phpunit-arraysubset-asserts": "^0.1.0",
"eaglewu/swoole-ide-helper": "dev-master",
"infection/infection": "^0.15.0",
"phpstan/phpstan": "^0.12.3",
"phpunit/phpunit": "^8.3",
"cebe/php-openapi": "^1.7",
"devster/ubench": "^2.1",
"dms/phpunit-arraysubset-asserts": "^0.4.0",
"infection/infection": "^0.26.15",
"openswoole/ide-helper": "~4.11.1",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-doctrine": "^1.3",
"phpstan/phpstan-symfony": "^1.2",
"phpunit/php-code-coverage": "^9.2",
"phpunit/phpunit": "^9.5",
"roave/security-advisories": "dev-master",
"shlinkio/php-coding-standard": "~2.1.0",
"shlinkio/shlink-test-utils": "^1.3",
"symfony/var-dumper": "^5.0"
"shlinkio/php-coding-standard": "~2.3.0",
"shlinkio/shlink-test-utils": "^3.3",
"symfony/var-dumper": "^6.1",
"veewee/composer-run-parallel": "^1.1"
},
"autoload": {
"psr-4": {
@@ -75,92 +84,117 @@
"Shlinkio\\Shlink\\Core\\": "module/Core/src"
},
"files": [
"config/constants.php",
"module/Core/functions/functions.php"
]
},
"autoload-dev": {
"psr-4": {
"ShlinkioTest\\Shlink\\CLI\\": "module/CLI/test",
"ShlinkioCliTest\\Shlink\\CLI\\": "module/CLI/test-cli",
"ShlinkioTest\\Shlink\\Rest\\": "module/Rest/test",
"ShlinkioApiTest\\Shlink\\Rest\\": "module/Rest/test-api",
"ShlinkioTest\\Shlink\\Core\\": [
"module/Core/test",
"module/Core/test-db"
]
}
"ShlinkioDbTest\\Shlink\\Rest\\": "module/Rest/test-db",
"ShlinkioTest\\Shlink\\Core\\": "module/Core/test",
"ShlinkioDbTest\\Shlink\\Core\\": "module/Core/test-db"
},
"files": [
"config/test/constants.php"
]
},
"scripts": {
"ci": [
"@cs",
"@stan",
"@test:ci",
"@infect:ci"
"@parallel cs stan swagger:validate test:unit:ci test:db:sqlite:ci test:db:mysql test:db:maria test:db:postgres test:db:ms",
"@parallel infect:test:api infect:test:cli infect:ci:unit infect:ci:db"
],
"cs": "phpcs",
"cs:fix": "phpcbf",
"stan": "phpstan analyse module/*/src/ module/*/config config docker/config --level=6",
"stan": "APP_ENV=test php vendor/bin/phpstan analyse module/*/src module/*/config config docker/config data/migrations --level=8",
"test": [
"@test:unit",
"@test:db",
"@test:api"
"@parallel test:unit test:db",
"@parallel test:api test:cli"
],
"test:ci": [
"@test:unit:ci",
"@test:db:ci",
"@test:api"
],
"test:unit": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-php build/coverage-unit.cov --testdox",
"test:unit:ci": "@test:unit --coverage-clover=build/clover.xml --coverage-xml=build/coverage-xml --log-junit=build/junit.xml",
"test:db": [
"@test:db:sqlite",
"@test:db:mysql",
"@test:db:maria",
"@test:db:postgres"
],
"test:db:ci": [
"@test:db:sqlite",
"@test:db:mysql",
"@test:db:postgres"
],
"test:db:sqlite": "APP_ENV=test phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-php build/coverage-db.cov --testdox -c phpunit-db.xml",
"test:unit": "@php vendor/bin/phpunit --order-by=random --colors=always --testdox",
"test:unit:ci": "@test:unit --coverage-php=build/coverage-unit.cov --coverage-xml=build/coverage-unit/coverage-xml --log-junit=build/coverage-unit/junit.xml",
"test:unit:pretty": "@test:unit --coverage-html build/coverage-unit/coverage-html",
"test:db": "@parallel test:db:sqlite:ci test:db:mysql test:db:maria test:db:postgres test:db:ms",
"test:db:sqlite": "APP_ENV=test php vendor/bin/phpunit --order-by=random --colors=always --testdox -c phpunit-db.xml",
"test:db:sqlite:ci": "@test:db:sqlite --coverage-php build/coverage-db.cov --coverage-xml=build/coverage-db/coverage-xml --log-junit=build/coverage-db/junit.xml",
"test:db:mysql": "DB_DRIVER=mysql composer test:db:sqlite",
"test:db:maria": "DB_DRIVER=maria composer test:db:sqlite",
"test:db:postgres": "DB_DRIVER=postgres composer test:db:sqlite",
"test:db:ms": "DB_DRIVER=mssql composer test:db:sqlite",
"test:api": "bin/test/run-api-tests.sh",
"test:unit:pretty": "phpdbg -qrr vendor/bin/phpunit --order-by=random --colors=always --coverage-html build/coverage",
"infect": "infection --threads=4 --min-msi=80 --log-verbosity=default --only-covered",
"infect:ci": "@infect --coverage=build",
"infect:show": "@infect --show-mutations",
"test:api:rr": "TEST_RUNTIME=rr bin/test/run-api-tests.sh",
"test:api:ci": "GENERATE_COVERAGE=yes composer test:api",
"test:api:pretty": "GENERATE_COVERAGE=pretty composer test:api",
"test:cli": "APP_ENV=test DB_DRIVER=maria TEST_ENV=cli php vendor/bin/phpunit --order-by=random --colors=always --testdox -c phpunit-cli.xml --log-junit=build/coverage-cli/junit.xml",
"test:cli:ci": "GENERATE_COVERAGE=yes composer test:cli",
"test:cli:pretty": "GENERATE_COVERAGE=pretty composer test:cli",
"infect:ci:base": "infection --threads=max --only-covered --only-covering-test-cases --skip-initial-tests",
"infect:ci:unit": "@infect:ci:base --coverage=build/coverage-unit --min-msi=84",
"infect:ci:db": "@infect:ci:base --coverage=build/coverage-db --min-msi=95 --configuration=infection-db.json",
"infect:ci:api": "@infect:ci:base --coverage=build/coverage-api --min-msi=80 --configuration=infection-api.json",
"infect:ci:cli": "@infect:ci:base --coverage=build/coverage-cli --min-msi=80 --configuration=infection-cli.json",
"infect:ci": "@parallel infect:ci:unit infect:ci:db infect:ci:api infect:ci:cli",
"infect:test": [
"@test:unit:ci",
"@parallel test:unit:ci test:db:sqlite:ci test:api:ci",
"@infect:ci"
],
"infect:test:unit": [
"@test:unit:ci",
"@infect:ci:unit"
],
"infect:test:api": [
"@test:api:ci",
"@infect:ci:api"
],
"infect:test:cli": [
"@test:cli:ci",
"@infect:ci:cli"
],
"swagger:validate": "php-openapi validate docs/swagger/swagger.json",
"swagger:inline": "php-openapi inline docs/swagger/swagger.json docs/swagger/swagger-inlined.json",
"clean:dev": "rm -f data/database.sqlite && rm -f config/params/generated_config.php"
},
"scripts-descriptions": {
"ci": "<fg=blue;options=bold>Alias for \"cs\", \"stan\", \"test:ci\" and \"infect:ci\"</>",
"ci": "<fg=blue;options=bold>Alias for \"cs\", \"stan\", \"swagger:validate\", \"test:ci\" and \"infect:ci\"</>",
"cs": "<fg=blue;options=bold>Checks coding styles</>",
"cs:fix": "<fg=blue;options=bold>Fixes coding styles, when possible</>",
"stan": "<fg=blue;options=bold>Inspects code with phpstan</>",
"test": "<fg=blue;options=bold>Runs all test suites</>",
"test:ci": "<fg=blue;options=bold>Runs all test suites, generating all needed reports and logs for CI envs</>",
"test:unit": "<fg=blue;options=bold>Runs unit test suites</>",
"test:unit:ci": "<fg=blue;options=bold>Runs unit test suites, generating all needed reports and logs for CI envs</>",
"test:db": "<fg=blue;options=bold>Runs database test suites on a SQLite, MySQL, MariaDB and PostgreSQL</>",
"test:db:ci": "<fg=blue;options=bold>Runs database test suites on a SQLite, MySQL and PostgreSQL</>",
"test:unit:pretty": "<fg=blue;options=bold>Runs unit test suites and generates an HTML code coverage report</>",
"test:db": "<fg=blue;options=bold>Runs database test suites on a SQLite, MySQL, MariaDB, PostgreSQL and MsSQL</>",
"test:db:sqlite": "<fg=blue;options=bold>Runs database test suites on a SQLite database</>",
"test:db:sqlite:ci": "<fg=blue;options=bold>Runs database test suites on a SQLite database, generating all needed reports and logs for CI envs</>",
"test:db:mysql": "<fg=blue;options=bold>Runs database test suites on a MySQL database</>",
"test:db:maria": "<fg=blue;options=bold>Runs database test suites on a MariaDB database</>",
"test:db:postgres": "<fg=blue;options=bold>Runs database test suites on a PostgreSQL database</>",
"test:db:ms": "<fg=blue;options=bold>Runs database test suites on a Microsoft SQL Server database</>",
"test:api": "<fg=blue;options=bold>Runs API test suites</>",
"test:unit:pretty": "<fg=blue;options=bold>Runs unit test suites and generates an HTML code coverage report</>",
"infect": "<fg=blue;options=bold>Checks unit tests quality applying mutation testing</>",
"infect:ci": "<fg=blue;options=bold>Checks unit tests quality applying mutation testing with existing reports and logs</>",
"infect:show": "<fg=blue;options=bold>Checks unit tests quality applying mutation testing and shows applied mutators</>",
"infect:test": "<fg=blue;options=bold>Checks unit tests quality applying mutation testing</>",
"test:api:ci": "<fg=blue;options=bold>Runs API test suites, and generates code coverage for CI</>",
"test:api:pretty": "<fg=blue;options=bold>Runs API test suites, and generates code coverage in HTML format</>",
"test:cli": "<fg=blue;options=bold>Runs CLI test suites</>",
"test:cli:ci": "<fg=blue;options=bold>Runs CLI test suites, and generates code coverage for CI</>",
"test:cli:pretty": "<fg=blue;options=bold>Runs CLI test suites, and generates code coverage in HTML format</>",
"infect:ci": "<fg=blue;options=bold>Checks unit and db tests quality applying mutation testing with existing reports and logs</>",
"infect:ci:unit": "<fg=blue;options=bold>Checks unit tests quality applying mutation testing with existing reports and logs</>",
"infect:ci:db": "<fg=blue;options=bold>Checks db tests quality applying mutation testing with existing reports and logs</>",
"infect:test": "<fg=blue;options=bold>Runs unit and db tests, then checks tests quality applying mutation testing</>",
"swagger:validate": "<fg=blue;options=bold>Validates the swagger docs, making sure they fulfil the spec</>",
"swagger:inline": "<fg=blue;options=bold>Inlines swagger docs in a single file</>",
"clean:dev": "<fg=blue;options=bold>Deletes artifacts which are gitignored and could affect dev env</>"
},
"config": {
"sort-packages": true
"sort-packages": true,
"platform-check": false,
"allow-plugins": {
"composer/package-versions-deprecated": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"infection/extension-installer": true,
"veewee/composer-run-parallel": true
}
}
}

View File

@@ -7,7 +7,6 @@ return [
'app_options' => [
'name' => 'Shlink',
'version' => '%SHLINK_VERSION%',
'disable_track_param' => null,
],
];

View File

@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
return [
'app_options' => [
'version' => 'latest',
],
];

View File

@@ -7,6 +7,9 @@ use Laminas\ConfigAggregator\ConfigAggregator;
return [
'debug' => false,
ConfigAggregator::ENABLE_CACHE => true,
// Disabling config cache for cli, ensures it's never used for openswoole/RoadRunner, and also that console
// commands don't generate a cache file that's then used by php-fpm web executions
ConfigAggregator::ENABLE_CACHE => PHP_SAPI !== 'cli',
];

View File

@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
return [
'cors' => [
'max_age' => 3600,
],
];

View File

@@ -4,11 +4,17 @@ declare(strict_types=1);
namespace Shlinkio\Shlink;
return [
use Shlinkio\Shlink\Core\Config\EnvVars;
'delete_short_urls' => [
'visits_threshold' => 15,
'check_visits_threshold' => true,
],
return (static function (): array {
$threshold = EnvVars::DELETE_SHORT_URL_THRESHOLD->loadFromEnv();
];
return [
'delete_short_urls' => [
'check_visits_threshold' => $threshold !== null,
'visits_threshold' => (int) ($threshold ?? DEFAULT_DELETE_SHORT_URL_THRESHOLD),
],
];
})();

View File

@@ -2,17 +2,33 @@
declare(strict_types=1);
use GuzzleHttp\Client;
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
use Mezzio\Container;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\ServerRequestFactoryInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\UploadedFileFactoryInterface;
use Spiral\RoadRunner\Http\PSR7Worker;
use Spiral\RoadRunner\WorkerInterface;
return [
'dependencies' => [
'factories' => [
PSR7Worker::class => ConfigAbstractFactory::class,
],
'delegators' => [
Mezzio\Application::class => [
Container\ApplicationConfigInjectionDelegator::class,
],
],
'aliases' => [
ClientInterface::class => Client::class,
],
'lazy_services' => [
'proxies_target_dir' => 'data/proxies',
'proxies_namespace' => 'ShlinkProxy',
@@ -20,4 +36,13 @@ return [
],
],
ConfigAbstractFactory::class => [
PSR7Worker::class => [
WorkerInterface::class,
ServerRequestFactoryInterface::class,
StreamFactoryInterface::class,
UploadedFileFactoryInterface::class,
],
],
];

View File

@@ -2,21 +2,59 @@
declare(strict_types=1);
namespace Shlinkio\Shlink\Common;
use Happyr\DoctrineSpecification\Repository\EntitySpecificationRepository;
use Shlinkio\Shlink\Core\Config\EnvVars;
return [
use function Functional\contains;
'entity_manager' => [
'orm' => [
'proxies_dir' => 'data/proxies',
'load_mappings_using_functional_style' => true,
return (static function (): array {
$driver = EnvVars::DB_DRIVER->loadFromEnv();
$isMysqlCompatible = contains(['maria', 'mysql'], $driver);
$resolveDriver = static fn () => match ($driver) {
'postgres' => 'pdo_pgsql',
'mssql' => 'pdo_sqlsrv',
default => 'pdo_mysql',
};
$resolveDefaultPort = static fn () => match ($driver) {
'postgres' => '5432',
'mssql' => '1433',
default => '3306',
};
$resolveCharset = static fn () => match ($driver) {
// This does not determine charsets or collations in tables or columns, but the charset used in the data
// flowing in the connection, so it has to match what has been set in the database.
'maria', 'mysql' => 'utf8mb4',
'postgres' => 'utf8',
default => null,
};
$resolveConnection = static fn () => match ($driver) {
null, 'sqlite' => [
'driver' => 'pdo_sqlite',
'path' => 'data/database.sqlite',
],
'connection' => [
'user' => '',
'password' => '',
'dbname' => 'shlink',
'charset' => 'utf8',
default => [
'driver' => $resolveDriver(),
'dbname' => EnvVars::DB_NAME->loadFromEnv('shlink'),
'user' => EnvVars::DB_USER->loadFromEnv(),
'password' => EnvVars::DB_PASSWORD->loadFromEnv(),
'host' => EnvVars::DB_HOST->loadFromEnv(EnvVars::DB_UNIX_SOCKET->loadFromEnv()),
'port' => EnvVars::DB_PORT->loadFromEnv($resolveDefaultPort()),
'unix_socket' => $isMysqlCompatible ? EnvVars::DB_UNIX_SOCKET->loadFromEnv() : null,
'charset' => $resolveCharset(),
],
],
};
];
return [
'entity_manager' => [
'orm' => [
'proxies_dir' => 'data/proxies',
'load_mappings_using_functional_style' => true,
'default_repository_classname' => EntitySpecificationRepository::class,
],
'connection' => $resolveConnection(),
],
];
})();

View File

@@ -9,10 +9,9 @@ return [
'user' => 'root',
'password' => 'root',
'driver' => 'pdo_mysql',
'host' => 'shlink_db',
'driverOptions' => [
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
],
'host' => 'shlink_db_mysql',
'dbname' => 'shlink',
'charset' => 'utf8mb4',
],
],

View File

@@ -6,12 +6,14 @@ use Laminas\Stratigility\Middleware\ErrorHandler;
use Mezzio\ProblemDetails\ProblemDetailsMiddleware;
use Shlinkio\Shlink\Common\Logger;
use function Shlinkio\Shlink\Core\toProblemDetailsType;
return [
'problem-details' => [
'default_types_map' => [
404 => 'NOT_FOUND',
500 => 'INTERNAL_SERVER_ERROR',
404 => toProblemDetailsType('not-found'),
500 => toProblemDetailsType('internal-server-error'),
],
],

View File

@@ -2,12 +2,14 @@
declare(strict_types=1);
use Shlinkio\Shlink\Core\Config\EnvVars;
return [
'geolite2' => [
'db_location' => __DIR__ . '/../../data/GeoLite2-City.mmdb',
'temp_dir' => sys_get_temp_dir(),
'license_key' => 'G4Lm0C60yJsnkdPi',
'temp_dir' => __DIR__ . '/../../data',
'license_key' => EnvVars::GEOLITE_LICENSE_KEY->loadFromEnv(),
],
];

View File

@@ -2,42 +2,88 @@
declare(strict_types=1);
namespace Shlinkio\Shlink\CLI;
use Shlinkio\Shlink\Installer\Config\Option;
use Shlinkio\Shlink\Installer\Util\InstallationCommand;
return [
'installer' => [
'enabled_options' => [
Option\DatabaseDriverConfigOption::class,
Option\DatabaseNameConfigOption::class,
Option\DatabaseHostConfigOption::class,
Option\DatabasePortConfigOption::class,
Option\DatabaseUserConfigOption::class,
Option\DatabasePasswordConfigOption::class,
Option\DatabaseSqlitePathConfigOption::class,
Option\DatabaseMySqlOptionsConfigOption::class,
Option\ShortDomainHostConfigOption::class,
Option\ShortDomainSchemaConfigOption::class,
Option\ValidateUrlConfigOption::class,
Option\VisitsWebhooksConfigOption::class,
Option\BaseUrlRedirectConfigOption::class,
Option\InvalidShortUrlRedirectConfigOption::class,
Option\Regular404RedirectConfigOption::class,
Option\DisableTrackParamConfigOption::class,
Option\CheckVisitsThresholdConfigOption::class,
Option\VisitsThresholdConfigOption::class,
Option\Database\DatabaseDriverConfigOption::class,
Option\Database\DatabaseNameConfigOption::class,
Option\Database\DatabaseHostConfigOption::class,
Option\Database\DatabasePortConfigOption::class,
Option\Database\DatabaseUserConfigOption::class,
Option\Database\DatabasePasswordConfigOption::class,
Option\Database\DatabaseUnixSocketConfigOption::class,
Option\UrlShortener\ShortDomainHostConfigOption::class,
Option\UrlShortener\ShortDomainSchemaConfigOption::class,
Option\Visit\VisitsWebhooksConfigOption::class,
Option\Visit\OrphanVisitsWebhooksConfigOption::class,
Option\Redirect\BaseUrlRedirectConfigOption::class,
Option\Redirect\InvalidShortUrlRedirectConfigOption::class,
Option\Redirect\Regular404RedirectConfigOption::class,
Option\Visit\VisitsThresholdConfigOption::class,
Option\BasePathConfigOption::class,
Option\TaskWorkerNumConfigOption::class,
Option\WebWorkerNumConfigOption::class,
Option\RedisServersConfigOption::class,
Option\TimezoneConfigOption::class,
Option\Worker\TaskWorkerNumConfigOption::class,
Option\Worker\WebWorkerNumConfigOption::class,
Option\Redis\RedisServersConfigOption::class,
Option\Redis\RedisSentinelServiceConfigOption::class,
Option\Redis\RedisPubSubConfigOption::class,
Option\UrlShortener\ShortCodeLengthOption::class,
Option\Mercure\EnableMercureConfigOption::class,
Option\Mercure\MercurePublicUrlConfigOption::class,
Option\Mercure\MercureInternalUrlConfigOption::class,
Option\Mercure\MercureJwtSecretConfigOption::class,
Option\UrlShortener\GeoLiteLicenseKeyConfigOption::class,
Option\UrlShortener\RedirectStatusCodeConfigOption::class,
Option\UrlShortener\RedirectCacheLifeTimeConfigOption::class,
Option\UrlShortener\AutoResolveTitlesConfigOption::class,
Option\UrlShortener\AppendExtraPathConfigOption::class,
Option\UrlShortener\EnableMultiSegmentSlugsConfigOption::class,
Option\UrlShortener\EnableTrailingSlashConfigOption::class,
Option\Tracking\IpAnonymizationConfigOption::class,
Option\Tracking\OrphanVisitsTrackingConfigOption::class,
Option\Tracking\DisableTrackParamConfigOption::class,
Option\Tracking\DisableTrackingFromConfigOption::class,
Option\Tracking\DisableTrackingConfigOption::class,
Option\Tracking\DisableIpTrackingConfigOption::class,
Option\Tracking\DisableReferrerTrackingConfigOption::class,
Option\Tracking\DisableUaTrackingConfigOption::class,
Option\QrCode\DefaultSizeConfigOption::class,
Option\QrCode\DefaultMarginConfigOption::class,
Option\QrCode\DefaultFormatConfigOption::class,
Option\QrCode\DefaultErrorCorrectionConfigOption::class,
Option\QrCode\DefaultRoundBlockSizeConfigOption::class,
Option\RabbitMq\RabbitMqEnabledConfigOption::class,
Option\RabbitMq\RabbitMqHostConfigOption::class,
Option\RabbitMq\RabbitMqPortConfigOption::class,
Option\RabbitMq\RabbitMqUserConfigOption::class,
Option\RabbitMq\RabbitMqPasswordConfigOption::class,
Option\RabbitMq\RabbitMqVhostConfigOption::class,
],
'installation_commands' => [
'db_create_schema' => [
'command' => 'bin/cli db:create',
InstallationCommand::DB_CREATE_SCHEMA->value => [
'command' => 'bin/cli ' . Command\Db\CreateDatabaseCommand::NAME,
],
'db_migrate' => [
'command' => 'bin/cli db:migrate',
InstallationCommand::DB_MIGRATE->value => [
'command' => 'bin/cli ' . Command\Db\MigrateDatabaseCommand::NAME,
],
InstallationCommand::ORM_PROXIES->value => [
'command' => 'bin/doctrine orm:generate-proxies',
],
InstallationCommand::ORM_CLEAR_CACHE->value => [
'command' => 'bin/doctrine orm:clear-cache:metadata',
],
InstallationCommand::GEOLITE_DOWNLOAD_DB->value => [
'command' => 'bin/cli ' . Command\Visit\DownloadGeoLiteDbCommand::NAME,
],
InstallationCommand::API_KEY_GENERATE->value => [
'command' => 'bin/cli ' . Command\Api\GenerateKeyCommand::NAME,
],
],
],

View File

@@ -4,11 +4,11 @@ declare(strict_types=1);
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
use Shlinkio\Shlink\Common\Cache\RedisFactory;
use Shlinkio\Shlink\Common\Lock\RetryLockStoreDelegatorFactory;
use Shlinkio\Shlink\Common\Logger\LoggerAwareDelegatorFactory;
use Shlinkio\Shlink\Core\Config\EnvVars;
use Symfony\Component\Lock;
$localLockFactory = 'Shlinkio\Shlink\LocalLockFactory';
use const Shlinkio\Shlink\LOCAL_LOCK_FACTORY;
return [
@@ -21,19 +21,15 @@ return [
Lock\Store\FlockStore::class => ConfigAbstractFactory::class,
Lock\Store\RedisStore::class => ConfigAbstractFactory::class,
Lock\LockFactory::class => ConfigAbstractFactory::class,
$localLockFactory => ConfigAbstractFactory::class,
LOCAL_LOCK_FACTORY => ConfigAbstractFactory::class,
],
'aliases' => [
// With this config, a user could alias 'lock_store' => 'redis_lock_store' to override the default
'lock_store' => 'local_lock_store',
'lock_store' => EnvVars::REDIS_SERVERS->existsInEnv() ? 'redis_lock_store' : 'local_lock_store',
'redis_lock_store' => Lock\Store\RedisStore::class,
'local_lock_store' => Lock\Store\FlockStore::class,
],
'delegators' => [
Lock\Store\RedisStore::class => [
RetryLockStoreDelegatorFactory::class,
],
Lock\LockFactory::class => [
LoggerAwareDelegatorFactory::class,
],
@@ -44,7 +40,7 @@ return [
Lock\Store\FlockStore::class => ['config.locks.locks_dir'],
Lock\Store\RedisStore::class => [RedisFactory::SERVICE_NAME],
Lock\LockFactory::class => ['lock_store'],
$localLockFactory => ['local_lock_store'],
LOCAL_LOCK_FACTORY => ['local_lock_store'],
],
];

View File

@@ -4,70 +4,36 @@ declare(strict_types=1);
namespace Shlinkio\Shlink;
use Monolog\Formatter;
use Monolog\Handler;
use Monolog\Level;
use Monolog\Logger;
use Monolog\Processor;
use MonologFactory\DiContainerLoggerFactory;
use PhpMiddleware\RequestId;
use Psr\Log\LoggerInterface;
use Shlinkio\Shlink\Common\Logger\LoggerFactory;
use Shlinkio\Shlink\Common\Logger\LoggerType;
use const PHP_EOL;
$processors = [
'exception_with_new_line' => [
'name' => Common\Logger\Processor\ExceptionWithNewLineProcessor::class,
],
'psr3' => [
'name' => Processor\PsrLogMessageProcessor::class,
],
];
$formatter = [
'name' => Formatter\LineFormatter::class,
'params' => [
'format' => '[%datetime%] %channel%.%level_name% - %message%' . PHP_EOL,
'allow_inline_line_breaks' => true,
],
$common = [
'level' => Level::Info->value,
'processors' => [RequestId\MonologProcessor::class],
'line_format' => '[%datetime%] [%extra.request_id%] %channel%.%level_name% - %message%',
];
return [
'logger' => [
'Shlink' => [
'name' => 'Shlink',
'handlers' => [
'shlink_handler' => [
'name' => Handler\RotatingFileHandler::class,
'params' => [
'level' => Logger::INFO,
'filename' => 'data/log/shlink_log.log',
'max_files' => 30,
'file_permission' => 0666,
],
'formatter' => $formatter,
],
],
'processors' => $processors,
'type' => LoggerType::FILE->value,
...$common,
],
'Access' => [
'name' => 'Access',
'handlers' => [
'access_handler' => [
'name' => Handler\StreamHandler::class,
'params' => [
'level' => Logger::INFO,
'stream' => 'php://stdout',
],
'formatter' => $formatter,
],
],
'processors' => $processors,
'type' => LoggerType::STREAM->value,
...$common,
],
],
'dependencies' => [
'factories' => [
'Logger_Shlink' => [DiContainerLoggerFactory::class, 'Shlink'],
'Logger_Access' => [DiContainerLoggerFactory::class, 'Access'],
'Logger_Shlink' => [LoggerFactory::class, 'Shlink'],
'Logger_Access' => [LoggerFactory::class, 'Access'],
],
'aliases' => [
'logger' => 'Logger_Shlink',
@@ -80,6 +46,7 @@ return [
'swoole-http-server' => [
'logger' => [
'logger-name' => 'Logger_Access',
'format' => '%u "%r" %>s %B',
],
],
],

View File

@@ -2,33 +2,18 @@
declare(strict_types=1);
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use Monolog\Level;
use Shlinkio\Shlink\Common\Logger\LoggerType;
$isSwoole = extension_loaded('swoole');
// For swoole, send logs to standard output
$handler = $isSwoole
? [
'name' => StreamHandler::class,
'params' => [
'level' => Logger::DEBUG,
'stream' => 'php://stdout',
],
]
: [
'params' => [
'level' => Logger::DEBUG,
],
];
$isSwoole = extension_loaded('openswoole');
return [
'logger' => [
'Shlink' => [
'handlers' => [
'shlink_handler' => $handler,
],
// For swoole, send logs as stream
'type' => $isSwoole ? LoggerType::STREAM->value : LoggerType::FILE->value,
'level' => Level::Debug->value,
],
],

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
use Laminas\ServiceManager\Proxy\LazyServiceFactory;
use Shlinkio\Shlink\Common\Mercure\LcobucciJwtProvider;
use Shlinkio\Shlink\Core\Config\EnvVars;
use Symfony\Component\Mercure\Hub;
use Symfony\Component\Mercure\HubInterface;
return (static function (): array {
$publicUrl = EnvVars::MERCURE_PUBLIC_HUB_URL->loadFromEnv();
return [
'mercure' => [
'public_hub_url' => $publicUrl,
'internal_hub_url' => EnvVars::MERCURE_INTERNAL_HUB_URL->loadFromEnv($publicUrl),
'jwt_secret' => EnvVars::MERCURE_JWT_SECRET->loadFromEnv(),
'jwt_issuer' => 'Shlink',
],
'dependencies' => [
'delegators' => [
LcobucciJwtProvider::class => [
LazyServiceFactory::class,
],
Hub::class => [
LazyServiceFactory::class,
],
],
'lazy_services' => [
'class_map' => [
LcobucciJwtProvider::class => LcobucciJwtProvider::class,
Hub::class => HubInterface::class,
],
],
],
];
})();

View File

@@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
return [
'mercure' => [
'public_hub_url' => 'http://localhost:8001',
'internal_hub_url' => 'http://shlink_mercure_proxy',
'jwt_secret' => 'mercure_jwt_key_long_enough_to_avoid_error',
],
];

View File

@@ -5,22 +5,26 @@ declare(strict_types=1);
namespace Shlinkio\Shlink;
use Laminas\Stratigility\Middleware\ErrorHandler;
use Mezzio;
use Mezzio\ProblemDetails;
use Mezzio\Router;
use PhpMiddleware\RequestId\RequestIdMiddleware;
use RKA\Middleware\IpAddress;
use Shlinkio\Shlink\Common\Middleware\ContentLengthMiddleware;
return [
'middleware_pipeline' => [
'error-handler' => [
'middleware' => [
Mezzio\Helper\ContentLengthMiddleware::class,
ContentLengthMiddleware::class,
RequestIdMiddleware::class,
ErrorHandler::class,
Rest\Middleware\CrossDomainMiddleware::class,
],
],
'error-handler-rest' => [
'path' => '/rest',
'middleware' => [
Rest\Middleware\CrossDomainMiddleware::class,
ProblemDetails\ProblemDetailsMiddleware::class,
],
],
@@ -33,14 +37,16 @@ return [
'routing' => [
'middleware' => [
Mezzio\Router\Middleware\RouteMiddleware::class,
Router\Middleware\RouteMiddleware::class,
Router\Middleware\ImplicitHeadMiddleware::class,
],
],
'rest' => [
'path' => '/rest',
'middleware' => [
Mezzio\Router\Middleware\ImplicitOptionsMiddleware::class,
Rest\Middleware\ErrorHandler\BackwardsCompatibleProblemDetailsHandler::class,
Router\Middleware\ImplicitOptionsMiddleware::class,
Rest\Middleware\BodyParserMiddleware::class,
Rest\Middleware\AuthenticationMiddleware::class,
],
@@ -48,7 +54,7 @@ return [
'dispatch' => [
'middleware' => [
Mezzio\Router\Middleware\DispatchMiddleware::class,
Router\Middleware\DispatchMiddleware::class,
],
],
@@ -60,9 +66,15 @@ return [
],
'not-found' => [
'middleware' => [
// This middleware is in front of tracking actions explicitly. Putting here for orphan visits tracking
IpAddress::class,
Core\ErrorHandler\NotFoundTypeResolverMiddleware::class,
Core\ShortUrl\Middleware\ExtraPathRedirectMiddleware::class,
Core\ErrorHandler\NotFoundTrackerMiddleware::class,
Core\ErrorHandler\NotFoundRedirectHandler::class,
Core\ErrorHandler\NotFoundTemplateHandler::class,
],
],
],
];

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
use Shlinkio\Shlink\Core\Config\EnvVars;
use const Shlinkio\Shlink\DEFAULT_QR_CODE_ERROR_CORRECTION;
use const Shlinkio\Shlink\DEFAULT_QR_CODE_FORMAT;
use const Shlinkio\Shlink\DEFAULT_QR_CODE_MARGIN;
use const Shlinkio\Shlink\DEFAULT_QR_CODE_ROUND_BLOCK_SIZE;
use const Shlinkio\Shlink\DEFAULT_QR_CODE_SIZE;
return [
'qr_codes' => [
'size' => (int) EnvVars::DEFAULT_QR_CODE_SIZE->loadFromEnv(DEFAULT_QR_CODE_SIZE),
'margin' => (int) EnvVars::DEFAULT_QR_CODE_MARGIN->loadFromEnv(DEFAULT_QR_CODE_MARGIN),
'format' => EnvVars::DEFAULT_QR_CODE_FORMAT->loadFromEnv(DEFAULT_QR_CODE_FORMAT),
'error_correction' => EnvVars::DEFAULT_QR_CODE_ERROR_CORRECTION->loadFromEnv(
DEFAULT_QR_CODE_ERROR_CORRECTION,
),
'round_block_size' => (bool) EnvVars::DEFAULT_QR_CODE_ROUND_BLOCK_SIZE->loadFromEnv(
DEFAULT_QR_CODE_ROUND_BLOCK_SIZE,
),
],
];

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
use Shlinkio\Shlink\Core\Config\EnvVars;
return [
'rabbitmq' => [
'enabled' => (bool) EnvVars::RABBITMQ_ENABLED->loadFromEnv(false),
'host' => EnvVars::RABBITMQ_HOST->loadFromEnv(),
'port' => (int) EnvVars::RABBITMQ_PORT->loadFromEnv('5672'),
'user' => EnvVars::RABBITMQ_USER->loadFromEnv(),
'password' => EnvVars::RABBITMQ_PASSWORD->loadFromEnv(),
'vhost' => EnvVars::RABBITMQ_VHOST->loadFromEnv('/'),
// Deprecated
'legacy_visits_publishing' => (bool) EnvVars::RABBITMQ_LEGACY_VISITS_PUBLISHING->loadFromEnv(false),
],
];

View File

@@ -0,0 +1,14 @@
<?php
declare(strict_types=1);
return [
'rabbitmq' => [
'enabled' => true,
'host' => 'shlink_rabbitmq',
'user' => 'rabbit',
'password' => 'rabbit',
],
];

View File

@@ -2,12 +2,24 @@
declare(strict_types=1);
use Shlinkio\Shlink\Core\Config\EnvVars;
use const Shlinkio\Shlink\DEFAULT_REDIRECT_CACHE_LIFETIME;
use const Shlinkio\Shlink\DEFAULT_REDIRECT_STATUS_CODE;
return [
'not_found_redirects' => [
'invalid_short_url' => null, // Formerly url_shortener.not_found_short_url.redirect_to
'regular_404' => null,
'base_url' => null,
'invalid_short_url' => EnvVars::DEFAULT_INVALID_SHORT_URL_REDIRECT->loadFromEnv(),
'regular_404' => EnvVars::DEFAULT_REGULAR_404_REDIRECT->loadFromEnv(),
'base_url' => EnvVars::DEFAULT_BASE_URL_REDIRECT->loadFromEnv(),
],
'redirects' => [
'redirect_status_code' => (int) EnvVars::REDIRECT_STATUS_CODE->loadFromEnv(DEFAULT_REDIRECT_STATUS_CODE),
'redirect_cache_lifetime' => (int) EnvVars::REDIRECT_CACHE_LIFETIME->loadFromEnv(
DEFAULT_REDIRECT_CACHE_LIFETIME,
),
],
];

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
use Shlinkio\Shlink\Core\Config\EnvVars;
return (static function (): array {
$redisServers = EnvVars::REDIS_SERVERS->loadFromEnv();
$pubSub = [
'redis' => [
'pub_sub_enabled' => $redisServers !== null && EnvVars::REDIS_PUB_SUB_ENABLED->loadFromEnv(false),
],
];
return match ($redisServers) {
null => $pubSub,
default => [
'cache' => [
'redis' => [
'servers' => $redisServers,
'sentinel_service' => EnvVars::REDIS_SENTINEL_SERVICE->loadFromEnv(),
],
],
...$pubSub,
],
};
})();

View File

@@ -7,12 +7,13 @@ return [
'cache' => [
'redis' => [
'servers' => 'tcp://shlink_redis:6379',
// 'servers' => [
// 'tcp://shlink_redis:6379',
// ],
],
],
'redis' => [
'pub_sub_enabled' => true,
],
'dependencies' => [
'aliases' => [
// With this config, a user could alias 'lock_store' => 'redis_lock_store' to override the default

View File

@@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
use Laminas\ServiceManager\Factory\InvokableFactory;
use PhpMiddleware\RequestId;
use Shlinkio\Shlink\Common\Logger\Processor\BackwardsCompatibleMonologProcessorDelegator;
return [
'request_id' => [
'allow_override' => true,
'header_name' => 'X-Request-Id',
],
'dependencies' => [
'factories' => [
RequestId\Generator\RamseyUuid4StaticGenerator::class => InvokableFactory::class,
RequestId\RequestIdProviderFactory::class => ConfigAbstractFactory::class,
RequestId\RequestIdMiddleware::class => ConfigAbstractFactory::class,
RequestId\MonologProcessor::class => ConfigAbstractFactory::class,
],
'delegators' => [
RequestId\MonologProcessor::class => [
BackwardsCompatibleMonologProcessorDelegator::class,
],
],
],
ConfigAbstractFactory::class => [
RequestId\RequestIdProviderFactory::class => [
RequestId\Generator\RamseyUuid4StaticGenerator::class,
'config.request_id.allow_override',
'config.request_id.header_name',
],
RequestId\RequestIdMiddleware::class => [
RequestId\RequestIdProviderFactory::class,
'config.request_id.header_name',
],
RequestId\MonologProcessor::class => [RequestId\RequestIdMiddleware::class],
],
];

View File

@@ -3,11 +3,12 @@
declare(strict_types=1);
use Mezzio\Router\FastRouteRouter;
use Shlinkio\Shlink\Core\Config\EnvVars;
return [
'router' => [
'base_path' => '',
'base_path' => EnvVars::BASE_PATH->loadFromEnv(''),
'fastroute' => [
FastRouteRouter::CONFIG_CACHE_ENABLED => true,

View File

@@ -0,0 +1,107 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink;
use Fig\Http\Message\RequestMethodInterface;
use RKA\Middleware\IpAddress;
use Shlinkio\Shlink\Core\Action as CoreAction;
use Shlinkio\Shlink\Core\Config\EnvVars;
use Shlinkio\Shlink\Rest\Action;
use Shlinkio\Shlink\Rest\ConfigProvider;
use Shlinkio\Shlink\Rest\Middleware;
use Shlinkio\Shlink\Rest\Middleware\Mercure\NotConfiguredMercureErrorHandler;
use function sprintf;
return (static function (): array {
$contentNegotiationMiddleware = Middleware\ShortUrl\CreateShortUrlContentNegotiationMiddleware::class;
$dropDomainMiddleware = Middleware\ShortUrl\DropDefaultDomainFromRequestMiddleware::class;
$overrideDomainMiddleware = Middleware\ShortUrl\OverrideDomainMiddleware::class;
$shortUrlRouteSuffix = EnvVars::SHORT_URL_TRAILING_SLASH->loadFromEnv(false) ? '[/]' : '';
return [
// The order of the routes defined here matters. Changing it might cause path conflicts
'routes' => [
// Rest
...ConfigProvider::applyRoutesPrefix([
Action\HealthAction::getRouteDef(),
// Visits
Action\Visit\ShortUrlVisitsAction::getRouteDef([$dropDomainMiddleware]),
Action\Visit\TagVisitsAction::getRouteDef(),
Action\Visit\DomainVisitsAction::getRouteDef(),
Action\Visit\GlobalVisitsAction::getRouteDef(),
Action\Visit\OrphanVisitsAction::getRouteDef(),
Action\Visit\NonOrphanVisitsAction::getRouteDef(),
// Short URLs
Action\ShortUrl\CreateShortUrlAction::getRouteDef([
$contentNegotiationMiddleware,
$dropDomainMiddleware,
$overrideDomainMiddleware,
Middleware\ShortUrl\DefaultShortCodesLengthMiddleware::class,
]),
Action\ShortUrl\SingleStepCreateShortUrlAction::getRouteDef([
$contentNegotiationMiddleware,
$overrideDomainMiddleware,
]),
Action\ShortUrl\EditShortUrlAction::getRouteDef([$dropDomainMiddleware]),
Action\ShortUrl\DeleteShortUrlAction::getRouteDef([$dropDomainMiddleware]),
Action\ShortUrl\ResolveShortUrlAction::getRouteDef([$dropDomainMiddleware]),
Action\ShortUrl\ListShortUrlsAction::getRouteDef(),
// Tags
Action\Tag\ListTagsAction::getRouteDef(),
Action\Tag\TagsStatsAction::getRouteDef(),
Action\Tag\DeleteTagsAction::getRouteDef(),
Action\Tag\UpdateTagAction::getRouteDef(),
// Domains
Action\Domain\ListDomainsAction::getRouteDef(),
Action\Domain\DomainRedirectsAction::getRouteDef(),
Action\MercureInfoAction::getRouteDef([NotConfiguredMercureErrorHandler::class]),
]),
// Non-rest
[
'name' => CoreAction\RobotsAction::class,
'path' => '/robots.txt',
'middleware' => [
CoreAction\RobotsAction::class,
],
'allowed_methods' => [RequestMethodInterface::METHOD_GET],
],
[
'name' => CoreAction\PixelAction::class,
'path' => '/{shortCode}/track',
'middleware' => [
IpAddress::class,
CoreAction\PixelAction::class,
],
'allowed_methods' => [RequestMethodInterface::METHOD_GET],
],
[
'name' => CoreAction\QrCodeAction::class,
'path' => '/{shortCode}/qr-code',
'middleware' => [
CoreAction\QrCodeAction::class,
],
'allowed_methods' => [RequestMethodInterface::METHOD_GET],
],
[
'name' => CoreAction\RedirectAction::class,
'path' => sprintf('/{shortCode}%s', $shortUrlRouteSuffix),
'middleware' => [
IpAddress::class,
CoreAction\RedirectAction::class,
],
'allowed_methods' => [RequestMethodInterface::METHOD_GET],
],
],
];
})();

View File

@@ -2,20 +2,30 @@
declare(strict_types=1);
return [
use Shlinkio\Shlink\Core\Config\EnvVars;
'mezzio-swoole' => [
'enable_coroutine' => true,
use const Shlinkio\Shlink\MIN_TASK_WORKERS;
'swoole-http-server' => [
'host' => '0.0.0.0',
'process-name' => 'shlink',
return (static function (): array {
$taskWorkers = (int) EnvVars::TASK_WORKER_NUM->loadFromEnv(16);
'options' => [
'worker_num' => 16,
'task_worker_num' => 16,
return [
'mezzio-swoole' => [
// Setting this to true can have unexpected behaviors when running several concurrent slow DB queries
'enable_coroutine' => false,
'swoole-http-server' => [
'host' => '0.0.0.0',
'port' => (int) EnvVars::PORT->loadFromEnv(8080),
'process-name' => 'shlink',
'options' => [
'worker_num' => (int) EnvVars::WEB_WORKER_NUM->loadFromEnv(16),
'task_worker_num' => max($taskWorkers, MIN_TASK_WORKERS),
],
],
],
],
];
];
})();

View File

@@ -2,9 +2,6 @@
declare(strict_types=1);
use Laminas\ServiceManager\Factory\InvokableFactory;
use Mezzio\Swoole\HotCodeReload\FileWatcher\InotifyFileWatcher;
return [
'mezzio-swoole' => [
@@ -13,10 +10,4 @@ return [
],
],
'dependencies' => [
'factories' => [
InotifyFileWatcher::class => InvokableFactory::class,
],
],
];

View File

@@ -1,17 +0,0 @@
<?php
declare(strict_types=1);
return [
'templates' => [
'extension' => 'phtml',
],
'plates' => [
'extensions' => [
// extension service names or instances
],
],
];

View File

@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
use Shlinkio\Shlink\Core\Config\EnvVars;
return (static function (): array {
/** @var string|null $disableTrackingFrom */
$disableTrackingFrom = EnvVars::DISABLE_TRACKING_FROM->loadFromEnv();
return [
'tracking' => [
// Tells if IP addresses should be anonymized before persisting, to fulfil data protection regulations
// This applies only if IP address tracking is enabled
'anonymize_remote_addr' => (bool) EnvVars::ANONYMIZE_REMOTE_ADDR->loadFromEnv(true),
// Tells if visits to not-found URLs should be tracked. The disable_tracking option takes precedence
'track_orphan_visits' => (bool) EnvVars::TRACK_ORPHAN_VISITS->loadFromEnv(true),
// A query param that, if provided, will disable tracking of one particular visit. Always takes precedence
'disable_track_param' => EnvVars::DISABLE_TRACK_PARAM->loadFromEnv(),
// If true, visits will not be tracked at all
'disable_tracking' => (bool) EnvVars::DISABLE_TRACKING->loadFromEnv(false),
// If true, visits will be tracked, but neither the IP address, nor the location will be resolved
'disable_ip_tracking' => (bool) EnvVars::DISABLE_IP_TRACKING->loadFromEnv(false),
// If true, the referrer will not be tracked
'disable_referrer_tracking' => (bool) EnvVars::DISABLE_REFERRER_TRACKING->loadFromEnv(false),
// If true, the user agent will not be tracked
'disable_ua_tracking' => (bool) EnvVars::DISABLE_UA_TRACKING->loadFromEnv(false),
// A list of IP addresses, patterns or CIDR blocks from which tracking is disabled by default
'disable_tracking_from' => $disableTrackingFrom === null
? []
: array_map(trim(...), explode(',', $disableTrackingFrom)),
],
];
})();

View File

@@ -2,15 +2,29 @@
declare(strict_types=1);
return [
use Shlinkio\Shlink\Core\Config\EnvVars;
'url_shortener' => [
'domain' => [
'schema' => 'https',
'hostname' => '',
use const Shlinkio\Shlink\DEFAULT_SHORT_CODES_LENGTH;
use const Shlinkio\Shlink\MIN_SHORT_CODES_LENGTH;
return (static function (): array {
$shortCodesLength = max(
(int) EnvVars::DEFAULT_SHORT_CODES_LENGTH->loadFromEnv(DEFAULT_SHORT_CODES_LENGTH),
MIN_SHORT_CODES_LENGTH,
);
return [
'url_shortener' => [
'domain' => [ // TODO Refactor this structure to url_shortener.schema and url_shortener.default_domain
'schema' => ((bool) EnvVars::IS_HTTPS_ENABLED->loadFromEnv(true)) ? 'https' : 'http',
'hostname' => EnvVars::DEFAULT_DOMAIN->loadFromEnv(''),
],
'default_short_codes_length' => $shortCodesLength,
'auto_resolve_titles' => (bool) EnvVars::AUTO_RESOLVE_TITLES->loadFromEnv(false),
'append_extra_path' => (bool) EnvVars::REDIRECT_APPEND_EXTRA_PATH->loadFromEnv(false),
'multi_segment_slugs_enabled' => (bool) EnvVars::MULTI_SEGMENT_SLUGS_ENABLED->loadFromEnv(false),
],
'validate_url' => false,
'visits_webhooks' => [],
],
];
];
})();

View File

@@ -2,13 +2,22 @@
declare(strict_types=1);
use function Shlinkio\Shlink\Config\runningInOpenswoole;
use function Shlinkio\Shlink\Config\runningInRoadRunner;
return [
'url_shortener' => [
'domain' => [
'schema' => 'http',
'hostname' => 'localhost:8080',
'hostname' => sprintf('localhost:%s', match (true) {
runningInRoadRunner() => '8800',
runningInOpenswoole() => '8080',
default => '8000',
}),
],
'auto_resolve_titles' => true,
// 'multi_segment_slugs_enabled' => true,
],
];

View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
use Shlinkio\Shlink\Core\Config\EnvVars;
// Deprecated. Webhooks are no longer supported. To be removed in Shlink 4.0.0
return (static function (): array {
$webhooks = EnvVars::VISITS_WEBHOOKS->loadFromEnv();
return [
'visits_webhooks' => [
'webhooks' => $webhooks === null ? [] : explode(',', $webhooks),
'notify_orphan_visits_to_webhooks' =>
(bool) EnvVars::NOTIFY_ORPHAN_VISITS_TO_WEBHOOKS->loadFromEnv(false),
],
];
})();

12
config/cli-app.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
use Psr\Container\ContainerInterface;
use Symfony\Component\Console\Application as CliApp;
return (static function (): CliApp {
/** @var ContainerInterface $container */
$container = include __DIR__ . '/container.php';
return $container->get(CliApp::class);
})();

View File

@@ -4,13 +4,9 @@ declare(strict_types=1);
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Laminas\ServiceManager\ServiceManager;
use Psr\Container\ContainerInterface;
return (function () {
/** @var ContainerInterface|ServiceManager $container */
$container = include __DIR__ . '/container.php';
$em = $container->get(EntityManager::class);
return (static function () {
/** @var EntityManager $em */
$em = include __DIR__ . '/entity-manager.php';
return ConsoleRunner::createHelperSet($em);
})();

View File

@@ -5,32 +5,49 @@ declare(strict_types=1);
namespace Shlinkio\Shlink;
use Laminas\ConfigAggregator;
use Laminas\ZendFrameworkBridge;
use Laminas\Diactoros;
use Mezzio;
use Mezzio\ProblemDetails;
use Mezzio\Swoole;
use Shlinkio\Shlink\Config\ConfigAggregator\EnvVarLoaderProvider;
use function Shlinkio\Shlink\Common\env;
use function class_exists;
use function Shlinkio\Shlink\Config\env;
use function Shlinkio\Shlink\Config\openswooleIsInstalled;
use function Shlinkio\Shlink\Config\runningInRoadRunner;
use const PHP_SAPI;
$isTestEnv = env('APP_ENV') === 'test';
$enableSwoole = PHP_SAPI === 'cli' && openswooleIsInstalled() && ! runningInRoadRunner();
return (new ConfigAggregator\ConfigAggregator([
! $isTestEnv
? new EnvVarLoaderProvider('config/params/generated_config.php', Core\Config\EnvVars::values())
: new ConfigAggregator\ArrayProvider([]),
Mezzio\ConfigProvider::class,
Mezzio\Router\ConfigProvider::class,
Mezzio\Router\FastRouteRouter\ConfigProvider::class,
Mezzio\Plates\ConfigProvider::class,
Mezzio\Swoole\ConfigProvider::class,
$enableSwoole && class_exists(Swoole\ConfigProvider::class)
? Swoole\ConfigProvider::class
: new ConfigAggregator\ArrayProvider([]),
ProblemDetails\ConfigProvider::class,
Diactoros\ConfigProvider::class,
Common\ConfigProvider::class,
Config\ConfigProvider::class,
Importer\ConfigProvider::class,
IpGeolocation\ConfigProvider::class,
EventDispatcher\ConfigProvider::class,
Core\ConfigProvider::class,
CLI\ConfigProvider::class,
Rest\ConfigProvider::class,
EventDispatcher\ConfigProvider::class,
new ConfigAggregator\PhpFileProvider('config/autoload/{{,*.}global,{,*.}local}.php'),
env('APP_ENV') === 'test'
$isTestEnv
? new ConfigAggregator\PhpFileProvider('config/test/*.global.php')
: new ConfigAggregator\LaminasConfigProvider('config/params/{generated_config.php,*.config.{php,json}}'),
: new ConfigAggregator\ArrayProvider([]),
// Routes have to be loaded last
new ConfigAggregator\PhpFileProvider('config/autoload/routes.config.php'),
], 'data/cache/app_config.php', [
ZendFrameworkBridge\ConfigPostProcessor::class,
Core\Config\SimplifiedConfigParser::class,
Core\Config\BasePathPrefixer::class,
Core\Config\DeprecatedConfigParser::class,
Core\Config\MultiSegmentSlugProcessor::class,
]))->getMergedConfig();

22
config/constants.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink;
use Fig\Http\Message\StatusCodeInterface;
const DEFAULT_DELETE_SHORT_URL_THRESHOLD = 15;
const DEFAULT_SHORT_CODES_LENGTH = 5;
const MIN_SHORT_CODES_LENGTH = 4;
const DEFAULT_REDIRECT_STATUS_CODE = StatusCodeInterface::STATUS_FOUND;
const DEFAULT_REDIRECT_CACHE_LIFETIME = 30;
const LOCAL_LOCK_FACTORY = 'Shlinkio\Shlink\LocalLockFactory';
const TITLE_TAG_VALUE = '/<title[^>]*>(.*?)<\/title>/i'; // Matches the value inside a html title tag
const DEFAULT_QR_CODE_SIZE = 300;
const DEFAULT_QR_CODE_MARGIN = 0;
const DEFAULT_QR_CODE_FORMAT = 'png';
const DEFAULT_QR_CODE_ERROR_CORRECTION = 'l';
const DEFAULT_QR_CODE_ROUND_BLOCK_SIZE = true;
const MIN_TASK_WORKERS = 4;
const MIGRATIONS_TABLE = 'migrations';

View File

@@ -3,19 +3,26 @@
declare(strict_types=1);
use Laminas\ServiceManager\ServiceManager;
use Shlinkio\Shlink\Core\Config\EnvVars;
use Symfony\Component\Lock;
use const Shlinkio\Shlink\LOCAL_LOCK_FACTORY;
chdir(dirname(__DIR__));
require 'vendor/autoload.php';
// This is one of the first files loaded. Configure the timezone here
date_default_timezone_set(EnvVars::TIMEZONE->loadFromEnv(date_default_timezone_get()));
// This class alias tricks the ConfigAbstractFactory to return Lock\Factory instances even with a different service name
if (! class_exists('Shlinkio\Shlink\LocalLockFactory')) {
class_alias(Lock\LockFactory::class, 'Shlinkio\Shlink\LocalLockFactory');
// It needs to be placed here as individual config files will not be loaded once config is cached
if (! class_exists(LOCAL_LOCK_FACTORY)) {
class_alias(Lock\LockFactory::class, LOCAL_LOCK_FACTORY);
}
// Build container
return (function () {
return (static function (): ServiceManager {
$config = require __DIR__ . '/config.php';
$container = new ServiceManager($config['dependencies']);
$container->setService('config', $config);

13
config/entity-manager.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Container\ContainerInterface;
return (static function (): EntityManagerInterface {
/** @var ContainerInterface $container */
$container = include __DIR__ . '/container.php';
return $container->get(EntityManager::class);
})();

View File

@@ -0,0 +1,49 @@
version: '2.7'
rpc:
listen: tcp://127.0.0.1:6001
server:
command: 'php ../../bin/roadrunner-worker.php'
http:
address: '0.0.0.0:8080'
middleware: ['static']
static:
dir: '../../public'
forbid: ['.php', '.htaccess']
pool:
num_workers: 1
jobs:
pool:
num_workers: 1
timeout: 300
consume: ['shlink']
pipelines:
shlink:
driver: memory
config:
priority: 10
prefetch: 10
logs:
mode: development
channels:
http:
level: debug
server:
level: debug
metrics:
level: debug
reload:
interval: 1s
patterns: ['.php']
services:
http:
dirs: ['../../bin', '../../config', '../../data/migrations', '../../module', '../../vendor']
recursive: true
jobs:
dirs: ['../../bin', '../../config', '../../data/migrations', '../../module', '../../vendor']
recursive: true

36
config/roadrunner/.rr.yml Normal file
View File

@@ -0,0 +1,36 @@
version: '2.7'
rpc:
listen: tcp://127.0.0.1:6001
server:
command: 'php -dopcache.enable_cli=1 -dopcache.validate_timestamps=0 ../../bin/roadrunner-worker.php'
http:
address: '0.0.0.0:${PORT}'
middleware: ['static']
static:
dir: '../../public'
forbid: ['.php', '.htaccess']
pool:
num_workers: ${WEB_WORKER_NUM}
jobs:
timeout: 300 # 5 minutes
pool:
num_workers: ${TASK_WORKER_NUM}
consume: ['shlink']
pipelines:
shlink:
driver: memory
config:
priority: 10
prefetch: 10
logs:
mode: production
channels:
http:
level: info # Log all http requests, set to info to disable
server:
level: debug # Everything written to worker stderr is logged

View File

@@ -4,12 +4,11 @@ declare(strict_types=1);
use Mezzio\Application;
use Psr\Container\ContainerInterface;
use Symfony\Component\Console\Application as CliApp;
return function (bool $isCli = false): void {
return static function (): void {
/** @var ContainerInterface $container */
$container = include __DIR__ . '/container.php';
$app = $container->get($isCli ? CliApp::class : Application::class);
$app = $container->get(Application::class);
$app->run();
};

View File

@@ -7,12 +7,32 @@ namespace Shlinkio\Shlink\TestUtils;
use Doctrine\ORM\EntityManager;
use Psr\Container\ContainerInterface;
use function register_shutdown_function;
use function sprintf;
use const ShlinkioTest\Shlink\API_TESTS_HOST;
use const ShlinkioTest\Shlink\API_TESTS_PORT;
/** @var ContainerInterface $container */
$container = require __DIR__ . '/../container.php';
$testHelper = $container->get(Helper\TestHelper::class);
$config = $container->get('config');
$em = $container->get(EntityManager::class);
$httpClient = $container->get('shlink_test_api_client');
$testHelper->createTestDb();
ApiTest\ApiTestCase::setApiClient($container->get('shlink_test_api_client'));
// Dump code coverage when process shuts down
register_shutdown_function(function () use ($httpClient): void {
$httpClient->request(
'GET',
sprintf('http://%s:%s/api-tests/stop-coverage', API_TESTS_HOST, API_TESTS_PORT),
);
});
$testHelper->createTestDb(
['bin/cli', 'db:create'],
['bin/cli', 'db:migrate'],
['bin/doctrine', 'orm:schema-tool:drop'],
['bin/doctrine', 'dbal:run-sql'],
);
ApiTest\ApiTestCase::setApiClient($httpClient);
ApiTest\ApiTestCase::setSeedFixturesCallback(fn () => $testHelper->seedFixtures($em, $config['data_fixtures'] ?? []));

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\TestUtils;
use Doctrine\ORM\EntityManager;
use Psr\Container\ContainerInterface;
use function file_exists;
use function unlink;
/** @var ContainerInterface $container */
$container = require __DIR__ . '/../container.php';
$testHelper = $container->get(Helper\TestHelper::class);
$config = $container->get('config');
$em = $container->get(EntityManager::class);
// Delete old coverage in PHP, to avoid merging older executions with current one
$covFile = __DIR__ . '/../../build/coverage-cli.cov';
if (file_exists($covFile)) {
unlink($covFile);
}
$testHelper->createTestDb(
['bin/cli', 'db:create'],
['bin/cli', 'db:migrate'],
['bin/doctrine', 'orm:schema-tool:drop'],
['bin/doctrine', 'dbal:run-sql'],
);
CliTest\CliTestCase::setSeedFixturesCallback(
static fn () => $testHelper->seedFixtures($em, $config['data_fixtures'] ?? []),
);

View File

@@ -8,5 +8,10 @@ use Psr\Container\ContainerInterface;
/** @var ContainerInterface $container */
$container = require __DIR__ . '/../container.php';
$container->get(Helper\TestHelper::class)->createTestDb();
$container->get(Helper\TestHelper::class)->createTestDb(
['bin/cli', 'db:create'],
['bin/cli', 'db:migrate'],
['bin/doctrine', 'orm:schema-tool:drop'],
['bin/doctrine', 'dbal:run-sql'],
);
DbTest\DatabaseTestCase::setEntityManager($container->get('em'));

View File

@@ -0,0 +1,8 @@
<?php
declare(strict_types=1);
namespace ShlinkioTest\Shlink;
const API_TESTS_HOST = '127.0.0.1';
const API_TESTS_PORT = 9999;

View File

@@ -6,51 +6,120 @@ namespace Shlinkio\Shlink;
use GuzzleHttp\Client;
use Laminas\ConfigAggregator\ConfigAggregator;
use Laminas\Diactoros\Response\EmptyResponse;
use Laminas\ServiceManager\Factory\InvokableFactory;
use PDO;
use League\Event\EventDispatcher;
use Monolog\Level;
use PHPUnit\Runner\Version;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeCoverage\Driver\Selector;
use SebastianBergmann\CodeCoverage\Filter;
use SebastianBergmann\CodeCoverage\Report\Html\Facade as Html;
use SebastianBergmann\CodeCoverage\Report\PHP;
use SebastianBergmann\CodeCoverage\Report\Xml\Facade as Xml;
use Shlinkio\Shlink\Common\Logger\LoggerType;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use function Shlinkio\Shlink\Common\env;
use function file_exists;
use function Functional\contains;
use function Laminas\Stratigility\middleware;
use function Shlinkio\Shlink\Config\env;
use function sprintf;
use function sys_get_temp_dir;
$swooleTestingHost = '127.0.0.1';
$swooleTestingPort = 9999;
use const ShlinkioTest\Shlink\API_TESTS_HOST;
use const ShlinkioTest\Shlink\API_TESTS_PORT;
$buildDbConnection = function (): array {
$isApiTest = env('TEST_ENV') === 'api';
$isCliTest = env('TEST_ENV') === 'cli';
$isE2eTest = $isApiTest || $isCliTest;
$coverageType = env('GENERATE_COVERAGE');
$generateCoverage = contains(['yes', 'pretty'], $coverageType);
$coverage = null;
if ($isE2eTest && $generateCoverage) {
$filter = new Filter();
$filter->includeDirectory(__DIR__ . '/../../module/Core/src');
$filter->includeDirectory(__DIR__ . '/../../module/' . ($isApiTest ? 'Rest' : 'CLI') . '/src');
$coverage = new CodeCoverage((new Selector())->forLineCoverage($filter), $filter);
}
/**
* @param 'api'|'cli' $type
*/
$exportCoverage = static function (string $type = 'api') use (&$coverage, $coverageType): void {
if ($coverage === null) {
return;
}
$basePath = __DIR__ . '/../../build/coverage-' . $type;
$covPath = $basePath . '.cov';
// Every CLI test runs on its own process and dumps the coverage afterwards.
// Try to load it and merge it, so that we end up with the whole coverage at the end.
if ($type === 'cli' && file_exists($covPath)) {
$coverage->merge(require $covPath);
}
if ($coverageType === 'pretty') {
(new Html())->process($coverage, $basePath . '/coverage-html');
} else {
(new PHP())->process($coverage, $covPath);
(new Xml(Version::getVersionString()))->process($coverage, $basePath . '/coverage-xml');
}
};
$buildDbConnection = static function (): array {
$driver = env('DB_DRIVER', 'sqlite');
$isCi = env('TRAVIS', false);
$getMysqlHost = fn (string $driver) => sprintf('shlink_db%s', $driver === 'mysql' ? '' : '_maria');
$isCi = env('CI', false);
$getCiMysqlPort = static fn (string $driver) => $driver === 'mysql' ? '3307' : '3308';
$driverConfigMap = [
return match ($driver) {
'sqlite' => [
'driver' => 'pdo_sqlite',
'path' => sys_get_temp_dir() . '/shlink-tests.db',
],
'mysql' => [
'driver' => 'pdo_mysql',
'host' => $isCi ? '127.0.0.1' : $getMysqlHost($driver),
'user' => 'root',
'password' => $isCi ? '' : 'root',
'dbname' => 'shlink_test',
'charset' => 'utf8',
'driverOptions' => [
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
],
],
'postgres' => [
'driver' => 'pdo_pgsql',
'host' => $isCi ? '127.0.0.1' : 'shlink_db_postgres',
'port' => $isCi ? '5433' : '5432',
'user' => 'postgres',
'password' => $isCi ? '' : 'root',
'password' => 'root',
'dbname' => 'shlink_test',
'charset' => 'utf8',
],
];
$driverConfigMap['maria'] = $driverConfigMap['mysql'];
return $driverConfigMap[$driver] ?? [];
'mssql' => [
'driver' => 'pdo_sqlsrv',
'host' => $isCi ? '127.0.0.1' : 'shlink_db_ms',
'user' => 'sa',
'password' => 'Passw0rd!',
'dbname' => 'shlink_test',
],
default => [ // mysql and maria
'driver' => 'pdo_mysql',
'host' => $isCi ? '127.0.0.1' : sprintf('shlink_db_%s', $driver),
'port' => $isCi ? $getCiMysqlPort($driver) : '3306',
'user' => 'root',
'password' => 'root',
'dbname' => 'shlink_test',
'charset' => 'utf8mb4',
],
};
};
$buildTestLoggerConfig = static fn (string $filename) => [
'level' => Level::Debug->value,
'type' => LoggerType::STREAM->value,
'destination' => sprintf('data/log/api-tests/%s', $filename),
];
return [
'debug' => true,
@@ -61,34 +130,126 @@ return [
'schema' => 'http',
'hostname' => 'doma.in',
],
'validate_url' => true,
],
'mezzio-swoole' => [
'enable_coroutine' => false,
'swoole-http-server' => [
'host' => $swooleTestingHost,
'port' => $swooleTestingPort,
'host' => API_TESTS_HOST,
'port' => API_TESTS_PORT,
'process-name' => 'shlink_test',
'options' => [
'pid_file' => sys_get_temp_dir() . '/shlink-test-swoole.pid',
'worker_num' => 1,
'task_worker_num' => 1,
'log_file' => __DIR__ . '/../../data/log/api-tests/output.log',
'enable_coroutine' => false,
],
],
],
'routes' => !$isApiTest ? [] : [
[
'name' => 'dump_coverage',
'path' => '/api-tests/stop-coverage',
'middleware' => middleware(static function () use ($exportCoverage) {
// TODO I have tried moving this block to a listener so that it's invoked automatically,
// but then the coverage is generated empty ¯\_(ツ)_/¯
$exportCoverage();
return new EmptyResponse();
}),
'allowed_methods' => ['GET'],
],
],
'middleware_pipeline' => !$isApiTest ? [] : [
'capture_code_coverage' => [
'middleware' => middleware(static function (
ServerRequestInterface $req,
RequestHandlerInterface $handler,
) use (&$coverage): ResponseInterface {
$coverage?->start($req->getHeaderLine('x-coverage-id'));
try {
return $handler->handle($req);
} finally {
$coverage?->stop();
}
}),
'priority' => 9999,
],
],
'mercure' => [
'public_hub_url' => null,
'internal_hub_url' => null,
'jwt_secret' => null,
],
'dependencies' => [
'services' => [
'shlink_test_api_client' => new Client([
'base_uri' => sprintf('http://%s:%s/', $swooleTestingHost, $swooleTestingPort),
'base_uri' => sprintf('http://%s:%s/', API_TESTS_HOST, API_TESTS_PORT),
'http_errors' => false,
]),
],
'factories' => [
TestUtils\Helper\TestHelper::class => InvokableFactory::class,
],
'delegators' => $isCliTest ? [
Application::class => [
static function (
ContainerInterface $c,
string $serviceName,
callable $callback,
) use (
&$coverage,
$exportCoverage,
) {
/** @var Application $app */
$app = $callback();
$wrappedEventDispatcher = new EventDispatcher();
// When the command starts, start collecting coverage
$wrappedEventDispatcher->subscribeTo(
ConsoleCommandEvent::class,
static function () use (&$coverage): void {
$id = env('COVERAGE_ID');
if ($id === null) {
return;
}
$coverage?->start($id);
},
);
// When the command ends, stop collecting coverage
$wrappedEventDispatcher->subscribeTo(
ConsoleTerminateEvent::class,
static function () use (&$coverage, $exportCoverage): void {
$id = env('COVERAGE_ID');
if ($id === null) {
return;
}
$coverage?->stop();
$exportCoverage('cli');
},
);
$app->setDispatcher(new class ($wrappedEventDispatcher) implements EventDispatcherInterface {
public function __construct(private EventDispatcher $wrappedDispatcher)
{
}
public function dispatch(object $event, ?string $eventName = null): object
{
$this->wrappedDispatcher->dispatch($event);
return $event;
}
});
return $app;
},
],
] : [],
],
'entity_manager' => [
@@ -97,8 +258,14 @@ return [
'data_fixtures' => [
'paths' => [
// TODO These are used for CLI tests too, so maybe should be somewhere else
__DIR__ . '/../../module/Rest/test-api/Fixtures',
],
],
'logger' => [
'Shlink' => $buildTestLoggerConfig('shlink.log'),
'Access' => $buildTestLoggerConfig('access.log'),
],
];

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -ex
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
apt-get update
ACCEPT_EULA=Y apt-get install msodbcsql17
apt-get install unixodbc-dev

View File

@@ -11,7 +11,7 @@ server {
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}

View File

@@ -1,4 +1,4 @@
/var/log/shlink/shlink_swoole.log {
/var/log/shlink/shlink_openswoole.log {
su root root
daily
missingok
@@ -8,6 +8,6 @@
notifempty
create 0640 root root
postrotate
/etc/init.d/shlink_swoole restart
/etc/init.d/shlink_openswoole restart
endscript
}

View File

@@ -1,26 +1,26 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: shlink_swoole
# Provides: shlink_openswoole
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Shlink non-blocking server with swoole
# Description: Shlink non-blocking server with openswoole
### END INIT INFO
SCRIPT=/path/to/shlink/vendor/bin/mezzio-swoole\ start
SCRIPT=/path/to/shlink/vendor/bin/laminas\ mezzio:swoole:start
RUNAS=root
PIDFILE=/var/run/shlink_swoole.pid
PIDFILE=/var/run/shlink_openswoole.pid
LOGDIR=/var/log/shlink
LOGFILE=${LOGDIR}/shlink_swoole.log
LOGFILE=${LOGDIR}/shlink_openswoole.log
start() {
if [[ -f "$PIDFILE" ]] && kill -0 $(cat "$PIDFILE"); then
echo 'Shlink with swoole already running' >&2
echo 'Shlink with openswoole already running' >&2
return 1
fi
echo 'Starting shlink with swoole' >&2
echo 'Starting shlink with openswoole' >&2
mkdir -p "$LOGDIR"
touch "$LOGFILE"
local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
@@ -30,10 +30,10 @@ start() {
stop() {
if [[ ! -f "$PIDFILE" ]] || ! kill -0 $(cat "$PIDFILE"); then
echo 'Shlink with swoole not running' >&2
echo 'Shlink with openswoole not running' >&2
return 1
fi
echo 'Stopping shlink with swoole' >&2
echo 'Stopping shlink with openswoole' >&2
kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE"
echo 'Shlink stopped' >&2
}

View File

@@ -0,0 +1,17 @@
server {
listen 80 default_server;
error_log /home/shlink/www/data/infra/nginx/mercure_proxy.error.log;
location / {
proxy_pass http://shlink_mercure;
proxy_read_timeout 24h;
proxy_http_version 1.1;
proxy_set_header Connection "";
## Be sure to set USE_FORWARDED_HEADERS=1 to allow the hub to use those headers ##
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

View File

@@ -1,15 +1,14 @@
FROM php:7.4.1-fpm-alpine3.10
FROM php:8.1.9-fpm-alpine3.16
MAINTAINER Alejandro Celaya <alejandro@alejandrocelaya.com>
ENV APCU_VERSION 5.1.18
ENV APCU_BC_VERSION 1.0.5
ENV XDEBUG_VERSION 2.9.0
ENV APCU_VERSION 5.1.21
ENV PDO_SQLSRV_VERSION 5.10.1
ENV MS_ODBC_SQL_VERSION 17.5.2.2
RUN apk update
# Install common php extensions
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install iconv
RUN docker-php-ext-install calendar
RUN apk add --no-cache oniguruma-dev
@@ -31,44 +30,30 @@ RUN docker-php-ext-install gd
RUN apk add --no-cache postgresql-dev
RUN docker-php-ext-install pdo_pgsql
RUN docker-php-ext-install sockets
RUN docker-php-ext-install bcmath
# Install APCu extension
ADD https://pecl.php.net/get/apcu-$APCU_VERSION.tgz /tmp/apcu.tar.gz
RUN mkdir -p /usr/src/php/ext/apcu\
&& tar xf /tmp/apcu.tar.gz -C /usr/src/php/ext/apcu --strip-components=1
# configure and install
RUN docker-php-ext-configure apcu\
&& docker-php-ext-install apcu
# cleanup
RUN rm /tmp/apcu.tar.gz
RUN mkdir -p /usr/src/php/ext/apcu \
&& tar xf /tmp/apcu.tar.gz -C /usr/src/php/ext/apcu --strip-components=1 \
&& docker-php-ext-configure apcu \
&& docker-php-ext-install apcu \
&& rm /tmp/apcu.tar.gz \
&& rm /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini \
&& echo extension=apcu.so > /usr/local/etc/php/conf.d/20-php-ext-apcu.ini
# Install APCu-BC extension
ADD https://pecl.php.net/get/apcu_bc-$APCU_BC_VERSION.tgz /tmp/apcu_bc.tar.gz
RUN mkdir -p /usr/src/php/ext/apcu-bc\
&& tar xf /tmp/apcu_bc.tar.gz -C /usr/src/php/ext/apcu-bc --strip-components=1
# configure and install
RUN docker-php-ext-configure apcu-bc\
&& docker-php-ext-install apcu-bc
# cleanup
RUN rm /tmp/apcu_bc.tar.gz
# Load APCU.ini before APC.ini
RUN rm /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini
RUN echo extension=apcu.so > /usr/local/etc/php/conf.d/20-php-ext-apcu.ini
# Install xdebug
ADD https://pecl.php.net/get/xdebug-$XDEBUG_VERSION /tmp/xdebug.tar.gz
RUN mkdir -p /usr/src/php/ext/xdebug\
&& tar xf /tmp/xdebug.tar.gz -C /usr/src/php/ext/xdebug --strip-components=1
# configure and install
RUN docker-php-ext-configure xdebug\
&& docker-php-ext-install xdebug
# cleanup
RUN rm /tmp/xdebug.tar.gz
# Install pcov and sqlsrv driver
RUN wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
apk add --allow-untrusted msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc-dev && \
pecl install pdo_sqlsrv-${PDO_SQLSRV_VERSION} pcov && \
docker-php-ext-enable pdo_sqlsrv pcov && \
apk del .phpize-deps && \
rm msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk
# Install composer
RUN php -r "readfile('https://getcomposer.org/installer');" | php
RUN chmod +x composer.phar
RUN mv composer.phar /usr/local/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
# Make home directory writable by anyone
RUN chmod 777 /home

View File

@@ -4,3 +4,5 @@ memory_limit=-1
log_errors_max_len=0
zend.assertions=1
assert.exception=1
pcov.enabled=1
pcov.directory=module

View File

@@ -0,0 +1,73 @@
FROM php:8.1.9-alpine3.16
MAINTAINER Alejandro Celaya <alejandro@alejandrocelaya.com>
ENV APCU_VERSION 5.1.21
ENV PDO_SQLSRV_VERSION 5.10.1
ENV MS_ODBC_SQL_VERSION 17.5.2.2
RUN apk update
# Install common php extensions
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install calendar
RUN apk add --no-cache oniguruma-dev
RUN docker-php-ext-install mbstring
RUN apk add --no-cache sqlite-libs
RUN apk add --no-cache sqlite-dev
RUN docker-php-ext-install pdo_sqlite
RUN apk add --no-cache icu-dev
RUN docker-php-ext-install intl
RUN apk add --no-cache libzip-dev zlib-dev
RUN docker-php-ext-install zip
RUN apk add --no-cache libpng-dev
RUN docker-php-ext-install gd
RUN apk add --no-cache postgresql-dev
RUN docker-php-ext-install pdo_pgsql
RUN docker-php-ext-install sockets
RUN docker-php-ext-install bcmath
# Install APCu extension
ADD https://pecl.php.net/get/apcu-$APCU_VERSION.tgz /tmp/apcu.tar.gz
RUN mkdir -p /usr/src/php/ext/apcu \
&& tar xf /tmp/apcu.tar.gz -C /usr/src/php/ext/apcu --strip-components=1 \
&& docker-php-ext-configure apcu \
&& docker-php-ext-install apcu \
&& rm /tmp/apcu.tar.gz \
&& rm /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini \
&& echo extension=apcu.so > /usr/local/etc/php/conf.d/20-php-ext-apcu.ini
# Install pcov and sqlsrv driver
RUN wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
apk add --allow-untrusted msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc-dev && \
pecl install pdo_sqlsrv-${PDO_SQLSRV_VERSION} pcov && \
docker-php-ext-enable pdo_sqlsrv pcov && \
apk del .phpize-deps && \
rm msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk
# Install composer
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
# Make home directory writable by anyone
RUN chmod 777 /home
VOLUME /home/shlink
WORKDIR /home/shlink
# Expose roadrunner port
EXPOSE 8080
CMD \
# Install dependencies if the vendor dir does not exist
if [[ ! -d "./vendor" ]]; then /usr/local/bin/composer install ; fi && \
# Download roadrunner binary
if [[ ! -f "./bin/rr" ]]; then ./vendor/bin/rr get --no-interaction --location bin/ && chmod +x bin/rr ; fi && \
# This forces the app to be started every second until the exit code is 0
until ./bin/rr serve -c config/roadrunner/.rr.dev.yml; do sleep 1 ; done

View File

@@ -1,16 +1,16 @@
FROM php:7.4.1-alpine3.10
FROM php:8.1.9-alpine3.16
MAINTAINER Alejandro Celaya <alejandro@alejandrocelaya.com>
ENV APCU_VERSION 5.1.18
ENV APCU_BC_VERSION 1.0.5
ENV INOTIFY_VERSION 2.0.0
ENV SWOOLE_VERSION 4.4.12
ENV APCU_VERSION 5.1.21
ENV INOTIFY_VERSION 3.0.0
ENV OPENSWOOLE_VERSION 4.11.1
ENV PDO_SQLSRV_VERSION 5.10.1
ENV MS_ODBC_SQL_VERSION 17.5.2.2
RUN apk update
# Install common php extensions
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install iconv
RUN docker-php-ext-install calendar
RUN apk add --no-cache oniguruma-dev
@@ -32,51 +32,38 @@ RUN docker-php-ext-install gd
RUN apk add --no-cache postgresql-dev
RUN docker-php-ext-install pdo_pgsql
RUN docker-php-ext-install sockets
RUN docker-php-ext-install bcmath
# Install APCu extension
ADD https://pecl.php.net/get/apcu-$APCU_VERSION.tgz /tmp/apcu.tar.gz
RUN mkdir -p /usr/src/php/ext/apcu\
&& tar xf /tmp/apcu.tar.gz -C /usr/src/php/ext/apcu --strip-components=1
# configure and install
RUN docker-php-ext-configure apcu\
&& docker-php-ext-install apcu
# cleanup
RUN rm /tmp/apcu.tar.gz
# Install APCu-BC extension
ADD https://pecl.php.net/get/apcu_bc-$APCU_BC_VERSION.tgz /tmp/apcu_bc.tar.gz
RUN mkdir -p /usr/src/php/ext/apcu-bc\
&& tar xf /tmp/apcu_bc.tar.gz -C /usr/src/php/ext/apcu-bc --strip-components=1
# configure and install
RUN docker-php-ext-configure apcu-bc\
&& docker-php-ext-install apcu-bc
# cleanup
RUN rm /tmp/apcu_bc.tar.gz
# Load APCU.ini before APC.ini
RUN rm /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini
RUN echo extension=apcu.so > /usr/local/etc/php/conf.d/20-php-ext-apcu.ini
RUN mkdir -p /usr/src/php/ext/apcu \
&& tar xf /tmp/apcu.tar.gz -C /usr/src/php/ext/apcu --strip-components=1 \
&& docker-php-ext-configure apcu \
&& docker-php-ext-install apcu \
&& rm /tmp/apcu.tar.gz \
&& rm /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini \
&& echo extension=apcu.so > /usr/local/etc/php/conf.d/20-php-ext-apcu.ini
# Install inotify extension
ADD https://pecl.php.net/get/inotify-$INOTIFY_VERSION.tgz /tmp/inotify.tar.gz
RUN mkdir -p /usr/src/php/ext/inotify\
&& tar xf /tmp/inotify.tar.gz -C /usr/src/php/ext/inotify --strip-components=1
# configure and install
RUN docker-php-ext-configure inotify\
&& docker-php-ext-install inotify
# cleanup
RUN rm /tmp/inotify.tar.gz
RUN mkdir -p /usr/src/php/ext/inotify \
&& tar xf /tmp/inotify.tar.gz -C /usr/src/php/ext/inotify --strip-components=1 \
&& docker-php-ext-configure inotify \
&& docker-php-ext-install inotify \
&& rm /tmp/inotify.tar.gz
# Install swoole
# First line fixes an error when installing pecl extensions. Found in https://github.com/docker-library/php/issues/233
RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS && \
pecl install swoole-${SWOOLE_VERSION} && \
docker-php-ext-enable swoole && \
apk del .phpize-deps
# Install openswoole, pcov and mssql driver
RUN wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
apk add --allow-untrusted msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc-dev && \
pecl install openswoole-${OPENSWOOLE_VERSION} pdo_sqlsrv-${PDO_SQLSRV_VERSION} pcov && \
docker-php-ext-enable openswoole pdo_sqlsrv pcov && \
apk del .phpize-deps && \
rm msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk
# Install composer
RUN php -r "readfile('https://getcomposer.org/installer');" | php
RUN chmod +x composer.phar
RUN mv composer.phar /usr/local/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
# Make home directory writable by anyone
RUN chmod 777 /home
@@ -84,12 +71,12 @@ RUN chmod 777 /home
VOLUME /home/shlink
WORKDIR /home/shlink
# Expose swoole port
# Expose openswoole port
EXPOSE 8080
CMD \
# Install dependencies if the vendor dir does not exist
if [[ ! -d "./vendor" ]]; then /usr/local/bin/composer install ; fi && \
# When restarting the container, swoole might think it is already in execution
# When restarting the container, openswoole might think it is already in execution
# This forces the app to be started every second until the exit code is 0
until php ./vendor/bin/mezzio-swoole start; do sleep 1 ; done
until php ./vendor/bin/laminas mezzio:swoole:start; do sleep 1 ; done

View File

@@ -0,0 +1,14 @@
server {
listen 80 default_server;
error_log /home/shlink/www/data/infra/nginx/swoole_proxy.error.log;
location / {
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://shlink_swoole:8080;
proxy_read_timeout 90s;
}
}

View File

@@ -4,41 +4,46 @@ declare(strict_types=1);
namespace ShlinkMigrations;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
use Doctrine\Migrations\AbstractMigration;
use function is_subclass_of;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20160819142757 extends AbstractMigration
{
private const MYSQL = 'mysql';
private const SQLITE = 'sqlite';
/**
* @throws DBALException
* @throws Exception
* @throws SchemaException
*/
public function up(Schema $schema): void
{
$db = $this->connection->getDatabasePlatform()->getName();
$platformClass = $this->connection->getDatabasePlatform();
$table = $schema->getTable('short_urls');
$column = $table->getColumn('short_code');
if ($db === self::MYSQL) {
$column->setPlatformOption('collation', 'utf8_bin');
} elseif ($db === self::SQLITE) {
$column->setPlatformOption('collate', 'BINARY');
}
match (true) {
is_subclass_of($platformClass, MySQLPlatform::class) => $column
->setPlatformOption('charset', 'utf8mb4')
->setPlatformOption('collation', 'utf8mb4_bin'),
is_subclass_of($platformClass, SqlitePlatform::class) => $column->setPlatformOption('collate', 'BINARY'),
default => null,
};
}
/**
* @throws DBALException
*/
public function down(Schema $schema): void
{
$db = $this->connection->getDatabasePlatform()->getName();
// Nothing to roll back
}
public function isTransactional(): bool
{
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
}
}

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
@@ -73,4 +74,9 @@ class Version20160820191203 extends AbstractMigration
$schema->dropTable('short_urls_in_tags');
$schema->dropTable('tags');
}
public function isTransactional(): bool
{
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
}
}

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
use Doctrine\DBAL\Types\Types;
@@ -24,10 +25,10 @@ class Version20171021093246 extends AbstractMigration
return;
}
$shortUrls->addColumn('valid_since', Types::DATETIME, [
$shortUrls->addColumn('valid_since', Types::DATETIME_MUTABLE, [
'notnull' => false,
]);
$shortUrls->addColumn('valid_until', Types::DATETIME, [
$shortUrls->addColumn('valid_until', Types::DATETIME_MUTABLE, [
'notnull' => false,
]);
}
@@ -45,4 +46,9 @@ class Version20171021093246 extends AbstractMigration
$shortUrls->dropColumn('valid_since');
$shortUrls->dropColumn('valid_until');
}
public function isTransactional(): bool
{
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
}
}

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
use Doctrine\DBAL\Types\Types;
@@ -42,4 +43,9 @@ class Version20171022064541 extends AbstractMigration
$shortUrls->dropColumn('max_visits');
}
public function isTransactional(): bool
{
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
}
}

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
use Doctrine\Migrations\AbstractMigration;
@@ -39,4 +40,9 @@ final class Version20180801183328 extends AbstractMigration
{
$schema->getTable('short_urls')->getColumn('short_code')->setLength($size);
}
public function isTransactional(): bool
{
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
}
}

View File

@@ -4,7 +4,8 @@ declare(strict_types=1);
namespace ShlinkMigrations;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use PDO;
@@ -16,15 +17,13 @@ use Shlinkio\Shlink\Common\Util\IpAddress;
*/
final class Version20180913205455 extends AbstractMigration
{
/**
*/
public function up(Schema $schema): void
{
// Nothing to create
}
/**
* @throws DBALException
* @throws Exception
*/
public function postUp(Schema $schema): void
{
@@ -58,16 +57,19 @@ final class Version20180913205455 extends AbstractMigration
}
try {
return (string) IpAddress::fromString($addr)->getObfuscatedCopy();
} catch (InvalidArgumentException $e) {
return (string) IpAddress::fromString($addr)->getAnonymizedCopy();
} catch (InvalidArgumentException) {
return null;
}
}
/**
*/
public function down(Schema $schema): void
{
// Nothing to rollback
}
public function isTransactional(): bool
{
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
}
}

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
use Doctrine\Migrations\AbstractMigration;
@@ -47,4 +48,9 @@ final class Version20180915110857 extends AbstractMigration
{
// Nothing to run
}
public function isTransactional(): bool
{
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
}
}

View File

@@ -4,7 +4,8 @@ declare(strict_types=1);
namespace ShlinkMigrations;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
use Doctrine\DBAL\Schema\Table;
@@ -42,7 +43,7 @@ final class Version20181020060559 extends AbstractMigration
/**
* @throws SchemaException
* @throws DBALException
* @throws Exception
*/
public function postUp(Schema $schema): void
{
@@ -58,11 +59,16 @@ final class Version20181020060559 extends AbstractMigration
foreach (self::COLUMNS as $camelCaseName => $snakeCaseName) {
$qb->set($snakeCaseName, $camelCaseName);
}
$qb->execute();
$qb->executeStatement();
}
public function down(Schema $schema): void
{
// No down
}
public function isTransactional(): bool
{
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
}
}

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
use Doctrine\Migrations\AbstractMigration;
@@ -38,4 +39,9 @@ final class Version20181020065148 extends AbstractMigration
{
// No down
}
public function isTransactional(): bool
{
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
}
}

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
@@ -34,4 +35,9 @@ final class Version20181110175521 extends AbstractMigration
{
return $schema->getTable('visits')->getColumn('user_agent');
}
public function isTransactional(): bool
{
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
}
}

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
@@ -34,4 +35,9 @@ final class Version20190824075137 extends AbstractMigration
{
return $schema->getTable('visits')->getColumn('referer');
}
public function isTransactional(): bool
{
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
}
}

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace ShlinkMigrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaException;
use Doctrine\DBAL\Types\Types;
@@ -52,4 +53,9 @@ final class Version20190930165521 extends AbstractMigration
$schema->getTable('short_urls')->dropColumn('domain_id');
$schema->dropTable('domains');
}
public function isTransactional(): bool
{
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
}
}

Some files were not shown because too many files have changed in this diff Show More