forked from wallabag/wallabag
Compare commits
245 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cf9243151a | |||
| e9a837a0ac | |||
| abef36fd2b | |||
| 2f86dd9c73 | |||
| 3d22442f8c | |||
| c99a733aff | |||
| 85065b509f | |||
| ca879c36de | |||
| ffcc5c9062 | |||
| 78b0b55c40 | |||
| 94a6bc0dad | |||
| 383dcc5c45 | |||
| de5aa004cb | |||
| dca910e2a6 | |||
| bc491e3712 | |||
| 40d7ca11da | |||
| 89d38b23e0 | |||
| 7be1a4e1b2 | |||
| 4d890868ed | |||
| 1d0200c5b9 | |||
| 6a5e7dba89 | |||
| 6f23eba62d | |||
| d87237484c | |||
| 46ebbfc9a4 | |||
| 8ee95437a0 | |||
| ef5b43f55c | |||
| a465db607f | |||
| 985c7add1d | |||
| 3d9986d6fc | |||
| 4b7a6eaf39 | |||
| 3e8cc92dcd | |||
| 6172071a64 | |||
| cf3adbfaea | |||
| 24e6311c05 | |||
| 69b96fe179 | |||
| ffa2e68c5f | |||
| b338c68945 | |||
| f67486a6df | |||
| 33c72bb9fc | |||
| 78dc311c72 | |||
| 48226ad6e5 | |||
| f33d1f8e48 | |||
| 97810f7335 | |||
| 15230f488a | |||
| 89ca32e705 | |||
| a71d95e38a | |||
| fa2e1d933f | |||
| 181fe7e1e9 | |||
| 905d61eb49 | |||
| c78f2706c9 | |||
| dbbb5f3cfb | |||
| 33d22c149b | |||
| cc33fcb4ba | |||
| 24db3d6862 | |||
| c3d1f92278 | |||
| a9893d754f | |||
| f4fd8e4675 | |||
| 0ccbd653fa | |||
| 70452cfc3f | |||
| 826e310687 | |||
| b81054697b | |||
| ddd8754a11 | |||
| ac1c1ff571 | |||
| 815158fefa | |||
| e1928c78ff | |||
| 65915004e0 | |||
| 60cb8c0294 | |||
| f6e85e88af | |||
| a4b0a01b6d | |||
| 1bed15fd9b | |||
| 59860d9526 | |||
| 807d473564 | |||
| ed17e61db2 | |||
| 6159c92f27 | |||
| bf176121c4 | |||
| ec33ec14e5 | |||
| 2aa7e7e121 | |||
| 093003d9af | |||
| 58a0ca2622 | |||
| 1ba1ed23f1 | |||
| 7beb535b7a | |||
| 9870785d59 | |||
| 53a2874351 | |||
| bb6b9f9f05 | |||
| 526ef23e1a | |||
| 8d3d916d4a | |||
| e90daf0690 | |||
| 9729db75de | |||
| ced2ea4015 | |||
| 7d78e2ae06 | |||
| f43d8fa947 | |||
| f48f982025 | |||
| 667ea14d42 | |||
| e93fdca2d3 | |||
| fcf6d3c3f8 | |||
| c2bfc0f359 | |||
| 8281920f2c | |||
| d4913c50c2 | |||
| 19d3e878cf | |||
| c659a42c51 | |||
| cb411e8dcd | |||
| fec8a993d9 | |||
| 31542bc4b1 | |||
| 827dded754 | |||
| 39bcddfd8b | |||
| 8cfa1cd551 | |||
| 649e1e56a9 | |||
| c1ed66aad5 | |||
| 9beadfde59 | |||
| 090f873ffc | |||
| 1b7d756be0 | |||
| d6f63d5d51 | |||
| c1cba72a19 | |||
| e80a169435 | |||
| 911e0238b7 | |||
| 5fe5551972 | |||
| 90631abe46 | |||
| ce88e7aaab | |||
| a339fcd137 | |||
| f74571e750 | |||
| 0f44b2b75c | |||
| 382272c51c | |||
| 78cddcafd7 | |||
| 594770bdf4 | |||
| 2dcdb4e23c | |||
| 76617f0440 | |||
| 192fa3ea2e | |||
| 72eef910d9 | |||
| 8508b92f98 | |||
| 839a3ddbf2 | |||
| 3904543a96 | |||
| af7cd960dd | |||
| b58b6ca9f3 | |||
| 7098fd6193 | |||
| 070f5e1cf4 | |||
| 8e05fd0a3f | |||
| 931f665bc7 | |||
| 7615a29095 | |||
| 1a01323002 | |||
| 724fea0aea | |||
| 13a3a5596c | |||
| e2857a1ffe | |||
| 8c39d2aca1 | |||
| 8c82b42338 | |||
| 24a0ec60bf | |||
| fc95d812dd | |||
| 8b9fd04c74 | |||
| df56bfe94e | |||
| 11617ca7e1 | |||
| 90281b8786 | |||
| 91b47be5a9 | |||
| 8146b4180e | |||
| f1fb885ca6 | |||
| cf42b834d7 | |||
| b2b2627817 | |||
| 8c56a40d38 | |||
| 9484f3d2ce | |||
| d835f03f15 | |||
| 81403edb00 | |||
| c75d3e6961 | |||
| 2c1687ce91 | |||
| 5ca4df1585 | |||
| 241955a317 | |||
| 193953f75d | |||
| c535e291d5 | |||
| d9b4e0791d | |||
| edc2194ead | |||
| 3d36ccf8dd | |||
| 65b621da9e | |||
| 0e0de8578c | |||
| 2241d77304 | |||
| 54e3801cfe | |||
| 9cc23c615a | |||
| 80a3447d20 | |||
| e07b13fd38 | |||
| da3e9a2fb2 | |||
| 8b79bc654b | |||
| f8c834db0f | |||
| 0596633a29 | |||
| c8190c8a5a | |||
| f315552825 | |||
| a8ade4bb39 | |||
| 530fc289f2 | |||
| 21a8d427e7 | |||
| 1be3dc91b9 | |||
| 74f8acca3e | |||
| a4d2957c54 | |||
| 112c9e1b7c | |||
| 908e44f9b9 | |||
| b22a6feed2 | |||
| 13a7f1bc80 | |||
| 24887f4ad6 | |||
| 5b1230a909 | |||
| 31566fb6eb | |||
| 183c5248f3 | |||
| 738ff474a6 | |||
| 81022c3089 | |||
| 2486f42c09 | |||
| 4fc21d08f2 | |||
| 8814eaa03b | |||
| 303cdffe36 | |||
| 27b7ce9479 | |||
| 39bed07622 | |||
| cb1082904b | |||
| ee5de3b491 | |||
| 5acab2b264 | |||
| 4c797162bf | |||
| 0a6826cb4c | |||
| 49e81d8952 | |||
| 4af2abf0b7 | |||
| 84bbeed4f0 | |||
| 6639f7da6d | |||
| 131ef532c7 | |||
| dc02c679d2 | |||
| 0fff56ea68 | |||
| e9054bbd41 | |||
| 36c3a7d505 | |||
| 05c04cc509 | |||
| 2e3ca273c8 | |||
| bc8c7cd7ca | |||
| 513337c1fa | |||
| 103386c66a | |||
| 74848a4794 | |||
| 32c901f7cd | |||
| 1d9709db08 | |||
| 5905b0c12f | |||
| e776c9bc9d | |||
| 3a691e8ddd | |||
| dc36da99c0 | |||
| b05464ffd1 | |||
| 28d3a5655c | |||
| 696ee80de7 | |||
| 8bf4222bdb | |||
| f58c656a08 | |||
| 391f346cc3 | |||
| 6c3118951b | |||
| c833141942 | |||
| 4f162fff64 | |||
| 1413772bca | |||
| bf59e8aad3 | |||
| d33e3d64d2 | |||
| a6c78f0039 | |||
| 97fee36fa6 | |||
| fbccae8a79 | |||
| 13bd448e01 |
14
.github/CONTRIBUTING.md
vendored
14
.github/CONTRIBUTING.md
vendored
@ -45,3 +45,17 @@ Note : If you have large portions of text, use [Github's Gist service](https://g
|
||||
|
||||
## You want to fix a bug or to add a feature
|
||||
Please fork wallabag and work with **the master branch**.
|
||||
|
||||
## Run Tests and PHP formatter
|
||||
|
||||
All pull requests need to pass the tests and the code needs match the style guide.
|
||||
|
||||
To run the tests locally run:
|
||||
|
||||
- when testing using Docker: `docker-compose run --rm php make test`
|
||||
- otherwise: `make test`
|
||||
|
||||
To run the PHP formatter:
|
||||
|
||||
- when testing using Docker: `docker-compose run --rm php bin/php-cs-fixer fix`
|
||||
- otherwise: `php bin/php-cs-fixer fix`
|
||||
|
||||
3
.github/workflows/coding-standards.yml
vendored
3
.github/workflows/coding-standards.yml
vendored
@ -49,3 +49,6 @@ jobs:
|
||||
|
||||
- name: "Run TwigCS"
|
||||
run: "php bin/twigcs --severity=error --display=blocking --reporter checkstyle app/ src/ | cs2pr"
|
||||
|
||||
- name: "Run ergebnis/composer-normalize"
|
||||
run: "composer normalize --dry-run --no-check-lock"
|
||||
|
||||
71
.github/workflows/continuous-integration.yml
vendored
71
.github/workflows/continuous-integration.yml
vendored
@ -80,3 +80,74 @@ jobs:
|
||||
|
||||
- name: "Run PHPUnit"
|
||||
run: "php bin/simple-phpunit -v"
|
||||
|
||||
phpunit_no_prefix:
|
||||
name: "PHP ${{ matrix.php }} using ${{ matrix.database }} without prefix"
|
||||
runs-on: "ubuntu-20.04"
|
||||
services:
|
||||
rabbitmq:
|
||||
image: rabbitmq:3-alpine
|
||||
ports:
|
||||
- 5672:5672
|
||||
redis:
|
||||
image: redis:6-alpine
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
php:
|
||||
- "8.2"
|
||||
database:
|
||||
- "sqlite"
|
||||
- "mysql"
|
||||
- "pgsql"
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: "actions/checkout@v3"
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: "Install PHP"
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
php-version: "${{ matrix.php }}"
|
||||
coverage: none
|
||||
tools: pecl
|
||||
extensions: json, pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, curl, imagick, pgsql, gd, tidy
|
||||
ini-values: "date.timezone=Europe/Paris"
|
||||
|
||||
- name: "Remove database prefix"
|
||||
run: |
|
||||
pip install --user yq
|
||||
yq -Y --in-place '.parameters.database_table_prefix = ""' app/config/parameters.yml.dist
|
||||
|
||||
- name: "Setup MySQL"
|
||||
if: "${{ matrix.database == 'mysql' }}"
|
||||
run: |
|
||||
sudo systemctl start mysql.service
|
||||
sudo mysql -u root -proot -h 127.0.0.1 -e "CREATE DATABASE wallabag_test"
|
||||
|
||||
- name: "Setup PostgreSQL"
|
||||
if: "${{ matrix.database == 'pgsql' }}"
|
||||
run: |
|
||||
sudo systemctl start postgresql
|
||||
sudo -u postgres psql -d template1 -c "CREATE USER wallabag WITH PASSWORD 'wallabagrocks' CREATEDB"
|
||||
createdb -h localhost -p 5432 -U wallabag wallabag_test
|
||||
pg_isready -d wallabag_test -h localhost -p 5432 -U wallabag
|
||||
|
||||
- name: "Install dependencies with Composer"
|
||||
uses: "ramsey/composer-install@v2"
|
||||
with:
|
||||
composer-options: "--optimize-autoloader --prefer-dist"
|
||||
|
||||
- name: "Prepare database"
|
||||
run: "make prepare DB=${{ matrix.database }}"
|
||||
|
||||
- name: "Prepare fixtures"
|
||||
run: "make fixtures"
|
||||
|
||||
- name: "Run PHPUnit"
|
||||
run: "php bin/simple-phpunit -v"
|
||||
|
||||
@ -12,7 +12,7 @@ jobs:
|
||||
steps:
|
||||
- name: Dependabot metadata
|
||||
id: metadata
|
||||
uses: dependabot/fetch-metadata@v1.5.1
|
||||
uses: dependabot/fetch-metadata@v1.6.0
|
||||
with:
|
||||
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
- name: Approve and merge minor updates
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -15,6 +15,7 @@
|
||||
.php-cs-fixer.cache
|
||||
.phpunit.result.cache
|
||||
phpunit.xml
|
||||
docker-compose.override.yml
|
||||
|
||||
# Parameters
|
||||
/app/config/parameters.yml
|
||||
|
||||
61
CHANGELOG.md
61
CHANGELOG.md
@ -1,5 +1,66 @@
|
||||
# Changelog
|
||||
|
||||
## [2.6.4](https://github.com/wallabag/wallabag/tree/2.6.4)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.3...2.6.4)
|
||||
|
||||
### Fixes
|
||||
* Fix API token generation by @nicosomb https://github.com/wallabag/wallabag/pull/6869
|
||||
* Fix checkboxes which were broken by @nicosomb https://github.com/wallabag/wallabag/pull/6864
|
||||
|
||||
## [2.6.3](https://github.com/wallabag/wallabag/tree/2.6.3)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.2...2.6.3)
|
||||
|
||||
### Security fixes
|
||||
* Replace GET way to POST way to reset data user by @nicosomb https://github.com/wallabag/wallabag/commit/78b0b55c40511e1f22d5bbb4897aa10fca68441c
|
||||
* Replace GET way to POST way to delete API client by @nicosomb https://github.com/wallabag/wallabag/commit/ffcc5c9062fcc8cd922d7d6d65edbe5efae96806
|
||||
|
||||
### Improvement
|
||||
* Add confirmation before reload entry by @nicosomb https://github.com/wallabag/wallabag/pull/6778
|
||||
* Remove external dependencies on howto page by @viktoriussuwandi https://github.com/wallabag/wallabag/pull/6775
|
||||
|
||||
### Fixes
|
||||
* Use Session instead of Referrer for Redirection by @Spoons https://github.com/wallabag/wallabag/pull/6119
|
||||
* Reduce risk of collision for #content by @kdecherf https://github.com/wallabag/wallabag/pull/6829
|
||||
* Update dependencies to fix vulnerabilities by @nicosomb https://github.com/wallabag/wallabag/pull/6783
|
||||
* Fix failing randomly test by @nicosomb https://github.com/wallabag/wallabag/pull/6763
|
||||
|
||||
### Technical stuff
|
||||
* Add check if git is installed by @nicosomb https://github.com/wallabag/wallabag/pull/6788
|
||||
* Replace kernel.root_dir by kernel.project_dir by @yguedidi https://github.com/wallabag/wallabag/pull/6809
|
||||
* Split symfony/symfony by @yguedidi https://github.com/wallabag/wallabag/pull/6817
|
||||
* Make Crawler::extract get an array by @yguedidi https://github.com/wallabag/wallabag/pull/6812
|
||||
* Use PSR-17 and PSR-18 by @yguedidi https://github.com/wallabag/wallabag/pull/6816
|
||||
* Replace Client by KernelBrowser by @yguedidi https://github.com/wallabag/wallabag/pull/6813
|
||||
* Replace Debug component by ErrorHandler component by @yguedidi https://github.com/wallabag/wallabag/pull/6810
|
||||
* Make ImportController extends AbstractController by @yguedidi https://github.com/wallabag/wallabag/pull/6808
|
||||
* Use Twig instead of templating by @yguedidi https://github.com/wallabag/wallabag/pull/6797
|
||||
* Identify platforms by their class by @yguedidi https://github.com/wallabag/wallabag/pull/6799
|
||||
* Move from transchoice to trans by @yguedidi https://github.com/wallabag/wallabag/pull/6800
|
||||
* Replace GetResponseEvent by RequestEvent by @yguedidi https://github.com/wallabag/wallabag/pull/6811
|
||||
* Ensure the kernel is shut down before calling createClient by @yguedidi https://github.com/wallabag/wallabag/pull/6803
|
||||
* Ignore docker-compose.override.yml by @yguedidi https://github.com/wallabag/wallabag/pull/6814
|
||||
* Add composer normalizer by @nicosomb https://github.com/wallabag/wallabag/pull/6762
|
||||
|
||||
## [2.6.2](https://github.com/wallabag/wallabag/tree/2.6.2)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.1...2.6.2)
|
||||
|
||||
### Fixes
|
||||
* Fix mass action input on dark theme by @simounet https://github.com/wallabag/wallabag/pull/6673
|
||||
* Fix undefined variable by @nicosomb https://github.com/wallabag/wallabag/pull/6672
|
||||
* Fix table name in migration by @nicosomb https://github.com/wallabag/wallabag/pull/6653
|
||||
|
||||
### Technical stuff
|
||||
* Add a new build to test when no database table prefix are defined by @j0k3r https://github.com/wallabag/wallabag/pull/6731
|
||||
* Keep escaped table name while migrating by @Glandos https://github.com/wallabag/wallabag/pull/6710
|
||||
* Remove twofactor_auth parameter by @nicosomb https://github.com/wallabag/wallabag/pull/6723
|
||||
* ApiDoc: Add response description to UserRestController by @caspermeijn https://github.com/wallabag/wallabag/pull/6684
|
||||
* ApiDoc: Add response description to WallabagRestController by @caspermeijn https://github.com/wallabag/wallabag/pull/6102
|
||||
* Skip migration if the table was already renamed by @gramakri https://github.com/wallabag/wallabag/pull/6678
|
||||
|
||||
### Meta
|
||||
* Document how to run tests and formatter for new contributors by @caspermeijn https://github.com/wallabag/wallabag/pull/6685
|
||||
* Add link to wallabag ecosystem resources by @nicosomb https://github.com/wallabag/wallabag/pull/6700
|
||||
|
||||
## [2.6.1](https://github.com/wallabag/wallabag/tree/2.6.1)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.0...2.6.1)
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ ifdef DB
|
||||
endif
|
||||
-php bin/console doctrine:database:drop --force --env=test
|
||||
php bin/console doctrine:database:create --env=test
|
||||
php bin/console doctrine:migrations:migrate --no-interaction --env=test
|
||||
php bin/console doctrine:migrations:migrate --no-interaction --env=test -vv
|
||||
|
||||
fixtures: ## Load fixtures into database
|
||||
php bin/console doctrine:fixtures:load --no-interaction --env=test
|
||||
|
||||
@ -18,6 +18,7 @@ You can install it on your own server, or you can create an account on [wallabag
|
||||
* iOS app: [wallabag/ios-app](https://github.com/wallabag/ios-app)
|
||||
* Browser extension: [wallabag/wallabagger](https://github.com/wallabag/wallabagger)
|
||||
* GNOME (Linux) app: [read-it-later](https://gitlab.gnome.org/World/read-it-later) (not maintained by this project)
|
||||
* All resources about wallabag ecosystem are listed here: https://github.com/wallabag/wallabag/wiki/wallabag-ecosystem
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
@ -17,9 +17,8 @@ During this documentation, we assume the release is `$LAST_WALLABAG_RELEASE` (li
|
||||
#### Create a new release on GitHub
|
||||
|
||||
- [Create the new release on GitHub](https://github.com/wallabag/wallabag/releases/new) by targetting the `master` branch or any appropriate branch (for instance backports).
|
||||
- Update [website](https://github.com/wallabag/website) to change the redirect rule for `/latest-v2-package` & `/latest-v2`. They both should redirect to the asset of the GitHub release.
|
||||
- Update [website](https://github.com/wallabag/website) to change MD5 sum and create the release blog post (based on the changelog).
|
||||
- Update Dockerfile https://github.com/wallabag/docker (and create a new tag)
|
||||
- Update [website](https://github.com/wallabag/website) website (downloads, MD5 sum, releases and new blog post)
|
||||
- Put the next patch version suffixed with `-dev` in `app/config/wallabag.yml` (`wallabag_core.version`)
|
||||
- Drink a :beer:!
|
||||
|
||||
|
||||
@ -62,11 +62,6 @@ class AppKernel extends Kernel
|
||||
return $bundles;
|
||||
}
|
||||
|
||||
public function getRootDir()
|
||||
{
|
||||
return __DIR__;
|
||||
}
|
||||
|
||||
public function getCacheDir()
|
||||
{
|
||||
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
|
||||
@ -79,7 +74,7 @@ class AppKernel extends Kernel
|
||||
|
||||
public function registerContainerConfiguration(LoaderInterface $loader)
|
||||
{
|
||||
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
|
||||
$loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml');
|
||||
|
||||
$loader->load(function ($container) {
|
||||
if ($container->getParameter('use_webpack_dev_server')) {
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -14,8 +17,10 @@ class Version20160401000000 extends WallabagMigration
|
||||
{
|
||||
$this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$sql = <<<SQL
|
||||
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
|
||||
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
|
||||
@ -58,7 +63,7 @@ SQL
|
||||
}
|
||||
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$sql = <<<SQL
|
||||
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE {$this->getTable('entry')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
@ -91,7 +96,7 @@ SQL
|
||||
$this->addSql($query);
|
||||
}
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$sql = <<<SQL
|
||||
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
|
||||
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -15,7 +16,7 @@ class Version20160812120952 extends WallabagMigration
|
||||
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
||||
$this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.');
|
||||
|
||||
if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
// Can't use $clientsTable->addColumn('name', 'blob');
|
||||
// because of the error:
|
||||
// SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL
|
||||
@ -35,7 +36,7 @@ class Version20160812120952 extends WallabagMigration
|
||||
{
|
||||
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
||||
|
||||
if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
$databaseTablePrefix = $this->container->getParameter('database_table_prefix');
|
||||
$this->addSql('DROP INDEX IDX_635D765EA76ED395');
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients');
|
||||
|
||||
@ -3,6 +3,9 @@
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -13,11 +16,13 @@ class Version20161001072726 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
|
||||
// remove all FK from entry_tag
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'mysql':
|
||||
switch (true) {
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$query = $this->connection->query("
|
||||
SELECT CONSTRAINT_NAME
|
||||
FROM information_schema.key_column_usage
|
||||
@ -29,7 +34,7 @@ class Version20161001072726 extends WallabagMigration
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry_tag') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
||||
}
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
|
||||
$query = $this->connection->query("
|
||||
SELECT conrelid::regclass AS table_from
|
||||
@ -53,8 +58,8 @@ class Version20161001072726 extends WallabagMigration
|
||||
|
||||
// remove entry FK from annotation
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'mysql':
|
||||
switch (true) {
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$query = $this->connection->query("
|
||||
SELECT CONSTRAINT_NAME
|
||||
FROM information_schema.key_column_usage
|
||||
@ -68,7 +73,7 @@ class Version20161001072726 extends WallabagMigration
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
||||
}
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
|
||||
$query = $this->connection->query("
|
||||
SELECT conrelid::regclass AS table_from
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -12,7 +13,7 @@ class Version20161022134138 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||
|
||||
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;');
|
||||
|
||||
@ -40,7 +41,7 @@ class Version20161022134138 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||
|
||||
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;');
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -37,7 +38,7 @@ class Version20161024212538 extends WallabagMigration
|
||||
|
||||
$clientsTable->dropColumn('user_id', 'integer');
|
||||
|
||||
if ('sqlite' !== $this->connection->getDatabasePlatform()->getName()) {
|
||||
if (!$this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
$clientsTable->removeForeignKey($this->constraintName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -16,18 +19,20 @@ class Version20161214094402 extends WallabagMigration
|
||||
|
||||
$this->skipIf($entryTable->hasColumn('uid'), 'It seems that you already played this migration.');
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_entry AS SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM ' . $this->getTable('entry'));
|
||||
$this->addSql('DROP TABLE ' . $this->getTable('entry'));
|
||||
$this->addSql('CREATE TABLE ' . $this->getTable('entry') . ' (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid CLOB DEFAULT NULL COLLATE BINARY, title CLOB DEFAULT NULL COLLATE BINARY, url CLOB DEFAULT NULL COLLATE BINARY, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL COLLATE BINARY, language CLOB DEFAULT NULL COLLATE BINARY, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL COLLATE BINARY, preview_picture CLOB DEFAULT NULL COLLATE BINARY, is_public BOOLEAN DEFAULT "0", PRIMARY KEY(id));');
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('entry') . ' (id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public) SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM __temp__wallabag_entry;');
|
||||
$this->addSql('DROP TABLE __temp__wallabag_entry');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uuid uid VARCHAR(23)');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uuid TO uid');
|
||||
}
|
||||
}
|
||||
@ -38,14 +43,16 @@ class Version20161214094402 extends WallabagMigration
|
||||
|
||||
$this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.');
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
throw new SkipMigrationException('Too complex ...');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uid uuid VARCHAR(23)');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uid TO uuid');
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -25,7 +26,7 @@ class Version20170501115751 extends WallabagMigration
|
||||
$table->setPrimaryKey(['id']);
|
||||
$table->addForeignKeyConstraint($this->getTable('user'), ['user_id'], ['id'], [], 'fk_user');
|
||||
|
||||
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||
$schema->dropSequence('site_credential_id_seq');
|
||||
$schema->createSequence('site_credential_id_seq');
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -19,7 +20,7 @@ class Version20170510082609 extends WallabagMigration
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||
|
||||
foreach ($this->fields as $field) {
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(180) NOT NULL;');
|
||||
@ -28,7 +29,7 @@ class Version20170510082609 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||
|
||||
foreach ($this->fields as $field) {
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;');
|
||||
|
||||
@ -3,6 +3,9 @@
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -13,8 +16,10 @@ class Version20170511211659 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$annotationTableName = $this->getTable('annotation', true);
|
||||
$userTableName = $this->getTable('user', true);
|
||||
$entryTableName = $this->getTable('entry', true);
|
||||
@ -53,10 +58,10 @@ EOD
|
||||
);
|
||||
$this->addSql('DROP TABLE __temp__wallabag_annotation');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' MODIFY quote TEXT NOT NULL');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' ALTER COLUMN quote TYPE TEXT');
|
||||
break;
|
||||
}
|
||||
@ -66,14 +71,16 @@ EOD
|
||||
{
|
||||
$tableName = $this->getTable('annotation');
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
throw new SkipMigrationException('Too complex ...');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $tableName . ' MODIFY quote VARCHAR(255) NOT NULL');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $tableName . ' ALTER COLUMN quote TYPE VARCHAR(255)');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -13,6 +13,8 @@ class Version20170606155640 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf(!$schema->hasTable($this->getTable('craue_config_setting')), 'Table already renamed');
|
||||
|
||||
$apiUserRegistration = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -12,7 +13,7 @@ class Version20170719231144 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
$this->skipIf($this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
|
||||
// Find tags which need to be merged
|
||||
$dupTags = $this->connection->query('
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -12,14 +15,16 @@ class Version20171008195606 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'mysql':
|
||||
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time SET NOT NULL;');
|
||||
break;
|
||||
@ -28,13 +33,15 @@ class Version20171008195606 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'mysql':
|
||||
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11);');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time DROP NOT NULL;');
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -12,7 +13,7 @@ class Version20181128203230 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration can only be applied on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(191) NOT NULL');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(191)');
|
||||
@ -27,7 +28,7 @@ class Version20181128203230 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration can only be applied on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(255) NOT NULL');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(255)');
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -12,8 +15,10 @@ final class Version20181202073750 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
|
||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
|
||||
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
|
||||
@ -28,13 +33,13 @@ final class Version20181202073750 extends WallabagMigration
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $this->getTable('user', true) . ' (email_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $this->getTable('user', true) . ' (username_canonical)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE twoFactorAuthentication emailTwoFactor BOOLEAN NOT NULL');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD backupCodes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN twofactorauthentication TO emailTwoFactor');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
|
||||
@ -45,8 +50,10 @@ final class Version20181202073750 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
|
||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
|
||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
|
||||
@ -59,13 +66,13 @@ final class Version20181202073750 extends WallabagMigration
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "' . $this->getTable('user', true) . '" (email_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "' . $this->getTable('user', true) . '" (confirmation_token)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP googleAuthenticatorSecret');
|
||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` CHANGE emailtwofactor twoFactorAuthentication BOOLEAN NOT NULL');
|
||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` ADD trusted TEXT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP backupCodes');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP googleAuthenticatorSecret');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN emailTwoFactor TO twofactorauthentication');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD trusted TEXT DEFAULT NULL');
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -12,8 +15,10 @@ final class Version20190425115043 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM ' . $this->getTable('config', true));
|
||||
$this->addSql('DROP TABLE ' . $this->getTable('config', true));
|
||||
@ -22,11 +27,11 @@ final class Version20190425115043 extends WallabagMigration
|
||||
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON ' . $this->getTable('config', true) . ' (user_id)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_token feed_token VARCHAR(255) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_limit feed_limit INT DEFAULT NULL');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_token TO feed_token');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_limit TO feed_limit');
|
||||
break;
|
||||
@ -35,8 +40,10 @@ final class Version20190425115043 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, feed_token, feed_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM "' . $this->getTable('config', true) . '"');
|
||||
$this->addSql('DROP TABLE "' . $this->getTable('config', true) . '"');
|
||||
@ -45,11 +52,11 @@ final class Version20190425115043 extends WallabagMigration
|
||||
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "' . $this->getTable('config', true) . '" (user_id)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_token rss_token');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_limit rss_limit');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_token TO rss_token');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_limit TO rss_limit');
|
||||
break;
|
||||
|
||||
@ -3,6 +3,9 @@
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -17,8 +20,10 @@ final class Version20190510141130 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX IDX_368A4209A76ED395');
|
||||
$this->addSql('DROP INDEX IDX_368A420919EB6921');
|
||||
$this->addSql('DROP INDEX UNIQ_368A42095F37A13B');
|
||||
@ -60,7 +65,7 @@ final class Version20190510141130 extends WallabagMigration
|
||||
$this->addSql('CREATE INDEX IDX_EE52E3FAA76ED395 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (user_id)');
|
||||
$this->addSql('CREATE INDEX IDX_EE52E3FA19EB6921 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (client_id)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP FOREIGN KEY FK_368A4209A76ED395');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
|
||||
|
||||
@ -75,7 +80,7 @@ final class Version20190510141130 extends WallabagMigration
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' DROP FOREIGN KEY FK_EE52E3FAA76ED395');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP CONSTRAINT FK_368A4209A76ED395');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -14,7 +15,7 @@ final class Version20190511165128 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
|
||||
@ -22,7 +23,7 @@ final class Version20190511165128 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -14,7 +15,7 @@ final class Version20190619093534 extends WallabagMigration
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->skipIf('sqlite' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'sqlite\'.');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'sqlite\'.');
|
||||
|
||||
$this->addSql('UPDATE ' . $this->getTable('entry', true) . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
||||
|
||||
@ -42,7 +43,7 @@ final class Version20190619093534 extends WallabagMigration
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->skipIf('sqlite' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'sqlite\'.');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'sqlite\'.');
|
||||
|
||||
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
|
||||
$this->addSql('DROP INDEX created_at');
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -18,8 +21,10 @@ final class Version20190806130304 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX uid');
|
||||
$this->addSql('DROP INDEX created_at');
|
||||
$this->addSql('DROP INDEX hashed_url_user_id');
|
||||
@ -44,7 +49,7 @@ final class Version20190806130304 extends WallabagMigration
|
||||
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag', true) . ' (label)');
|
||||
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config', true) . ' (feed_token)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language VARCHAR(20) DEFAULT NULL');
|
||||
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
||||
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
||||
@ -53,7 +58,7 @@ final class Version20190806130304 extends WallabagMigration
|
||||
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag') . ' (label (255))');
|
||||
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config') . ' (feed_token (255))');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE VARCHAR(20)');
|
||||
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
||||
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
||||
@ -67,8 +72,10 @@ final class Version20190806130304 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
|
||||
$this->addSql('DROP INDEX created_at');
|
||||
$this->addSql('DROP INDEX uid');
|
||||
@ -93,7 +100,7 @@ final class Version20190806130304 extends WallabagMigration
|
||||
$this->addSql('CREATE INDEX hashed_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_url)');
|
||||
$this->addSql('CREATE INDEX hashed_given_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_given_url)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language LONGTEXT DEFAULT NULL');
|
||||
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
||||
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
||||
@ -102,7 +109,7 @@ final class Version20190806130304 extends WallabagMigration
|
||||
$this->addSql('DROP INDEX tag_label ON ' . $this->getTable('tag'));
|
||||
$this->addSql('DROP INDEX config_feed_token ON ' . $this->getTable('config'));
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE TEXT');
|
||||
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
||||
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -12,14 +15,16 @@ final class Version20190808124957 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting', true) . ' RENAME TO ' . $this->getTable('internal_setting', true));
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME ' . $this->getTable('internal_setting'));
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME TO ' . $this->getTable('internal_setting'));
|
||||
break;
|
||||
}
|
||||
@ -27,14 +32,16 @@ final class Version20190808124957 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting', true) . ' RENAME TO ' . $this->getTable('craue_config_setting', true));
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME ' . $this->getTable('craue_config_setting'));
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME TO ' . $this->getTable('craue_config_setting'));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -23,7 +24,7 @@ final class Version20190826204730 extends WallabagMigration
|
||||
$userTable->setPrimaryKey(['id']);
|
||||
$userTable->addForeignKeyConstraint($this->getTable('config'), ['config_id'], ['id'], [], 'fk_config');
|
||||
|
||||
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||
$schema->dropSequence('ignore_origin_user_rule_id_seq');
|
||||
$schema->createSequence('ignore_origin_user_rule_id_seq');
|
||||
}
|
||||
@ -35,7 +36,7 @@ final class Version20190826204730 extends WallabagMigration
|
||||
$instanceTable->addColumn('rule', 'string', ['length' => 255]);
|
||||
$instanceTable->setPrimaryKey(['id']);
|
||||
|
||||
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||
$schema->dropSequence('ignore_origin_instance_rule_id_seq');
|
||||
$schema->createSequence('ignore_origin_instance_rule_id_seq');
|
||||
}
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
@ -12,48 +15,54 @@ final class Version20221221092957 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM wallabag_user');
|
||||
$this->addSql('DROP TABLE wallabag_user');
|
||||
$this->addSql('CREATE TABLE "wallabag_user" (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
||||
$userTable = $this->getTable('user');
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM ' . $userTable);
|
||||
$this->addSql('DROP TABLE ' . $userTable);
|
||||
$this->addSql('CREATE TABLE ' . $userTable . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
||||
, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, googleAuthenticatorSecret VARCHAR(255) DEFAULT NULL, backupCodes CLOB DEFAULT NULL --(DC2Type:json)
|
||||
, emailTwoFactor BOOLEAN NOT NULL)');
|
||||
$this->addSql('INSERT INTO wallabag_user (id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes) SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM __temp__wallabag_user');
|
||||
$this->addSql('INSERT INTO ' . $userTable . ' (id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes) SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM __temp__wallabag_user');
|
||||
$this->addSql('DROP TABLE __temp__wallabag_user');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON wallabag_user (username_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON wallabag_user (email_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON wallabag_user (confirmation_token)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $userTable . ' (username_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $userTable . ' (email_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON ' . $userTable . ' (confirmation_token)');
|
||||
break;
|
||||
case 'mysql':
|
||||
$this->addSql('ALTER TABLE wallabag_user CHANGE backupCodes backupCodes JSON DEFAULT NULL');
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL');
|
||||
break;
|
||||
case 'postgresql':
|
||||
$this->addSql('ALTER TABLE wallabag_user ALTER backupcodes TYPE JSON USING backupcodes::json');
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupcodes TYPE JSON USING backupcodes::json');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM "wallabag_user"');
|
||||
$this->addSql('DROP TABLE "wallabag_user"');
|
||||
$this->addSql('CREATE TABLE "wallabag_user" (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
||||
$userTable = $this->getTable('user');
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM ' . $userTable);
|
||||
$this->addSql('DROP TABLE ' . $userTable);
|
||||
$this->addSql('CREATE TABLE ' . $userTable . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
||||
, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, googleAuthenticatorSecret VARCHAR(255) DEFAULT NULL, backupCodes CLOB DEFAULT NULL --(DC2Type:json_array)
|
||||
, emailTwoFactor BOOLEAN NOT NULL)');
|
||||
$this->addSql('INSERT INTO "wallabag_user" (id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor) SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM __temp__wallabag_user');
|
||||
$this->addSql('INSERT INTO ' . $userTable . ' (id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor) SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM __temp__wallabag_user');
|
||||
$this->addSql('DROP TABLE __temp__wallabag_user');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON "wallabag_user" (username_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "wallabag_user" (email_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "wallabag_user" (confirmation_token)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $userTable . ' (username_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $userTable . ' (email_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON ' . $userTable . ' (confirmation_token)');
|
||||
break;
|
||||
case 'mysql':
|
||||
$this->addSql('ALTER TABLE `wallabag_user`CHANGE backupCodes backupCodes JSON DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
||||
break;
|
||||
case 'postgresql':
|
||||
$this->addSql('ALTER TABLE "wallabag_user" ALTER backupCodes TYPE TEXT');
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupCodes TYPE TEXT');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
========================================================================== */
|
||||
|
||||
main {
|
||||
#content {
|
||||
div#content {
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,6 +52,7 @@
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
opacity: initial;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.toggle-checkbox:not(:checked) + .mass-action,
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
@media screen and (min-width: 993px) {
|
||||
.entry #content {
|
||||
.entry main div#content {
|
||||
padding-left: 70px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,10 @@ div.settings div.file-field {
|
||||
}
|
||||
}
|
||||
|
||||
.input-field label {
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
|
||||
.input-field label.active {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
@ -23,8 +23,6 @@ framework:
|
||||
csrf_protection: ~
|
||||
validation:
|
||||
enable_annotations: true
|
||||
templating:
|
||||
engines: ['twig']
|
||||
default_locale: "%locale%"
|
||||
trusted_hosts: ~
|
||||
session:
|
||||
@ -43,7 +41,6 @@ twig:
|
||||
strict_variables: "%kernel.debug%"
|
||||
form_themes:
|
||||
- "@LexikFormFilter/Form/form_div_layout.html.twig"
|
||||
exception_controller: Wallabag\CoreBundle\Controller\ExceptionController:showAction
|
||||
globals:
|
||||
registration_enabled: '%fosuser_registration%'
|
||||
|
||||
@ -201,15 +198,15 @@ scheb_two_factor:
|
||||
lifetime: 2592000
|
||||
|
||||
backup_codes:
|
||||
enabled: "%twofactor_auth%"
|
||||
enabled: true
|
||||
|
||||
google:
|
||||
enabled: "%twofactor_auth%"
|
||||
enabled: true
|
||||
issuer: "%server_name%"
|
||||
template: "@WallabagUser/Authentication/form.html.twig"
|
||||
|
||||
email:
|
||||
enabled: "%twofactor_auth%"
|
||||
enabled: true
|
||||
sender_email: "%twofactor_sender%"
|
||||
digits: 6
|
||||
template: "@WallabagUser/Authentication/form.html.twig"
|
||||
|
||||
@ -34,7 +34,6 @@ parameters:
|
||||
secret: CHANGE_ME_TO_SOMETHING_SECRET_AND_RANDOM
|
||||
|
||||
# two factor stuff
|
||||
twofactor_auth: true
|
||||
twofactor_sender: no-reply@wallabag.org
|
||||
|
||||
# fosuser stuff
|
||||
|
||||
@ -12,7 +12,7 @@ services:
|
||||
autoconfigure: true
|
||||
public: true
|
||||
bind:
|
||||
$rootDir: '%kernel.root_dir%'
|
||||
$projectDir: '%kernel.project_dir%'
|
||||
$debug: '%kernel.debug%'
|
||||
$defaultLocale: '%kernel.default_locale%'
|
||||
$wallabagUrl: '%domain_name%'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
wallabag_core:
|
||||
version: 2.6.1
|
||||
version: 2.6.4
|
||||
paypal_url: "https://liberapay.com/wallabag/donate"
|
||||
languages:
|
||||
en: 'English'
|
||||
|
||||
@ -2,16 +2,16 @@ const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const StyleLintPlugin = require('stylelint-webpack-plugin');
|
||||
|
||||
const rootDir = path.resolve(__dirname, '../../../');
|
||||
const projectDir = path.resolve(__dirname, '../../../');
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
material: path.join(rootDir, './app/Resources/static/themes/material/index.js'),
|
||||
public: path.join(rootDir, './app/Resources/static/themes/_global/share.js'),
|
||||
material: path.join(projectDir, './app/Resources/static/themes/material/index.js'),
|
||||
public: path.join(projectDir, './app/Resources/static/themes/_global/share.js'),
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(rootDir, 'web/wallassets'),
|
||||
path: path.resolve(projectDir, 'web/wallassets'),
|
||||
publicPath: '',
|
||||
},
|
||||
plugins: [
|
||||
@ -31,7 +31,7 @@ module.exports = {
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
jquery: path.join(rootDir, 'node_modules/jquery/dist/jquery.js'),
|
||||
jquery: path.join(projectDir, 'node_modules/jquery/dist/jquery.js'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\Debug\Debug;
|
||||
use Symfony\Component\ErrorHandler\Debug;
|
||||
|
||||
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
|
||||
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
|
||||
|
||||
112
composer.json
112
composer.json
@ -1,33 +1,38 @@
|
||||
{
|
||||
"name": "wallabag/wallabag",
|
||||
"type": "project",
|
||||
"description": "open source self hostable read-it-later web application",
|
||||
"license": "MIT",
|
||||
"type": "project",
|
||||
"keywords": [
|
||||
"poche",
|
||||
"wallabag",
|
||||
"read-it-later",
|
||||
"read it later"
|
||||
],
|
||||
"homepage": "https://github.com/wallabag/wallabag",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Lœuillet",
|
||||
"email": "nicolas@loeuillet.org",
|
||||
"homepage": "http://www.cdetc.fr",
|
||||
"homepage": "https://nicolas.loeuillet.org",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Thomas Citharel",
|
||||
"homepage": "http://tcit.fr",
|
||||
"homepage": "https://tcit.fr",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Jérémy Benoist",
|
||||
"homepage": "https://www.j0k3r.net",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Kevin Decherf",
|
||||
"homepage": "https://kdecherf.com/",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"homepage": "https://github.com/wallabag/wallabag",
|
||||
"support": {
|
||||
"email": "hello@wallabag.org",
|
||||
"issues": "https://github.com/wallabag/wallabag/issues"
|
||||
@ -81,7 +86,6 @@
|
||||
"kphoen/rulerz": "^0.21",
|
||||
"kphoen/rulerz-bundle": "~0.13",
|
||||
"laminas/laminas-code": "^4.7",
|
||||
"laminas/laminas-diactoros": "^2.3",
|
||||
"lcobucci/jwt": "~4.1.5",
|
||||
"lexik/form-filter-bundle": "^7.0",
|
||||
"mgargano/simplehtmldom": "~1.5",
|
||||
@ -111,13 +115,34 @@
|
||||
"scheb/2fa-qr-code": "^5.13",
|
||||
"scheb/2fa-trusted-device": "^5.13",
|
||||
"sensio/framework-extra-bundle": "^6.2",
|
||||
"sentry/sentry-symfony": "4.9.2",
|
||||
"sentry/sentry-symfony": "4.10.0",
|
||||
"stof/doctrine-extensions-bundle": "^1.2",
|
||||
"symfony/dom-crawler": "^4.0",
|
||||
"symfony/mailer": "^4.0",
|
||||
"symfony/asset": "^4.4",
|
||||
"symfony/config": "^4.4",
|
||||
"symfony/console": "^4.4",
|
||||
"symfony/debug": "^4.4",
|
||||
"symfony/dependency-injection": "^4.4",
|
||||
"symfony/doctrine-bridge": "^4.4",
|
||||
"symfony/dom-crawler": "^4.4",
|
||||
"symfony/error-handler": "^4.4",
|
||||
"symfony/event-dispatcher": "^4.4",
|
||||
"symfony/finder": "^4.4",
|
||||
"symfony/form": "^4.4",
|
||||
"symfony/framework-bundle": "^4.4",
|
||||
"symfony/http-foundation": "^4.4",
|
||||
"symfony/http-kernel": "^4.4",
|
||||
"symfony/mailer": "^4.4",
|
||||
"symfony/mime": "^4.4",
|
||||
"symfony/monolog-bundle": "^3.1",
|
||||
"symfony/options-resolver": "^4.4",
|
||||
"symfony/proxy-manager-bridge": "^4.4",
|
||||
"symfony/symfony": "^4.0",
|
||||
"symfony/routing": "^4.4",
|
||||
"symfony/security-bundle": "^4.4",
|
||||
"symfony/security-core": "^4.4",
|
||||
"symfony/security-http": "^4.4",
|
||||
"symfony/templating": "^4.4",
|
||||
"symfony/twig-bundle": "^4.4",
|
||||
"symfony/validator": "^4.4",
|
||||
"tecnickcom/tcpdf": "^6.3.0",
|
||||
"twig/extra-bundle": "^3.4",
|
||||
"twig/string-extra": "^3.4",
|
||||
@ -130,6 +155,7 @@
|
||||
"require-dev": {
|
||||
"dama/doctrine-test-bundle": "^7.1",
|
||||
"doctrine/doctrine-fixtures-bundle": "~3.0",
|
||||
"ergebnis/composer-normalize": "^2.28",
|
||||
"friendsofphp/php-cs-fixer": "~3.4",
|
||||
"friendsoftwig/twigcs": "^6.0",
|
||||
"m6web/redis-mock": "^5.0",
|
||||
@ -139,31 +165,20 @@
|
||||
"phpstan/phpstan-doctrine": "^1.3",
|
||||
"phpstan/phpstan-phpunit": "^1.1",
|
||||
"phpstan/phpstan-symfony": "^1.2",
|
||||
"symfony/browser-kit": "^4.4",
|
||||
"symfony/css-selector": "^4.4",
|
||||
"symfony/debug-bundle": "^4.4",
|
||||
"symfony/maker-bundle": "^1.18",
|
||||
"symfony/phpunit-bridge": "~6.0"
|
||||
"symfony/phpunit-bridge": "~6.0",
|
||||
"symfony/var-dumper": "^4.4",
|
||||
"symfony/web-profiler-bundle": "^4.4",
|
||||
"symfony/web-server-bundle": "^4.4"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-imagick": "To keep GIF animation when downloading image is enabled"
|
||||
},
|
||||
"scripts": {
|
||||
"post-cmd": [
|
||||
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
|
||||
"bin/console cache:clear --no-warmup",
|
||||
"bin/console assets:install web --symlink --relative"
|
||||
],
|
||||
"post-install-cmd": [
|
||||
"@post-cmd"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@post-cmd"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"incenteev-parameters": {
|
||||
"file": "app/config/parameters.yml"
|
||||
},
|
||||
"public-dir": "web"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Wallabag\\": "src/Wallabag/"
|
||||
@ -176,22 +191,37 @@
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Tests\\": "tests/"
|
||||
},
|
||||
"files": [
|
||||
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
|
||||
]
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"phpstan/extension-installer": true,
|
||||
"php-http/discovery": true,
|
||||
"ergebnis/composer-normalize": true
|
||||
},
|
||||
"bin-dir": "bin",
|
||||
"platform": {
|
||||
"php": "7.4.29"
|
||||
},
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"phpstan/extension-installer": true,
|
||||
"php-http/discovery": true
|
||||
}
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
"extra": {
|
||||
"incenteev-parameters": {
|
||||
"file": "app/config/parameters.yml"
|
||||
},
|
||||
"public-dir": "web"
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": [
|
||||
"@post-cmd"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@post-cmd"
|
||||
],
|
||||
"post-cmd": [
|
||||
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
|
||||
"bin/console cache:clear --no-warmup",
|
||||
"bin/console assets:install web --symlink --relative"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
5505
composer.lock
generated
5505
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
FROM php:7.4-fpm AS rootless
|
||||
FROM php:8.1-fpm AS rootless
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG NODE_VERSION=16
|
||||
@ -33,7 +33,8 @@ RUN apt-get update && apt-get install -y \
|
||||
zlib1g-dev \
|
||||
git \
|
||||
build-essential \
|
||||
nodejs
|
||||
nodejs \
|
||||
npm
|
||||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
|
||||
RUN docker-php-ext-install -j "$(nproc)" \
|
||||
bcmath \
|
||||
|
||||
@ -6,7 +6,7 @@ parameters:
|
||||
database_name: ${DATABASE_NAME:-symfony}
|
||||
database_user: ${DATABASE_USER:-root}
|
||||
database_password: ${DATABASE_PASSWORD:-~}
|
||||
database_path: '${DATABASE_PATH:-"%kernel.root_dir%/data/db/wallabag.sqlite"}'
|
||||
database_path: '${DATABASE_PATH:-"%kernel.project_dir%/data/db/wallabag.sqlite"}'
|
||||
database_table_prefix: ${DATABASE_TABLE_PREFIX:-wallabag_}
|
||||
database_socket: null
|
||||
database_charset: ${DATABASE_CHARSET:-utf8}
|
||||
@ -22,7 +22,6 @@ parameters:
|
||||
secret: ${SECRET:-~}
|
||||
|
||||
# two factor stuff
|
||||
twofactor_auth: ${TWOFACTOR_AUTH:-true}
|
||||
twofactor_sender: ${TWOFACTOR_SENDER:-no-reply@wallabag.org}
|
||||
|
||||
# fosuser stuff
|
||||
|
||||
45
package.json
45
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wallabag",
|
||||
"version": "2.5.0",
|
||||
"version": "2.6.0",
|
||||
"description": "wallabag is a self hostable application for saving web pages",
|
||||
"private": true,
|
||||
"directories": {
|
||||
@ -17,17 +17,22 @@
|
||||
{
|
||||
"name": "Nicolas Lœuillet",
|
||||
"email": "nicolas@loeuillet.org",
|
||||
"homepage": "http://www.cdetc.fr",
|
||||
"homepage": "https://nicolas.loeuillet.org",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Thomas Citharel",
|
||||
"homepage": "http://tcit.fr",
|
||||
"homepage": "https://tcit.fr",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Jérémy Benoist",
|
||||
"homepage": "http://www.j0k3r.net",
|
||||
"homepage": "https://www.j0k3r.net",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Kevin Decherf",
|
||||
"homepage": "https://kdecherf.com/",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
@ -36,34 +41,34 @@
|
||||
"url": "https://github.com/wallabag/wallabag/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.22.5",
|
||||
"@babel/eslint-parser": "^7.22.5",
|
||||
"@babel/preset-env": "^7.22.5",
|
||||
"autoprefixer": "^10.4.14",
|
||||
"babel-loader": "^9.1.2",
|
||||
"@babel/core": "^7.22.10",
|
||||
"@babel/eslint-parser": "^7.22.10",
|
||||
"@babel/preset-env": "^7.22.10",
|
||||
"autoprefixer": "^10.4.15",
|
||||
"babel-loader": "^9.1.3",
|
||||
"css-loader": "^6.8.1",
|
||||
"eslint": "^8.43.0",
|
||||
"eslint": "^8.47.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-import": "^2.28.1",
|
||||
"eslint-webpack-plugin": "^4.0.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"lato-font": "^3.0.0",
|
||||
"mini-css-extract-plugin": "^2.7.6",
|
||||
"node-sass": "^9.0.0",
|
||||
"postcss": "^8.4.24",
|
||||
"postcss": "^8.4.28",
|
||||
"postcss-loader": "^7.3.3",
|
||||
"postcss-scss": "^4.0.6",
|
||||
"sass": "^1.63.4",
|
||||
"postcss-scss": "^4.0.7",
|
||||
"sass": "^1.66.1",
|
||||
"sass-loader": "^13.3.2",
|
||||
"style-loader": "^3.3.3",
|
||||
"stylelint": "^15.8.0",
|
||||
"stylelint-config-standard": "^33.0.0",
|
||||
"stylelint-config-standard-scss": "^9.0.0",
|
||||
"stylelint-scss": "^5.0.1",
|
||||
"stylelint": "^15.10.3",
|
||||
"stylelint-config-standard": "^34.0.0",
|
||||
"stylelint-config-standard-scss": "^10.0.0",
|
||||
"stylelint-scss": "^5.1.0",
|
||||
"stylelint-webpack-plugin": "^4.1.1",
|
||||
"terser-webpack-plugin": "^5.3.9",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.87.0",
|
||||
"webpack": "^5.88.2",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^4.15.1",
|
||||
"webpack-manifest-plugin": "^5.0.0",
|
||||
@ -79,7 +84,7 @@
|
||||
"jquery.cookie": "^1.4.1",
|
||||
"jr-qrcode": "^1.0.7",
|
||||
"material-design-icons-iconfont": "^6.7.0",
|
||||
"materialize-css": "^0.98.1",
|
||||
"materialize-css": "^0.100.2",
|
||||
"mathjax": "^3.2.2",
|
||||
"mousetrap": "^1.6.0",
|
||||
"ptsans-npm-webfont": "^0.0.4",
|
||||
|
||||
@ -7,3 +7,9 @@ if [ ! -f composer.phar ]; then
|
||||
else
|
||||
COMPOSER_COMMAND='./composer.phar'
|
||||
fi
|
||||
|
||||
# Check for git
|
||||
command -v git >/dev/null 2>&1 ||
|
||||
{ echo >&2 "git is not installed. We can't install wallabag";
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -7,7 +7,9 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||
use Wallabag\CoreBundle\DataFixtures\EntryFixtures;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
@ -16,8 +18,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
||||
*/
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
$annotation1 = new Annotation($this->getReference('admin-user'));
|
||||
$annotation1->setEntry($this->getReference('entry1'));
|
||||
$annotation1 = new Annotation($this->getReference('admin-user', User::class));
|
||||
$annotation1->setEntry($this->getReference('entry1', Entry::class));
|
||||
$annotation1->setText('This is my annotation /o/');
|
||||
$annotation1->setQuote('content');
|
||||
|
||||
@ -25,8 +27,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
||||
|
||||
$this->addReference('annotation1', $annotation1);
|
||||
|
||||
$annotation2 = new Annotation($this->getReference('admin-user'));
|
||||
$annotation2->setEntry($this->getReference('entry2'));
|
||||
$annotation2 = new Annotation($this->getReference('admin-user', User::class));
|
||||
$annotation2->setEntry($this->getReference('entry2', Entry::class));
|
||||
$annotation2->setText('This is my 2nd annotation /o/');
|
||||
$annotation2->setQuote('content');
|
||||
|
||||
@ -34,8 +36,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
||||
|
||||
$this->addReference('annotation2', $annotation2);
|
||||
|
||||
$annotation3 = new Annotation($this->getReference('bob-user'));
|
||||
$annotation3->setEntry($this->getReference('entry3'));
|
||||
$annotation3 = new Annotation($this->getReference('bob-user', User::class));
|
||||
$annotation3->setEntry($this->getReference('entry3', Entry::class));
|
||||
$annotation3->setText('This is my first annotation !');
|
||||
$annotation3->setQuote('content');
|
||||
|
||||
|
||||
@ -69,12 +69,16 @@ class DeveloperController extends AbstractController
|
||||
/**
|
||||
* Remove a client.
|
||||
*
|
||||
* @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client")
|
||||
* @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client", methods={"POST"})
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function deleteClientAction(Client $client, EntityManagerInterface $entityManager, TranslatorInterface $translator)
|
||||
public function deleteClientAction(Request $request, Client $client, EntityManagerInterface $entityManager, TranslatorInterface $translator)
|
||||
{
|
||||
if (!$this->isCsrfTokenValid('delete-client', $request->request->get('token'))) {
|
||||
throw $this->createAccessDeniedException('Bad CSRF token.');
|
||||
}
|
||||
|
||||
if (null === $this->getUser() || $client->getUser()->getId() !== $this->getUser()->getId()) {
|
||||
throw $this->createAccessDeniedException('You can not access this client.');
|
||||
}
|
||||
@ -99,6 +103,9 @@ class DeveloperController extends AbstractController
|
||||
*/
|
||||
public function howtoFirstAppAction()
|
||||
{
|
||||
return $this->render('@WallabagCore/Developer/howto_app.html.twig');
|
||||
return $this->render('@WallabagCore/Developer/howto_app.html.twig',
|
||||
[
|
||||
'wallabag_url' => $this->getParameter('domain_name'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ use FOS\UserBundle\Event\UserEvent;
|
||||
use FOS\UserBundle\FOSUserEvents;
|
||||
use FOS\UserBundle\Model\UserManagerInterface;
|
||||
use JMS\Serializer\SerializationContext;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
@ -28,7 +29,8 @@ class UserRestController extends WallabagRestController
|
||||
* summary="Retrieve current logged in user informations.",
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* description="Returned when successful",
|
||||
* @Model(type=User::class, groups={"user_api"}))
|
||||
* )
|
||||
* )
|
||||
*
|
||||
@ -52,32 +54,45 @@ class UserRestController extends WallabagRestController
|
||||
* @OA\RequestBody(
|
||||
* @OA\JsonContent(
|
||||
* type="object",
|
||||
* required={"username", "password", "email", "client_name"},
|
||||
* required={"username", "password", "email"},
|
||||
* @OA\Property(
|
||||
* property="username",
|
||||
* description="The user's username",
|
||||
* @OA\Schema(type="string")
|
||||
* type="string",
|
||||
* example="wallabag",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="password",
|
||||
* description="The user's password",
|
||||
* @OA\Schema(type="string")
|
||||
* type="string",
|
||||
* example="hidden_value",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="email",
|
||||
* description="The user's email",
|
||||
* @OA\Schema(type="string")
|
||||
* type="string",
|
||||
* example="wallabag@wallabag.io",
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="client_name",
|
||||
* description="The client name (to be used by your app)",
|
||||
* @OA\Schema(type="string")
|
||||
* type="string",
|
||||
* example="Fancy App",
|
||||
* ),
|
||||
* )
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* response="201",
|
||||
* description="Returned when successful",
|
||||
* @Model(type=User::class, groups={"user_api_with_client"})),
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response="403",
|
||||
* description="Server doesn't allow registrations"
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response="400",
|
||||
* description="Request is incorrectly formatted"
|
||||
* )
|
||||
* )
|
||||
*
|
||||
|
||||
@ -7,6 +7,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
use FOS\RestBundle\Controller\AbstractFOSRestController;
|
||||
use JMS\Serializer\SerializationContext;
|
||||
use JMS\Serializer\SerializerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
@ -15,6 +16,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ApiBundle\Entity\ApplicationInfo;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class WallabagRestController extends AbstractFOSRestController
|
||||
@ -38,11 +40,16 @@ class WallabagRestController extends AbstractFOSRestController
|
||||
* Retrieve version number.
|
||||
*
|
||||
* @Operation(
|
||||
* tags={"Informations"},
|
||||
* tags={"Information"},
|
||||
* summary="Retrieve version number.",
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* description="Returned when successful",
|
||||
* @OA\JsonContent(
|
||||
* description="Version number of the application.",
|
||||
* type="string",
|
||||
* example="2.5.2",
|
||||
* )
|
||||
* )
|
||||
* )
|
||||
*
|
||||
@ -61,14 +68,13 @@ class WallabagRestController extends AbstractFOSRestController
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve information about the wallabag instance.
|
||||
*
|
||||
* @Operation(
|
||||
* tags={"Informations"},
|
||||
* summary="Retrieve information about the wallabag instance.",
|
||||
* tags={"Information"},
|
||||
* summary="Retrieve information about the running wallabag application.",
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* description="Returned when successful",
|
||||
* @Model(type=ApplicationInfo::class),
|
||||
* )
|
||||
* )
|
||||
*
|
||||
@ -78,11 +84,10 @@ class WallabagRestController extends AbstractFOSRestController
|
||||
*/
|
||||
public function getInfoAction(Config $craueConfig)
|
||||
{
|
||||
$info = [
|
||||
'appname' => 'wallabag',
|
||||
'version' => $this->getParameter('wallabag_core.version'),
|
||||
'allowed_registration' => $this->getParameter('fosuser_registration') && $craueConfig->get('api_user_registration'),
|
||||
];
|
||||
$info = new ApplicationInfo(
|
||||
$this->getParameter('wallabag_core.version'),
|
||||
$this->getParameter('fosuser_registration') && $craueConfig->get('api_user_registration'),
|
||||
);
|
||||
|
||||
return (new JsonResponse())->setJson($this->serializer->serialize($info, 'json'));
|
||||
}
|
||||
|
||||
44
src/Wallabag/ApiBundle/Entity/ApplicationInfo.php
Normal file
44
src/Wallabag/ApiBundle/Entity/ApplicationInfo.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Entity;
|
||||
|
||||
use OpenApi\Annotations as OA;
|
||||
|
||||
class ApplicationInfo
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
* @OA\Property(
|
||||
* description="Name of the application.",
|
||||
* type="string",
|
||||
* example="wallabag",
|
||||
* )
|
||||
*/
|
||||
public $appname;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @OA\Property(
|
||||
* description="Version number of the application.",
|
||||
* type="string",
|
||||
* example="2.5.2",
|
||||
* )
|
||||
*/
|
||||
public $version;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
* @OA\Property(
|
||||
* description="Indicates whether registration is allowed. See PUT /api/user.",
|
||||
* type="boolean"
|
||||
* )
|
||||
*/
|
||||
public $allowed_registration;
|
||||
|
||||
public function __construct($version, $allowed_registration)
|
||||
{
|
||||
$this->appname = 'wallabag';
|
||||
$this->version = $version;
|
||||
$this->allowed_registration = $allowed_registration;
|
||||
}
|
||||
}
|
||||
@ -7,6 +7,7 @@ use FOS\OAuthServerBundle\Entity\Client as BaseClient;
|
||||
use JMS\Serializer\Annotation\Groups;
|
||||
use JMS\Serializer\Annotation\SerializedName;
|
||||
use JMS\Serializer\Annotation\VirtualProperty;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
@ -27,6 +28,12 @@ class Client extends BaseClient
|
||||
*
|
||||
* @ORM\Column(name="name", type="text", nullable=false)
|
||||
*
|
||||
* @OA\Property(
|
||||
* description="Name of the API client",
|
||||
* type="string",
|
||||
* example="Default Client",
|
||||
* )
|
||||
*
|
||||
* @Groups({"user_api_with_client"})
|
||||
*/
|
||||
protected $name;
|
||||
@ -44,6 +51,12 @@ class Client extends BaseClient
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @OA\Property(
|
||||
* description="Client secret used for authorization",
|
||||
* type="string",
|
||||
* example="2lmubx2m9vy80ss8c4wwcsg8ok44s88ocwcc8wo0w884oc8440",
|
||||
* )
|
||||
*
|
||||
* @SerializedName("client_secret")
|
||||
* @Groups({"user_api_with_client"})
|
||||
*/
|
||||
@ -94,6 +107,13 @@ class Client extends BaseClient
|
||||
|
||||
/**
|
||||
* @VirtualProperty
|
||||
*
|
||||
* @OA\Property(
|
||||
* description="Client secret used for authorization",
|
||||
* type="string",
|
||||
* example="3_1lpybsn0od40css4w4ko8gsc8cwwskggs8kgg448ko0owo4c84",
|
||||
* )
|
||||
*
|
||||
* @SerializedName("client_id")
|
||||
* @Groups({"user_api_with_client"})
|
||||
*/
|
||||
|
||||
@ -4,6 +4,9 @@ namespace Wallabag\CoreBundle\Command;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Exception\DriverException;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use FOS\UserBundle\Event\UserEvent;
|
||||
use FOS\UserBundle\FOSUserEvents;
|
||||
@ -138,7 +141,7 @@ class InstallCommand extends Command
|
||||
$help = '';
|
||||
|
||||
// now check if MySQL isn't too old to handle utf8mb4
|
||||
if ($conn->isConnected() && 'mysql' === $conn->getDatabasePlatform()->getName()) {
|
||||
if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof MySQLPlatform) {
|
||||
$version = $conn->query('select version()')->fetchOne();
|
||||
$minimalVersion = '5.5.4';
|
||||
|
||||
@ -150,7 +153,7 @@ class InstallCommand extends Command
|
||||
}
|
||||
|
||||
// testing if PostgreSQL > 9.1
|
||||
if ($conn->isConnected() && 'postgresql' === $conn->getDatabasePlatform()->getName()) {
|
||||
if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||
// return version should be like "PostgreSQL 9.5.4 on x86_64-apple-darwin15.6.0, compiled by Apple LLVM version 8.0.0 (clang-800.0.38), 64-bit"
|
||||
$version = $conn->query('SELECT version();')->fetchOne();
|
||||
|
||||
@ -391,7 +394,7 @@ class InstallCommand extends Command
|
||||
}
|
||||
|
||||
// custom verification for sqlite, since `getListDatabasesSQL` doesn't work for sqlite
|
||||
if ('sqlite' === $schemaManager->getDatabasePlatform()->getName()) {
|
||||
if ($connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
$params = $connection->getParams();
|
||||
|
||||
if (isset($params['path']) && file_exists($params['path'])) {
|
||||
|
||||
@ -246,7 +246,6 @@ class ConfigController extends AbstractController
|
||||
'username' => $user->getUsername(),
|
||||
'token' => $config->getFeedToken(),
|
||||
],
|
||||
'twofactor_auth' => $this->getParameter('twofactor_auth'),
|
||||
'wallabag_url' => $this->getParameter('domain_name'),
|
||||
'enabled_users' => $userRepository->getSumEnabledUsers(),
|
||||
]);
|
||||
@ -259,10 +258,6 @@ class ConfigController extends AbstractController
|
||||
*/
|
||||
public function disableOtpEmailAction()
|
||||
{
|
||||
if (!$this->getParameter('twofactor_auth')) {
|
||||
return $this->createNotFoundException('two_factor not enabled');
|
||||
}
|
||||
|
||||
$user = $this->getUser();
|
||||
$user->setEmailTwoFactor(false);
|
||||
|
||||
@ -283,10 +278,6 @@ class ConfigController extends AbstractController
|
||||
*/
|
||||
public function otpEmailAction()
|
||||
{
|
||||
if (!$this->getParameter('twofactor_auth')) {
|
||||
return $this->createNotFoundException('two_factor not enabled');
|
||||
}
|
||||
|
||||
$user = $this->getUser();
|
||||
|
||||
$user->setGoogleAuthenticatorSecret(null);
|
||||
@ -310,10 +301,6 @@ class ConfigController extends AbstractController
|
||||
*/
|
||||
public function disableOtpAppAction()
|
||||
{
|
||||
if (!$this->getParameter('twofactor_auth')) {
|
||||
return $this->createNotFoundException('two_factor not enabled');
|
||||
}
|
||||
|
||||
$user = $this->getUser();
|
||||
|
||||
$user->setGoogleAuthenticatorSecret('');
|
||||
@ -336,10 +323,6 @@ class ConfigController extends AbstractController
|
||||
*/
|
||||
public function otpAppAction(GoogleAuthenticatorInterface $googleAuthenticator)
|
||||
{
|
||||
if (!$this->getParameter('twofactor_auth')) {
|
||||
return $this->createNotFoundException('two_factor not enabled');
|
||||
}
|
||||
|
||||
$user = $this->getUser();
|
||||
$secret = $googleAuthenticator->generateSecret();
|
||||
|
||||
@ -377,10 +360,6 @@ class ConfigController extends AbstractController
|
||||
*/
|
||||
public function otpAppCancelAction()
|
||||
{
|
||||
if (!$this->getParameter('twofactor_auth')) {
|
||||
return $this->createNotFoundException('two_factor not enabled');
|
||||
}
|
||||
|
||||
$user = $this->getUser();
|
||||
$user->setGoogleAuthenticatorSecret(null);
|
||||
$user->setBackupCodes(null);
|
||||
@ -544,12 +523,16 @@ class ConfigController extends AbstractController
|
||||
/**
|
||||
* Remove all annotations OR tags OR entries for the current user.
|
||||
*
|
||||
* @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries"}, name="config_reset")
|
||||
* @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries"}, name="config_reset", methods={"POST"})
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function resetAction(string $type, AnnotationRepository $annotationRepository, EntryRepository $entryRepository)
|
||||
public function resetAction(Request $request, string $type, AnnotationRepository $annotationRepository, EntryRepository $entryRepository)
|
||||
{
|
||||
if (!$this->isCsrfTokenValid('reset-area', $request->request->get('token'))) {
|
||||
throw $this->createAccessDeniedException('Bad CSRF token.');
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'annotations':
|
||||
$annotationRepository->removeAllByUserId($this->getUser()->getId());
|
||||
@ -636,7 +619,7 @@ class ConfigController extends AbstractController
|
||||
$this->entityManager->persist($user);
|
||||
$this->entityManager->flush();
|
||||
|
||||
return $this->redirect($request->headers->get('referer'));
|
||||
return $this->redirect($request->getSession()->get('prevUrl'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -128,7 +128,7 @@ class EntryController extends AbstractController
|
||||
$this->entityManager->flush();
|
||||
}
|
||||
|
||||
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
|
||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'));
|
||||
|
||||
return $this->redirect($redirectUrl);
|
||||
}
|
||||
@ -390,6 +390,7 @@ class EntryController extends AbstractController
|
||||
public function viewAction(Entry $entry)
|
||||
{
|
||||
$this->checkUserAction($entry);
|
||||
$this->get('session')->set('prevUrl', $this->generateUrl('view', ['id' => $entry->getId()]));
|
||||
|
||||
return $this->render(
|
||||
'@WallabagCore/Entry/entry.html.twig',
|
||||
@ -451,7 +452,7 @@ class EntryController extends AbstractController
|
||||
$message
|
||||
);
|
||||
|
||||
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
|
||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'));
|
||||
|
||||
return $this->redirect($redirectUrl);
|
||||
}
|
||||
@ -481,7 +482,7 @@ class EntryController extends AbstractController
|
||||
$message
|
||||
);
|
||||
|
||||
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
|
||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'));
|
||||
|
||||
return $this->redirect($redirectUrl);
|
||||
}
|
||||
@ -517,8 +518,8 @@ class EntryController extends AbstractController
|
||||
);
|
||||
|
||||
// don't redirect user to the deleted entry (check that the referer doesn't end with the same url)
|
||||
$referer = $request->headers->get('referer');
|
||||
$to = (1 !== preg_match('#' . $url . '$#i', $referer) ? $referer : null);
|
||||
$prev = $request->getSession()->get('prevUrl');
|
||||
$to = (1 !== preg_match('#' . $url . '$#i', $prev) ? $prev : null);
|
||||
|
||||
$redirectUrl = $this->redirectHelper->to($to);
|
||||
|
||||
@ -616,6 +617,7 @@ class EntryController extends AbstractController
|
||||
{
|
||||
$searchTerm = (isset($request->get('search_entry')['term']) ? $request->get('search_entry')['term'] : '');
|
||||
$currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
|
||||
$request->getSession()->set('prevUrl', $request->getRequestUri());
|
||||
|
||||
$formOptions = [];
|
||||
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\TwigBundle\Controller\ExceptionController as BaseExceptionController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* This controller allow us to customize the error template.
|
||||
* The only modified line from the parent template is for "WallabagCoreBundle".
|
||||
*/
|
||||
class ExceptionController extends BaseExceptionController
|
||||
{
|
||||
protected function findTemplate(Request $request, $format, $code, $showException)
|
||||
{
|
||||
$name = $showException ? 'exception' : 'error';
|
||||
if ($showException && 'html' === $format) {
|
||||
$name = 'exception_full';
|
||||
}
|
||||
|
||||
// For error pages, try to find a template for the specific HTTP status code and format
|
||||
if (!$showException) {
|
||||
$template = sprintf('@WallabagCore/Exception/%s.%s.twig', $name, $format);
|
||||
if ($this->templateExists($template)) {
|
||||
return $template;
|
||||
}
|
||||
}
|
||||
|
||||
// try to find a template for the given format
|
||||
$template = sprintf('@Twig/Exception/%s.%s.twig', $name, $format);
|
||||
if ($this->templateExists($template)) {
|
||||
return $template;
|
||||
}
|
||||
|
||||
// default to a generic HTML exception
|
||||
$request->setRequestFormat('html');
|
||||
|
||||
return sprintf('@Twig/Exception/%s.html.twig', $showException ? 'exception_full' : $name);
|
||||
}
|
||||
}
|
||||
@ -61,13 +61,21 @@ class ExportController extends AbstractController
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function downloadEntriesAction(Request $request, EntryRepository $entryRepository, TagRepository $tagRepository, EntriesExport $entriesExport, string $format, string $category)
|
||||
public function downloadEntriesAction(Request $request, EntryRepository $entryRepository, TagRepository $tagRepository, EntriesExport $entriesExport, string $format, string $category, int $entry = 0)
|
||||
{
|
||||
$method = ucfirst($category);
|
||||
$methodBuilder = 'getBuilderFor' . $method . 'ByUser';
|
||||
$title = $method;
|
||||
|
||||
if ('tag_entries' === $category) {
|
||||
if ('same_domain' === $category) {
|
||||
$entries = $entryRepository->getBuilderForSameDomainByUser(
|
||||
$this->getUser()->getId(),
|
||||
$request->get('entry')
|
||||
)->getQuery()
|
||||
->getResult();
|
||||
|
||||
$title = 'Same domain';
|
||||
} elseif ('tag_entries' === $category) {
|
||||
$tag = $tagRepository->findOneBySlug($request->query->get('tag'));
|
||||
|
||||
$entries = $entryRepository->findAllByTagId(
|
||||
|
||||
@ -104,7 +104,7 @@ class TagController extends AbstractController
|
||||
$this->entityManager->flush();
|
||||
}
|
||||
|
||||
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
|
||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true);
|
||||
|
||||
return $this->redirect($redirectUrl);
|
||||
}
|
||||
@ -185,7 +185,7 @@ class TagController extends AbstractController
|
||||
$form = $this->createForm(RenameTagType::class, new Tag());
|
||||
$form->handleRequest($request);
|
||||
|
||||
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
|
||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$newTag = new Tag();
|
||||
@ -257,7 +257,7 @@ class TagController extends AbstractController
|
||||
$this->entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirect($this->redirectHelper->to($request->headers->get('referer'), '', true));
|
||||
return $this->redirect($this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -279,8 +279,7 @@ class TagController extends AbstractController
|
||||
$this->entityManager->remove($tag);
|
||||
$this->entityManager->flush();
|
||||
}
|
||||
|
||||
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
|
||||
$redirectUrl = $this->redirectHelper->to($request->getSession()->get('prevUrl'), '', true);
|
||||
|
||||
return $this->redirect($redirectUrl);
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\CoreBundle\Entity\Config;
|
||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
@ -15,7 +16,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
||||
*/
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$adminConfig = new Config($this->getReference('admin-user'));
|
||||
$adminConfig = new Config($this->getReference('admin-user', User::class));
|
||||
|
||||
$adminConfig->setItemsPerPage(30);
|
||||
$adminConfig->setReadingSpeed(200);
|
||||
@ -29,7 +30,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
||||
|
||||
$this->addReference('admin-config', $adminConfig);
|
||||
|
||||
$bobConfig = new Config($this->getReference('bob-user'));
|
||||
$bobConfig = new Config($this->getReference('bob-user', User::class));
|
||||
$bobConfig->setItemsPerPage(10);
|
||||
$bobConfig->setReadingSpeed(200);
|
||||
$bobConfig->setLanguage('fr');
|
||||
@ -42,7 +43,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
||||
|
||||
$this->addReference('bob-config', $bobConfig);
|
||||
|
||||
$emptyConfig = new Config($this->getReference('empty-user'));
|
||||
$emptyConfig = new Config($this->getReference('empty-user', User::class));
|
||||
$emptyConfig->setItemsPerPage(10);
|
||||
$emptyConfig->setReadingSpeed(100);
|
||||
$emptyConfig->setLanguage('en');
|
||||
|
||||
@ -6,7 +6,9 @@ use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class EntryFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
@ -87,7 +89,7 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
||||
];
|
||||
|
||||
foreach ($entries as $reference => $item) {
|
||||
$entry = new Entry($this->getReference($item['user']));
|
||||
$entry = new Entry($this->getReference($item['user'], User::class));
|
||||
$entry->setUrl($item['url']);
|
||||
$entry->setReadingTime($item['reading_time']);
|
||||
$entry->setDomainName($item['domain']);
|
||||
@ -98,7 +100,7 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
|
||||
|
||||
if (isset($item['tags'])) {
|
||||
foreach ($item['tags'] as $tag) {
|
||||
$entry->addTag($this->getReference($tag));
|
||||
$entry->addTag($this->getReference($tag, Tag::class));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
@ -17,7 +18,7 @@ class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureIn
|
||||
{
|
||||
$rule = new IgnoreOriginUserRule();
|
||||
$rule->setRule('host = "example.fr"');
|
||||
$rule->setConfig($this->getReference('admin-user')->getConfig());
|
||||
$rule->setConfig($this->getReference('admin-user', User::class)->getConfig());
|
||||
|
||||
$manager->persist($rule);
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Entity\SiteCredential;
|
||||
use Wallabag\CoreBundle\Helper\CryptoProxy;
|
||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface, ContainerAwareInterface
|
||||
{
|
||||
@ -28,14 +29,14 @@ class SiteCredentialFixtures extends Fixture implements DependentFixtureInterfac
|
||||
*/
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$credential = new SiteCredential($this->getReference('admin-user'));
|
||||
$credential = new SiteCredential($this->getReference('admin-user', User::class));
|
||||
$credential->setHost('.super.com');
|
||||
$credential->setUsername($this->container->get(CryptoProxy::class)->crypt('.super'));
|
||||
$credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
|
||||
|
||||
$manager->persist($credential);
|
||||
|
||||
$credential = new SiteCredential($this->getReference('admin-user'));
|
||||
$credential = new SiteCredential($this->getReference('admin-user', User::class));
|
||||
$credential->setHost('paywall.example.com');
|
||||
$credential->setUsername($this->container->get(CryptoProxy::class)->crypt('paywall.example'));
|
||||
$credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
|
||||
|
||||
@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\DataFixtures;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\CoreBundle\Entity\Config;
|
||||
use Wallabag\CoreBundle\Entity\TaggingRule;
|
||||
|
||||
class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
|
||||
@ -17,14 +18,14 @@ class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
|
||||
$tr1 = new TaggingRule();
|
||||
$tr1->setRule('content matches "spurs"');
|
||||
$tr1->setTags(['sport']);
|
||||
$tr1->setConfig($this->getReference('admin-config'));
|
||||
$tr1->setConfig($this->getReference('admin-config', Config::class));
|
||||
|
||||
$manager->persist($tr1);
|
||||
|
||||
$tr2 = new TaggingRule();
|
||||
$tr2->setRule('content matches "basket"');
|
||||
$tr2->setTags(['sport']);
|
||||
$tr2->setConfig($this->getReference('admin-config'));
|
||||
$tr2->setConfig($this->getReference('admin-config', Config::class));
|
||||
|
||||
$manager->persist($tr2);
|
||||
|
||||
@ -32,28 +33,28 @@ class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
|
||||
|
||||
$tr3->setRule('title matches "wallabag"');
|
||||
$tr3->setTags(['wallabag']);
|
||||
$tr3->setConfig($this->getReference('admin-config'));
|
||||
$tr3->setConfig($this->getReference('admin-config', Config::class));
|
||||
|
||||
$manager->persist($tr3);
|
||||
|
||||
$tr4 = new TaggingRule();
|
||||
$tr4->setRule('content notmatches "basket"');
|
||||
$tr4->setTags(['foot']);
|
||||
$tr4->setConfig($this->getReference('admin-config'));
|
||||
$tr4->setConfig($this->getReference('admin-config', Config::class));
|
||||
|
||||
$manager->persist($tr4);
|
||||
|
||||
$tr5 = new TaggingRule();
|
||||
$tr5->setRule('readingTime <= 5');
|
||||
$tr5->setTags(['shortread']);
|
||||
$tr5->setConfig($this->getReference('empty-config'));
|
||||
$tr5->setConfig($this->getReference('empty-config', Config::class));
|
||||
|
||||
$manager->persist($tr5);
|
||||
|
||||
$tr6 = new TaggingRule();
|
||||
$tr6->setRule('readingTime > 5');
|
||||
$tr6->setTags(['longread']);
|
||||
$tr6->setConfig($this->getReference('empty-config'));
|
||||
$tr6->setConfig($this->getReference('empty-config', Config::class));
|
||||
|
||||
$manager->persist($tr6);
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Wallabag\CoreBundle\Doctrine;
|
||||
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
@ -49,7 +50,7 @@ abstract class WallabagMigration extends AbstractMigration implements ContainerA
|
||||
}
|
||||
|
||||
// escape table name is handled using " on postgresql
|
||||
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||
return '"' . $table . '"';
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
namespace Wallabag\CoreBundle\Event\Listener;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||
use Symfony\Component\HttpKernel\Event\RequestEvent;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
|
||||
/**
|
||||
@ -18,7 +18,7 @@ class LocaleListener implements EventSubscriberInterface
|
||||
$this->defaultLocale = $defaultLocale;
|
||||
}
|
||||
|
||||
public function onKernelRequest(GetResponseEvent $event)
|
||||
public function onKernelRequest(RequestEvent $event)
|
||||
{
|
||||
$request = $event->getRequest();
|
||||
if (!$request->hasPreviousSession()) {
|
||||
|
||||
@ -9,10 +9,11 @@ use Http\Client\Common\HttpMethodsClient;
|
||||
use Http\Client\Common\Plugin\ErrorPlugin;
|
||||
use Http\Client\Common\Plugin\RedirectPlugin;
|
||||
use Http\Client\Common\PluginClient;
|
||||
use Http\Client\HttpClient;
|
||||
use Http\Discovery\MessageFactoryDiscovery;
|
||||
use Http\Message\MessageFactory;
|
||||
use Http\Discovery\Psr17FactoryDiscovery;
|
||||
use Psr\Http\Client\ClientInterface;
|
||||
use Psr\Http\Message\RequestFactoryInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\StreamFactoryInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\DomCrawler\Crawler;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
@ -28,9 +29,9 @@ class DownloadImages
|
||||
private $mimeTypes;
|
||||
private $wallabagUrl;
|
||||
|
||||
public function __construct(HttpClient $client, $baseFolder, $wallabagUrl, LoggerInterface $logger, MessageFactory $messageFactory = null)
|
||||
public function __construct(ClientInterface $client, $baseFolder, $wallabagUrl, LoggerInterface $logger, RequestFactoryInterface $requestFactory = null, StreamFactoryInterface $streamFactory = null)
|
||||
{
|
||||
$this->client = new HttpMethodsClient(new PluginClient($client, [new ErrorPlugin(), new RedirectPlugin()]), $messageFactory ?: MessageFactoryDiscovery::find());
|
||||
$this->client = new HttpMethodsClient(new PluginClient($client, [new ErrorPlugin(), new RedirectPlugin()]), $requestFactory ?: Psr17FactoryDiscovery::findRequestFactory(), $streamFactory ?: Psr17FactoryDiscovery::findStreamFactory());
|
||||
$this->baseFolder = $baseFolder;
|
||||
$this->wallabagUrl = rtrim($wallabagUrl, '/');
|
||||
$this->logger = $logger;
|
||||
|
||||
@ -209,38 +209,36 @@
|
||||
|
||||
{{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
|
||||
|
||||
{% if twofactor_auth %}
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<h5>{{ 'config.otp.page_title'|trans }}</h5>
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<h5>{{ 'config.otp.page_title'|trans }}</h5>
|
||||
|
||||
<p>{{ 'config.form_user.two_factor_description'|trans }}</p>
|
||||
<p>{{ 'config.form_user.two_factor_description'|trans }}</p>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'config.form_user.two_factor.table_method'|trans }}</th>
|
||||
<th>{{ 'config.form_user.two_factor.table_state'|trans }}</th>
|
||||
<th>{{ 'config.form_user.two_factor.table_action'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'config.form_user.two_factor.table_method'|trans }}</th>
|
||||
<th>{{ 'config.form_user.two_factor.table_state'|trans }}</th>
|
||||
<th>{{ 'config.form_user.two_factor.table_action'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}</td>
|
||||
<td>{% if app.user.isEmailTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
|
||||
<td><a href="{{ path('config_otp_email') }}" class="waves-effect waves-light btn{% if app.user.isEmailTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_email'|trans }}</a> {% if app.user.isEmailTwoFactor %}<a href="{{ path('disable_otp_email') }}" class="waves-effect waves-light btn red">Disable</a>{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}</td>
|
||||
<td>{% if app.user.isGoogleTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
|
||||
<td><a href="{{ path('config_otp_app') }}" class="waves-effect waves-light btn{% if app.user.isGoogleTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_app'|trans }}</a> {% if app.user.isGoogleTwoFactor %}<a href="{{ path('disable_otp_app') }}" class="waves-effect waves-light btn red">Disable</a>{% endif %}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}</td>
|
||||
<td>{% if app.user.isEmailTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
|
||||
<td><a href="{{ path('config_otp_email') }}" class="waves-effect waves-light btn{% if app.user.isEmailTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_email'|trans }}</a> {% if app.user.isEmailTwoFactor %}<a href="{{ path('disable_otp_email') }}" class="waves-effect waves-light btn red">Disable</a>{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}</td>
|
||||
<td>{% if app.user.isGoogleTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
|
||||
<td><a href="{{ path('config_otp_app') }}" class="waves-effect waves-light btn{% if app.user.isGoogleTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_app'|trans }}</a> {% if app.user.isGoogleTwoFactor %}<a href="{{ path('disable_otp_app') }}" class="waves-effect waves-light btn red">Disable</a>{% endif %}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ form_widget(form.user._token) }}
|
||||
</form>
|
||||
</div>
|
||||
@ -554,18 +552,34 @@
|
||||
<div class="row">
|
||||
<h5>{{ 'config.reset.title'|trans }}</h5>
|
||||
<p>{{ 'config.reset.description'|trans }}</p>
|
||||
<a href="{{ path('config_reset', {type: 'annotations'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
|
||||
{{ 'config.reset.annotations'|trans }}
|
||||
</a>
|
||||
<a href="{{ path('config_reset', {type: 'tags'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
|
||||
{{ 'config.reset.tags'|trans }}
|
||||
</a>
|
||||
<a href="{{ path('config_reset', {type: 'archived'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
|
||||
{{ 'config.reset.archived'|trans }}
|
||||
</a>
|
||||
<a href="{{ path('config_reset', {type: 'entries'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
|
||||
{{ 'config.reset.entries'|trans }}
|
||||
</a>
|
||||
<p>
|
||||
<form action="{{ path('config_reset', {type: 'annotations'}) }}" method="post" onsubmit="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" name="reset-annotations">
|
||||
<input type="hidden" name="token" value="{{ csrf_token('reset-area') }}" />
|
||||
|
||||
<button class="waves-effect waves-light btn red" type="submit">{{ 'config.reset.annotations'|trans }}</button>
|
||||
</form>
|
||||
</p>
|
||||
<p>
|
||||
<form action="{{ path('config_reset', {type: 'tags'}) }}" method="post" onsubmit="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" name="reset-tags">
|
||||
<input type="hidden" name="token" value="{{ csrf_token('reset-area') }}" />
|
||||
|
||||
<button class="waves-effect waves-light btn red" type="submit">{{ 'config.reset.tags'|trans }}</button>
|
||||
</form>
|
||||
</p>
|
||||
<p>
|
||||
<form action="{{ path('config_reset', {type: 'archived'}) }}" method="post" onsubmit="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" name="reset-archived">
|
||||
<input type="hidden" name="token" value="{{ csrf_token('reset-area') }}" />
|
||||
|
||||
<button class="waves-effect waves-light btn red" type="submit">{{ 'config.reset.archived'|trans }}</button>
|
||||
</form>
|
||||
</p>
|
||||
<p>
|
||||
<form action="{{ path('config_reset', {type: 'entries'}) }}" method="post" onsubmit="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" name="reset-entries">
|
||||
<input type="hidden" name="token" value="{{ csrf_token('reset-area') }}" />
|
||||
|
||||
<button class="waves-effect waves-light btn red" type="submit">{{ 'config.reset.entries'|trans }}</button>
|
||||
</form>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% if enabled_users > 1 %}
|
||||
|
||||
@ -2,11 +2,6 @@
|
||||
|
||||
{% block title %}{{ 'developer.howto.page_title'|trans }}{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
<link rel="stylesheet" href="{{ asset('https://cdnjs.cloudflare.com/ajax/libs/prism/1.4.1/themes/prism-dark.min.css') }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
@ -18,7 +13,7 @@
|
||||
<p>{{ 'developer.howto.description.paragraph_3'|trans({'%link%': path('developer_create_client')})|raw }}</p>
|
||||
<p>{{ 'developer.howto.description.paragraph_4'|trans }}</p>
|
||||
<p>
|
||||
<pre><code class="language-bash">http POST https://app.wallabag.it/oauth/v2/token \
|
||||
<pre><code class="language-bash">http POST {{ wallabag_url }}/oauth/v2/token \
|
||||
grant_type=password \
|
||||
client_id=12_5um6nz50ceg4088c0840wwc0kgg44g00kk84og044ggkscso0k \
|
||||
client_secret=3qd12zpeaxes8cwg8c0404g888co4wo8kc4gcw0occww8cgw4k \
|
||||
@ -47,7 +42,7 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13
|
||||
</p>
|
||||
<p>{{ 'developer.howto.description.paragraph_6'|trans }}</p>
|
||||
<p>
|
||||
<pre><code class="language-bash">http GET https://app.wallabag.it/api/entries.json \
|
||||
<pre><code class="language-bash">http GET {{ wallabag_url }}/api/entries.json \
|
||||
"Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"</code></pre>
|
||||
</p>
|
||||
<p>{{ 'developer.howto.description.paragraph_7'|trans }}</p>
|
||||
@ -58,6 +53,4 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{ asset('https://cdnjs.cloudflare.com/ajax/libs/prism/1.4.1/prism.min.js') }}"></script>
|
||||
<script src="{{ asset('https://cdnjs.cloudflare.com/ajax/libs/prism/1.4.1/components/prism-bash.min.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
@ -57,9 +57,11 @@
|
||||
|
||||
<p>{{ 'developer.remove.warn_message_1'|trans({'%name%': client.name}) }}</p>
|
||||
<p>{{ 'developer.remove.warn_message_2'|trans({'%name%': client.name}) }}</p>
|
||||
<p>
|
||||
<a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{{ 'developer.remove.action'|trans({'%name%': client.name}) }}</a>
|
||||
</p>
|
||||
<form action="{{ path('developer_delete_client', {id: client.id}) }}" method="post" name="delete-client">
|
||||
<input type="hidden" name="token" value="{{ csrf_token('delete-client') }}" />
|
||||
|
||||
<button class="waves-effect waves-light btn red" type="submit">{{ 'developer.remove.action'|trans({'%name%': client.name}) }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
@ -9,6 +9,6 @@
|
||||
{% set feed_route = feed_route ~ '_feed' %}
|
||||
{% set slug = null %}
|
||||
{% endif %}
|
||||
{% if feed_route %}
|
||||
{% if feed_route is defined %}
|
||||
<a rel="alternate" type="application/atom+xml" href="{{ path(feed_route, {'username': app.user.username, 'token': app.user.config.feedToken, 'slug': slug}) }}" class="results-item"><i class="material-icons">rss_feed</i></a>
|
||||
{% endif %}
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
<form name="form_mass_action" action="{{ path('mass_action') }}" method="post">
|
||||
<div class="results">
|
||||
<div class="nb-results">
|
||||
{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
|
||||
{{ 'entry.list.number_on_the_page'|trans({'%count%': entries.count}) }}
|
||||
{% if entries.count > 0 %}
|
||||
<a class="results-item" href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if list_mode == 0 %}view_list{% else %}view_module{% endif %}</i></a>
|
||||
{% endif %}
|
||||
@ -96,16 +96,17 @@
|
||||
{% if searchTerm is defined %}
|
||||
{% set export_search_term = searchTerm %}
|
||||
{% endif %}
|
||||
{% set entry = app.request.attributes.get('id') %}
|
||||
{% set previous_route = app.request.attributes.get('currentRoute') %}
|
||||
<h4 class="center">{{ 'entry.list.export_title'|trans }}</h4>
|
||||
<ul>
|
||||
{% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'epub', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route}) }}">EPUB</a></li>{% endif %}
|
||||
{% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'mobi', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route}) }}">MOBI (deprecated)</a></li>{% endif %}
|
||||
{% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'pdf', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route}) }}">PDF</a></li>{% endif %}
|
||||
{% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'json', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route}) }}">JSON</a></li>{% endif %}
|
||||
{% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'csv', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route}) }}">CSV</a></li>{% endif %}
|
||||
{% if craue_setting('export_txt') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'txt', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route}) }}">TXT</a></li>{% endif %}
|
||||
{% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'xml', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route}) }}">XML</a></li>{% endif %}
|
||||
{% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'epub', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route, 'entry': entry}) }}">EPUB</a></li>{% endif %}
|
||||
{% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'mobi', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route, 'entry': entry}) }}">MOBI (deprecated)</a></li>{% endif %}
|
||||
{% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'pdf', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route, 'entry': entry}) }}">PDF</a></li>{% endif %}
|
||||
{% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'json', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route, 'entry': entry}) }}">JSON</a></li>{% endif %}
|
||||
{% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'csv', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route, 'entry': entry}) }}">CSV</a></li>{% endif %}
|
||||
{% if craue_setting('export_txt') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'txt', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route, 'entry': entry}) }}">TXT</a></li>{% endif %}
|
||||
{% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', {'category': current_route, 'format': 'xml', 'tag': current_tag, 'search_entry[term]': export_search_term, 'currentRoute': previous_route, 'entry': entry}) }}">XML</a></li>{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
</li>
|
||||
|
||||
<li class="bold">
|
||||
<a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.re_fetch_content'|trans }}" href="{{ path('reload_entry', {'id': entry.id}) }}" id="reload">
|
||||
<a class="waves-effect collapsible-header" onclick="return confirm('{{ 'entry.confirm.reload'|trans|escape('js') }}')" title="{{ 'entry.view.left_menu.re_fetch_content'|trans }}" href="{{ path('reload_entry', {'id': entry.id}) }}" id="reload">
|
||||
<i class="material-icons small">refresh</i>
|
||||
<span>{{ 'entry.view.left_menu.re_fetch_content'|trans }}</span>
|
||||
</a>
|
||||
@ -269,7 +269,7 @@
|
||||
{% if entry.annotations|length %}
|
||||
<li>
|
||||
<i class="material-icons grey-text">comment</i>
|
||||
{{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations|length) }}
|
||||
{{ 'entry.view.annotations_on_the_entry'|trans({'%count%': entry.annotations|length}) }}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if entry.originUrl is not empty %}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="results clearfix">
|
||||
{{ 'tag.list.number_on_the_page'|transchoice(tags|length) }}
|
||||
{{ 'tag.list.number_on_the_page'|trans({'%count%': tags|length}) }}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
@ -19,16 +19,16 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
||||
private $tagRepository;
|
||||
private $lifeTime;
|
||||
private $translator;
|
||||
private $rootDir;
|
||||
private $projectDir;
|
||||
|
||||
public function __construct(EntryRepository $entryRepository, TagRepository $tagRepository, TokenStorageInterface $tokenStorage, $lifeTime, TranslatorInterface $translator, string $rootDir)
|
||||
public function __construct(EntryRepository $entryRepository, TagRepository $tagRepository, TokenStorageInterface $tokenStorage, $lifeTime, TranslatorInterface $translator, string $projectDir)
|
||||
{
|
||||
$this->entryRepository = $entryRepository;
|
||||
$this->tagRepository = $tagRepository;
|
||||
$this->tokenStorage = $tokenStorage;
|
||||
$this->lifeTime = $lifeTime;
|
||||
$this->translator = $translator;
|
||||
$this->rootDir = $rootDir;
|
||||
$this->projectDir = $projectDir;
|
||||
}
|
||||
|
||||
public function getGlobals(): array
|
||||
@ -174,7 +174,7 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
||||
|
||||
public function assetFileExists($name)
|
||||
{
|
||||
return file_exists(realpath($this->rootDir . '/../web/' . $name));
|
||||
return file_exists(realpath($this->projectDir . '/web/' . $name));
|
||||
}
|
||||
|
||||
public function themeClass()
|
||||
|
||||
@ -4,13 +4,13 @@ namespace Wallabag\ImportBundle\Controller;
|
||||
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use Predis\Client;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
use Wallabag\ImportBundle\Consumer\RabbitMQConsumerTotalProxy;
|
||||
use Wallabag\ImportBundle\Import\ImportChain;
|
||||
|
||||
class ImportController extends Controller
|
||||
class ImportController extends AbstractController
|
||||
{
|
||||
private RabbitMQConsumerTotalProxy $rabbitMQConsumerTotalProxy;
|
||||
|
||||
|
||||
@ -6,10 +6,11 @@ use Http\Client\Common\HttpMethodsClient;
|
||||
use Http\Client\Common\Plugin\ErrorPlugin;
|
||||
use Http\Client\Common\PluginClient;
|
||||
use Http\Client\Exception\RequestException;
|
||||
use Http\Client\HttpClient;
|
||||
use Http\Discovery\MessageFactoryDiscovery;
|
||||
use Http\Message\MessageFactory;
|
||||
use Http\Discovery\Psr17FactoryDiscovery;
|
||||
use Psr\Http\Client\ClientInterface;
|
||||
use Psr\Http\Message\RequestFactoryInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\StreamFactoryInterface;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
|
||||
class PocketImport extends AbstractImport
|
||||
@ -152,9 +153,9 @@ class PocketImport extends AbstractImport
|
||||
/**
|
||||
* Set the Http client.
|
||||
*/
|
||||
public function setClient(HttpClient $client, MessageFactory $messageFactory = null)
|
||||
public function setClient(ClientInterface $client, RequestFactoryInterface $requestFactory = null, StreamFactoryInterface $streamFactory = null)
|
||||
{
|
||||
$this->client = new HttpMethodsClient(new PluginClient($client, [new ErrorPlugin()]), $messageFactory ?: MessageFactoryDiscovery::find());
|
||||
$this->client = new HttpMethodsClient(new PluginClient($client, [new ErrorPlugin()]), $requestFactory ?: Psr17FactoryDiscovery::findRequestFactory(), $streamFactory ?: Psr17FactoryDiscovery::findStreamFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -85,19 +85,17 @@ class ManageController extends AbstractController
|
||||
$form->handleRequest($request);
|
||||
|
||||
// `googleTwoFactor` isn't a field within the User entity, we need to define it's value in a different way
|
||||
if ($this->getParameter('twofactor_auth') && true === $user->isGoogleAuthenticatorEnabled() && false === $form->isSubmitted()) {
|
||||
if (true === $user->isGoogleAuthenticatorEnabled() && false === $form->isSubmitted()) {
|
||||
$form->get('googleTwoFactor')->setData(true);
|
||||
}
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
// handle creation / reset of the OTP secret if checkbox changed from the previous state
|
||||
if ($this->getParameter('twofactor_auth')) {
|
||||
if (true === $form->get('googleTwoFactor')->getData() && false === $user->isGoogleAuthenticatorEnabled()) {
|
||||
$user->setGoogleAuthenticatorSecret($googleAuthenticator->generateSecret());
|
||||
$user->setEmailTwoFactor(false);
|
||||
} elseif (false === $form->get('googleTwoFactor')->getData() && true === $user->isGoogleAuthenticatorEnabled()) {
|
||||
$user->setGoogleAuthenticatorSecret(null);
|
||||
}
|
||||
if (true === $form->get('googleTwoFactor')->getData() && false === $user->isGoogleAuthenticatorEnabled()) {
|
||||
$user->setGoogleAuthenticatorSecret($googleAuthenticator->generateSecret());
|
||||
$user->setEmailTwoFactor(false);
|
||||
} elseif (false === $form->get('googleTwoFactor')->getData() && true === $user->isGoogleAuthenticatorEnabled()) {
|
||||
$user->setGoogleAuthenticatorSecret(null);
|
||||
}
|
||||
|
||||
$userManager->updateUser($user);
|
||||
@ -114,7 +112,6 @@ class ManageController extends AbstractController
|
||||
'user' => $user,
|
||||
'edit_form' => $form->createView(),
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
'twofactor_auth' => $this->getParameter('twofactor_auth'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,8 @@ use FOS\UserBundle\Model\User as BaseUser;
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\Groups;
|
||||
use JMS\Serializer\Annotation\XmlRoot;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Scheb\TwoFactorBundle\Model\BackupCodeInterface;
|
||||
use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface as EmailTwoFactorInterface;
|
||||
use Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface as GoogleTwoFactorInterface;
|
||||
@ -40,6 +42,12 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*
|
||||
* @OA\Property(
|
||||
* description="The unique numeric id of the user",
|
||||
* type="int",
|
||||
* example=12,
|
||||
* )
|
||||
*
|
||||
* @Groups({"user_api", "user_api_with_client"})
|
||||
*/
|
||||
protected $id;
|
||||
@ -49,6 +57,12 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
|
||||
*
|
||||
* @ORM\Column(name="name", type="text", nullable=true)
|
||||
*
|
||||
* @OA\Property(
|
||||
* description="The personal Name of the user",
|
||||
* type="string",
|
||||
* example="Walla Baggger",
|
||||
* )
|
||||
*
|
||||
* @Groups({"user_api", "user_api_with_client"})
|
||||
*/
|
||||
protected $name;
|
||||
@ -56,6 +70,12 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @OA\Property(
|
||||
* description="The unique username of the user",
|
||||
* type="string",
|
||||
* example="wallabag",
|
||||
* )
|
||||
*
|
||||
* @Groups({"user_api", "user_api_with_client"})
|
||||
*/
|
||||
protected $username;
|
||||
@ -63,6 +83,12 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @OA\Property(
|
||||
* description="E-mail address of the user",
|
||||
* type="string",
|
||||
* example="wallabag@wallabag.io",
|
||||
* )
|
||||
*
|
||||
* @Groups({"user_api", "user_api_with_client"})
|
||||
*/
|
||||
protected $email;
|
||||
@ -72,6 +98,12 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
|
||||
*
|
||||
* @ORM\Column(name="created_at", type="datetime")
|
||||
*
|
||||
* @OA\Property(
|
||||
* description="Creation date of the user account. (In ISO 8601 format)",
|
||||
* type="string",
|
||||
* example="2023-06-27T19:25:44+0000",
|
||||
* )
|
||||
*
|
||||
* @Groups({"user_api", "user_api_with_client"})
|
||||
*/
|
||||
protected $createdAt;
|
||||
@ -81,6 +113,12 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
|
||||
*
|
||||
* @ORM\Column(name="updated_at", type="datetime")
|
||||
*
|
||||
* @OA\Property(
|
||||
* description="Update date of the user account. (In ISO 8601 format)",
|
||||
* type="string",
|
||||
* example="2023-06-27T19:37:30+0000",
|
||||
* )
|
||||
*
|
||||
* @Groups({"user_api", "user_api_with_client"})
|
||||
*/
|
||||
protected $updatedAt;
|
||||
@ -112,6 +150,11 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
|
||||
/**
|
||||
* @see getFirstClient() below
|
||||
*
|
||||
* @OA\Property(
|
||||
* description="Default client created during user registration. Used for further authorization",
|
||||
* ref=@Model(type=Client::class, groups={"user_api_with_client"})
|
||||
* )
|
||||
*
|
||||
* @Groups({"user_api_with_client"})
|
||||
* @Accessor(getter="getFirstClient")
|
||||
*/
|
||||
|
||||
@ -47,7 +47,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if twofactor_auth %}
|
||||
<div class="row">
|
||||
<div class="input-field col s12">
|
||||
{{ form_widget(edit_form.emailTwoFactor) }}
|
||||
@ -60,7 +59,6 @@
|
||||
{{ form_errors(edit_form.googleTwoFactor) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ namespace Tests\Wallabag\AnnotationBundle;
|
||||
use FOS\UserBundle\Model\UserInterface;
|
||||
use FOS\UserBundle\Model\UserManager;
|
||||
use FOS\UserBundle\Security\LoginManager;
|
||||
use Symfony\Bundle\FrameworkBundle\Client;
|
||||
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Component\BrowserKit\Cookie;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
@ -14,7 +14,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
|
||||
abstract class WallabagAnnotationTestCase extends WebTestCase
|
||||
{
|
||||
/**
|
||||
* @var Client
|
||||
* @var KernelBrowser
|
||||
*/
|
||||
protected $client = null;
|
||||
|
||||
@ -42,7 +42,7 @@ abstract class WallabagAnnotationTestCase extends WebTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Client
|
||||
* @return KernelBrowser
|
||||
*/
|
||||
protected function createAuthorizedClient()
|
||||
{
|
||||
|
||||
@ -104,20 +104,16 @@ class DeveloperControllerTest extends WallabagCoreTestCase
|
||||
$this->assertStringContainsString('no_client', $client->getResponse()->getContent());
|
||||
|
||||
$this->logInAs('bob');
|
||||
$client->request('GET', '/developer/client/delete/' . $adminApiClient->getId());
|
||||
$client->request('POST', '/developer/client/delete/' . $adminApiClient->getId());
|
||||
$this->assertSame(403, $client->getResponse()->getStatusCode());
|
||||
|
||||
// Try to remove the admin's client with the good user
|
||||
$this->logInAs('admin');
|
||||
$crawler = $client->request('GET', '/developer');
|
||||
|
||||
$link = $crawler
|
||||
->filter('div[class=collapsible-body] p a')
|
||||
->eq(0)
|
||||
->link()
|
||||
;
|
||||
$form = $crawler->filter('form[name=delete-client]')->form();
|
||||
|
||||
$client->click($link);
|
||||
$client->submit($form);
|
||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||
|
||||
$this->assertNull(
|
||||
|
||||
@ -6,7 +6,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
use FOS\UserBundle\Model\UserInterface;
|
||||
use FOS\UserBundle\Model\UserManager;
|
||||
use FOS\UserBundle\Security\LoginManager;
|
||||
use Symfony\Bundle\FrameworkBundle\Client;
|
||||
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Component\BrowserKit\Cookie;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
@ -16,7 +16,7 @@ use Wallabag\UserBundle\Entity\User;
|
||||
abstract class WallabagApiTestCase extends WebTestCase
|
||||
{
|
||||
/**
|
||||
* @var Client
|
||||
* @var KernelBrowser
|
||||
*/
|
||||
protected $client = null;
|
||||
|
||||
@ -32,7 +32,7 @@ abstract class WallabagApiTestCase extends WebTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Client
|
||||
* @return KernelBrowser
|
||||
*/
|
||||
protected function createAuthorizedClient()
|
||||
{
|
||||
|
||||
@ -929,7 +929,8 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$crawler = $client->click($crawler->selectLink('config.reset.annotations')->link());
|
||||
$form = $crawler->filter('form[name=reset-annotations]')->form();
|
||||
$client->submit($form);
|
||||
|
||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||
$this->assertStringContainsString('flashes.config.notice.annotations_reset', $client->getContainer()->get(SessionInterface::class)->getFlashBag()->get('notice')[0]);
|
||||
@ -945,7 +946,8 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$crawler = $client->click($crawler->selectLink('config.reset.tags')->link());
|
||||
$form = $crawler->filter('form[name=reset-tags]')->form();
|
||||
$client->submit($form);
|
||||
|
||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||
$this->assertStringContainsString('flashes.config.notice.tags_reset', $client->getContainer()->get(SessionInterface::class)->getFlashBag()->get('notice')[0]);
|
||||
@ -961,7 +963,8 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$crawler = $client->click($crawler->selectLink('config.reset.entries')->link());
|
||||
$form = $crawler->filter('form[name=reset-entries]')->form();
|
||||
$client->submit($form);
|
||||
|
||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||
$this->assertStringContainsString('flashes.config.notice.entries_reset', $client->getContainer()->get(SessionInterface::class)->getFlashBag()->get('notice')[0]);
|
||||
@ -1027,7 +1030,8 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$crawler = $client->click($crawler->selectLink('config.reset.archived')->link());
|
||||
$form = $crawler->filter('form[name=reset-archived]')->form();
|
||||
$client->submit($form);
|
||||
|
||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||
$this->assertStringContainsString('flashes.config.notice.archived_reset', $client->getContainer()->get(SessionInterface::class)->getFlashBag()->get('notice')[0]);
|
||||
@ -1086,7 +1090,8 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$crawler = $client->click($crawler->selectLink('config.reset.entries')->link());
|
||||
$form = $crawler->filter('form[name=reset-entries]')->form();
|
||||
$client->submit($form);
|
||||
|
||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||
$this->assertStringContainsString('flashes.config.notice.entries_reset', $client->getContainer()->get(SessionInterface::class)->getFlashBag()->get('notice')[0]);
|
||||
|
||||
@ -1654,7 +1654,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||
// As long as the deletion link of a tag is following
|
||||
// a link to the tag view, we take the second one to retrieve
|
||||
// the deletion link of the first tag
|
||||
$link = $crawler->filter('body div#article div.tools ul.tags li.chip a')->extract('href')[1];
|
||||
$link = $crawler->filter('body div#article div.tools ul.tags li.chip a')->extract(['href'])[1];
|
||||
|
||||
$this->assertSame(sprintf('/remove-tag/%s/%s', $entry->getId(), $tag->getId()), $link);
|
||||
}
|
||||
|
||||
@ -10,6 +10,8 @@ class ExportControllerTest extends WallabagCoreTestCase
|
||||
{
|
||||
private $adminEntry;
|
||||
private $bobEntry;
|
||||
private $sameDomainEntry;
|
||||
private $sameDomainEntry2;
|
||||
|
||||
public function testLogin()
|
||||
{
|
||||
@ -326,6 +328,26 @@ class ExportControllerTest extends WallabagCoreTestCase
|
||||
$this->assertNotEmpty('updated_at', (string) $content->entry[0]->updated_at);
|
||||
}
|
||||
|
||||
public function testJsonExportFromSameDomain()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getTestClient();
|
||||
|
||||
ob_start();
|
||||
$crawler = $client->request('GET', '/export/same_domain.json?entry=1');
|
||||
ob_end_clean();
|
||||
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$headers = $client->getResponse()->headers;
|
||||
$this->assertSame('application/json', $headers->get('content-type'));
|
||||
$this->assertSame('attachment; filename="Same domain articles.json"', $headers->get('content-disposition'));
|
||||
$this->assertSame('UTF-8', $headers->get('content-transfer-encoding'));
|
||||
|
||||
$content = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertCount(4, $content);
|
||||
}
|
||||
|
||||
private function setUpForJsonExportFromSearch()
|
||||
{
|
||||
$client = $this->getTestClient();
|
||||
|
||||
@ -237,14 +237,18 @@ class FeedControllerTest extends WallabagCoreTestCase
|
||||
$entry1->setCreatedAt($day1);
|
||||
$entry4->setCreatedAt($day2);
|
||||
|
||||
$property = (new \ReflectionObject($entry1))->getProperty('updatedAt');
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($entry1, $day4);
|
||||
|
||||
$property = (new \ReflectionObject($entry4))->getProperty('updatedAt');
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($entry4, $day3);
|
||||
|
||||
// We have to flush and sleep here to be sure that $entry1 and $entry4 have different updatedAt values
|
||||
$em->flush();
|
||||
sleep(2);
|
||||
|
||||
$property = (new \ReflectionObject($entry1))->getProperty('updatedAt');
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($entry1, $day4);
|
||||
|
||||
$em->flush();
|
||||
|
||||
$client = $this->getTestClient();
|
||||
|
||||
@ -32,12 +32,6 @@ class SecurityControllerTest extends WallabagCoreTestCase
|
||||
{
|
||||
$client = $this->getTestClient();
|
||||
|
||||
if (!$client->getContainer()->getParameter('twofactor_auth')) {
|
||||
$this->markTestSkipped('twofactor_auth is not enabled.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$client->followRedirects();
|
||||
|
||||
$em = $client->getContainer()->get(EntityManagerInterface::class);
|
||||
@ -65,12 +59,6 @@ class SecurityControllerTest extends WallabagCoreTestCase
|
||||
{
|
||||
$client = $this->getTestClient();
|
||||
|
||||
if (!$client->getContainer()->getParameter('twofactor_auth')) {
|
||||
$this->markTestSkipped('twofactor_auth is not enabled.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$client->followRedirects();
|
||||
|
||||
$em = $client->getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
@ -4,7 +4,7 @@ namespace Tests\Wallabag\CoreBundle\Controller;
|
||||
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Client;
|
||||
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
|
||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
use Wallabag\CoreBundle\Entity\SiteCredential;
|
||||
|
||||
@ -139,7 +139,7 @@ class SiteCredentialControllerTest extends WallabagCoreTestCase
|
||||
$this->assertStringContainsString('flashes.site_credential.notice.deleted', $crawler->filter('body')->extract(['_text'])[0]);
|
||||
}
|
||||
|
||||
private function createSiteCredential(Client $client)
|
||||
private function createSiteCredential(KernelBrowser $client)
|
||||
{
|
||||
$credential = new SiteCredential($this->getLoggedInUser());
|
||||
$credential->setHost('google.io');
|
||||
|
||||
@ -124,7 +124,7 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||
|
||||
// We make a first request to set an history and test redirection after tag deletion
|
||||
$client->request('GET', '/view/' . $entry->getId());
|
||||
$entryUri = $client->getRequest()->getUri();
|
||||
$entryUri = $client->getRequest()->getRequestUri();
|
||||
$client->request('GET', '/remove-tag/' . $entry->getId() . '/' . $tag->getId());
|
||||
|
||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||
|
||||
@ -7,7 +7,7 @@ use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
|
||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||
use Symfony\Component\HttpKernel\Event\RequestEvent;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
use Wallabag\CoreBundle\Event\Listener\LocaleListener;
|
||||
@ -82,6 +82,6 @@ class LocaleListenerTest extends TestCase
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
return new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
|
||||
return new RequestEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
namespace Tests\Wallabag\CoreBundle;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Client;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Component\BrowserKit\Cookie;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
@ -16,12 +16,14 @@ use Wallabag\UserBundle\Entity\User;
|
||||
abstract class WallabagCoreTestCase extends WebTestCase
|
||||
{
|
||||
/**
|
||||
* @var Client|null
|
||||
* @var KernelBrowser|null
|
||||
*/
|
||||
private $client = null;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
static::ensureKernelShutdown();
|
||||
|
||||
parent::setUp();
|
||||
|
||||
$this->client = static::createClient();
|
||||
@ -29,6 +31,8 @@ abstract class WallabagCoreTestCase extends WebTestCase
|
||||
|
||||
public function getNewClient()
|
||||
{
|
||||
static::ensureKernelShutdown();
|
||||
|
||||
return $this->client = static::createClient();
|
||||
}
|
||||
|
||||
@ -37,7 +41,7 @@ abstract class WallabagCoreTestCase extends WebTestCase
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
public function resetDatabase(Client $client)
|
||||
public function resetDatabase(KernelBrowser $client)
|
||||
{
|
||||
$application = new Application($client->getKernel());
|
||||
$application->setAutoExit(false);
|
||||
|
||||
@ -74,7 +74,7 @@ class ManageControllerTest extends WallabagCoreTestCase
|
||||
$client = $this->getTestClient();
|
||||
|
||||
$crawler = $client->request('GET', '/users/' . $this->getLoggedInUserId() . '/edit');
|
||||
$disabled = $crawler->selectButton('user.form.delete')->extract('disabled');
|
||||
$disabled = $crawler->selectButton('user.form.delete')->extract(['disabled']);
|
||||
|
||||
$this->assertSame('disabled', $disabled[0]);
|
||||
}
|
||||
|
||||
@ -320,6 +320,7 @@ entry:
|
||||
delete: Are you sure you want to remove that article?
|
||||
delete_tag: Are you sure you want to remove that tag from that article?
|
||||
delete_entries: Are you sure you want to remove these articles?
|
||||
reload: Are you sure you want to reload that article?
|
||||
metadata:
|
||||
reading_time: Estimated reading time
|
||||
reading_time_minutes_short: '%readingTime% min'
|
||||
|
||||
@ -88,6 +88,8 @@ config:
|
||||
help_reading_speed: wallabag calcule une durée de lecture pour chaque article. Vous pouvez définir ici, grâce à cette liste déroulante, si vous lisez plus ou moins vite. wallabag recalculera la durée de lecture de chaque article.
|
||||
help_language: Vous pouvez définir la langue de l’interface de wallabag.
|
||||
help_pocket_consumer_key: Nécessaire pour l’import depuis Pocket. Vous pouvez le créer depuis votre compte Pocket.
|
||||
help_display_thumbnails: Vous pouvez décidez d'afficher ou non les miniatures des articles. Utile pour les connexions lentes.
|
||||
display_thumbnails_label: Afficher les miniatures des articles (utile pour les connexions lentes).
|
||||
form_feed:
|
||||
description: "Les flux Atom fournis par wallabag vous permettent de lire vos articles sauvegardés dans votre lecteur de flux préféré. Pour pouvoir les utiliser, vous devez d’abord créer un jeton."
|
||||
token_label: "Jeton de flux"
|
||||
@ -145,7 +147,7 @@ config:
|
||||
card:
|
||||
new_tagging_rule: Créer une règle d'étiquetage
|
||||
import_tagging_rules: Importer des règles
|
||||
import_tagging_rules_detail: Vous devez sélectionné un fichier JSON que vous avez précédemment exporté.
|
||||
import_tagging_rules_detail: Vous devez sélectionner un fichier JSON que vous avez précédemment exporté.
|
||||
export_tagging_rules: Exporter les règles
|
||||
export_tagging_rules_detail: Un fichier JSON sera téléchargé et vous pourrez l'utiliser pour ré-importer les règles ou comme sauvegarde.
|
||||
file_label: Fichier JSON
|
||||
@ -412,7 +414,7 @@ quickstart:
|
||||
configure:
|
||||
title: Configurez l’application
|
||||
description: Pour voir une application qui vous correspond, allez voir du côté de la configuration de wallabag.
|
||||
language: Changez la langue et le design de l’application
|
||||
language: Changez la langue et l'interface
|
||||
rss: Activez les flux RSS
|
||||
tagging_rules: Écrivez des règles pour classer automatiquement vos articles
|
||||
feed: Activer les flux RSS
|
||||
@ -499,7 +501,7 @@ import:
|
||||
description: Cet outil va importer tous vos articles d’une autre instance de wallabag v2. Allez dans tous vos articles, puis, sur la barre latérale, cliquez sur « JSON ». Vous allez récupérer un fichier « All articles.json ».
|
||||
readability:
|
||||
page_title: Importer > Readability
|
||||
description: Cet outil va importer toutes vos données de Readability. Sur la page des outils (https://www.readability.com/tools/), cliquez sur « Export your data » dans la section « Data Export ». Vous allez recevoir un courriel avec un lien pour télécharger le json (qui ne se finit pas par .json).
|
||||
description: Cet outil va importer toutes vos données de Readability.
|
||||
how_to: Choisissez le fichier de votre export Readability et cliquez sur le bouton ci-dessous pour l’importer.
|
||||
worker:
|
||||
enabled: 'Les imports sont asynchrones. Une fois l’import commencé un worker externe traitera les messages un par un. Le service activé est :'
|
||||
@ -521,7 +523,7 @@ import:
|
||||
description: Sur la page « Backup » (https://pinboard.in/settings/backup), cliquez sur « JSON » dans la section « Bookmarks ». Un fichier json (sans extension) sera téléchargé (« pinboard_export »).
|
||||
how_to: Choisissez le fichier de votre export Pinboard et cliquez sur le bouton ci-dessous pour l’importer.
|
||||
elcurator:
|
||||
description: Cet outil va importer tous vos articles depuis elCurator. Allez dans vos préférences sur elCurator et exportez vos contenus. Vous allez récupérer un fichier JSON.
|
||||
description: Cet outil va importer tous vos articles depuis elCurator.
|
||||
page_title: Importer > elCurator
|
||||
delicious:
|
||||
page_title: Importer > del.icio.us
|
||||
|
||||
@ -451,10 +451,10 @@ import:
|
||||
enabled: 'A importación faise de xeito asíncrono. Unha vez se inicia a tarefa de importación, un servizo externo ocuparase delas dunha en unha. O servizo actual é:'
|
||||
readability:
|
||||
how_to: Escolle o teu ficheiro de Readability e preme no botón inferior para subilo e importalo.
|
||||
description: Este importador vai traer todos os teus artigos Readability. Nas ferramentas (https://www.readability.com/tools/), preme en "Exporta os teus datos" na sección "Exportar Datos". Obterás un email para descargar un json (que en realidade non remata en .json).
|
||||
description: Este importador traerá todos os teus artigos en Readability.
|
||||
page_title: Importar > Readability
|
||||
elcurator:
|
||||
description: Este importador traerá todos os teus ficheiros de elCurator. Vai ós axustes na túa conta elCurator e após exporta o teu contido. Obterás un ficheiro JSON.
|
||||
description: Este importador traerá todos os teus artigos de elCurator.
|
||||
page_title: Importar > elCurator
|
||||
delicious:
|
||||
page_title: Importar > del.icio.us
|
||||
@ -519,7 +519,7 @@ quickstart:
|
||||
configure:
|
||||
tagging_rules: Establece regras para etiquetar automáticamente os artigos
|
||||
feed: Activar fontes
|
||||
language: Cambiar o idioma e deseño
|
||||
language: Cambiar o idioma e interface
|
||||
description: Para poder adaptar a aplicación ás túas preferencias, entra nos axustes de wallabag.
|
||||
title: Configurar a aplicación
|
||||
intro:
|
||||
|
||||
@ -64,7 +64,7 @@ import:
|
||||
readability:
|
||||
how_to: Odaberi Readability izvoz i pritisni donji gumb za slanje i uvoz datoteke.
|
||||
page_title: Uvoz > Readability
|
||||
description: Ovaj uvoznik uvozi sve tvoje Readability članke. Na stranici alata (https://www.readability.com/tools/), pritisni „Izvezi svoje podatke” u odjeljku „Izvoz podataka”. Primit ćeš e-mail za preuzimanje json-a (što zapravo ne završava s .json).
|
||||
description: Ovaj će uvoznik uvesti sve tvoje Readability članke.
|
||||
worker:
|
||||
enabled: 'Uvoz se vrši asinkrono. Nakon što se uvoz zadatak pokrene, jedna vanjska usluga obradit će poslove jedan po jedan. Trenutačna usluga je:'
|
||||
download_images_warning: Aktivirao(la) si preuzimanje slika za članke. U kombinaciji s klasičnim uvozom, postupak može potrajati godinama (ili možda ne uspije). <strong>Preporučujemo</strong> aktivirati asinkroniziran uvoz za izbjegavanje grešaka.
|
||||
@ -98,7 +98,7 @@ import:
|
||||
action:
|
||||
import_contents: Sadržaj uvoza
|
||||
elcurator:
|
||||
description: Ovaj će uvoznik uvesti sve tvoje elCurator članke. Prijeđi na postavke na tvom elCurator računu, a zatim izvezi sadržaj. Dobit ćete JSON datoteku.
|
||||
description: Ovaj će uvoznik uvesti sve tvoje elCurator članke.
|
||||
page_title: Uvezi > elCurator
|
||||
delicious:
|
||||
page_title: Uvoz > del.icio.us
|
||||
@ -107,7 +107,7 @@ import:
|
||||
about:
|
||||
helping:
|
||||
description: 'wallabag je slobodan softver otvorenog koda. Možeš nam pomoći:'
|
||||
by_paypal: putem PayPal-a
|
||||
by_paypal: putem Liberapay
|
||||
who_behind_wallabag:
|
||||
license: Licenca
|
||||
website: web-stranica
|
||||
@ -215,6 +215,8 @@ config:
|
||||
items_per_page_label: Broj stavki po stranici
|
||||
help_reading_speed: wallabag izračunava vrijeme čitanja za svaki članak. Ovdje možeš definirati, zahvaljujući ovom popisu, jesi li brz ili spor čitač. wallabag će izračunati vrijeme čitanja za svaki članak.
|
||||
language_label: Jezik
|
||||
help_display_thumbnails: Možeš odlučiti želiš li prikazivati minijature članaka. Korisno za spore veze.
|
||||
display_thumbnails_label: Prikaži minijatue članaka (korisno za spore veze).
|
||||
form_user:
|
||||
delete:
|
||||
confirm: Sigurno? (OVO JE NEPOVRATNA RADNJA)
|
||||
@ -428,6 +430,7 @@ flashes:
|
||||
notice:
|
||||
tag_added: Oznaka dodana
|
||||
tag_renamed: Oznaka preimenovana
|
||||
too_much_tags: Za izbjegavanje problem s performansama, ne možeš dodati više od %tags% oznaka odjednom ili oznake koje imaju više od %characters% znakova.
|
||||
ignore_origin_instance_rule:
|
||||
notice:
|
||||
deleted: Globalno pravilo za zanemarivanje izvora izbrisano
|
||||
@ -495,6 +498,7 @@ entry:
|
||||
assign_search_tag: Dodijeli ovo pretraživanje kao oznaku svakom rezultatu
|
||||
mass_action_tags_input_placeholder: oznaka1, oznaka2, oznaka3
|
||||
toggle_mass_action: Uklj./Isklj. grupne radnje
|
||||
add_tags: Dodaj oznake
|
||||
view:
|
||||
left_menu:
|
||||
set_as_starred: Uklj/Isklj omiljene
|
||||
@ -547,6 +551,7 @@ entry:
|
||||
delete: Stvarno želiš ukloniti taj članak?
|
||||
delete_tag: Stvarno želiš ukloniti tu oznaku za taj članak?
|
||||
delete_entries: Stvarno želiš ukloniti ove članke?
|
||||
reload: Stvarno želiš ponovo učitati taj članak?
|
||||
edit:
|
||||
title_label: Naslov
|
||||
url_label: Url
|
||||
@ -614,7 +619,7 @@ quickstart:
|
||||
description: Za dobivanje programa koji tebi najviše odgovara, pogledaj konfiguraciju wallabaga.
|
||||
tagging_rules: Odredi pravila za automatsko označivanje članaka
|
||||
title: Konfiguriraj program
|
||||
language: Promijeni jezik i dizajn
|
||||
language: Promijeni jezik i sučelje
|
||||
feed: Aktiviraj feedove
|
||||
developer:
|
||||
description: 'Mislili smo i na pregramere: Docker, sučelje (API), prijevodi itd.'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user