Commit graph

172 commits

Author SHA1 Message Date
Jeremy Benoist 3c507d676f
Add build test on PHP 8.0 & 8.1
Add `isTransactional` to `WallabagMigration` because PHP 8 behave differently with PDO transaction.
This is a workaround because we can't upgrade Doctrine Migration for now (upper versions have the fix).

- Build is now using Composer v2 (instead of v1)
- All actions have been updated to latest version
- Fix bug in PHP 8 were `$entry->getTags()` can't be properly used as a _traversable_ by `assertContains` during tests. Added a custom method `Entry::getTagsLabel()` which return a flatted tag array with only label
- Replace `assertNotRegExp` by `assertDoesNotMatchRegularExpression` because it was deprecated
2022-01-31 12:59:39 +01:00
Nicolas Lœuillet ebb806496f Fixed timeout when assigning tags to entry
Fix #4998
2021-08-03 08:14:13 +02:00
Jeremy Benoist 381f9681b5
Fix CS 2021-01-18 10:38:56 +01:00
Kevin Decherf f39c5a2a70 Add new Helper to process Ignore Origin rules and RulerZ operator
This commits adds a new helper like RuleBasedTagger for processing
ignore origin rules. It also adds a new custom RulerZ operator for the
'~' pattern matching rule.

Renames 'pattern' with '_all' in IgnoreOriginRule entity.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2020-04-25 15:59:23 +02:00
Kevin Decherf c675bd11c6 Add IgnoreOriginRule-related entities, db migration, update config
Add IgnoreOriginUserRule for user-defined rules and
IgnoreOriginInstanceRule for system-wide rules. Add an interface for
these two new entities.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2020-04-25 15:59:23 +02:00
Kevin Decherf 8ee7b1603d Fix createdAt date range filter
- hiddenName has been disabled in order to fix the missing date range
  values when using the material theme
- data format has been changed to 'Y-m-d' in order to comply with the
  browser date input default format
- tests: date() and strtotime have been replaced with DateTime-related
  objects

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2020-03-22 17:01:39 +01:00
Simounet 416d44d0ae
Use lang attribute 2020-01-23 21:21:54 +01:00
Jeremy Benoist 8d4ed0df06
Update deps
Also CS (because cs-fixer got an update)

Package operations: 0 installs, 26 updates, 0 removals
  - Updating twig/twig (v2.12.1 => v2.12.2)
  - Updating symfony/symfony (v3.4.33 => v3.4.34)
  - Updating doctrine/event-manager (v1.0.0 => 1.1.0)
  - Updating doctrine/collections (v1.6.2 => 1.6.3)
  - Updating doctrine/cache (v1.8.1 => 1.9.0)
  - Updating doctrine/persistence (1.1.1 => 1.2.0)
  - Updating doctrine/inflector (v1.3.0 => 1.3.1)
  - Updating symfony/mime (v4.3.5 => v4.3.7)
  - Updating swiftmailer/swiftmailer (v6.2.1 => v6.2.3)
  - Updating symfony/swiftmailer-bundle (v3.3.0 => v3.3.1)
  - Updating doctrine/dbal (v2.9.2 => v2.9.3)
  - Updating doctrine/instantiator (1.2.0 => 1.3.0)
  - Updating j0k3r/graby-site-config (1.0.93 => 1.0.94)
  - Updating phpoption/phpoption (1.5.0 => 1.5.2)
  - Updating symfony/http-client-contracts (v1.1.7 => v1.1.8)
  - Updating symfony/http-client (v4.3.5 => v4.3.7)
  - Updating sensiolabs/security-checker (v6.0.2 => v6.0.3)
  - Updating paragonie/constant_time_encoding (v2.2.3 => v2.3.0)
  - Updating scheb/two-factor-bundle (v4.7.1 => v4.8.0)
  - Updating symfony/phpunit-bridge (v4.3.6 => v4.3.7)
  - Updating composer/xdebug-handler (1.3.3 => 1.4.0)
  - Updating friendsofphp/php-cs-fixer (v2.15.3 => v2.16.0)
  - Updating doctrine/data-fixtures (v1.3.2 => 1.3.3)
  - Updating nette/schema (v1.0.0 => v1.0.1)
  - Updating nikic/php-parser (v4.2.4 => v4.3.0)
  - Updating sentry/sentry (2.2.2 => 2.2.4)
2019-11-12 14:18:58 +01:00
Jeremy Benoist 1576905e03
Rename internal settings table
In fact it's not _just_ a rename.
We are now able to use our own entity with the CraueConfigBundle which allow us to enforce a custom length on string field and avoid error with utf8mb4 on MySQL.
To fix that issue before we were in need to fork CraueConfigBundle to hard apply these length changes.

The recent 2.3.0 release fix that issue. That's why we are in need to rename the table (getting rid of the bundle name from it)

Also updating deps:
  - Updating symfony/polyfill-mbstring (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-ctype (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-php70 (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-util (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-php56 (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-intl-icu (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-apcu (v1.11.0 => v1.12.0)
  - Updating j0k3r/graby-site-config (1.0.88 => 1.0.89)
  - Updating php-http/message (1.7.2 => 1.8.0)
  - Updating symfony/polyfill-php73 (v1.11.0 => v1.12.0)
  - Updating symfony/http-client (v4.3.2 => v4.3.3)
  - Updating symfony/polyfill-php72 (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-intl-idn (v1.11.0 => v1.12.0)
  - Updating symfony/mime (v4.3.2 => v4.3.3)
  - Updating craue/config-bundle (dev-utf8mb4 46cfd37 => 2.3.0)
  - Updating masterminds/html5 (2.6.0 => 2.7.0)
  - Updating nette/di (v3.0.0 => v3.0.1)
  - Updating symfony/polyfill-iconv (v1.11.0 => v1.12.0)
  - Updating wallabag/php-mobi (1.0.1 => 1.1.0)
2019-08-08 16:03:20 +02:00
Jeremy Benoist 0810c75e0b
Add tag_label & config_feed_token index 2019-08-08 09:36:03 +02:00
Olivier Mehani 2b0f4e86b2
Add user_created index
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-08-07 22:02:37 +10:00
Olivier Mehani 588de419e0
Add user_archived index
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-08-07 21:44:00 +10:00
Olivier Mehani 5071c8c9cf
Add index on starred entries
Fixes #4079

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-08-06 23:21:47 +10:00
Olivier Mehani d1dbe10e84
Update language in Entry model, and add index
Fixes #4080

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-08-06 23:21:18 +10:00
Jeremy Benoist 34be2d5de4
Add ability to import/export tagging rules
- Add missing translations
- Add some tests
- Add `/api/taggingrule/export` API endpoint
- Add baggy theme
- Add error message when importing tagging rules failed
- Also fix all translations (I think we are good now)
2019-07-08 09:38:32 +02:00
Jérémy Benoist c19845a7ae
Merge pull request #3959 from wallabag/mig-tag-collation
mysql: change collation of tag label
2019-06-06 12:03:37 +02:00
Jérémy Benoist 16e1c07553
Merge pull request #3271 from wallabag/store-resolved-url
Add `given_url` in Entry table to check if a redirected url has already added
2019-06-05 11:38:00 +02:00
Jeremy Benoist d8809f70ea
Typos 2019-06-05 10:54:43 +02:00
Jeremy Benoist 70df4c3359
Use two indexes instead of one for hashed urls
When using `OR` in a where clause, a composite index can't be used. We should use a `UNION` to take advantages of it.
Instead, create 2 indexes on each hashed urls and make 2 queries to find an url. It'll be faster than the previous solution.
2019-06-05 10:53:15 +02:00
Jeremy Benoist f3bfb875e9
Use hash given url to avoid duplicate
Using hashed url we can ensure an index on them to ensure it's fast.
2019-05-29 15:56:20 +02:00
Nicolas Lœuillet b7fa51ae7d
Added given_url in entry table
- Added index on entry table for given_url field
- Fix tests:

    The previous `bit.ly` url redirected to doc.wallabag but that url doesn't exist in the fixtures.
    I used our own internal "redirector" to create a redirect to an url which exist in the fixtures.

Also, updating current migration to use the new `WallabagMigration`.
2019-05-29 13:50:59 +02:00
Jeremy Benoist 52e8d93248
Fix some Scrutinizer issues 2019-05-29 12:50:44 +02:00
Olivier Mehani 4a5516376b
Add Wallabag\CoreBundle\Helper\UrlHasher
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-05-24 15:17:46 +02:00
Kevin Decherf feb239ea10 mysql: change collation of tag table
utf8mb4_unicode_ci considers that 'caché' is equal to 'cache' which
can lead to attaching incorrect tags to entries. This issue is due to
some unicode normalization done by MySQL.

utf8mb4_bin makes no unicode normalization, letting wallabag to consider
'cache' and 'caché' as two different tags.

We change the collation of the whole table as Doctrine does not support
setting a collation on a column for a specific platform (it tries to
apply utf8mb4_bin even for pgsql and sqlite).

Fixes #3302

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-05-19 23:37:49 +02:00
Jeremy Benoist f277bc042c
Fix tests & cs & migration 2019-04-26 12:53:21 +02:00
Thomas Citharel 531c8d0a5c
Changed RSS to Atom feed and improve paging 2019-04-25 13:46:31 +02:00
Jeremy Benoist 5cc0646e66
Fix index on MySQL 2019-04-01 15:45:17 +02:00
Jeremy Benoist 8a64566298
Use a better index for hashed_url
It'll most often be used in addition to the `user_id`.
Also, automatically generate the hash when saving the url.
Switch from `md5` to `sha1`.
2019-04-01 13:51:57 +02:00
Jeremy Benoist 9c2b2aae70
Keep url in exists endpoint
- Add migration
- Use md5 instead of sha512 (we don't need security here, just a hash)
- Update tests
2019-04-01 13:24:40 +02:00
Thomas Citharel bfe02a0b48
Hash the urls to check if they exist
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-04-01 13:24:40 +02:00
Jeremy Benoist 1e0d8ad7b7
Enable PHPStan
- Fix error for level 0 & 1 (level 7 has 699 errors...)
- Add `updated_at` to site_credential (so the `timestamps()` method applies correctly)
2019-01-18 15:25:50 +01:00
Jeremy Benoist 0f159f8fc1
Fix RulerZBundle
People should really follow semver and provide UPGRADE file when they
provide a library ...
2018-11-25 10:08:45 +01:00
Sébastien Viande 7975395d10
Entry: add archived_at property and updateArchived method 2018-09-21 10:33:33 +02:00
Kevin Decherf eae8138b33 Fix phpcs
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-11-19 15:26:13 +01:00
Kevin Decherf e0ef1a1c8b Add originUrl property to Entry, handle that in EntryRestController, handle migration
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-11-19 15:02:11 +01:00
Nicolas Lœuillet 88bac4a33e Changed reading_time field to prevent null values 2017-10-13 09:35:44 +02:00
Jérémy Benoist 3af5d41759 Merge pull request #3139 from Kdecherf/2502-tag-case
Ignore tag's case
2017-09-03 20:25:15 +02:00
Kevin Decherf 7036d91fe7 Tag: render tags case-insensitive by storing them in lowercase
Fixes #2502

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-08-27 16:51:23 +02:00
François D a991c46eed Set a starred_at field when an entry is starred.
This date is used to sort starred entries.

Can not use Entry::timestamps method otherwise starred_at will be updated each time entry is updated.
Add an updateStar method into Entry class
A migration script has been added in order to set starred_at field.
2017-08-25 21:19:47 +02:00
Jeremy Benoist 927c9e796f
Add EntityTimestampsTrait to handle dates
Refactorize timestamps() method to avoid re-writing it on each entity
2017-07-06 09:01:51 +02:00
Jérémy Benoist b5d7eb148c Merge pull request #3256 from wallabag/fix-patch
Fix PATCH method
2017-07-05 15:00:24 +02:00
Jeremy Benoist a05b61159e
Fix PATCH method
The PATCH method for the entry should only update what user sent to us and not the whole entry as it was before.
Also, sending tags when patching an entry will now remove all current tags & assocatied new ones.
2017-07-03 13:45:04 +02:00
Jeremy Benoist e50d7d31c0
CS 2017-07-03 13:40:47 +02:00
Jeremy Benoist f808b01692
Add a real configuration for CS-Fixer 2017-07-01 09:52:38 +02:00
Jérémy Benoist 80784b782b Merge pull request #2683 from wallabag/credentials-in-db
Store credentials in DB
2017-06-20 16:40:48 +02:00
Thomas Citharel bead8b42da
Fix reviews
Encrypt username too
Redirect to list after saving credentials
Fix typos

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2017-06-20 16:03:39 +02:00
Jeremy Benoist 906424c1b6
Crypt site credential password 2017-06-20 16:03:35 +02:00
Jeremy Benoist f92fcb53ca
Add CRUD for site credentials 2017-06-20 16:03:08 +02:00
Jeremy Benoist a9c6577f0c
Few fixes 2017-06-10 15:37:25 +02:00
Jeremy Benoist 1112e54772
Add public filter/field in the API
Listing entries can now be filtered by “public”.
Creating or patching an entry can now set is to public or remove the public.
Entry response now include “is_public” boolean field
2017-06-10 15:31:57 +02:00