Compare commits

..

202 Commits

Author SHA1 Message Date
39643c6b76 Merge pull request #1493 from wallabag/v2-pocket-import
v2 – 1st draft for Pocket import via API & Wallabag v1 import
2016-01-07 22:15:08 +01:00
b88cf91fc8 updated tests 2016-01-07 21:00:04 +01:00
488a468e3e Merge pull request #1553 from wallabag/v2-hide-export-button
Hide export button if we are not on entries list
2016-01-06 21:25:41 +01:00
10b2411c10 Hide export button if we are not on entries list 2016-01-06 07:47:09 +01:00
d1af8ad4db Added french translations 2016-01-05 22:38:09 +01:00
8eedc8cfac Few phpDoc fix
And some little mistakes
2016-01-03 11:15:44 +01:00
c5c7f90a81 Fix tag related test for Pocket 2016-01-03 10:32:56 +01:00
5b2b5858fe Update deps 2016-01-02 23:31:41 +01:00
6d7c7a6e3f Remove real consumer key
We should never commit them :)
2016-01-02 23:27:41 +01:00
7019c7cf6c Add tagged services for import
- list services in /import
- add url to import service
- ImportBundle routing are now prefixed by /import
- optimize flush in each import (flushing each 20 contents)
- improve design of each import
- add more tests
2016-01-02 23:27:41 +01:00
b1d05721cf Rewrote Wallabag v1 import 2016-01-02 23:27:41 +01:00
252ebd6071 Rewrote Pocket Import
For the moment, we won't do a queue system, just a plain synchronous import.
We also use ContentProxy to grab content for each article from Pocket.
Error from Pocket are now logged using the logger.
The ImportInterface need to be simple and not related to oAuth (not all import will use that method).
2016-01-02 23:27:41 +01:00
b4b592a0c0 Fix the way to check for an existing entry
Instead of requiring more than 1 entry (> 1) we have to check for at least one entry (> 0)
2016-01-02 23:27:41 +01:00
77a7752a59 Update after previous merge
PR #1443 was merged into this branch to handle all import type in the same place.
2016-01-02 23:27:41 +01:00
7ec2897ee0 First test on PocketImport
Giving ability to define the Client add abitliy to easliy test the import.
2016-01-02 23:27:41 +01:00
0aa344dc24 Update url & service name
Prefix ur with service namel: [service]_[route name]
Add comment in Interface
2016-01-02 23:27:41 +01:00
5a4bbcc9a7 Change the way to check for an existing entry
The repository method return the entry found or false if nothing exists.
2016-01-02 23:27:41 +01:00
27a8708b67 Update deps 2016-01-02 23:27:41 +01:00
303768dfe9 - remove importers configuration
- add check on userId for findOneByURL for entries
2016-01-02 23:27:41 +01:00
dda57bb944 fix #1502 avoid duplicate entry and store pocket url in config 2016-01-02 23:24:17 +01:00
87f23b005c assign tags to entries and add lastPocketImport attribute to user 2016-01-02 23:24:17 +01:00
d51b38ed30 create ImportController to list importers 2016-01-02 23:24:17 +01:00
557e549db7 service call 2016-01-02 23:24:17 +01:00
9c9c23cf08 forgot test parameters 2016-01-02 23:24:17 +01:00
ff7b031d57 refactor pocket import 2016-01-02 23:24:17 +01:00
1f4408de9e 1st draft for Pocket import via API 2016-01-02 23:24:17 +01:00
10b40f85d6 add docs for Import feature 2016-01-02 23:24:17 +01:00
d275bdf4d3 form to upload file 2016-01-02 23:24:17 +01:00
8c3c77c1bd create controller to launch import command 2016-01-02 23:24:17 +01:00
a1bb1b3c2a userId is now set in parameters 2016-01-02 23:24:17 +01:00
56ea1de99b first draft for json import, needed for wallabag v1 migration 2016-01-02 23:24:17 +01:00
dad1c546a5 Merge pull request #1545 from wallabag/v2-user-tag
v2 – Remove user reference in tag
2016-01-02 12:46:52 +01:00
5432f61509 Merge pull request #1546 from wallabag/v2-reload-content
v2 – Ability to reload an entry
2016-01-02 12:46:09 +01:00
00a051add4 Merge pull request #1547 from wallabag/v2-mistakes
v2 – Fix wrong if when deleting an entry
2016-01-02 12:45:08 +01:00
e82160e5e9 Fix wrong if when deleting an entry
Bad condition when deleting an entry returned `true` instead of the referer url
2015-12-30 11:32:53 +01:00
0cf434c00f Backport all icomoon from v1
And add a reload icon
2015-12-30 09:53:52 +01:00
831b02aaf2 Ability to reload an entry
Could be useful when we want to update the content or when the content failed to be fetched.

Fix #1503
2015-12-30 09:41:17 +01:00
6be9750155 Removed comment
And move the SQL query inside the php doc
2015-12-29 21:59:34 +01:00
e6a228c43b Merge pull request #1544 from wallabag/2fa-email
v2 – Add custom email for 2FA
2015-12-29 20:32:58 +01:00
4059a061c0 Fix the way to remove a tag from all user entries 2015-12-29 15:43:32 +01:00
1bb1939ab7 Cleanup tests
- WallabagRestController: remove the tag deletion from the API since we can't remove a tag now, we only remove reference to entries
- RuleBasedTaggerTest: remove workaround for asserting tag are equal since problem was related to mock expects (_call instead of findOneByLabel which was removed from the tag repository)
2015-12-29 15:04:46 +01:00
01fddd0cb2 Fix parameters regarding documentation
Parameters are `star` & `archived`, not `is_starred` & `is_archived`
2015-12-29 14:54:55 +01:00
fc73222723 Remove user reference in tag
Fix #1543
2015-12-29 14:50:52 +01:00
ab64c3d9ac PHP 7.0 must not fail 2015-12-29 11:41:35 +01:00
23ff8d3619 Add custom email for 2FA
Related #1490
2015-12-29 11:17:06 +01:00
c997cfcc9c Merge pull request #1540 from wallabag/v2-fix-delete
v2 – 	Don't redirect to the content page after deletion
2015-12-28 13:51:48 +01:00
2863bf2ab5 Don't redirect to the content page after deletion
Fix #1512

We generate the url of the removed content and compare it to the referer url. If they matche, we redirect user to the homepage otherwise to the referer url.
2015-12-28 13:42:50 +01:00
71eff67f8b Entry data should have unique url 2015-12-28 13:42:50 +01:00
d25b828821 Merge pull request #1542 from wallabag/v2-avoid-duplicate-tag
v2 – 	Avoid multiple tag creation
2015-12-28 13:37:13 +01:00
e9fa8c40aa Add test on tagAllForUser
And fix multiplication of entries returned by `tagAllForUser`.
2015-12-28 13:20:48 +01:00
fc031e5706 Avoid multiple tag creation
When a new tag is created but not yet persisted, it can be duplicated.
It could happen when multiple rules match the content and at least 2 of them should attach same new tag.

Fix #1528
2015-12-28 13:20:48 +01:00
82899c0402 Merge pull request #1488 from wallabag/v2-slug-tags
Slug for tags
2015-12-28 13:12:30 +01:00
3c65dfb735 add slug for tags 2015-12-28 12:49:45 +01:00
22c1d29b89 Merge pull request #1537 from bdunogier/update_lock
Updated composer.lock
2015-12-24 08:37:27 +01:00
d4aa174367 Updated composer.lock
Had to restrict scheb/two-factor-bundle to ~1.4.0 because of a circular service reference.
See https://github.com/scheb/two-factor-bundle/issues/33.

Also updated php version requirement to 5.5.0.
2015-12-23 22:49:03 +01:00
da2240f9d4 Merge pull request #1529 from wallabag/v2-taggingrule-tablename
changed table name for tagging rule
2015-12-08 09:35:27 +01:00
347fa6beb0 php cs 2015-12-08 09:20:03 +01:00
c5d0db8b71 changed table name for tagging rule 2015-12-08 09:05:56 +01:00
a7f1921f7d Merge pull request #1478 from K-Phoen/rule-based-tags
Rule based tags
2015-12-06 14:31:26 +01:00
2e15e30bf0 Merge pull request #1523 from wallabag/tcitworld-patch-1
Typo
2015-12-04 06:43:40 +01:00
a24c1ee30a Typo 2015-12-04 00:17:07 +01:00
f4b617f2ff Merge pull request #1518 from mathbruyen/smtp-from-env
Set SMTP from environment variables
2015-12-03 08:43:40 +01:00
752b90d1f2 Fix tagging rules ordering 2015-11-29 16:19:02 +01:00
59507c5b24 SMTP configuration through environment
Configuring SMTP parameters required to be written in files which is not
convenient when using docker containers as the credentials need to be in
the filesystem.

Created environment parameters override for those parameters. A new build
script created in order to generate those parameters right before
launching the application.
2015-11-26 10:44:03 +01:00
c13eda461f Clean the tagging rule creation form 2015-11-16 14:01:43 +01:00
69edb774eb Assert that the tag has is the good one 2015-11-16 13:34:00 +01:00
958671a7ae Add a quick test 2015-11-13 22:53:28 +01:00
aeff8aa765 Document the matches operator in the FAQ 2015-11-13 20:57:46 +01:00
f27aca26f6 Add phpdoc for all Matches implementations 2015-11-13 20:50:09 +01:00
a6e27f7466 Add matches operator 2015-11-13 14:37:58 +01:00
5c514b0be3 Improve the tagging rules documentation 2015-11-11 17:06:36 +01:00
b7b2005494 Fix the creation of the repository services 2015-11-11 16:44:57 +01:00
6cbbf1481a Update rulerz-bundle 2015-11-11 16:39:28 +01:00
0c5bcd82ba Use Psr\Log\NullLogger instead of creating a mock 2015-11-11 16:27:53 +01:00
7b1648961d Fix incorrect comment. 2015-11-11 16:27:19 +01:00
8a99c7a86b Add a few functional tests for the tagging rules creation form 2015-11-11 16:27:19 +01:00
9b88658c04 Update baggy theme 2015-11-11 16:27:19 +01:00
52e423f307 Provide a way to delete tagging rules 2015-11-11 16:27:19 +01:00
625acf3352 Add a command to automatically tag all entries for a user 2015-11-11 16:27:19 +01:00
cad8cda7af Use a tagged version of kphoen/rulerz-bundle 2015-11-11 16:25:44 +01:00
c23fc05df8 Validate used operators when creating tagging rules 2015-11-11 16:23:49 +01:00
5a166c5c1a Add tests for the RuleBasedTagger class 2015-11-11 16:23:49 +01:00
1c9cd2a7f0 Errors in the automatic tagging do not prevent the entry from being added 2015-11-11 16:23:49 +01:00
1dc4e5da2e Also validate used variables when creating tagging rules 2015-11-11 16:23:49 +01:00
3447d1ee07 Add naïve validation for tagging rules (only checks the syntax) 2015-11-11 16:23:49 +01:00
71ef0ed254 Rename the « Tags » tab to « Tagging rules » 2015-11-11 16:23:49 +01:00
003fa77438 Add tests for the StringToListTransformer class 2015-11-11 16:23:49 +01:00
f530f7f5e1 Fix ContentProxyTest 2015-11-11 16:23:49 +01:00
1d7b350b25 Add missing use statement 2015-11-11 16:23:49 +01:00
e9fbd2d12e Add a table explaining the available variables 2015-11-11 16:23:49 +01:00
981cacf7b9 Display the tagging rules in the config 2015-11-11 16:23:49 +01:00
9cbb404b4a Add missing tagging rule repository 2015-11-11 16:23:49 +01:00
f19f9f62d1 Add a form to create tagging rules 2015-11-11 16:23:49 +01:00
ac9fec610a Add TaggingRule entity 2015-11-11 16:23:49 +01:00
c3510620ad PoC of rule-based tagging 2015-11-11 16:23:49 +01:00
0a0c600887 Merge pull request #1422 from wallabag/v2-ebook
V2 – Export entries
2015-11-09 16:45:48 +01:00
16bbb4aa41 Update deps 2015-11-09 16:35:09 +01:00
fba3f536a5 Fix tests 2015-11-09 16:32:48 +01:00
cceca9ea1d Fix route parameters
Improve export tests
Improve CSV export
2015-11-09 16:32:48 +01:00
268e9e7277 use JMS Serializer 2015-11-09 16:32:48 +01:00
5b7da07620 use the groups annotation instead of setIgnoredAttributes 2015-11-09 16:32:48 +01:00
8ac95cbfcc improved function 2015-11-09 16:32:48 +01:00
b3cc1a14e7 add json & xml 2015-11-09 16:32:48 +01:00
33c36f6b48 Fix tests on pgsql 2015-11-09 16:32:48 +01:00
add597bad9 Rework on export
- all export now return a `HttpFoundation\Response`
- return a 404 on unsupported format
- add tests
2015-11-09 16:32:48 +01:00
03690d1387 Start work on export
For now:
 - ebook
 - mobi
 - pdf
 - csv
2015-11-09 16:32:48 +01:00
f1eccfd63f Merge pull request #1500 from wallabag/v2-quote-pgsql
Fix quote strategy for reserved keyword in Postgres
2015-11-09 16:31:59 +01:00
53cf510689 Lock DoctrineBundle to 1.5.2
Because of a bad change, SQLite database cannot be created anymore.

➡️ https://github.com/doctrine/DoctrineBundle/pull/434
2015-11-08 10:47:56 +01:00
970e0e994f Remove duplicate comments 2015-11-07 14:18:38 +01:00
75c48e3ae0 CS 2015-11-07 14:16:13 +01:00
d502762598 Skipping PostgreSQL test that drop database
For a not-clear reason, I can't properly drop the current database. Even if Doctrine made a special case for that (https://github.com/doctrine/dbal/pull/849).

So instead of trying crazy things to achieve the test, better way is to skip test (too much wasted days ..)
2015-11-07 14:16:13 +01:00
8a493541fa Re-enable test on doctrine command
It will slow down the whole test suite (because it'll use doctrine command).
Remove unecessary `KernelTestCase`.
Also rename `AbstractControllerTest` to `WallabagApiTestCase` for consistency.
2015-11-07 14:16:13 +01:00
735068d181 Add tests on TablePrefixSubscriber 2015-11-07 14:15:33 +01:00
bd0f3d32c9 Quoted entity to avoid reserved keyword
Should fix #1498
2015-11-07 14:15:33 +01:00
54a2241e13 Fix database already exist detection
This is not the same message exception from MySQL & SQLite with Postgres.
2015-11-07 14:15:33 +01:00
4529d0f4b6 Merge pull request #1510 from wallabag/v2-sf3
v2 – Fix some deprecated for Symfony3
2015-11-07 13:39:30 +01:00
164d260c49 CS
Also force SYMFONY_DEPRECATIONS_HELPER for travis
2015-11-07 00:27:41 +01:00
b2a903feef Avoid other bundle deprecation to cancel the build 2015-11-07 00:18:46 +01:00
33fe61f92f Fix form_enctype deprecation
Use form_start instead
2015-11-07 00:18:06 +01:00
18f8f32f70 Fix security.context deprecation 2015-11-07 00:17:37 +01:00
5ead137fe6 Fix pattern deprecation
Replaced by path
2015-11-07 00:16:26 +01:00
78507d2835 Fix deprecated helper in command 2015-11-06 23:39:19 +01:00
872384b0c1 Update deps & add PHPUnit Bridge
Changelogs summary:

 - symfony/phpunit-bridge installed in version v2.7.6
   Release notes: https://github.com/symfony/phpunit-bridge/releases/tag/v2.7.6

 - twig/twig updated from v1.23.0 to v1.23.1
   See changes: https://github.com/twigphp/Twig/compare/v1.23.0...v1.23.1
   Release notes: https://github.com/twigphp/Twig/releases/tag/v1.23.1

 - doctrine/inflector updated from v1.0.1 to v1.1.0
   See changes: https://github.com/doctrine/inflector/compare/v1.0.1...v1.1.0
   Release notes: https://github.com/doctrine/inflector/releases/tag/v1.1.0

 - doctrine/cache updated from v1.5.0 to v1.5.1
   See changes: https://github.com/doctrine/cache/compare/v1.5.0...v1.5.1
   Release notes: https://github.com/doctrine/cache/releases/tag/v1.5.1

 - doctrine/doctrine-cache-bundle updated from v1.0.1 to 1.2.1
   See changes: https://github.com/doctrine/DoctrineCacheBundle/compare/v1.0.1...1.2.1
   Release notes: https://github.com/doctrine/DoctrineCacheBundle/releases/tag/1.2.1

 - doctrine/doctrine-bundle updated from v1.5.2 to 1.6.0
   See changes: https://github.com/doctrine/DoctrineBundle/compare/v1.5.2...1.6.0
   Release notes: https://github.com/doctrine/DoctrineBundle/releases/tag/1.6.0

 - friendsofsymfony/user-bundle updated from dev-master to dev-master
   See changes: d5b28c3...45d6f40
2015-11-06 23:39:14 +01:00
3d9ccf9390 Merge pull request #1505 from wallabag/v2-graby-log
Add graby log
2015-11-02 07:52:28 +01:00
386cd24663 Update deps
Changelogs summary:

 - twig/twig updated from v1.22.3 to v1.23.0
   See changes: https://github.com/twigphp/Twig/compare/v1.22.3...v1.23.0
   Release notes: https://github.com/twigphp/Twig/releases/tag/v1.23.0

 - doctrine/cache updated from v1.4.2 to v1.5.0
   See changes: https://github.com/doctrine/cache/compare/v1.4.2...v1.5.0
   Release notes: https://github.com/doctrine/cache/releases/tag/v1.5.0

 - symfony/symfony updated from v2.7.5 to v2.7.6
   See changes: https://github.com/symfony/symfony/compare/v2.7.5...v2.7.6
   Release notes: https://github.com/symfony/symfony/releases/tag/v2.7.6

 - sensio/distribution-bundle updated from v3.0.31 to v3.0.33
   See changes: https://github.com/sensiolabs/SensioDistributionBundle/compare/v3.0.31...v3.0.33
   Release notes: https://github.com/sensiolabs/SensioDistributionBundle/releases/tag/v3.0.33

 - nelmio/api-doc-bundle updated from 2.9.0 to 2.10.3
   See changes: https://github.com/nelmio/NelmioApiDocBundle/compare/2.9.0...2.10.3
   Release notes: https://github.com/nelmio/NelmioApiDocBundle/releases/tag/2.10.3

 - lexik/form-filter-bundle updated from v4.0.1 to v4.0.2
   See changes: https://github.com/lexik/LexikFormFilterBundle/compare/v4.0.1...v4.0.2
   Release notes: https://github.com/lexik/LexikFormFilterBundle/releases/tag/v4.0.2

 - j0k3r/graby-site-config updated from 1.0.5 to 1.0.6
   See changes: https://github.com/j0k3r/graby-site-config/compare/1.0.5...1.0.6
   Release notes: https://github.com/j0k3r/graby-site-config/releases/tag/1.0.6

 - j0k3r/graby updated from 1.0.2 to 1.0.4
   See changes: https://github.com/j0k3r/graby/compare/1.0.2...1.0.4
   Release notes: https://github.com/j0k3r/graby/releases/tag/1.0.4

 - phpunit/phpunit updated from 4.8.13 to 4.8.16
   See changes: https://github.com/sebastianbergmann/phpunit/compare/4.8.13...4.8.16
   Release notes: https://github.com/sebastianbergmann/phpunit/releases/tag/4.8.16
2015-10-30 08:00:43 +01:00
c929c88faf Enable graby log 2015-10-24 10:53:55 +02:00
e686b5e6fe Merge pull request #1495 from wallabag/v2-docs
add docs
2015-10-22 17:02:06 +02:00
71200c4155 Merge pull request #1496 from wallabag/v2-redirect-after-deletion
fix #1005 V2 redirect after deletion
2015-10-22 09:28:54 +02:00
18d5f4541e redirect on last page after deletion 2015-10-21 15:26:37 +02:00
59e91bc893 add docs 2015-10-21 14:14:51 +02:00
a4e1ddf2d6 Merge pull request #1491 from jlnostr/v2-german-translation
Add german translation.
2015-10-19 09:21:43 +02:00
57cf6fd76c Add language to config.yml 2015-10-18 22:04:50 +02:00
37a564a868 Add german translation. 2015-10-18 21:26:09 +02:00
fcc6949d4a Merge pull request #1446 from wallabag/v2-language-config
[WIP] language selection on config screen
2015-10-18 15:35:42 +02:00
2aac2f278f Add tests on listeners 2015-10-16 07:40:09 +02:00
c89d35e851 Language selection on config screen 2015-10-15 21:42:29 +02:00
3d3ed955f1 Merge pull request #1484 from wallabag/v2-2factor-auth
2factor authentication via email
2015-10-15 13:52:52 +02:00
e9b395ec4b forgot parameters for travis 2015-10-15 13:20:44 +02:00
18cf594f8a move 2factor activation in parameters 2015-10-15 13:17:21 +02:00
0d6a7929e1 add tests for 2factor authentication 2015-10-14 17:10:12 +02:00
f6af634aec Merge pull request #1475 from modos189/v2_material
V2 material
2015-10-14 12:01:30 +02:00
2db616b586 2factor authentication via email 2015-10-13 22:43:15 +02:00
c26a3edc0a Other improvements 2015-10-09 13:00:15 +03:00
ba873ae667 Icons in footer 2015-10-09 12:43:42 +03:00
cf0ea8f113 Merge pull request #1472 from wallabag/v2-clean-views
fix #1470: clean material theme
2015-10-08 13:44:04 +02:00
9dbcf9d418 Merge pull request #1471 from wallabag/v2-bookmarklet
implement bookmarklet
2015-10-08 13:43:53 +02:00
fa853bb603 fix #1470: clean material theme 2015-10-08 13:32:34 +02:00
880a0e1c0b implement bookmarklet 2015-10-08 13:29:41 +02:00
3bfbd22f13 Merge pull request #1468 from wallabag/v2-fix-detect-theme
fix bug on detect active theme
2015-10-06 20:57:54 +02:00
ce782c84b8 fix bug on detect active theme 2015-10-06 20:51:40 +02:00
3123b3c0c8 Merge pull request #1464 from wallabag/v2-fix-type-hint
fix type hint for User
2015-10-06 12:24:18 +02:00
1ce8f30342 fix type hint for User 2015-10-06 12:16:08 +02:00
16dabc3263 Merge pull request #1436 from wallabag/v2-register
Public registration & oAuth2 \o/
2015-10-06 09:19:06 +02:00
fdef5f4605 Merge pull request #1461 from wallabag/v2-test-for-www
fix #1433: add test for removeWww Twig Extension
2015-10-06 09:16:52 +02:00
794dc4ee8a Merge pull request #1459 from wallabag/v2-tags-chips
fix #1457 & update materialize
2015-10-06 09:09:56 +02:00
784bb4c38d add test for removeWww Twig Extension 2015-10-06 09:09:26 +02:00
8263e71192 use form widget for registration 2015-10-06 07:44:10 +02:00
68e9dcf615 restore blue color 2015-10-06 06:16:17 +02:00
e0d188809c move css 2015-10-05 22:49:46 +02:00
d30262154a last changes for baggy theme 2015-10-05 22:45:44 +02:00
ec3ce598f6 material design for register/login/recover pages 2015-10-05 22:16:18 +02:00
9c8f7af196 fix #1457 2015-10-05 21:37:17 +02:00
4c5e544183 Cleanup
- remove unecessary routing for UserBundle
- remove unused form type
2015-10-03 13:37:21 +02:00
0a878469d4 move some files to UserBundle 2015-10-03 13:31:48 +02:00
1210dae105 remove old implementation for login/register/recover 2015-10-03 13:31:48 +02:00
772d8c4b93 Add test on RegistrationConfirmedListener
And PLEASE @nicosomb, NEVER EVER inject the whole container inside a service.
2015-10-03 13:30:43 +02:00
2c13918acc add test for confirmed registration 2015-10-03 13:30:43 +02:00
359b3f43cc * rename AuthenticationListener
* add tests
2015-10-03 13:30:43 +02:00
772732531e check authentication on each API route 2015-10-03 13:30:43 +02:00
cd1298d6df allow API documentation for anonymous 2015-10-03 13:30:43 +02:00
fcb1fba5c2 * public registration
* remove WSSE implementation
* add oAuth2 implementation
2015-10-03 13:30:43 +02:00
8a60bc4cc2 Merge pull request #1447 from wallabag/v2-typo
typo
2015-10-01 19:58:58 +02:00
4b55e704ab typo 2015-10-01 18:48:38 +02:00
0e8f778199 Merge pull request #1441 from wallabag/v2-french-translation
Add french translation
2015-10-01 11:49:13 +02:00
4e9f656ecb restore footer 2015-10-01 11:38:59 +02:00
cfb28c9da0 french translation 2015-10-01 09:26:52 +02:00
8e417206d5 flash messages translation 2015-09-30 18:17:40 +02:00
4aafa7f0df french translation 2015-09-30 18:09:18 +02:00
4f0dfac6a6 add french translation 2015-09-30 17:06:41 +02:00
7c99da0c95 Merge pull request #1437 from wallabag/v2-clean-material
some cleanup on material theme
2015-09-30 09:05:03 +02:00
24429857d8 Merge pull request #1439 from wallabag/v2-fix-deploy
fix Capistrano configuration
2015-09-30 08:49:00 +02:00
d2755b1c30 Merge pull request #1440 from wallabag/v2-fix-1433
fix #1433: remove www. on entries view
2015-09-29 23:23:58 +02:00
2afdea1ccc forgot one file 2015-09-29 23:11:27 +02:00
72fcaf8a6c remove www. on entries view 2015-09-29 22:59:44 +02:00
e75b215a25 fix Capistrano configuration 2015-09-29 22:13:07 +02:00
b0b352fc8e some cleanup on material theme 2015-09-29 20:26:32 +02:00
917040d4a0 Merge pull request #1434 from wallabag/travis-db
Add multiple database tests on Travis
2015-09-28 22:57:11 +02:00
fef4124130 Enabled Tidy on travis for HHVM 2015-09-28 20:35:56 +02:00
02d17813a1 Fix tests for all 2015-09-28 20:26:37 +02:00
159986c4fb Fix Postgres tests 2015-09-28 19:35:55 +02:00
da3d4998c0 Move readingTime & domainName in ContentProxy
So, everything is centralized in one place when we save a new entry.
2015-09-28 19:35:33 +02:00
4180fddac1 Merge pull request #1435 from wallabag/v2-enabled-user
Enabled created user from Config
2015-09-26 20:19:42 +02:00
34c2cc7a1a Use tecnickcom/tcpdf
tecnick.com/tcpdf is abandonned.
2015-09-26 19:51:26 +02:00
0f30f48b93 Enabled created user from Config
By default, creating user with FOSUser are disabled by default.

Fix #1423
2015-09-26 19:45:14 +02:00
609594fa5e Fix authentication error from Github
From: http://blog.wyrihaximus.net/2015/09/github-auth-token-on-travis/
2015-09-26 19:23:20 +02:00
dc22b46bf3 Fix HHVM & PHP 7.0 2015-09-26 19:06:32 +02:00
03fb6fde5f Add multiple database tests on Travis 2015-09-26 11:56:15 +02:00
5716249455 Merge pull request #1429 from wallabag/v2-language
V2 – Handle language in entry
2015-09-23 09:13:34 +02:00
d4ebe5c5dc Entries filter on language
+ updated deps
2015-09-23 07:55:55 +02:00
0d3bafdfdf Remove tab from baggy css
And add a border left on the filter slider
2015-09-23 07:51:17 +02:00
98f0929f16 Handle entry in language
Fix #1333
2015-09-22 20:52:13 +02:00
db96045a0a Adjust preview picture 2015-09-20 22:36:51 +02:00
266 changed files with 20376 additions and 10955 deletions

View File

@ -3,6 +3,12 @@ language: php
# faster builds on docker-container setup
sudo: false
# used for HHVM
addons:
apt:
packages:
- tidy
# cache vendor dirs
cache:
directories:
@ -10,32 +16,40 @@ cache:
- $HOME/.composer/cache
php:
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
- nightly
env:
- DB=mysql
- DB=pgsql
- DB=sqlite
matrix:
fast_finish: true
exclude:
- php: hhvm
env: DB=pgsql # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
allow_failures:
- php: hhvm
- php: nightly
branches:
only:
- v2
install:
before_script:
- composer self-update
# build coverage only on one build, to speed up results feedbacks
# before_script:
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;
# disable xdebug since we don't use code-coverage for now
- if [[ $TRAVIS_PHP_VERSION != '5.6' && $TRAVIS_PHP_VERSION != 'hhvm' && $TRAVIS_PHP_VERSION != '7.0' ]]; then phpenv config-rm xdebug.ini; fi
# build coverage only on one build, to speed up results feedbacks
# - if [[ "$TRAVIS_PHP_VERSION" = "5.6" ]]; then PHPUNIT_FLAGS="--coverage-clover=coverage.clover"; else PHPUNIT_FLAGS=""; fi;
- if [[ "$DB" = "pgsql" ]]; then psql -c 'create database wallabag;' -U postgres; fi;
script:
- ant prepare
- bin/phpunit --exclude-group command-doctrine --debug $PHPUNIT_FLAGS
- ant prepare-$DB
- SYMFONY_DEPRECATIONS_HELPER=weak bin/phpunit -v
# after_script:
# - |

View File

@ -26,6 +26,12 @@ class AppKernel extends Kernel
new Wallabag\ApiBundle\WallabagApiBundle(),
new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
new Wallabag\UserBundle\WallabagUserBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new Scheb\TwoFactorBundle\SchebTwoFactorBundle(),
new KPhoen\RulerZBundle\KPhoenRulerZBundle(),
new Wallabag\ImportBundle\WallabagImportBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {

View File

@ -446,6 +446,12 @@ class SymfonyRequirements extends RequirementCollection
);
}
$this->addRequirement(
function_exists('iconv'),
'iconv() must be available',
'Install and enable the <strong>iconv</strong> extension.'
);
$this->addRequirement(
function_exists('json_encode'),
'json_encode() must be available',
@ -546,10 +552,10 @@ class SymfonyRequirements extends RequirementCollection
require_once __DIR__.'/../vendor/autoload.php';
try {
$r = new \ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle');
$r = new ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle');
$contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php');
} catch (\ReflectionException $e) {
} catch (ReflectionException $e) {
$contents = '';
}
$this->addRecommendation(

View File

@ -25,6 +25,16 @@ framework:
fragments: ~
http_method_override: true
wallabag_core:
languages:
en: 'English'
fr: 'Français'
de: 'Deutsch'
wallabag_import:
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain']
resource_dir: "%kernel.root_dir%/../web/uploads/import"
# Twig Configuration
twig:
debug: "%kernel.debug%"
@ -45,6 +55,7 @@ twig:
export_mobi: %export_mobi%
export_pdf: %export_pdf%
version: %app.version%
twofactor_auth: %twofactor_auth%
warning_message: %warning_message%
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
flattr_url: "https://flattr.com/thing/1265480"
@ -81,9 +92,16 @@ doctrine:
auto_generate_proxy_classes: "%kernel.debug%"
entity_managers:
default:
naming_strategy: wallabag_core.doctrine.prefixed_naming_strategy
auto_mapping: true
stof_doctrine_extensions:
default_locale: "%locale%"
translation_fallback: true
orm:
default:
tree: true
sluggable: true
# Swiftmailer Configuration
swiftmailer:
transport: "%mailer_transport%"
@ -110,7 +128,10 @@ fos_rest:
routing_loader:
default_format: json
nelmio_api_doc: ~
nelmio_api_doc:
sandbox:
enabled: false
name: wallabag API documentation
nelmio_cors:
defaults:
@ -156,4 +177,33 @@ liip_theme:
fos_user:
db_driver: orm
firewall_name: main
user_class: Wallabag\CoreBundle\Entity\User
user_class: Wallabag\UserBundle\Entity\User
registration:
confirmation:
enabled: true
fos_oauth_server:
db_driver: orm
client_class: Wallabag\ApiBundle\Entity\Client
access_token_class: Wallabag\ApiBundle\Entity\AccessToken
refresh_token_class: Wallabag\ApiBundle\Entity\RefreshToken
auth_code_class: Wallabag\ApiBundle\Entity\AuthCode
service:
user_provider: fos_user.user_manager
scheb_two_factor:
trusted_computer:
enabled: true
cookie_name: wllbg_trusted_computer
cookie_lifetime: 2592000
email:
enabled: %twofactor_auth%
sender_email: %twofactor_sender%
digits: 6
template: WallabagUserBundle:Authentication:form.html.twig
mailer: wallabag_user.auth_code_mailer
kphoen_rulerz:
executors:
doctrine: true

View File

@ -17,11 +17,6 @@ monolog:
type: fingers_crossed
action_level: error
handler: nested
wsse:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.wsse.log
level: error
channels: [wsse]
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"

View File

@ -19,9 +19,14 @@ swiftmailer:
doctrine:
dbal:
driver: pdo_sqlite
path: %kernel.root_dir%/../data/db/wallabag_test.sqlite
host: localhost
driver: "%test_database_driver%"
host: "%test_database_host%"
port: "%test_database_port%"
dbname: "%test_database_name%"
user: "%test_database_user%"
password: "%test_database_password%"
charset: UTF8
path: "%test_database_path%"
orm:
metadata_cache_driver:
type: service

View File

@ -1,7 +1,7 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
@ -9,6 +9,14 @@ parameters:
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_sqlite
test_database_host: 127.0.0.1
test_database_port: ~
test_database_name: ~
test_database_user: ~
test_database_password: ~
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
@ -21,6 +29,8 @@ parameters:
# wallabag misc
app.version: 2.0.0-alpha
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# message to display at the bottom of the page
warning_message: >
@ -41,10 +51,15 @@ parameters:
export_epub: true
export_mobi: true
export_pdf: true
wallabag_url: http://v2.wallabag.org
wallabag_support_url: 'https://www.wallabag.org/pages/support.html'
# default user config
items_on_page: 12
theme: material
language: en_US
language: en
from_email: no-reply@wallabag.org
rss_limit: 50
# pocket import
pocket_consumer_key: xxxxxxxx

View File

@ -1,32 +1,33 @@
wallabag_import:
resource: "@WallabagImportBundle/Controller/"
type: annotation
prefix: /import
wallabag_api:
resource: "@WallabagApiBundle/Resources/config/routing.yml"
prefix: /
prefix: /
app:
resource: @WallabagCoreBundle/Controller/
type: annotation
type: annotation
doc-api:
resource: "@NelmioApiDocBundle/Resources/config/routing.yml"
prefix: /api/doc
login:
pattern: /login
defaults: { _controller: WallabagCoreBundle:Security:login }
login_check:
pattern: /login_check
logout:
path: /logout
rest :
type : rest
resource : "routing_rest.yml"
prefix : /api
homepage:
pattern: "/{page}"
defaults: { _controller: WallabagCoreBundle:Entry:showUnread, page : 1 }
path: "/{page}"
defaults: { _controller: WallabagCoreBundle:Entry:showUnread, page : 1 }
requirements:
page: \d+
page: \d+
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
fos_oauth_server_token:
resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml"

View File

@ -1,9 +1,6 @@
security:
encoders:
Wallabag\CoreBundle\Entity\User:
algorithm: sha1
encode_as_base64: false
iterations: 1
FOS\UserBundle\Model\UserInterface: sha512
role_hierarchy:
ROLE_ADMIN: ROLE_USER
@ -11,18 +8,23 @@ security:
providers:
administrators:
entity: { class: WallabagCoreBundle:User, property: username }
entity: { class: WallabagUserBundle:User, property: username }
fos_userbundle:
id: fos_user.user_provider.username
# the main part of the security, where you can set up firewalls
# for specific sections of your app
firewalls:
wsse_secured:
pattern: /api/.*
wsse: true
stateless: true
anonymous: true
oauth_token:
pattern: ^/oauth/v2/token
security: false
api:
pattern: /api/.*
fos_oauth: true
stateless: true
anonymous: true
login_firewall:
pattern: ^/login$
anonymous: ~
@ -45,9 +47,9 @@ security:
target: /
access_control:
- { path: ^/api/salt, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/api/doc, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/forgot-password, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: /(unread|starred|archive).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/, roles: ROLE_USER }

View File

@ -1,9 +1,4 @@
# Learn more about services, parameters and containers at
# http://symfony.com/doc/current/book/service_container.html
parameters:
security.authentication.provider.dao.class: Wallabag\CoreBundle\Security\Authentication\Provider\WallabagAuthenticationProvider
security.encoder.digest.class: Wallabag\CoreBundle\Security\Authentication\Encoder\WallabagPasswordEncoder
security.validator.user_password.class: Wallabag\CoreBundle\Security\Validator\WallabagUserPasswordValidator
lexik_form_filter.get_filter.doctrine_orm.class: Wallabag\CoreBundle\Event\Subscriber\CustomDoctrineORMSubscriber
services:
@ -17,3 +12,21 @@ services:
class: Twig_Extensions_Extension_Text
tags:
- { name: twig.extension }
wallabag.twig_extension:
class: Wallabag\CoreBundle\Twig\WallabagExtension
public: false
tags:
- { name: twig.extension }
wallabag.locale_listener:
class: Wallabag\CoreBundle\EventListener\LocaleListener
arguments: ["%kernel.default_locale%"]
tags:
- { name: kernel.event_subscriber }
wallabag.user_locale_listener:
class: Wallabag\CoreBundle\EventListener\UserLocaleListener
arguments: ["@session"]
tags:
- { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin }

View File

@ -0,0 +1,65 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_mysql
test_database_host: localhost
test_database_port: 3306
test_database_name: wallabag
test_database_user: root
test_database_password: ~
test_database_path: ~
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# wallabag misc
app.version: 2.0.0-alpha
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# message to display at the bottom of the page
warning_message: >
You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
download_pictures: false # if true, pictures will be stored into data/assets for each article
# Entry view
share_twitter: true
share_mail: true
share_shaarli: true
shaarli_url: http://myshaarli.com
share_diaspora: true
diaspora_url: http://diasporapod.com
flattr: true
carrot: true
show_printlink: true
export_epub: true
export_mobi: true
export_pdf: true
wallabag_url: http://v2.wallabag.org
wallabag_support_url: 'https://www.wallabag.org/pages/support.html'
# default user config
items_on_page: 12
theme: material
language: en_US
from_email: no-reply@wallabag.org
rss_limit: 50
# pocket import
pocket_consumer_key: xxxxxxxx

View File

@ -0,0 +1,65 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_pgsql
test_database_host: localhost
test_database_port:
test_database_name: wallabag
test_database_user: travis
test_database_password: ~
test_database_path: ~
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# wallabag misc
app.version: 2.0.0-alpha
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# message to display at the bottom of the page
warning_message: >
You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
download_pictures: false # if true, pictures will be stored into data/assets for each article
# Entry view
share_twitter: true
share_mail: true
share_shaarli: true
shaarli_url: http://myshaarli.com
share_diaspora: true
diaspora_url: http://diasporapod.com
flattr: true
carrot: true
show_printlink: true
export_epub: true
export_mobi: true
export_pdf: true
wallabag_url: http://v2.wallabag.org
wallabag_support_url: 'https://www.wallabag.org/pages/support.html'
# default user config
items_on_page: 12
theme: material
language: en_US
from_email: no-reply@wallabag.org
rss_limit: 50
# pocket import
pocket_consumer_key: xxxxxxxx

View File

@ -0,0 +1,65 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_sqlite
test_database_host: localhost
test_database_port:
test_database_name: ~
test_database_user: ~
test_database_password: ~
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# wallabag misc
app.version: 2.0.0-alpha
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# message to display at the bottom of the page
warning_message: >
You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
download_pictures: false # if true, pictures will be stored into data/assets for each article
# Entry view
share_twitter: true
share_mail: true
share_shaarli: true
shaarli_url: http://myshaarli.com
share_diaspora: true
diaspora_url: http://diasporapod.com
flattr: true
carrot: true
show_printlink: true
export_epub: true
export_mobi: true
export_pdf: true
wallabag_url: http://v2.wallabag.org
wallabag_support_url: 'https://www.wallabag.org/pages/support.html'
# default user config
items_on_page: 12
theme: material
language: en_US
from_email: no-reply@wallabag.org
rss_limit: 50
# pocket import
pocket_consumer_key: xxxxxxxx

View File

@ -1,17 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="wallabag" default="build">
<target name="build" depends="prepare"/>
<target name="build" depends="clean,composer,prepare,phpunit"/>
<target name="prepare-mysql" depends="clean,composer,db_mysql,prepare"/>
<target name="prepare-sqlite" depends="clean,composer,db_sqlite,prepare"/>
<target name="prepare-pgsql" depends="clean,composer,db_pgsql,prepare"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/app/cache"/>
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<target name="composer" description="Install deps using Composer">
<exec executable="composer">
<arg value="install"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
</exec>
</target>
<target name="prepare" description="Prepare for build">
<exec executable="php">
<arg value="${basedir}/app/console"/>
<arg value="doctrine:database:drop"/>
@ -41,6 +47,48 @@
</exec>
</target>
<target name="db_mysql" description="Run test for MySQL">
<delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters.yml.dist.mysql"/>
<arg value="${basedir}/app/config/parameters.yml"/>
</exec>
<exec executable="php">
<arg value="${basedir}/app/console"/>
<arg value="cache:clear"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="db_sqlite" description="Run test for SQLite">
<delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters.yml.dist.sqlite"/>
<arg value="${basedir}/app/config/parameters.yml"/>
</exec>
<exec executable="php">
<arg value="${basedir}/app/console"/>
<arg value="cache:clear"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="db_pgsql" description="Run test for PostgreSQL">
<delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters.yml.dist.pgsql"/>
<arg value="${basedir}/app/config/parameters.yml"/>
</exec>
<exec executable="php">
<arg value="${basedir}/app/console"/>
<arg value="cache:clear"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">
<exec executable="phpunit" failonerror="true">
<arg value="--coverage-html"/>

View File

@ -28,10 +28,10 @@
"issues": "https://github.com/wallabag/wallabag/issues"
},
"require": {
"php": ">=5.3.3",
"php": ">=5.5.0",
"symfony/symfony": "~2.7.0",
"doctrine/orm": "~2.3",
"doctrine/doctrine-bundle": "~1.2",
"doctrine/doctrine-bundle": "1.5.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
@ -45,7 +45,7 @@
"nelmio/api-doc-bundle": "~2.7",
"ezyang/htmlpurifier": "~4.6",
"mgargano/simplehtmldom": "~1.5",
"tecnick.com/tcpdf": "~6.2",
"tecnickcom/tcpdf": "~6.2",
"simplepie/simplepie": "~1.3.1",
"willdurand/hateoas-bundle": "~0.5.0",
"htmlawed/htmlawed": "~1.1.19",
@ -53,13 +53,27 @@
"pagerfanta/pagerfanta": "~1.0.3",
"lexik/form-filter-bundle": "~4.0",
"j0k3r/graby": "~1.0",
"friendsofsymfony/user-bundle": "dev-master"
"friendsofsymfony/user-bundle": "dev-master",
"friendsofsymfony/oauth-server-bundle": "^1.4@dev",
"stof/doctrine-extensions-bundle": "^1.2@dev",
"scheb/two-factor-bundle": "~1.4.0",
"grandt/phpepub": "~4.0",
"wallabag/php-mobi": "~1.0.0",
"kphoen/rulerz-bundle": "~0.10",
"guzzlehttp/guzzle": "^5.2.0"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "~2.2.0",
"sensio/generator-bundle": "~2.5",
"phpunit/phpunit": "~4.4"
"phpunit/phpunit": "~4.4",
"symfony/phpunit-bridge": "~2.7.0"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/wallabag/phpMobi"
}
],
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
@ -74,6 +88,9 @@
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"build-parameters": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
]
},
"extra": {
@ -81,7 +98,13 @@
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
"file": "app/config/parameters.yml",
"env-map": {
"mailer_host": "WALLABAG_MAILER_HOST",
"mailer_user": "WALLABAG_MAILER_USER",
"mailer_password": "WALLABAG_MAILER_PASSWORD",
"secret": "WALLABAG_SECRET"
}
}
},
"autoload": {

2303
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -4,8 +4,8 @@ lock '3.4.0'
set :application, 'wallabag'
set :repo_url, 'git@github.com:wallabag/wallabag.git'
set :ssh_user, 'ssh_user'
server 'server_ip', user: fetch(:ssh_user), roles: %w{web app db}
set :ssh_user, 'framasoft_bag'
server '78.46.248.87', user: fetch(:ssh_user), roles: %w{web app db}
set :scm, :git
@ -16,51 +16,8 @@ set :log_level, :info
set :composer_install_flags, '--no-dev --prefer-dist --no-interaction --optimize-autoloader'
set :linked_files, %w{app/config/parameters.yml}
set :linked_dirs, %w{app/logs web/uploads}
set :linked_dirs, %w{app/logs web/uploads data}
set :keep_releases, 3
after 'deploy:finishing', 'deploy:cleanup'
# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
# Default deploy_to directory is /var/www/my_app_name
# set :deploy_to, '/var/www/my_app_name'
# Default value for :scm is :git
# set :scm, :git
# Default value for :format is :pretty
# set :format, :pretty
# Default value for :log_level is :debug
# set :log_level, :debug
# Default value for :pty is false
# set :pty, true
# Default value for :linked_files is []
# set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
# Default value for linked_dirs is []
# set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system')
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# Default value for keep_releases is 5
# set :keep_releases, 5
namespace :deploy do
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
end

View File

@ -1,64 +1,2 @@
# server-based syntax
# ======================
# Defines a single server with a list of roles and multiple properties.
# You can define all roles on a single server, or split them:
set :branch, 'v2'
set :deploy_to, '/var/www/'
# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
# server 'db.example.com', user: 'deploy', roles: %w{db}
# role-based syntax
# ==================
# Defines a role with one or multiple servers. The primary server in each
# group is considered to be the first unless any hosts have the primary
# property set. Specify the username and a domain or IP for the server.
# Don't use `:all`, it's a meta role.
# role :app, %w{deploy@example.com}, my_property: :my_value
# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
# role :db, %w{deploy@example.com}
# Configuration
# =============
# You can set any configuration variable like in config/deploy.rb
# These variables are then only loaded and set in this stage.
# For available Capistrano configuration variables see the documentation page.
# http://capistranorb.com/documentation/getting-started/configuration/
# Feel free to add new variables to customise your setup.
# Custom SSH Options
# ==================
# You may pass any option but keep in mind that net/ssh understands a
# limited set of options, consult the Net::SSH documentation.
# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
#
# Global options
# --------------
# set :ssh_options, {
# keys: %w(/home/rlisowski/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(password)
# }
#
# The server-based syntax can be used to override options:
# ------------------------------------
# server 'example.com',
# user: 'user_name',
# roles: %w{web app},
# ssh_options: {
# user: 'user_name', # overrides user setting above
# keys: %w(/home/user_name/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(publickey password)
# # password: 'please use keys'
# }
set :deploy_to, '/var/www/v2.wallabag.org/web/'

0
docs/README.rst Normal file
View File

View File

@ -0,0 +1,85 @@
Hidden options
==============
Caution
-------
**Be careful**, this section is destined to advanced users. We are going
to modify an important wallabag configuration file,
``inc/poche/config.inc.php``. It is therefore advised to do a backup of
this file before you proceed. **Any error occuring during the
modification of a wallabag file could lead to malfunctions**.
This file is created when you install wallabag. Install wallabag, do a
backup copy of the file, then open it in your favorite text editor.
In this file, there are some options that are not, as of now, available
in the **config** page of wallabag.
Modification of advanced options
--------------------------------
Each option is defined this way:
::
@define ('OPTION_NAME', 'Value');
For each line, you can only modify the ``Value`` field.
Here is the list of each option you can change:
- ``HTTP_PORT`` (default: ``80``) : the HTTP port of your web server.
You may need to change it if your server is behind a proxy. Accepted
values: number
- ``SSL_PORT`` (default: ``443``) : the HTTP port of your web server.
You may need to change it if your server use SSLH. Accepted values:
number
- ``MODE_DEMO`` (default : ``FALSE)``: If you ever wanted to set up a
demonstration server… Accepted values: ``TRUE`` or ``FALSE``.
- ``DEBUG_POCHE`` (default: ``FALSE``) : if you encounter some problems
with wallabag, we may ask you to active Debug mode. Accepted values:
``TRUE`` or ``FALSE``. Check the logs in cache/log.txt after
activating that.
- ``ERROR_REPORTING`` (default : ``E_ALL & ~E_NOTICE``) : Set to
``E_ALL`` if needed to look for eventual PHP errors.
- ``DOWNLOAD_PICTURES`` (default: ``FALSE``) : Allows wallabag to fetch
images from the articles you save on your server, instead of fetching
only the text. We prefer to let you activate this option yourself.
Accepted values: ``TRUE`` or ``FALSE``.
- ``REGENERATE_PICTURES_QUALITY`` (default : ``75``) : In order to
avoid security problems, pictures are regenerated if you activate the
download of pictures. This is the percentage of quality at which they
are saved. Increase that numbler if you want better quality, lower if
you need better performances.
- ``SHARE_TWITTER`` (default: ``TRUE``) : enables Twitter sharing.
Accepted values: ``TRUE`` or ``FALSE``.
- ``SHARE_MAIL`` (default: ``TRUE``) : enables mail sharing. Accepted
values: ``TRUE`` or ``FALSE``.
- ``SHARE_EVERNOTE``\ (default : ``FALSE``) : enables sharing with your
Evernote account. Accepted values: ``TRUE`` or ``FALSE``.
- ``SHARE_DIASPORA`` (default : ``FALSE``) : enables to share an
article on your Diaspora account.
- ``DIASPORA_URL`` (default : ``http://diasporapod.com``) : The URL of
your Diaspora\* pod
- ``CARROT`` (default : ``FALSE``) : Like Flattr, its a service to
give small amounts of money to a web page. See http://carrot.org/
- ``SHARE_SHAARLI`` (default: ``FALSE``) : enables sharing via your
Shaarli installation (Shaarli is an open-source bookmark manager).
Accepted values: ``TRUE`` or ``FALSE``.
- ``SHAARLI_URL`` (default: ``'http://myshaarliurl.com'``) : defines
your Shaarli installation URL. Accepted values: an URL.
- ``FLATTR`` (default: ``TRUE``) : enables the possibility to Flattr an
article (`Flattr is a microdonation platform`_). If an article is
Flattr-able, an icon will be displayed, allowing you to send a
microdonation to the author. Accepted values: ``TRUE`` or ``FALSE``.
- ``SHOW_PRINTLINK`` (default: ``'1'``) : enables the Print button for
articles. Accepted values: ``'1'`` to enable or ``'0'`` to disable.
- ``SHOW_READPERCENT`` (default: ``'1'``) : enables the reading
progress on articles (working on the ``default``, ``dark``,
``dmagenta``, ``solarized``, ``solarized-dark`` themes). Accepted
values: ``'1'`` to enable or ``'0'`` to disable.
- ``PAGINATION`` (default: ``'12'``) : defines the number of articles
that are displayed on a list. Accepted values: number.
.. _Flattr is a microdonation platform: http://en.wikipedia.org/wiki/Flattr

View File

@ -0,0 +1,200 @@
Download and install wallabag
=============================
I dont want to install wallabag
--------------------------------
If you cant or dont want to install Wallabag on your server, we
suggest you create a free account on `Framabag`_ which uses our
software (see :ref:`Framabag account creation`).
I want to install wallabag
--------------------------
I want to download wallabag manually
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`Download the latest wallabag version`_ and unpack it:
::
wget http://wllbg.org/latest
unzip latest
mv wallabag-version-number wallabag
Copy the files on your web server. For Ubuntu/Debian, it is the
directory /var/www/html/ :
::
sudo mv wallabag /var/www/html/
Then, jump off to next section.
I want to download wallabag via composer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You need to install composer:
::
curl -s http://getcomposer.org/installer | php
Next, on your web server, run this command:
::
composer create-project wallabag/wallabag . dev-master
All is downloaded into the current folder.
Prerequisites for your web server
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Wallabag requires that several components to be installed on your web
server. To make sure your server has all the prerequisites, open in your
browser the page ``http://monserveur.com/wallabag/install/index.php``.
The components are:
- `PHP 5.3.3 or above`_ **with `PDO`_ support**
- `XML for PHP`_
- `PCRE`_
- `ZLib`_ (otherwise, the processing of compressed pages will be
affected)
- `mbstring`_ anb/or `iconv`_ (otherwise some pages will not be read -
even in English)
- The `DOM/XML`_ extension
- `Data filtering`_
- `GD`_ (otherwise, pictures will not be saved)
- `Tidy for PHP`_ (otherwise, you may encounter problems with some
pages)
- `cURL`_ with ``Parallel URL fetching`` (optionnal)
- `Parse ini file`_
- `allow\_url\_fopen`_ (optionnal if cURL is installed)
- `gettext`_ (required for multi-language support)
Install the missing components before to proceed. For example, to
install Tidy on Ubuntu/Debian:
::
sudo apt-get install php5-tidy
sudo service apache2 reload
Note : if youre using IIS as a webserver, you have to disable
*Anonymous Authentication* and `enable *Basic Authentication*`_ in order
to be able to login.
Twig installation
^^^^^^^^^^^^^^^^^
wallabag is build with Twig, a template library. You have to download it
for wallabag to work. If you cannot install ``composer`` (for example in
the case of shared hosting), we offer you to download a file which
includes ``Twig``. This file can be downloaed from the page
``http://myservur.com/wallabag/install/index.php`` (section TWIG
INSTALLATION) or directly at http://wllbg.org/vendor. Uncompress it in
your wallabag directory.
Otherwise, you can use Composer to install ``Twig`` by launching
``composer`` from your wallabag directory (in the case of Ubuntu/Debian
too: /var/www/html/wallabag/) by following the commands written on
screen:
::
curl -s http://getcomposer.org/installer | php
php composer.phar install
Creation of the database.
^^^^^^^^^^^^^^^^^^^^^^^^^
Wallabag can be installed on different types of databases:
- `SQLite`_. The easiest system of all. No extra configuration needed.
- `MySQL`_. A well known database system, which is in most cases more
efficient than SQLite.
- `PostgreSQL`_. Some people found it better than MySQL.
We advice you to use MySQL because it is more efficient. In this case,
you should create a new database (for example ``wallabag``), a new user
(for example ``wallabag``) and a password (here ``YourPassWord``). To do
this, you can use ``phpMyAdmin``, or launch the following commands:
::
mysql -p -u root
mysql> CREATE DATABASE wallabag;
mysql> GRANT ALL PRIVILEGES ON `wallabag`.* TO 'wallabag'@'localhost' IDENTIFIED BY 'VotreMotdePasse';
mysql> exit
*Note:* If youre using MySQL or Postgresql, you have to **fill all the
fields**, otherwise the installation will not work and an error message
will tell you whats wrong. You must create the database that you will
use for wallabag manually with a tool like PHPMyAdmin or the console.
Permissions
~~~~~~~~~~~
Your web server needs a writing access to the ``assets``, ``cache`` and
``db`` directories. Otherwise, a message will report that the
installation is impossible:
::
sudo chown -R www-data:www-data /var/www/html/wallabag
Installation of wallabag. At last.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Access to wallabag from your web browser:
``http://votreserveur.com/wallabag``. If your server is correctly
configured, you directly reach the setup screen.
Select the type of database (``sqlite``, ``mysql`` or ``postgresql``)
and fill the information about your database. In the case of the databse
MySQL created before, the standard configuration will be:
::
Database engine: MySQL
Server: localhost
Database: wallabag
Username: wallabag
Password: YourPassWord
Finally, Create your first user and his/her password (different from the
database user).
Wallabag is now installed.
Login
-----
From your web browser, you reach the login screen: fill your username
and your password to connect to your account.
Enjoy!
.. _SQLite: http://php.net/manual/fr/book.sqlite.php
.. _MySQL: http://php.net/manual/fr/book.mysql.php
.. _PostgreSQL: http://php.net/manual/fr/book.pgsql.php
.. _Framabag: https://framabag.org/
.. _Download the latest wallabag version: http://wllbg.org/latest
.. _PHP 5.3.3 or above: http://php.net/manual/fr/install.php
.. _PDO: http://php.net/manual/en/book.pdo.php
.. _XML for PHP: http://php.net/fr/xml
.. _PCRE: http://php.net/fr/pcre
.. _ZLib: http://php.net/en/zlib
.. _mbstring: http://php.net/en/mbstring
.. _iconv: http://php.net/en/iconv
.. _DOM/XML: http://php.net/manual/en/book.dom.php
.. _Data filtering: http://php.net/manual/fr/book.filter.php
.. _GD: http://php.net/manual/en/book.image.php
.. _Tidy for PHP: http://php.net/fr/tidy
.. _cURL: http://php.net/fr/curl
.. _Parse ini file: http://uk.php.net/manual/en/function.parse-ini-file.php
.. _allow\_url\_fopen: http://www.php.net/manual/fr/filesystem.configuration.php#ini.allow-url-fopen
.. _gettext: http://php.net/manual/fr/book.gettext.php
.. _enable *Basic Authentication*: https://technet.microsoft.com/en-us/library/cc772009%28v=ws.10%29.aspx

View File

@ -0,0 +1,47 @@
.. _`Multi users`:
Multi users
===========
Create a new account
--------------------
Administrator mode
------------------
If you want to use wallabag with several persons, you can create new
accounts from the configuration page.
At the bottom of this page there is a form where you should input a user
name and a password.
It is now possible to login to this account from the login page of
wallabag.
No information are shared among the accounts.
Open registration mode
----------------------
Starting from version 1.9, the administrator can let users register by
themselves. This is done by changing the following lines in the
configuration file:
::
// registration
@define ('ALLOW_REGISTER', FALSE);
@define ('SEND_CONFIRMATION_EMAIL', FALSE);
Then, a user will be able to enter his/her user name and password to
create his/her own account. Depending on the configuration, a
confimation email can be sent to users who gave an email address.
Remove an account
-----------------
It is possible to remove your own account from the configuration page.
You simply have to enter your password and to ask for the removal.
Of course, when there is only one account, it is impossible to remove
it.

View File

@ -0,0 +1,26 @@
Session issues
==============
If you end up disconnected even while checking the *Stay signed in
checkbox*, please run the following commands as root (or with sudo) :
::
mkdir /var/lib/wallabag-sessions
chown www-data:www-data /var/lib/wallabag-sessions
*NOTE : The www-data user and group may not exist, you may use
``chown http:http /var/lib/wallabag-sessions`` instead*
Then, using apache add:
``php_admin_value session.save_path /var/lib/wallabag-sessions`` to your
apache vhost, for instance ``wallabag-apache.conf`` Finally, restart
apache, for instance like this : ``/etc/init.d/apache2 restart``
If youre using nginx, add
``php_admin_value[session.save_path] = /var/lib/wallabag-sessions`` in
your nginx configuration file. Then, restart nginx :
``/etc/init.d/nginx restart``
*NOTE : If youre using systemd, you should do
``systemctl restart apache2`` (or nginx).*

View File

@ -0,0 +1,30 @@
Update wallabag
===============
Update an existing wallabag installation
----------------------------------------
In order to update your installation, download and unzip the archive
into your installation folder. For example on Ubuntu/Debian:
::
wget http://wllbg.org/latest
unzip latest
rsync -ur wallabag-version-number/* /var/www/html/wallabag/ # could be another location such as /srv/html, /usr/share/nginx/html
After that, just access wallabag in your browser and follow the
instructions to finish the update.
You can verify at the bottom of the configuration page that youre
running the last version.
**If it fails**, just delete the ``install`` folder and clear the cache:
::
cd /var/www/html/wallabag/
rm -r cache/* install/
Clearing the cache is also possible in the configuration page, clicking
on the link ``Delete Cache``.

View File

@ -0,0 +1,4 @@
Create new theme
================
TODO

View File

@ -0,0 +1,29 @@
Git repository
==============
If you wish to contribute to the project by suggesting new features or
by fixing some bugs, please follow the recommendations below regarding
the git repository available at https://github.com/wallabag/wallabag.
Current state
-------------
To manage the different versions of wallabag, we use Git.
There are multiple branches for the source code of wallabag web app:
- ``master`` branch : this is the stable branch, downloaded by those
who wish to install wallabag for their own use.
- ``dev`` branch : before being added on ``master`` branch, all bug
fixes and new features must go on that branch. This branch is not
recommended for production use.
- ``v2`` branch : this is the branch for a revamp of wallabag.
A whole chapter is to be focused on it.
Workflow
--------
All the rules for contributing to the git repository are in the
`CONTRIBUTING.md file of
wallabag <https://github.com/wallabag/wallabag/blob/master/CONTRIBUTING.md>`__.
Please read carefully this file before you make any change.

View File

@ -0,0 +1,52 @@
Write config files
==================
wallabag can use specific site config files to parse website articles.
These files are stored in the
```inc/3rdparty/site_config/standard`` <https://github.com/wallabag/wallabag/tree/master/inc/3rdparty/site_config/standard>`__
folder.
The format used for these files is
`XPath <http://www.w3.org/TR/xpath20/>`__. Look at some examples in the
folder.
Automatic config files generation
---------------------------------
Fivefilters has created a `very useful
tool <http://siteconfig.fivefilters.org/>`__ to create config files. You
just type in the adress of the article to work on with, and you select
the area containing the content you want.
.. figure:: https://lut.im/RNaO7gGe/l9vRnO1b
:alt: siteconfig
siteconfig
| You should confirm this area by trying with other articles.
| When you got the right area, just click on *Download Full-Text RSS
site config* to download your file.
Manual config file generation
-----------------------------
If Fivefilters tool doesn't work correctly, take a look at the source
(Ctrl + U on Firefox and Chromium). Search for your content and get the
``class`` or the ``id`` attribute of the area containing what you want.
Once you've got the id or class, you can write for example one or
another of these lines:
::
body: //div[@class='myclass']
body: //div[@id='myid']
Then, test you file. If you got the right content but you want to strip
unnecessary parts, do:
::
strip: //div[@class='hidden']
You can look at other options for siteconfig files
`here <http://help.fivefilters.org/customer/portal/articles/223153-site-patterns>`__.

View File

@ -0,0 +1,118 @@
.. _`Configure wallabag`:
Configure wallabag
==================
From the configuration menu, you can change some of wallabag's options.
Some parts won't be detailed here, as they have a dedicated chapter in
the documentation (:ref:`RSS feeds`, :ref:`Import / Export`, :ref:`ePub conversion` and :ref:`Multi users`).
Saving articles
---------------
You'll find help about the different ways to save articles to your
wallabag here.
Save article field
~~~~~~~~~~~~~~~~~~
Enter a link in the field and click “bag it!” to save.
Browser extensions
~~~~~~~~~~~~~~~~~~
Links to download extensions for your favourite browser, Firefox or
Chrome.
Mobile apps
~~~~~~~~~~~
Links to download mobile apps, Android, iOS or Windows Phone.
For Android, you have the choice to download either from Google's Play
Store of from the Free and Open Source market
`F-Droid <https://f-droid.org>`__
Bookmarklet
~~~~~~~~~~~
Lastly, you can use the bookmarklet. A bookmarklet is a simple link you
can drag to your browser's bookmarks. Once it's in your bookmarks,
simply clicking on it will save the webpage you're currently viewing to
your wallabag.
Feeds
-----
Plese refer to `RSS feeds <rss_feed.html>`__ for more details.
.. _`Howto change theme`:
Theme
-----
As they say, “all tastes and colors are found in nature”. That's why
wallabag allows you to change its appearance through the use of themes,
in order to please everyone.
Select the theme of your choice from the drop down list and confirm by
clicking on **Update**.
Language
--------
Select the language of your choice in the drop down list and confirm by
clicking on **Update**.
Import
------
Please refer to `Import/Export <import_export.html>`__ for more details.
Export
------
Please refer to `Import/Export <import_export.html>`__ for more details.
Clear the cache
---------------
The cache allows wallabag perform certain functions faster.
After updating wallabag, it is advised to clear the cache.
Click on “delete cache” to do so (no confirmation will be asked).
Password
--------
Fill in your new password in the two dedicated fields and confirm by
clicking on **Update**.
You will be disconnected and will have to enter your new password to
access your wallabag.
User
----
Add a user here by entering their name, password and (optionnaly) email
in the corresponding fields.
You may not be able to add a user if don't have the rights to do so.
Remind newly created users to change their password the first time they
connect to wallabag!
Delete
------
Delete your user account on wallabag here.
If there is only one account, you won't be able to delete the account.
Upgrade
-------
Wallabag will check its curent version and if there is a new version
available and display this information here.

View File

@ -0,0 +1,32 @@
.. _`ePub conversion`:
ePub conversion
===============
To enable you to read your articles on a e-reader, wallabag can convert
them to the ePub format, and hence create an eBook for your long winter
evenings.
A word of caution
-----------------
Be careful, the creation of ePub files can be very resource demanding
for the server on which wallabag is installed. It depends on the number
of articles and on their length. Do not create a really big eBook if
this is not necessary.
Where to convert the articles
-----------------------------
You can convert your articles at various places in wallabag:
- on the reading page of an article: the ePub link will convert this
article only
- from the list of articles (unread, favorite or archived articles,
articles with a tag): a link at the bottom of the page allows you to
convert all the article of this category
- from a search: the link is at the bottom of the page
- from the configuration page: you can convert all your articles,
whatever the category to which they belong
TODO talk about calibre

View File

@ -0,0 +1,49 @@
.. _`Framabag account creation`:
Framabag account creation
=========================
If you do not want to install and update wallabag, or if you do not have
the know-how to install it, it is possible to create an account for free
at `Framabag.org <https://www.framabag.org>`__.
Account creation
----------------
Click on the button **Créez votre compte / Create your account**.
You have to input some information: your username, your password and
your email address. Your address is used only to validate your account,
except if you check the box to subscribe the newsletter (3 to 4 messages
per year).
Once this form validated, you will receive an email with the
confirmation link. Click on it to create your account.
You will receive a last email with the address of your Framabag account,
which will look like ``https://www.framabag.org/u/Your-username``.
Information storage
-------------------
Framabag use one database per user. We do not and will not use your
stored data.
You have forgotten your password
--------------------------------
| If you have forgotten your password to get connected to Framabag, a
form is available `on the main page of the
service <https://www.framabag.org>`__.
| Fill it, and a confirmation will be sent to you and will allow you to
input a new password.
Account deletion
----------------
If you wish to delete your account, contact us by email:
hello@wallabag.org using the address your created your account with, and
state your username.
We will answer you after your account has been deleted: then, no
information about you will be stored by Framabag.

View File

@ -0,0 +1,107 @@
.. _`Import / Export`:
Import and export data
======================
Import
------
To import data in wallabag, go to the page **Configuration**.
Caution
~~~~~~~
Data import can be a **demanding process** for your server. Hence, it is
done in two steps:
- Insertion of the URL in the wallabag database
- in the second step, the retrieval, for each article, of its full
content.
These two steps cannot be done concurrently, because it let us the
possibility to import thousands of links, but today, wallabag does not
have sufficient technical capabilities to do this task automatically.
From Pocket
~~~~~~~~~~~
Export your data from Pocket
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
From your Pocket account, go to the options. TODO
Import your Pocket data
^^^^^^^^^^^^^^^^^^^^^^^
From the configuration page of wallabag, section **Import**, select the
file ``ril_export.html`` generated by Pocket, then click on **Import**.
Wallabag only insert these links in the database. Now, you have to get
the content of each article.
For this, click on ``Click to finish import``: wallabag will fetch the
content of 10 articles at a time.
TODO
TODO new ticket: why when a click is done, this does not load in a loop?
I believe this was doing this ping @mariroz
From Instapaper
~~~~~~~~~~~~~~~
Export your data from Instapaper
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TODO
Import your Instapaper data
^^^^^^^^^^^^^^^^^^^^^^^^^^^
TODO
From Readability
~~~~~~~~~~~~~~~~
Export your data from Readability
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TODO
Import your Readability data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TODO
From wallabag
~~~~~~~~~~~~~
Since you can export your data from wallabag (see below), it is of
course possible to re-import them.
In the import form, select your wallabag-exported file (format JSON).
Start the import, et voilà.
Unlike the above imports, this process is shorter because all the data
(title and content of the articles) are already included in the file.
Hence wallabag does not have to access each URL. However, the import
file is necessarily bigger.
From a HTML or JSON file
~~~~~~~~~~~~~~~~~~~~~~~~
TODO
Export
------
It is possible to export your data from the page **Configuration** of
wallabag. Several reasons to do this:
- re-install of wallabag
- leave the Framabag service to install your own wallabag
- a user with an account on a multi-user wallabag want to have his/her
own wallabag installation
- ...
This will lead you to download a file `at the JSON
format <http://en.wikipedia.org/wiki/JavaScript_Object_Notation>`__. As detailed above, you can import this file in wallabag.

View File

@ -0,0 +1,36 @@
.. _`Article is not displayed properly`:
My article is not displayed properly in wallabag
================================================
If you think wallabag do not copy well the content of an article (empty
or incomplete text), here are some suggestions.
Ask for help
------------
Via an email or a ticket, do not forget to give some information that
are important for us to better solve the problem:
- The URL of the article
- What wallabag displays
- What you were expecting
- The wallabag version of if you use Framabag
Open a ticket on github
~~~~~~~~~~~~~~~~~~~~~~~
To open a new ticket, you should `go to
github <https://github.com/wallabag/wallabag/issues/new>`__. An account
is required. Do not forget to send us the information listed above.
Send us an email
~~~~~~~~~~~~~~~~
Send us the link in a email to the address
`hello@wallabag.org <mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag>`__. Do not forget to send us the information listed above.
Solve this display problem
--------------------------
TODO

View File

@ -0,0 +1,109 @@
.. _`Organize articles`:
Organize articles
=================
To be able to find more easily your articles, several methods are
available.
Tags
----
Assign a tag
~~~~~~~~~~~~
When saving an article
^^^^^^^^^^^^^^^^^^^^^^
To tag an article when saving it, just click on the tag icon next to the
URL field before hitting the Save button. At the moment, it is possible
only to do this from the web interface, but it could come to some apps
or extensions.
From the article
^^^^^^^^^^^^^^^^
To tag an already-saved article, go to the reading page of the article.
There is a part ``tags`` followed with a pencil. Click on the pencil.
Input in the box the tags you want to assign. Add as many tags as you
want. They need to be separated by commas and not spaces.
Auto-completion is available here: when you type the first letters of an
existing tag, it is not necessary to type the whole word. Select it in
the drop-down list. Once all your tags are inputted, click on the button
**Tag**.
Then, you can go back to your article and read it.
From the search
^^^^^^^^^^^^^^^
A full chapter on search is available. Here, we will describe only how
to assign a tag from your search.
When your search displays results, there is a link
``Apply the tag ABCD to this search`` at the bottom of the page. Click
on it: a tad depending on your search (here ``ABCD``) will be assigned
to all the articles found.
Find all the articles with a given tag
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the wallabag menu, click on **Tags**. Then, all the tags you have
created are displayed, sorted by the number of articles for each tag.
Click on one of these tags to find all the articles with this tag.
Preferred articles
------------------
When you wish to set aside an article, you can mark it as preferred.
Set an article as favorite
~~~~~~~~~~~~~~~~~~~~~~~~~~
From the reading page of an article, or from a list of articles (such as
the list of unread articles), you can set an article as favorite simply
by a click on the star which is displayed. Click again on the star will
remove the **favorite** status of this article.
Find all the favorite articles
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the wallabag menu, click on **Favorites** to display the list of all
the articles that you have set as favorite.
Archived articles
-----------------
When you have read an article, you can archive it: hence it will not be
displayed in your list of unread articles.
Archiving an article does not remove it from wallabag.
Archive an article
~~~~~~~~~~~~~~~~~~
| From the reading page of an article, or from a list of articles (such
as the list of unread articles), you can archive an article simply by
clicking on the icon ✓.
| Click again on this icon will set back the **unread** status of the
article.
Find all the archived articles
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the wallabag menu, click on **Archive** to find all the articles that
you have archived.
Delete an article
-----------------
Be cautious: the deletion of an article is **definitive**. It is deleted
from the wallabag database.
To delete an article, a trash icon is displayed on the page of an
article or of a list of articles (unread articles, favorites or
archived, for example).
We trust you: that is why there is no confirmation message during the
deletion.

View File

@ -0,0 +1,63 @@
Read an article
===============
Reading an article is not difficult in wallabag: you only have to click on the title of the article for it to be displayed.
Back to where you left the article
----------------------------------
If you stop reading an article halfway through, the next time wallabag will open it right where you left off.
This feature only works with web applications and not with smartphone applications.
Possible actions in an article
------------------------------
The following actions can be performed through the icons displayed at the top of the page. We assume here that you are using the Baggy theme (see the section on :ref:`Howto change theme`). Icons in other themes are very similar.
Here are the actions, in the order of appearance of the icons.
Read the original article
~~~~~~~~~~~~~~~~~~~~~~~~~
Open the article on its original location.
Mark the article as read
~~~~~~~~~~~~~~~~~~~~~~~~
Archive the article, which will be placed into the **Archive** category of the wallabag menu. Clicking again on this button will move the article back to the **unread** category.
Mark the article as favorite
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark the article as favorite, and it will be placed into the **Favorites** category of the wallabag menu. Clicking again on this button will remove the favorite status.
Delete the article
~~~~~~~~~~~~~~~~~~
Delete the article from wallabag permanently. It cannot be restored. Be careful: no confirmation message is displayed.
Share through twitter
~~~~~~~~~~~~~~~~~~~~~
Share the title and the original link of the article on twitter.
Share via email
~~~~~~~~~~~~~~~
Share the title and the original link of the article via e-mail.
Print the article
~~~~~~~~~~~~~~~~~
Open the print window of the browser.
Convert into ePub
~~~~~~~~~~~~~~~~~
Convert the article into ePub format: see the section on :ref:`ePub conversion`.
Notify us that the article appears wrong
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Notify the wallabag developers that an article is not displayed as expected (see the section on :ref:`Article is not displayed properly`).

41
docs/en/User/rss_feed.rst Normal file
View File

@ -0,0 +1,41 @@
.. _`RSS feeds`:
RSS feeds
=========
The RSS feeds allow you to:
- read your articles from your favorite RSS feed reader.
- to activate the reading features for smartphone softwares
| First, you must activate the RSS feature by generating a feed token.
| Go to **config** in wallabag and generate a token in the section
**Feeds**. You can generate a new token at any time.
Read articles
-------------
Once the token created, you have access to three RSS feeds:
- the one of the unread articles
- the one of the favorites articles
- the one of the archived articles
Add the feed you want to your RSS feed reader. Be careful: when you will
be reading an article from your feed reader, this will not set it as
read in wallabag.
Share your readings
~~~~~~~~~~~~~~~~~~~
If you wish to share your readings with somebody, send him for example
the RSS feed of your favorite articles. Hence, as soon as an article
will be set as favorite in wallabag, this person will be able to read it
too.
Activate the features for smartphones
-------------------------------------
You ave created an RSS feed token. It will also be useful to you to
configure your smartphone software. For more information about
smartphone sofwares, you can read :ref:`Save your first article`.

View File

@ -0,0 +1,226 @@
.. _`Save your first article`:
Save your first article
=======================
Once connected on wallabag, you have many ways to save an article.
From the web application
------------------------
Lets see first how to do from the web application. In the menu, you
have a link **save a link**. Clicking on it, a form shows up: you simply
have to type the web adress of the article you want to save.
Confirm to store the content of the article.
By default, only the text is saved. If you want to store a copy of the
images on your server, you have to enable the setting
*DOWNLOAD\_PICTURES*. Read the chapter on hidden options for more
information.
From the bookmarklet
--------------------
From `Wikipedias definition`_
A bookmarklet is a `bookmark`_ stored in a `web browser`_ that
contains `JavaScript`_\ commands to extend the browsers
functionality.
Bookmarklets are unobtrusive scripts stored as the URL of a bookmark
in a web browser or as a hyperlink on a web page.
When clicked, a bookmarklet performs some function, one of a wide
variety such as a search query or data extraction. Bookmarklets are
usually `JavaScript programs`_.
From the wallabags menu, click on **settings**. On the first part of
this page, we have listed all the ways to save an article. Youll find
the bookmarklet (its the ``Bag it!`` link) to drag and drop in the
bookmarks bar of your web browser. From now on, when you want to save
the article you are browsing, you just have to click on this bookmarklet
and the article will be automatically saved.
From your smartphone
--------------------
Above all else
~~~~~~~~~~~~~~
To use a smartphone application, you have to enable RSS feeds from the
settings panel of wallabag. Then some information will be displayed,
like your security token. Read the chapter on RSS feeds for more
information.
Android
~~~~~~~
Installation and configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can download the android application from the `Google Play Store`_
and from `F-droid`_. Its the exact same application on those two
stores.
Once installed, start the application, go to the **settings** part et
fill in the **URL (complete address of your wallabag installation or
your Framabag account)** and **User ID (in most cases, youll have to
put 1)** fields. If you have created multiple accounts from wallabag,
you will have to to fill the user account you want to connect to your
application and your security **Token** (enter properly all the tokens
letters as seen in the settings part of wallabag).
Saving of an article
^^^^^^^^^^^^^^^^^^^^
Now that everything is correctly set up, as soon as you browse on your
smartphones web browser, you can share an article in wallabag at any
time from the **Share** menu: youll find a **Bag it!** entry which will
add your article in wallabag.
Reading
^^^^^^^
When you open the application, click on Synchronize: your recently saved
articles will be downloaded on your smartphone.
You dont need an internet connection anymore: click on **List
articles** to start your reading.
At the end of each article, a **Mark as read** button allows you to
archive the article.
To date, the synchronisation occurs in one direction (from wallabag to
the application), thus preventing mark as read an article on wallabag
from your smartphone.
iOS
~~~
Installation and configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can download the iOS application from the `AppStore`_.
Once installed, configure the app by filling following fields inside the
settings: the **URL (complete address of your wallabag installation or
your Framabag account)** and **User ID (in most cases, youll have to
put 1)** field. If you have created multiple accounts from wallabag, you
will have to to fill the user account you want to connect to your
application and your security **Token** (enter properly all the tokens
letters as seen in the settings part of wallabag).
Usage
^^^^^
If the app is configured correctly, the app will automatically download
the articles from your wallabag (use **pull-to-refresh** to trigger this
update manually). Once an article is downloaded, itll be available
offline from your app.
Unfortunately you can only locally mark an article as read (it will not
synchronise to your online wallabag).
Saving articles
~~~~~~~~~~~~~~~
If youre browsing a website and want to add the current article to your
wallabag, simply tap the **Share**-button and select **Bag it!** (if you
dont find the wallabag icon, have a look in the **more**-menu). If
everything is set up correctly, your article will be saved (you may have
to login from time to time).
Windows Phone
~~~~~~~~~~~~~
Installation and configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can download the Windows Phone application from the `Windows Store`_
or directly from your smartphones Store.
Once installed, the application will show you a notification on the
first launch, asking the configuration of your wallabag server. Go to
the **Settings** part of the application by pressing the three dots menu
at the bottom of the screen, then fill in the **URL (complete address of
your wallabag installation or your Framabag account)** and **User ID (in
most cases, youll have to put 1)** fields.
If you have created multiple accounts from wallabag, you will have to to
fill the user account you want to connect to your application and your
security **Token** (enter properly all the tokens letters as seen in
the setting part of wallabag).
From your web browser
---------------------
Firefox Classic Add-on
~~~~~~~~~~~~~~~~~~~~~~
Download the Firefox add-on at `addons.mozilla.org`_ and install it like
any other Firefox add-on.
In the add-ons settings, fill the complete URL of your installation of
wallabag or your Framabag account.
Personalize the Firefox toolbar to add wallabag (**W** icon). When you
find an article you want to save, click on this icon: a new window will
open to add the article and will close itself automatically.
Firefox Social API Service
~~~~~~~~~~~~~~~~~~~~~~~~~~
*Available from wallabag v1.9.1 only*
You will need an https connection to use this. Its a Firefox
`requirement`_, sorry.
With Firefox 29+ versions, your browser comes with an integrated
interface to share things to multiple social services directly from your
browser. In the Firefox interface, it is shown a paper plane-like icon
that you will use to share a page, which means here, save an article.
You can add the service by going into the Config page of wallabag, then
click on Mozilla Services Social API Extension. You must also accept to
use Firefox Services.
Chrome
~~~~~~
Download the Chrome add-on `on the dedicated website`_ and install it
like any other Chrome add-on.
In the add-ons settings, fill the complete URL of your installation of
wallabag or your Framabag account.
During the addons installation, a new icon appear in Chrome toolbar (a
**W** icon). When you find an article you want to save, click on this
icon: a popup will appear to confirm that your article has been saved.
Opera
~~~~~
The recent versions of Opera (15+) allow to install add-ons compatible
with Chrome.
First, install the add-on named `Download Chrome Extensions`_ which will
allow you to install add-ons from the Chrome Web Store. Then, go `to to
Google site`_ and get the Chrome add-on by clicking on *Add to Opera*. A
message will invite you to confirm this action because this add-on is
not coming from a certified source. The behavior will be the same as for
Chrome (see above).
.. _Wikipedias definition: http://fr.wikipedia.org/wiki/Bookmarklet
.. _bookmark: http://en.wikipedia.org/wiki/Internet_bookmark
.. _web browser: http://en.wikipedia.org/wiki/Web_browser
.. _JavaScript: http://en.wikipedia.org/wiki/JavaScript
.. _JavaScript programs: http://en.wikipedia.org/wiki/Computer_program
.. _Google Play Store: https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche
.. _F-droid: https://f-droid.org/app/fr.gaulupeau.apps.InThePoche
.. _AppStore: https://itunes.apple.com/app/id828331015
.. _Windows Store: https://www.microsoft.com/en-us/store/apps/wallabag/9nblggh11646
.. _addons.mozilla.org: https://addons.mozilla.org/firefox/addon/wallabag/
.. _requirement: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Social_API/Manifest#Manifest_Contents
.. _on the dedicated website: https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj
.. _Download Chrome Extensions: https://addons.opera.com/en/extensions/details/download-chrome-extension-9/
.. _to to Google site: https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj

21
docs/en/User/search.rst Normal file
View File

@ -0,0 +1,21 @@
Search content in wallabag
==========================
To enable you to find an article quickly, we set up a full search
engine.
Click on **Search** in the wallabag menu. Then, enter your search terms.
Wallabag will go through all your articles, and lists the ones
containing the search terms in their title, their content or their URL.
Convert this search into ePub format
------------------------------------
You can convert the listed articles to the ePub format, so that you can
read them in your e-reader, for example. Look at :ref:`ePub conversion` for more about this.
Assign a tag to your search results
-----------------------------------
You can create a tag based on your search criteria. Loot at :ref:`Organize articles` for more about this.

87
docs/en/conf.py Normal file
View File

@ -0,0 +1,87 @@
# -*- coding: utf-8 -*-
#
# wallabag documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 16 06:47:23 2015.
import sys
import os
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'wallabag'
copyright = u'2013-2015, Nicolas Lœuillet - MIT Licence'
version = '2.0.0'
release = version
exclude_patterns = ['_build']
pygments_style = 'sphinx'
html_theme = 'default'
html_static_path = ['_static']
htmlhelp_basename = 'wallabagdoc'
latex_elements = {
}
latex_documents = [
('index', 'wallabag.tex', u'wallabag Documentation',
u'Nicolas Lœuillet', 'manual'),
]
man_pages = [
('index', 'wallabag', u'wallabag Documentation',
[u'Nicolas Lœuillet'], 1)
]
texinfo_documents = [
('index', 'wallabag', u'wallabag Documentation',
u'Nicolas Lœuillet', 'wallabag', 'One line description of project.',
'Miscellaneous'),
]
##### Guzzle sphinx theme
import guzzle_sphinx_theme
html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']
}
# Register the theme as an extension to generate a sitemap.xml
extensions.append("guzzle_sphinx_theme")
# Guzzle theme options (see theme.conf for more information)
html_theme_options = {
# Set the path to a special layout to include for the homepage
# "index_template": "homepage.html",
# Allow a separate homepage from the master_doc
# homepage = index
# Set the name of the project to appear in the nav menu
# "project_nav_name": "Guzzle",
# Set your Disqus short name to enable comments
# "disqus_comments_shortname": "my_disqus_comments_short_name",
# Set you GA account ID to enable tracking
# "google_analytics_account": "my_ga_account",
# Path to a touch icon
# "touch_icon": "",
# Specify a base_url used to generate sitemap.xml links. If not
# specified, then no sitemap will be built.
#"base_url": "http://guzzlephp.org"
# Allow the "Table of Contents" page to be defined separately from "master_doc"
# tocpage = Contents
# Allow the project link to be overriden to a custom URL.
# projectlink = http://myproject.url
}

58
docs/en/index.rst Normal file
View File

@ -0,0 +1,58 @@
wallabag documentation
======================
.. image:: ../img/wallabag.png
:alt: wallabag logo
:align: center
**wallabag** is a read-it-later application: it saves a web page by
keeping content only. Elements like navigation or ads are deleted.
The main documentation for the site is organized into a couple sections:
* :ref:`user-docs`
* :ref:`admin-docs`
* :ref:`dev-docs`
.. _user-docs:
.. toctree::
:maxdepth: 2
:caption: User Documentation
user/create_account
user/login
user/configuration
user/first_article
user/import
user/organize
user/filters
User/read_an_article
User/search
User/epub_conversion
User/issue_with_article
User/rss_feed
User/import_export
.. _admin-docs:
.. toctree::
:maxdepth: 2
:caption: Admin Documentation
Administrator/install
Administrator/update
Administrator/hidden_options
Administrator/multiusers
Administrator/sessions
.. _dev-docs:
.. toctree::
:maxdepth: 2
:caption: Developer Documentation
Developer/write_config_files
Developer/create_new_theme
Developer/git_repo

2
docs/en/requirements.txt Normal file
View File

@ -0,0 +1,2 @@
Sphinx>=1.3.0,<1.4.0
guzzle_sphinx_theme>=0.7.0,<0.8.0

View File

@ -0,0 +1,61 @@
Configuration
=============
Now you're logged in, it's time to configure your account as you want.
Click on ``Config`` menu. You have four tabs: ``Settings``, ``RSS``, ``User information`` and ``Password``.
Settings
--------
Theme
~~~~~
wallabag is customizable. You can choose your prefered theme here. You can also create a new one, a chapter is dedicated for this. The default theme is ``Material``, it's the theme used in the documentation screenshots.
Items per page
~~~~~~~~~~~~~~
You can change the number of articles displayed on each page.
Language
~~~~~~~~
You can change the language of wallabag interface.
RSS
---
wallabag provides RSS feeds for each article status: unread, starred and archive.
Firstly, you need to create a personal token: click on ``Create your token``.
It's possible to change your token by clicking on ``Reset your token``.
Now you have three links, one for each status: add them into your favourite RSS reader.
You can also define how many articles you want in each RSS feed (default value: 50).
User information
----------------
You can change your name, your email address and enable ``Two factor authentication``.
Two factor authentication
~~~~~~~~~~~~~~~~~~~~~~~~~
Two-factor authentication (also known as 2FA) is a technology patented in 1984 that provides identification of users by means of the combination of two different components.
https://en.wikipedia.org/wiki/Two-factor_authentication
If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email. You have to put this code on the following form.
.. image:: ../../img/user/2FA_form.png
:alt: Two factor authentication
:align: center
If you don't want to receive a code each time you want to login, you can check the ``I'm on a trusted computer`` checkbox: wallabag will remember you for 15 days.
Password
--------
You can change your password here.

View File

@ -0,0 +1,43 @@
Create an account
=================
On the login page, click on ``Register`` button.
.. image:: ../../img/user/registration_form.png
:alt: Registration form
:align: center
You have to fill the form. Please sure to type a valid email address, we'll send you an activation email.
.. image:: ../../img/user/sent_email.png
:alt: Email was sent to activate account
:align: center
Check your inbox, you now have a new mail with a link like this ``http://wallabag/register/confirm/Ba19wokGovN-DdBQNfg4YgRkUQWRP4-k2g0Bk-hBTX4``. Click on it to activate your account.
Your account is now activated.
.. image:: ../../img/user/activated_account.png
:alt: Welcome on board!
:align: center
Frequently asked questions
--------------------------
I can't valid the registration form
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Make sure that all fields are well filled:
* valid email address
* same passwords in two fields
I don't receive my activation email
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Are you sure your email address was correct? Did you check your spams folder?
When I click on the activation link, I've got this message: ``The user with confirmation token "DtrOPfbQeVkWf6N" does not exist``.
~~~~~~~~~~~~~~~
You already enabled your account or the URL of the activation email is wrong.

View File

@ -0,0 +1,79 @@
Save your first article
=======================
The main purpose of wallabag is to save web articles. You have many ways to do it.
By using a bookmarklet
----------------------
On the ``Howto`` page, you have a ``Bookmarklet`` tab. Drag and drop the ``bag it!`` link to your bookmarks bar of your browser.
Now, each time you're reading an article on the web and you want to save it, click on the ``bag it!`` link in your bookmarks bar. The article is saved.
By using the classic form
-------------------------
In the top bar of your screen, you have 3 icons. With the first one, a plus sign, you can easily save a new article.
.. image:: ../../img/user/topbar.png
:alt: Top bar
:align: center
Click on it to display a new field, paste the article URL inside and press your ``Return`` key. The article is saved.
By using a browser add-on
-------------------------
Firefox
~~~~~~~
Firefox Classic Add-on
^^^^^^^^^^^^^^^^^^^^^^
Download the Firefox add-on at `addons.mozilla.org`_ and install it like
any other Firefox add-on.
In the add-ons settings, fill the complete URL of your installation of
wallabag or your Framabag account.
Personalize the Firefox toolbar to add wallabag (**W** icon). When you
find an article you want to save, click on this icon: a new window will
open to add the article and will close itself automatically.
Firefox Social API Service
^^^^^^^^^^^^^^^^^^^^^^^^^^
*Available from wallabag v1.9.1 only*
You will need an https connection to use this. Its a Firefox
`requirement`_, sorry.
With Firefox 29+ versions, your browser comes with an integrated
interface to share things to multiple social services directly from your
browser. In the Firefox interface, it is shown a paper plane-like icon
that you will use to share a page, which means here, save an article.
You can add the service by going into the Config page of wallabag, then
click on Mozilla Services Social API Extension. You must also accept to
use Firefox Services.
Chrome
~~~~~~
By using your smarphone application
-----------------------------------
Android
~~~~~~~
Firefox OS
~~~~~~~~~~
Windows Phone
~~~~~~~~~~~~~
iOS
~~~
.. _addons.mozilla.org: https://addons.mozilla.org/firefox/addon/wallabag/
.. _requirement: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Social_API/Manifest#Manifest_Contents

39
docs/en/user/import.rst Normal file
View File

@ -0,0 +1,39 @@
Migrate to wallabag
===================
From wallabag 1.x
-----------------
Export your data from your wallabag 1.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On your config page, click on ``JSON export`` in the ``Export your wallabag data`` section.
.. image:: ../../img/user/export_wllbg_1.png
:alt: Export from wallabag 1.x
:align: center
You will have a ``wallabag-export-1-1970-01-01.json`` file.
Import your data into wallabag 2.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Click on ``Import`` link in the menu, select your export file on your computer and import it.
.. image:: ../../img/user/import_wllbg.png
:alt: Import from wallabag 1.x
:align: center
All your wallabag 1.x articles will be imported.
From Pocket
-----------
From Instapaper
---------------
From Readability
----------------
From HTML or JSON file
----------------------

20
docs/en/user/login.rst Normal file
View File

@ -0,0 +1,20 @@
Login
=====
Your account is now enabled, congratulations!
To login to wallabag, fill the form on login page.
If you are on your personal computer and you want to stay connected, you can check the ``Keep me logged in`` checkbox: wallabag will remember you for one year.
.. image:: ../../img/user/login_form.png
:alt: Login form
:align: center
Frequently asked questions
--------------------------
I forgot my password
~~~~~~~~~~~~~~~~~~~~
You can reset your password by clicking on ``Forgot your password?`` link, on the login page. Then, fill the form with your email address

View File

@ -0,0 +1,22 @@
---
language: Français
currentMenu: upgrade
subTitle: Mettre à jour wallabag
---
# Mettre à jour wallabag
Pour mettre à jour votre installation, téléchargez et décompressez larchive dans votre installation (ici `/var/www/html/wallabag/`) :
wget http://wllbg.org/latest
unzip latest
rsync -ur wallabag-version-number/* /var/www/html/wallabag/
Supprimez le répertoire `install` et videz le cache :
cd /var/www/html/wallabag/
rm -r cache/* install/
Pour vider le cache, il est également possible d'aller dans la page de configuration et de cliquer sur le lien pour supprimer le cache.
Vérifiez dans le bas de la page de configuration que la dernière version est bien installée.

View File

@ -0,0 +1,35 @@
---
language: Français
currentMenu: multiusers
subTitle: wallabag multi-utilisateurs
---
# wallabag multi-utilisateurs
## Créer un nouveau compte
### Mode administrateur
Si vous souhaitez utiliser wallabag pour plusieurs personnes, il est possible de créer de nouveaux comptes depuis la page de configuration.
En bas de cette page se trouve un formulaire où vous devez saisir un nom d'utilisateur et un mot de passe.
Il est maintenant possible de se connecter avec ce compte depuis la page d'identification de wallabag.
Aucune information n'est partagée entre les différents comptes.
### Mode libre
A partir de la version 1.9, l'administrateur peut laisser libre la création de nouveaux comptes. Il doit pour cela l'autoriser en modifiant les lignes suivantes dans le fichier de configuration :
// registration
@define ('ALLOW_REGISTER', FALSE);
@define ('SEND_CONFIRMATION_EMAIL', FALSE);
Ensuite, l'utilisateur rentrera lui-même son nom d'utilisateur et son mot de passe pour se créer un compte. Selon la configuration, un courriel de confirmation peut être envoyé aux utilisateurs ayant fourni une adresse électronique.
## Supprimer un compte
Il est possible de supprimer son propre compte, depuis la page de configuration. Il suffit de saisir son mot de passe et de demander la suppression.
Bien évidemment, lorsqu'il ne reste plus qu'un seul compte, il est impossible de le supprimer.

View File

@ -0,0 +1,40 @@
---
language: Français
currentMenu: hidden
subTitle: Options cachées
---
# Options cachées
## Mise en garde
**Attention**, cette partie concerne les utilisateurs avancés. Nous allons modifier un fichier important de wallabag, `inc/poche/config.inc.php`, il est donc conseillé de faire une sauvegarde de celui-ci avant toute modification.
**Toute erreur lors d'une modification d'un fichier de wallabag pourra entrainer des dysfonctionnements**.
Ce fichier est créé lorsque vous installez wallabag.
Installez donc d'abord wallabag, faites une copie du fichier et ouvrez-le avec ~~Sublime Text~~ votre éditeur de texte préféré.
Dans ce fichier sont définis des paramètres qui ne sont, aujourd'hui, pas encore disponibles dans la page **Configuration** de wallabag.
## Modification des options avancées
Chaque paramètre est défini de cette façon :
@define ('NOM_DU_PARAMETRE', 'Valeur du paramètre');
Pour chaque ligne, vous ne pouvez modifier que la partie `Valeur du paramètre`.
Listons maintenant les différents paramètres que vous pouvez changer :
* `HTTP_PORT` (par défaut, `80`) : correspond au port HTTP de votre serveur web. À changer si votre serveur web est derrière un proxy. Valeur attendue : un nombre.
* `SSL_PORT` (par défaut, `443`) : correspond au port SSL de votre serveur web. À changer si votre serveur web utilises SSLH. Valeur attendue : un nombre.
* `DEBUG_POCHE` (par défaut, `FALSE`) : si vous rencontrez des problèmes avec wallabag, nous vous demanderons peut-être d'activer le mode Debug. Valeurs attendues : `TRUE` ou `FALSE`.
* `DOWNLOAD_PICTURES` (par défaut, `FALSE`) : permet de télécharger sur votre serveur les images des articles. Ce paramètre est désactivé par défaut pour ne pas surcharger votre serveur web. Nous préférons vous laisser activer vous-même ce paramètre. Valeurs attendues : `TRUE` ou `FALSE`.
* `SHARE_TWITTER` (par défaut, `TRUE`) : permet d'activer le partage vers twitter. Valeurs attendues : `TRUE` ou `FALSE`.
* `SHARE_MAIL` (par défaut, `TRUE`) : permet d'activer le partage par email. Valeurs attendues : `TRUE` ou `FALSE`.
* `SHARE_SHAARLI` (par défaut, `FALSE`) : permet d'activer le partage vers votre installation de Shaarli (gestionnaire de favoris). Valeurs attendues : `TRUE` ou `FALSE`.
* `SHAARLI_URL` (par défaut, `'http://myshaarliurl.com'`) : définit l'URL de votre installation de Shaarli. Valeur attendue : une URL.
* `FLATTR` (par défaut, `TRUE`) : permet d'activer la possibilité de flattrer un article ([Flattr est une plateforme de micro-dons](http://fr.wikipedia.org/wiki/Flattr)). Si un article est flattrable, une icône s'affichera et vous permet d'envoyer un micro-don à l'auteur de l'article. Valeurs attendues : `TRUE` ou `FALSE`.
* `SHOW_PRINTLINK` (par défaut, `'1'`) : permet d'afficher le lien pour imprimer un article. Valeurs attendues : `'0'` pour désactiver ou `'1'` pour activer.
* `SHOW_READPERCENT` (par défaut, `'1'`) : permet d'afficher (sur les thèmes `default`, `dark`, `dmagenta`, `solarized`, `solarized-dark`) le pourcentage de lecture de l'article. Valeurs attendues : `'0'` pour désactiver ou `'1'` pour activer.
* `PAGINATION` (par défaut, `'12'`) : définit le nombre d'articles affichés sur une liste. Valeur attendue : un nombre.

View File

@ -0,0 +1,121 @@
---
language: Français
currentMenu: install
subTitle: Télécharger et installer wallabag
---
# Télécharger et installer wallabag
## Je ne souhaite pas installer wallabag
Puisque vous ne voulez pas ou ne pouvez pas installer wallabag, nous vous proposons de créer un compte gratuit sur [Framabag](https://framabag.org/), lequel utilise notre logiciel. [Lisez la documentation complète](../Utilisateur/Framabag.md).
## Je souhaite installer wallabag
### Je souhaite télécharger wallabag manuellement
[Télécharger la dernière version de wallabag](http://wllbg.org/latest) et décompresser-là :
wget http://wllbg.org/latest
unzip latest
mv wallabag-version-number wallabag
Copiez les fichiers sur votre serveur web. Dans le cas d'Ubuntu/Debian, il s'agit de /var/www/html/ :
sudo mv wallabag /var/www/html/
Puis sautez le paragraphe suivant.
### Je souhaite télécharger wallabag via composer
Vous devez installer composer :
curl -s http://getcomposer.org/installer | php
Ensuite, sur votre serveur web, exécutez cette commande :
composer create-project wallabag/wallabag . dev-master
Tout est téléchargé dans le répertoire courant.
#### Pré-requis pour votre serveur web
Wallabag nécessite qu'un certain nombre de composants soient installées sur votre serveur web.
Pour être sûr que votre serveur possède tous les pré-requis, ouvrez dans votre navigateur la page `http://monserveur.com/wallabag/install/index.php`.
Les composants sont :
* [PHP 5.3.3 ou plus](http://php.net/manual/fr/install.php) **avec support [PDO](http://php.net/manual/en/book.pdo.php)**
* [XML pour PHP](http://php.net/fr/xml)
* [PCRE](http://php.net/fr/pcre)
* [ZLib](http://php.net/en/zlib) (son absence affectera le traitement des pages compressées)
* [mbstring](http://php.net/en/mbstring) et/ou [iconv](http://php.net/en/iconv) (sinon, certaines pages ne pourront pas être lues - même en anglais)
* L'extension [DOM/XML](http://php.net/manual/en/book.dom.php)
* [Filtrage des données](http://php.net/manual/fr/book.filter.php)
* [GD](http://php.net/manual/en/book.image.php) (son absence empèchera la sauvegarde des images)
* [Tidy pour PHP](http://php.net/fr/tidy) (son absence peut poser problème avec certaines pages)
* [cURL](http://php.net/fr/curl) avec `Parallel URL fetching` (optionel)
* [Parse ini file](http://uk.php.net/manual/en/function.parse-ini-file.php)
* [allow_url_fopen](http://www.php.net/manual/fr/filesystem.configuration.php#ini.allow-url-fopen) (optionel si cURL présent)
* [gettext](http://php.net/manual/fr/book.gettext.php) (nécessaire pour le support multilingues)
Installez les composants manquants avant de poursuivre. Par exemple pour installer Tidy sur Ubuntu/Debian :
sudo apt-get install php5-tidy
sudo service apache2 reload
Note : si voux utilisez IIS comme serveur web, vous devez interdire l'*Authentification Anonyme* et [permettre L'*Authentification de base*](https://technet.microsoft.com/fr-fr/library/cc772009%28v=ws.10%29.aspx) pour autoriser la connexion.
#### Twig installation
Pour pouvoir fonctionner, wallabag a besoin de `Twig`, une bibliothèque de modèles.
Si vous ne pouvez pas installer `composer` (dans le cas d'hébergement mutualisé par exemple), nous vous proposons un fichier
incluant `Twig`. Ce fichier peut être télécharger depuis la page `http://monserveur.com/wallabag/install/index.php` (section INSTALLATION TWIG) ou directement ici [http://wllbg.org/vendor](http://wllbg.org/vendor). Décompressez-le dans votre répertoire wallabag.
Alternativement, vous pouvez installer `Twig` en lançant `composer` depuis votre dossier wallabag (toujours dans le cas d'Ubuntu/Debian : <code>/var/www/html/wallabag/</code>) en exécutant les commandes :
curl -s http://getcomposer.org/installer | php
php composer.phar install
### Création de la base de données
Wallabag peut s'installer sur différents types de bases de données :
* [SQLite](http://php.net/manual/fr/book.sqlite.php). Le plus simple de tous. Rien de particulier à configurer.
* [MySQL](http://php.net/manual/fr/book.mysql.php). Un système de base de données bien connu, qui est dans la plupart des cas plus efficace que SQLite.
* [PostgreSQL](http://php.net/manual/fr/book.pgsql.php). Certaines personnes l'ont trouvé mieux que MySQL.
Nous vous conseillons d'utiliser MySQL, plus performante. Il est alors nécessaire de créer une nouvelle base (par exemple `wallabag`), un nouvel utilisateur (par exemple `wallabag`) et un mot de passe (ici `VotreMotdePasse`). Vous pouvez pour cela utiliser `phpMyAdmin`, ou exécuter les commandes suivantes :
mysql -p -u root
mysql> CREATE DATABASE wallabag;
mysql> GRANT ALL PRIVILEGES ON `wallabag`.* TO 'wallabag'@'localhost' IDENTIFIED BY 'VotreMotdePasse';
mysql> exit
*Note :* Si vous utilisez MySQL ou Postgresql, vous devrez **remplir tous les champs**, sinon l'installation ne fonctionera pas et un message d'erreur vous dira ce qui ne va pas. Vous devez créer manuellement la base de données qui sera utilisée par wallabag avec un outil comme PHPMyAdmin ou en ligne de commande.
### Permissions
Le serveur web doit avoir accès en écriture aux répertoires `assets`, `cache` et `db`. Sans cela, un message vous indiquera que l'installation est impossible :
sudo chown -R www-data:www-data /var/www/html/wallabag
### Installation de wallabag. Enfin.
Accédez à wallabag depuis votre navigateur : `http://votreserveur.com/wallabag`. Si votre serveur est bien configuré, vous arrivez sur l'écran d'installation.
Renseignez le type de votre base de données (`sqlite`, `mysql` ou `postgresql`) et les informations de votre base de données. Dans le cas de la base MySQL créée plus haut, la configuration standard sera :
Database engine: MySQL
Server: localhost
Database: wallabag
Username: wallabag
Password: VotreMotdePasse
Créez enfin votre premier utilisateur et son mot de passe (différents de l'utilisateur de la base de données).
wallabag est maintenant installé.
### Connexion
Depuis votre navigateur, vous arrivez sur l'écran d'identification : saisissez votre identifiant et votre mot de passe et vous voici connecté.

View File

@ -0,0 +1,26 @@
---
language: Français
currentMenu: sessions
subTitle: Problème de sessions
---
Si vous vous retrouvez à être déconnecté même après avoir valider le *Stay signed in checkbox*,
lancez les commandes suivantes comme administrateur (ou avec sudo) :
```
mkdir /var/lib/wallabag-sessions
chown www-data:www-data /var/lib/wallabag-sessions
```
*NOTE : L'utilisateur et le groupe www-data pourrait ne pas exister.
Vous pouvez alors utiliser ```chown http:http /var/lib/wallabag-sessions``` à la place.*
Ensuite, en utilisant apache, ajoutez : `php_admin_value session.save_path /var/lib/wallabag-sessions`
à votre vhost apache, tel que `wallabag-apache.conf`.
Enfin, redémarrez apache, en lançant par exemple : ```/etc/init.d/apache2 restart```
Si vous utilisez nginx, ajoutez `php_admin_value[session.save_path] = /var/lib/wallabag-sessions`
à votre fichier de configuration de nginx.
Ensuite, redémarrez nginx : ```/etc/init.d/nginx restart```
*NOTE : si vous utilisez systemd, vous devriez faire `systemctl restart apache2` (ou nginx).*

View File

@ -0,0 +1,52 @@
---
language: Français
currentMenu: help_us
subTitle: Contribuer au projet
---
# Contribuer au projet
## Soumettre des bugs
### Demande de support
Si vous avez un problème lors de l'installation ou de l'utilisation de wallabag (que ça soit l'application web ou les applications pour smartphone), utilisez le site de support [http://support.wallabag.org](http://support.wallabag.org).
Nous verrons alors si nous pouvons vous dépanner rapidement ou alors s'il s'agit un nouveau bug qu'il nous faudra corriger.
Il est préférable d'utiliser le site de support plutôt que de nous envoyer un mail : le suivi est plus pratique pour vous comme pour nous et la résolution de votre problème pourra resservir pour un autre utilisateur.
### Créer un nouveau ticket
Si vous avez trouvé un bug lors de votre utilisation de wallabag, merci d'ouvrir un nouveau ticket sur Github (un compte est nécessaire).
**Avant toute chose**, pensez à lire [les recommandations nécessaires pour la rédaction d'un nouveau ticket](https://github.com/wallabag/wallabag/blob/master/CONTRIBUTING.md). Au mieux vous renseignez votre ticket, au mieux nous pourrons vous aider.
* si c'est un bug avec l'application web, [ouvrez un nouveau ticket ici](https://github.com/wallabag/wallabag/issues/new)
* si c'est un bug avec l'application Android, [ouvrez un nouveau ticket ici](https://github.com/wallabag/android-app/issues/new)
* si c'est un bug avec l'application Windows Phone, [ouvrez un nouveau ticket ici](https://github.com/wallabag/windowsphone-app)
* si c'est un bug avec l'application iOS, [ouvrez un nouveau ticket ici](https://github.com/wallabag/ios-app/issues/new)
* si c'est un bug avec l'extension Firefox, [ouvrez un nouveau ticket ici](https://github.com/wallabag/firefox-ext/issues/new)
* si c'est un bug avec l'extension Chrome, [ouvrez un nouveau ticket ici](https://github.com/wallabag/chrome-ext/issues/new)
## Écrire et corriger la documentation
La documentation que vous êtes en train de lire n'est sûrement pas complète, à jour, traduite dans votre langue. C'est pourquoi nous vous invitons à participer à sa rédaction.
Le dépôt Github se trouve ici : [https://github.com/wallabag/documentation](https://github.com/wallabag/documentation).
## Corriger les bugs, résoudre les problèmes : faire du support
Deux possibilités :
* lorsqu'un utilisateur de wallabag pose une nouvelle question [sur le site de support](http://support.wallabag.org), en tant qu'utilisateur avancé de wallabag, vous pouvez lui répondre.
* sur Github, des tickets correspondent sûrement à vos compétences. [Parcourez la liste des tickets](https://github.com/wallabag/wallabag/issues) et servez-vous.
Si vous souhaitez proposer une modification dans le code de wallabag, vous êtes le bienvenu. [N'oubliez pas de lire les recommandations pour proposer vos modifications](https://github.com/wallabag/wallabag/blob/master/CONTRIBUTING.md).
## Communiquer
Rien de compliqué ici, parlez de wallabag autour de vous. Utilisez le mot-clé #wallabag sur tous vos réseaux sociaux préférés : twitter, Facebook, Diaspora*, Google+, etc.
D'ailleurs, voici la liste de nos comptes sur ces réseaux, si jamais vous voulez nous citer dans un de vos messages :
* [Diaspora*](https://framasphere.org/people/2335ff202f920132196e2a0000053625)
* [twitter](https:/twitter.com/wallabagapp)
* [Facebook](https://www.facebook.com/wallabag)
* [Google+](https://plus.google.com/+WallabagOrg/)

View File

@ -0,0 +1,9 @@
---
language: Français
currentMenu: theme
subTitle: Créer un nouveau thème
---
# Créer un nouveau thème
TODO

View File

@ -0,0 +1,23 @@
---
language: Français
currentMenu: repo
subTitle: Dépôt git de wallabag
---
# Dépôt git de wallabag
Si vous souhaitez contribuer au projet en proposant de nouvelles fonctionnalités ou en corrigeant des bugs, il faut suivre les recommandations que vous lirez ci-dessous concernant le dépôt Git disponible à cette adresse : [https://github.com/wallabag/wallabag](https://github.com/wallabag/wallabag).
## État des lieux
Pour la gestion des différentes versions de wallabag, nous utilisons Git.
Nous utilisons plusieurs branches pour le code source de l'application web de wallabag :
* la branche `master` : c'est la branche stable, celle qui est téléchargée pour tous ceux qui souhaitent installer wallabag pour leur utilisation.
* la branche `dev` : avant d'être sur la branche `master`, toutes les corrections de bugs et nouvelles fonctionnalités doivent passer par cette branche. Cette branche n'est pas conseillée pour une utilisation en production.
* la branche `v2-symfony` : c'est la branche de la refonte de wallabag. Un chapitre complet lui est consacré.
## Workflow
Toutes les consignes concernant le dépôt Git se trouve dans [le fichier CONTRIBUTING.md de wallabag](https://github.com/wallabag/wallabag/blob/master/CONTRIBUTING.md). Merci de le lire attentivement avant toute modification.

View File

@ -0,0 +1,9 @@
---
language: Français
currentMenu: docker
subTitle: Docker
---
# Docker
TODO

View File

@ -0,0 +1,39 @@
---
language: Français
currentMenu: site_config
subTitle: Écrire un fichier de configuration
---
# Écrire un fichier de configuration
wallabag peut utiliser des fichiers de configuration spécifiques à un site pour lire les articles de ce site. Ces fichiers sont stockés dans le répertoire [`inc/3rdparty/site_config/standard`](https://github.com/wallabag/wallabag/tree/master/inc/3rdparty/site_config/standard).
Le format utilisé pour ces fichiers est [XPath](http://www.w3.org/TR/xpath20/). Inspirez-vous des exemples dans le répertoire pour en créer de nouveaux.
## Génération automatique de fichiers de configuration
@FiveFilters a créé un [outil très utile](http://siteconfig.fivefilters.org/) pour créer des fichiers de configuration. Vous devez taper l'adresse d'un article qui vous intéresse. puis vous sélectionnez le contenu que vous souhaitez.
![siteconfig](https://lut.im/RNaO7gGe/l9vRnO1b)
Vous devez confirmer cette zone en essayant avec d'autres articles.
Quand vous avez trouvé la bonne zone, cliquez simplement sur *Download Full-Text RSS site config* (Téléchargez la configuration du site Full-Text RSS) pour télécharger le fichier à inclure dans le répertoire.
## Génération manuelle de fichiers de configuration
Si l'outil de FiveFilters ne marche pas tel qu´attendu, regardez la source d'un article (Ctrl+U sur Firefox ou Chromium). Cherchez votre contenu parmi le code source et repérez l'attribut `class` ou `id` de la zone que vous souhaitez.
Une fois que vous avez obtenu l'attribut `id` ou `class`, vous pouvez écrire par exemple l'une ou l'autre de ces lignes :
```
body: //div[@class='myclass']
body: //div[@id='myid']
```
Ensuite, testez votre fichier de configuration avec d'autres articles du même site. Si vous avez trouvé le bon contenu mais que vous voulez enlever des parties inutiles, ajoutez la ligne suivante (avec l'attribut `class` correspondant à la partie inutile) :
```
strip: //div[@class='hidden']
```
Vous pouvez regarder d'autres options pour les fichiers de configuration de sites [sur l'aide du site de FiveFilters](http://help.fivefilters.org/customer/portal/articles/223153-site-patterns).

View File

@ -0,0 +1,34 @@
---
language: Français
currentMenu: vagrant
subTitle: Vagrant
---
# Vagrant
Pour vous permettre de mettre en place rapidement la configuration requise pour wallabag, nous vous proposons un fichier Vagrantfile.
[Définition Wikipedia](http://fr.wikipedia.org/wiki/Vagrant)
Vagrant est un logiciel libre et open-source pour la création et la configuration des environnements de développement virtuel. Il peut être considéré comme un wrapper autour du logiciel de virtualisation comme VirtualBox.
## Utiliser Vagrant pour wallabag
Voici la procédure pour exécuter wallabag au sein d'un conteneur Vagrant :
wget -O wallabag-dev.zip https://github.com/wallabag/wallabag/archive/dev.zip
unzip wallabag-dev.zip
cd wallabag-dev
vagrant up
Accédez maintenant à `http://localhost:8003` et à vous de jouer !
## Qu'a installé le Vagrantfile ?
Le script installe un serveur LAMP, à savoir :
* Ubuntu 14.04
* Un serveur web Apache2
* PHP5
* SQLite ou MySQL ou PostgreSQL pour PHP
* XDebug pour PHP

View File

@ -0,0 +1,9 @@
---
language: Français
currentMenu: v2
subTitle: wallabag v2 / symfony2
---
# wallabag v2 / symfony2
TODO

View File

@ -0,0 +1,68 @@
---
language: Français
currentMenu: sort_article
subTitle: Classer ses articles
---
# Classer ses articles
Pour pouvoir retrouver plus facilement vos articles, plusieurs méthodes existent.
## Tags
### Assigner un tag
#### Depuis l'article
Aujourd'hui, il n'est pas encore possible d'assigner un tag lorsque vous sauvegardez un nouvel article.
Tout ajout de tag se fera donc sur un article déjà sauvegardé.
Sur la page de lecture de l'article, se trouve une partie `tags` suivie d'un crayon. Cliquez sur ce crayon.
Saisissez dans la case les tags que vous souhaitez assigner. Saisissez autant de tags que vous le voulez. Ils doivent être séparés par des virgules et non par des espaces. L'auto-complétion existe ici : si vous tapez les premières lettres d'un tag déjà existant, inutile de taper le mot en entier, sélectionnez-le dans la liste déroulante. Une fois tous vos tags saisis, cliquez sur le bouton **Tag**.
Vous pouvez ensuite retourner lire votre article.
#### Depuis la recherche
Un chapitre complet sur la recherche existe. Ici, nous verrons uniquement comment assigner un tag depuis votre recherche.
Lorsque votre recherche vous affiche les résultats, vous avez un lien en bas de page `Apply the tag ABCD to this search`. Cliquez dessus : un tag en fonction de la recherche que vous venez d'effectuer (ici `ABCD`) sera assigné à tous les articles trouvés.
### Retrouver tous les articles d'un même tag
Dans le menu de wallabag, cliquez sur **Tags**. Ici s'affichent tous les tags que vous avez créés, triés par nombre d'articles au sein de chaque tag. Cliquez sur l'un de ces tags pour retrouver tous les articles correspondants à ce tag.
## Articles favoris
Lorsque vous souhaitez mettre de côté un article, vous pouvez le marquer comme favori.
### Marquer un article comme favori
Depuis la page de lecture d'un article, ou depuis une liste d'articles (par exemple, la liste des articles non lus), vous pouvez mettre un article comme favori juste en cliquant sur l'étoile qui apparait.
Recliquer sur cette étoile enlèvera le statut **favori** de cet article.
### Retrouver tous ses articles favoris
Dans le menu de wallabag, cliquez sur **Favoris** pour retrouver tous les articles que vous avez déjà mis en favori.
## Articles archivés
Lorsque vous avez lu un article, vous pouvez l'archiver : ainsi il n'apparaitra plus dans votre liste d'articles non lus.
Le fait d'archiver un article ne le supprime pas de wallabag.
### Archiver un article
Depuis la page de lecture d'un article, ou depuis une liste d'articles (par exemple, la liste des articles non lus), vous pouvez archiver un article juste en cliquant sur l'icône ✓.
Recliquer sur cette icône remettra l'article en statut **non lu**.
### Retrouver tous ses articles archivés
Dans le menu de wallabag, cliquez sur **Archive** pour retrouver tous les articles que vous avez déjà archivés.
## Supprimer l'article
Attention, la suppression d'un article est **définitive** : il est supprimé de la base de données de wallabag.
Pour supprimer un article, une icône de corbeille se trouve sur la page d'un article ou sur une liste d'articles (articles non lus, favoris ou archivés par exemple).
Nous vous faisons confiance : c'est pourquoi il n'y a aucune demande de confirmation lors de la suppression.

View File

@ -0,0 +1,30 @@
---
language: Français
currentMenu: configure
subTitle: Configurer wallabag
---
# Configurer wallabag
Depuis le menu **configuration**, vous avez la possibilité de changer quelques options de wallabag.
Certaines parties ne seront pas présentées ici car elles bénéficient d'un chapitre complet dans la documentation ([flux RSS](flux_rss.html), [l'import depuis un service tiers](importer_exporter.html), [l'export de vos données](importer_exporter.html), [la conversion en ePub](convertir_en_epub.html) et [le mode multi-utilisateurs](../Administrateur/multi-utilisateurs.html)).
## Thème
Des goûts et des couleurs, on ne discute pas. C'est pourquoi wallabag vous propose de changer son habillage pour plaire à chacun.
Sélectionnez le thème de votre choix dans la liste déroulante et validez en cliquant sur **Mettre à jour**.
## Langue
Sélectionnez la langue de votre choix dans la liste déroulante et validez en cliquant sur **Mettre à jour**.
## Mot de passe
Saisissez votre nouveau mot de passe dans les deux champs prévus et validez en cliquant sur **Mettre à jour**.
Vous serez alors déconnecté et devrez saisir votre nouveau mot de passe pour accéder à wallabag.
## Vider le cache
Le cache permet à wallabag d'effectuer certains traitements plus rapidement.
Après une mise à jour de wallabag, il est conseillé de vider le cache. Vous n'avez qu'un clic à faire pour le vider.

View File

@ -0,0 +1,25 @@
---
language: Français
currentMenu: epub
subTitle: Convertir en ePub
---
# Convertir en ePub
Pour que vous puissiez lire vos articles sauvegardés depuis votre liseuse, wallabag vous permet de les convertir au format ePub et ainsi vous créer un eBook pour vos longues soirées d'hiver.
## Mise en garde
Attention, la génération de fichiers ePub peut être très consommatrice de ressources pour le serveur sur lequel est installé wallabag. Cela dépend du nombre d'articles et de leur longueur.
Ne générez pas un eBook trop important si cela n'est pas nécessaire.
## Où convertir les articles
Vous pouvez convertir vos articles depuis différents endroits de wallabag :
* sur la page de lecture d'un article : le lien ePub convertira ce seul article
* depuis une liste d'articles (articles non lus, favoris ou archivés, articles d'un tag) : un lien en bas de page vous permet de convertir tous les articles de cette catégorie
* depuis une recherche : le lien se trouve en bas de page
* depuis la page de configuration : vous allez pouvoir convertir tous vos articles, peu importe la catégorie dans laquelle ils se trouvent
TODO parler de calibre

View File

@ -0,0 +1,35 @@
---
language: Français
currentMenu: rss
subTitle: Flux RSS
---
# Flux RSS
Les flux RSS vous permettent :
* de lire vos articles depuis votre lecteur de flux RSS préféré
* d'activer les fonctionnalités de lecture pour les applications smartphones
Tout d'abord, vous devez activer la fonctionnalité RSS en générant votre jeton de flux.
Rendez-vous dans **configuration** de wallabag et créez le jeton dans la partie **Flux**.
À tout moment, vous pouvez générer un nouveau jeton.
## Lire les articles
Une fois le jeton créé, vous avez accès à trois flux RSS :
* celui des articles non lus
* celui des articles favoris
* celui des articles archivés
Ajoutez le flux de votre choix dans votre lecteur de flux RSS.
Attention, lorsque vous lirez un article depuis votre lecteur de flux, ça ne le marquera pas comme lu dans wallabag.
### Partager vos lectures
Si vous souhaitez partager vos lectures avec quelqu'un, envoyez-lui par exemple le flux RSS de vos articles préférés. Ainsi, dès qu'un article sera mis en favori dans wallabag, cette personne pourra également le lire.
## Activer les fonctionnalités pour smartphones
Vous avez créé le jeton de flux RSS : il va vous être utile pour configurer votre application smartphone. Pour en savoir sur les applications smartphones, vous pouvez lire [Sauvegarder son premier article](Sauvegarder_son_premier_article.md).

View File

@ -0,0 +1,34 @@
---
language: Français
currentMenu: framabag
subTitle: Se créer un compte sur Framabag
---
# Se créer un compte sur Framabag
Puisque vous ne souhaitez peut-être pas gérer l'installation et la mise à jour de wallabag, ou puisque vous n'avez peut-être pas les connaissances pour l'installer, il vous est possible de vous créer un compte gratuit sur [Framabag.org](https://www.framabag.org).
## Création du compte
Cliquez sur le bouton **Créez votre compte / Create your account**.
Vous devez saisir certaines informations : votre nom d'utilisateur, votre mot de passe et votre adresse email. Votre adresse n'est utilisée que pour la validation de votre compte, sauf si vous cochez la case pour recevoir la newsletter (3 à 4 envois par an).
Une fois ce formulaire validé, vous recevez un email avec un lien de confirmation. Cliquez dessus, votre compte sera alors créé.
Vous recevrez un dernier email avec l'adresse de votre compte Framabag, de la forme `https://www.framabag.org/u/votre-nom-d'utilisateur`.
## Stockage de vos informations
Framabag utilise une base de données par utilisateur. Nous ne faisons et ne ferons aucune utilisation de vos données stockées.
## Vous avez oublié votre mot de passe
Si vous avez oublié votre mot de passe pour vous connecter à Framabag, un formulaire est disponible [depuis la page d'accueil du service](https://www.framabag.org).
Remplissez-le, un email de confirmation vous sera envoyé et vous permettra de saisir votre nouveau mot de passe.
## Suppression de votre compte
Si vous souhaitez supprimer votre compte, contactez-nous par email : [hello@wallabag.org](mailto:hello@wallabag.org) avec l'adresse de création de votre compte, en nous indiquant votre nom d'utilisateur.
Nous vous répondrons quand votre compte sera supprimé : dès cet instant, plus aucune information vous concernant ne sera stockée sur Framabag.

View File

@ -0,0 +1,78 @@
---
language: Français
currentMenu: import
subTitle: Importer ou exporter ses données
---
# Importer ou exporter ses données
## Importer
Pour importer des données dans wallabag, vous devez vous rendre dans la page **Configuration**.
### Mise en garde
L'import de données peut être une **opération gourmande** pour votre serveur. C'est pourquoi elle s'effectue en deux étapes :
* l'insertion des URL dans la base de données de wallabag
* dans un second temps, la récupération, pour chaque article, du contenu complet
Ces deux actions ne peuvent pas être effectuées simultanément, car nous vous donnons la possibilité d'importer des milliers de liens, mais aujourd'hui, wallabag n'a pas les possibilités techniques nécessaires pour effectuer tout ce travail automatiquement.
### Depuis Pocket
#### Exporter ses données depuis Pocket
Depuis votre compte Pocket, rendez-vous dans vos options.
TODO
#### Importer ses données Pocket
Depuis la page de configuration de wallabag, partie **Import**, sélectionnez le fichier `ril_export.html` que Pocket a généré puis cliquez sur **Import**.
wallabag ne fait qu'insérer les liens dans sa base de données. Il faut maintenant lui faire récupérer le contenu de chaque article.
Pour cela, cliquez sur `Click to finish import` : wallabag récupèrera alors le contenu de 10 articles à la fois.
TODO
TODO nouveau ticket : pourquoi quand on clique une fois, ça ne charge pas en boucle ? Il me semblait que ça faisait ça ping @mariroz
### Depuis Instapaper
#### Exporter ses données depuis Instapaper
TODO
#### Importer ses données Instapaper
TODO
### Depuis Readability
#### Exporter ses données depuis Readability
TODO
#### Importer ses données Readability
TODO
### Depuis wallabag
Puisque vous pouvez exporter vos données de wallabag (lire ci-dessous), il est évidemment possible de les réimporter.
Dans le formulaire d'import, sélectionnez votre fichier d'export wallabag (au format JSON). Démarrez l'import et voila.
Contrairement aux imports ci-dessus, le traitement est moins long car toutes les données (titre et contenu des articles) sont déjà présentes dans le fichier, il n'est pas nécessaire pour wallabag d'accéder à chacune des URL.
Par contre, le fichier d'import est forcément plus conséquent.
### Depuis un fichier HTML ou JSON
TODO
## Exporter
Il est possible d'exporter ses données depuis la page **Configuration** de wallabag. Plusieurs raisons possibles :
* réinstaller wallabag
* quitter le service Framabag pour installer soi-même wallabag
* un compte sur un wallabag multi-utilisateurs souhaite avoir sa propre installation de wallabag
* ...
Vous téléchargerez alors un fichier [au format JSON](http://fr.wikipedia.org/wiki/JavaScript_Object_Notation).
Comme nous l'avons vu ci-dessus, il est possible d'importer ce fichier dans wallabag.

View File

@ -0,0 +1,58 @@
---
language: Français
currentMenu: read_article
subTitle: Lire un article
---
# Lire un article
Lire un article n'est pas la chose la plus compliquée dans wallabag. Vous n'avez qu'à cliquer sur le titre d'un article pour l'afficher.
## Revenir là où vous avez laissé votre article
Si vous quittez un article alors que vous n'êtes qu'à la moitié de celui-ci par exemple, lorsque vous reviendrez, wallabag vous renverra là où vous avez laissé l'article.
Cette astuce ne fonctionne qu'avec l'application web et pas les applications smartphones.
## Actions possibles depuis l'article
Ces actions sont possibles grâce aux icônes affichés en haut de la page. Nous partons du principe que vous utilisez le thème Baggy ([lire la documentation pour changer de thème](Configurer_wallabag.md)), les icônes dans les autres thèmes sont sensiblement les mêmes.
Voici donc ces actions, par ordre d'apparition des icônes.
### Lire l'article original
Renvoie vers l'article original.
### Marquer l'article comme lu
Archive l'article, qui se retrouvera dans la catégorie **Archive** du menu de wallabag.
Recliquer dessus permet de replacer cet article en état non lu.
### Mettre l'article en favori
Marque l'article comme favori, qui se retrouvera dans la catégorie **Favoris** du menu de wallabag.
Recliquer dessus permet d'enlever le statut de favori.
### Supprimer l'article
Supprime complètement l'article de wallabag. Il ne pourra être restauré. Attention, aucune confirmation n'est demandée.
### Partager vers twitter
Partage le titre et le lien original de l'article sur twitter.
### Partager par email
Partage le titre et le lien original de l'article par email.
### Imprimer l'article
Ouvre la fenêtre d'impression du navigateur.
### Convertir en ePub
Convertit l'article au format ePub. [Un chapitre complet existe](Convertir_en_ePub.md).
### Signaler que l'article s'affiche mal
Permet de signaler qu'un article ne s'affiche pas comme attendu. [Un chapitre complet existe](Un_article_est_mal_affiche.md).

View File

@ -0,0 +1,21 @@
---
language: Français
currentMenu: search
subTitle: Rechercher du contenu dans wallabag
---
# Rechercher du contenu dans wallabag
Pour que vous puissiez retrouver un article au plus vite, nous avons mis en place un moteur de recherche complet.
Cliquez sur **Rechercher** dans le menu de wallabag. Là, saisissez un terme de recherche.
wallabag ira parcourir tous vos articles et affichera ceux qui contiennent le terme de recherche dans son titre, son contenu ou son URL.
## Convertir cette recherche au format ePub
Vous pouvez convertir les articles retournés au format ePub, pour les lire sur une liseuse par exemple. Lisez [Convertir en ePub](Convertir_en_ePub.md) pour en savoir plus.
## Assigner un tag aux résultats de cette recherche
Vous pouvez créer un tag en fonction du critère de recherche. Lisez [Classer ses articles](Classer_ses_articles.md) pour en savoir plus.

View File

@ -0,0 +1,101 @@
---
language: Français
currentMenu: save_article
subTitle: Sauvegarder son premier article
---
# Sauvegarder son premier article
Une fois connecté sur wallabag, vous avez plusieurs moyens pour sauvegarder un article.
## Depuis l'application web
Voyons d'abord comment faire depuis l'application web. Dans le menu, vous avez un lien **Sauvegarder un lien**. En cliquant dessus, un formulaire s'affiche : vous n'avez qu'à saisir l'adresse internet de l'article concerné.
Validez et le contenu de l'article est enregistré.
Par défaut, seul le texte est sauvegardé. Si vous souhaitez également conserver une copie des images sur votre serveur, il faut activer le paramètre `DOWNLOAD_PICTURES`. Lisez le chapitre [Les options cachées](../Administrateur/Options_cachees.md) pour en savoir plus.
## Depuis le bookmarklet
[Définition Wikipedia](http://fr.wikipedia.org/wiki/Bookmarklet)
Un bookmarklet est un petit programme JavaScript pouvant être stocké :
* soit en tant qu'URL dans un signet (marque-page ou lien favori) avec la plupart des navigateurs Web ;
* soit en tant qu'hyperlien dans une page web.
Depuis le menu de wallabag, cliquez sur **configuration**. Dans la première partie de cette page, nous avons listé les différents moyens de sauvegarder un article. Vous trouverez ainsi le bookmarklet (c'est le lien `bag it !`) à glisser / déposer dans la barre de favoris de votre navigateur.
Dorénavant, lorsque vous souhaitez sauvegarder un article sur lequel vous êtes en train de surfer, vous n'avez qu'à cliquer sur ce bookmarklet et l'article sera automatiquement enregistré.
## Depuis son smartphone
### Avant toute chose
Pour pouvoir utiliser une application smartphone, vous devez activer les flux RSS depuis la partie **configuration** de wallabag. Certaines informations seront ainsi affichées, comme votre **token** (jeton de sécurité). Lisez le chapitre [Flux RSS](Flux_RSS.md) pour en savoir plus.
### Android
#### Installation et configuration
Vous pouvez télécharger l'application Android depuis le [Google Play Store](https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche) et depuis [F-droid](https://f-droid.org/app/fr.gaulupeau.apps.InThePoche). C'est exactement la même application sur ces deux plateformes de téléchargement.
Une fois installée, démarrez l'application, rendez-vous dans la partie **settings** et renseignez les champs **URL** (Adresse complète de votre installation de wallabag ou de votre compte Framabag), **User ID** (très souvent, il vous faudra mettre 1 comme valeur). Si vous avez créé plusieurs comptes depuis wallabag, il faudra saisir l'identifiant du compte que vous souhaitez connecter à votre application) et **Token** (recopiez bien tous les caractères du token, disponible dans la **configuration** de wallabag).
#### Sauvegarde d'un article
Maintenant que tout est bien configuré, dès que vous naviguerez avec le navigateur de votre smartphone, vous pourrez à tout moment partager un article dans wallabag depuis le menu **Partager** : vous trouverez une entrée **Bag it!** qui ajoutera l'article dans wallabag.
#### Lecture
Lorsque vous ouvrez l'application, cliquez sur **Synchronize** : vos articles dernièrement sauvegardés seront ainsi téléchargés sur votre smartphone.
Vous n'avez maintenant plus besoin de connexion internet : cliquez sur le bouton **List articles** pour commencer votre lecture.
En bas de chaque article, un bouton **Mark as read** vous permet d'archiver l'article.
Aujourd'hui, la synchronisation ne s'effectue que dans un sens (de wallabag vers l'application), ce qui empêche de marquer comme lu un article sur wallabag depuis votre smartphone.
### iOS
#### Installation et configuration
TODO
#### Utilisation
TODO
### Windows Phone
#### Installation et configuration
Vous pouvez télécharger l'application Windows Phone depuis le [Windows Store](http://www.windowsphone.com/fr-fr/store/app/wallabag/ff890514-348c-4d0b-9b43-153fff3f7450) ou directement dans le Store de votre smartphone.
Une fois installée, l'application affichera une notification au premier lancement, demandant la configuration du serveur wallabag. Rendez-vous dans la partie **Configuration** de l'application en appuyant sur les 3 petits points du menu en bas de l'écran, puis renseignez les champs **URL** (Adresse complète de votre installation de wallabag ou de votre compte Framabag), **User ID** (très souvent, il vous faudra mettre 1 comme valeur).
Si vous avez créé plusieurs comptes depuis wallabag, il faudra saisir l'identifiant du compte que vous souhaitez connecter à votre application) et **Token** (recopiez bien tous les caractères du token, disponible dans la **configuration** de wallabag).
Enfin, sauvegardez les paramètres entrés.
## Depuis son navigateur
### Extension Firefox classique
Téléchargez l'extension Firefox [sur le site addons.mozilla.org](https://addons.mozilla.org/firefox/addon/wallabag/) et installez-la comme toute autre extension Firefox.
Dans les préférences de l'extension, renseignez l'URL complète de votre installation de wallabag ou de votre compte Framabag.
Personnalisez la barre d'outils de Firefox pour ajouter wallabag (icône `w`). Lorsque vous vous trouvez sur un article que vous souhaitez sauvegarder, cliquez sur cette icône : une nouvelle fenêtre s'ouvrira pour ajouter l'article et elle se refermera automatiquement.
### Extension Mozilla Services (Social API)
*Disponible uniquement à compter de wallabag 1.9.1*
Avec les versions 29 et supérieures de Firefox, votre navigateur possède une interface intégrée permettant le partage direct vers de multiples réseaux sociaux. Dans l'interface de Firefox, elle est symbolisée par un icône en forme d'avion en papier que vous pourrez utiliser pour partager une page, ce qui signifie ici enregistrer un article dans wallabag.
Vous pouvez ajouter ce service depuis la page de configuration de wallabag en cliquant sur Extension Mozilla Services (Social API). Vous devez aussi accepter l'utilisation des Services Firefox.
### Chrome
Téléchargez l'extension Chrome [sur le site dédié](https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj) et installez-la comme toute autre extension Chrome.
Dans les options de l'extension, renseignez l'URL complète de votre installation de wallabag ou de votre compte Framabag.
Lors de l'installation de l'extension, une nouvelle icône est apparue dans la barre d'outils de Chrome, une icône `w`. Lorsque vous vous trouvez sur un article que vous souhaitez sauvegarder, cliquez sur cette icône : une popup s'ouvrira et vous confirmera que l'article a bien été sauvegardé.
### Opera
Les dernières versions d'Opera (15+) permettent d'installer des extensions compatibles avec Chrome.
Il faut tout d'abord installer l'extension [Download Chrome Extensions](https://addons.opera.com/en/extensions/details/download-chrome-extension-9/) pour installer des extensions à partir du Chrome Web Store. Ensuite, on peut se rendre [sur le site de Google](https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj) et récupérer l'extension Chrome en cliquant sur *Add to Opera*. Vous obtiendrez un message qui vous invitera à confirmer l'action car l'extension ne provient pas d'une source approuvée. Le comportement sera ensuite le même que pour Chrome (ci-dessus).

View File

@ -0,0 +1,32 @@
---
language: Français
currentMenu: issue
subTitle: Mon article s'affiche mal dans wallabag
---
# Mon article s'affiche mal dans wallabag
Si vous pensez que wallabag récupère mal le contenu d'un article (texte absent ou incomplet), nous vous proposons plusieurs possibilités.
## Demande d'aide
Que ça soit par mail ou via un ticket, n'oubliez pas de nous donner certaines informations qui sont importantes pour que nous puissions résoudre le problème au mieux :
* l'URL de l'article concerné
* ce que wallabag affiche
* ce à quoi vous vous attendiez
* la version de wallabag ou alors si vous utilisez Framabag
### Ouvrir un ticket sur github
Pour ouvrir un nouveau ticket, il faut [aller sur github](https://github.com/wallabag/wallabag/issues/new). Un compte est nécessaire.
N'oubliez pas de nous envoyer les informations ci-dessus.
### Nous envoyer un email
Envoyez-nous un lien à l'adresse [hello@wallabag.org](mailto:hello@wallabag.org?subject=Mauvais%20affichage%20dans%20wallabag).
N'oubliez pas de nous envoyer les informations ci-dessus.
## Résoudre ce problème d'affichage
TODO

87
docs/fr/conf.py Normal file
View File

@ -0,0 +1,87 @@
# -*- coding: utf-8 -*-
#
# wallabag documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 16 06:47:23 2015.
import sys
import os
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'wallabag-fr'
copyright = u'2013-2015, Nicolas Lœuillet - MIT Licence'
version = '2.0.0'
release = version
exclude_patterns = ['_build']
pygments_style = 'sphinx'
html_theme = 'default'
html_static_path = ['_static']
htmlhelp_basename = 'wallabagfrdoc'
latex_elements = {
}
latex_documents = [
('index', 'wallabag-fr.tex', u'wallabag Documentation',
u'Nicolas Lœuillet', 'manual'),
]
man_pages = [
('index', 'wallabagfr', u'wallabag Documentation',
[u'Nicolas Lœuillet'], 1)
]
texinfo_documents = [
('index', 'wallabagfr', u'wallabag Documentation',
u'Nicolas Lœuillet', 'wallabagfr', 'One line description of project.',
'Miscellaneous'),
]
##### Guzzle sphinx theme
import guzzle_sphinx_theme
html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']
}
# Register the theme as an extension to generate a sitemap.xml
extensions.append("guzzle_sphinx_theme")
# Guzzle theme options (see theme.conf for more information)
html_theme_options = {
# Set the path to a special layout to include for the homepage
# "index_template": "homepage.html",
# Allow a separate homepage from the master_doc
# homepage = index
# Set the name of the project to appear in the nav menu
# "project_nav_name": "Guzzle",
# Set your Disqus short name to enable comments
# "disqus_comments_shortname": "my_disqus_comments_short_name",
# Set you GA account ID to enable tracking
# "google_analytics_account": "my_ga_account",
# Path to a touch icon
# "touch_icon": "",
# Specify a base_url used to generate sitemap.xml links. If not
# specified, then no sitemap will be built.
#"base_url": "http://guzzlephp.org"
# Allow the "Table of Contents" page to be defined separately from "master_doc"
# tocpage = Contents
# Allow the project link to be overriden to a custom URL.
# projectlink = http://myproject.url
}

29
docs/fr/index.rst Normal file
View File

@ -0,0 +1,29 @@
Documentation de wallabag
=========================
**wallabag** est une application de lecture différée : elle permet
simplement darchiver une page web en ne conservant que le contenu. Les
éléments superflus (menu, publicité, etc.) sont supprimés.
Principales fonctionnalités
---------------------------
- tout le contenu est archivé : le texte et les photos
- lapplication web est entièrement responsive
- vous pouvez convertir vos articles au format ePub pour les charger
sur votre liseuse
- des applications smartphones vous permettent de lire vos articles
tout en étant déconnecté
- des extensions pour votre navigateur vous permettent d'archiver
rapidement un nouvel article
- plusieurs thèmes graphiques vous permettent d'habiller votre
wallabag comme vous le souhaitez
- et forcément plein dautres fonctionnalités !
Cette documentation est justement là pour faire découvrir toutes les
possibilités de wallabag. Cest parti !
.. toctree::
:maxdepth: 2
index

2
docs/fr/requirements.txt Normal file
View File

@ -0,0 +1,2 @@
Sphinx>=1.3.0,<1.4.0
guzzle_sphinx_theme>=0.7.0,<0.8.0

BIN
docs/img/user/2FA_form.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
docs/img/user/topbar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
docs/img/wallabag.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -20,6 +20,11 @@
<php>
<server name="KERNEL_DIR" value="./app/" />
<!--
Avoid tests to fail because of deprecated stuff
see: http://symfony.com/doc/current/cookbook/upgrade/major_version.html#deprecations-in-phpunit
-->
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
</php>
<filter>

View File

@ -2,8 +2,8 @@
namespace Wallabag\ApiBundle\Controller;
use FOS\RestBundle\Controller\FOSRestController;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Wallabag\CoreBundle\Entity\Entry;
@ -11,7 +11,7 @@ use Wallabag\CoreBundle\Entity\Tag;
use Hateoas\Configuration\Route;
use Hateoas\Representation\Factory\PagerfantaFactory;
class WallabagRestController extends Controller
class WallabagRestController extends FOSRestController
{
/**
* @param Entry $entry
@ -27,7 +27,7 @@ class WallabagRestController extends Controller
->findOneByLabel($label);
if (is_null($tagEntity)) {
$tagEntity = new Tag($this->getUser());
$tagEntity = new Tag();
$tagEntity->setLabel($label);
}
@ -38,29 +38,11 @@ class WallabagRestController extends Controller
}
}
/**
* Retrieve salt for a giver user.
*
* @ApiDoc(
* parameters={
* {"name"="username", "dataType"="string", "required"=true, "description"="username"}
* }
* )
*
* @return array
*/
public function getSaltAction($username)
private function validateAuthentication()
{
$user = $this
->getDoctrine()
->getRepository('WallabagCoreBundle:User')
->findOneByUsername($username);
if (is_null($user)) {
throw $this->createNotFoundException();
if (false === $this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) {
throw new AccessDeniedException();
}
return array($user->getSalt() ?: null);
}
/**
@ -78,10 +60,12 @@ class WallabagRestController extends Controller
* }
* )
*
* @return Entry
* @return Response
*/
public function getEntriesAction(Request $request)
{
$this->validateAuthentication();
$isArchived = $request->query->get('archive');
$isStarred = $request->query->get('star');
$sort = $request->query->get('sort', 'created');
@ -90,8 +74,7 @@ class WallabagRestController extends Controller
$perPage = (int) $request->query->get('perPage', 30);
$tags = $request->query->get('tags', []);
$pager = $this
->getDoctrine()
$pager = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order);
@ -118,11 +101,12 @@ class WallabagRestController extends Controller
* }
* )
*
* @return Entry
* @return Response
*/
public function getEntryAction(Entry $entry)
{
$this->validateUserAccess($entry->getUser()->getId(), $this->getUser()->getId());
$this->validateAuthentication();
$this->validateUserAccess($entry->getUser()->getId());
$json = $this->get('serializer')->serialize($entry, 'json');
@ -140,10 +124,12 @@ class WallabagRestController extends Controller
* }
* )
*
* @return Entry
* @return Response
*/
public function postEntriesAction(Request $request)
{
$this->validateAuthentication();
$url = $request->request->get('url');
$entry = $this->get('wallabag_core.content_proxy')->updateEntry(
@ -180,15 +166,16 @@ class WallabagRestController extends Controller
* }
* )
*
* @return Entry
* @return Response
*/
public function patchEntriesAction(Entry $entry, Request $request)
{
$this->validateUserAccess($entry->getUser()->getId(), $this->getUser()->getId());
$this->validateAuthentication();
$this->validateUserAccess($entry->getUser()->getId());
$title = $request->request->get('title');
$isArchived = $request->request->get('is_archived');
$isStarred = $request->request->get('is_starred');
$isArchived = $request->request->get('archive');
$isStarred = $request->request->get('star');
if (!is_null($title)) {
$entry->setTitle($title);
@ -224,11 +211,12 @@ class WallabagRestController extends Controller
* }
* )
*
* @return Entry
* @return Response
*/
public function deleteEntriesAction(Entry $entry)
{
$this->validateUserAccess($entry->getUser()->getId(), $this->getUser()->getId());
$this->validateAuthentication();
$this->validateUserAccess($entry->getUser()->getId());
$em = $this->getDoctrine()->getManager();
$em->remove($entry);
@ -247,10 +235,13 @@ class WallabagRestController extends Controller
* {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
* }
* )
*
* @return Response
*/
public function getEntriesTagsAction(Entry $entry)
{
$this->validateUserAccess($entry->getUser()->getId(), $this->getUser()->getId());
$this->validateAuthentication();
$this->validateUserAccess($entry->getUser()->getId());
$json = $this->get('serializer')->serialize($entry->getTags(), 'json');
@ -268,10 +259,13 @@ class WallabagRestController extends Controller
* {"name"="tags", "dataType"="string", "required"=false, "format"="tag1,tag2,tag3", "description"="a comma-separated list of tags."},
* }
* )
*
* @return Response
*/
public function postEntriesTagsAction(Request $request, Entry $entry)
{
$this->validateUserAccess($entry->getUser()->getId(), $this->getUser()->getId());
$this->validateAuthentication();
$this->validateUserAccess($entry->getUser()->getId());
$tags = $request->request->get('tags', '');
if (!empty($tags)) {
@ -296,10 +290,13 @@ class WallabagRestController extends Controller
* {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
* }
* )
*
* @return Response
*/
public function deleteEntriesTagsAction(Entry $entry, Tag $tag)
{
$this->validateUserAccess($entry->getUser()->getId(), $this->getUser()->getId());
$this->validateAuthentication();
$this->validateUserAccess($entry->getUser()->getId());
$entry->removeTag($tag);
$em = $this->getDoctrine()->getManager();
@ -315,10 +312,18 @@ class WallabagRestController extends Controller
* Retrieve all tags.
*
* @ApiDoc()
*
* @return Response
*/
public function getTagsAction()
{
$json = $this->get('serializer')->serialize($this->getUser()->getTags(), 'json');
$this->validateAuthentication();
$tags = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Tag')
->findAllTags($this->getUser()->getId());
$json = $this->get('serializer')->serialize($tags, 'json');
return $this->renderJsonResponse($json);
}
@ -331,14 +336,16 @@ class WallabagRestController extends Controller
* {"name"="tag", "dataType"="integer", "requirement"="\w+", "description"="The tag"}
* }
* )
*
* @return Response
*/
public function deleteTagAction(Tag $tag)
{
$this->validateUserAccess($tag->getUser()->getId(), $this->getUser()->getId());
$this->validateAuthentication();
$em = $this->getDoctrine()->getManager();
$em->remove($tag);
$em->flush();
$this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->removeTag($this->getUser()->getId(), $tag);
$json = $this->get('serializer')->serialize($tag, 'json');
@ -350,12 +357,12 @@ class WallabagRestController extends Controller
* If not, throw exception. It means a user try to access information from an other user.
*
* @param int $requestUserId User id from the requested source
* @param int $currentUserId User id from the retrieved source
*/
private function validateUserAccess($requestUserId, $currentUserId)
private function validateUserAccess($requestUserId)
{
if ($requestUserId != $currentUserId) {
throw $this->createAccessDeniedException('Access forbidden. Entry user id: '.$requestUserId.', logged user id: '.$currentUserId);
$user = $this->get('security.token_storage')->getToken()->getUser();
if ($requestUserId != $user->getId()) {
throw $this->createAccessDeniedException('Access forbidden. Entry user id: '.$requestUserId.', logged user id: '.$user->getId());
}
}

View File

@ -1,40 +0,0 @@
<?php
namespace Wallabag\ApiBundle\DependencyInjection\Security\Factory;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
class WsseFactory implements SecurityFactoryInterface
{
public function create(ContainerBuilder $container, $id, $config, $userProvider, $defaultEntryPoint)
{
$providerId = 'security.authentication.provider.wsse.'.$id;
$container
->setDefinition($providerId, new DefinitionDecorator('wsse.security.authentication.provider'))
->replaceArgument(0, new Reference($userProvider))
;
$listenerId = 'security.authentication.listener.wsse.'.$id;
$listener = $container->setDefinition($listenerId, new DefinitionDecorator('wsse.security.authentication.listener'));
return array($providerId, $listenerId, $defaultEntryPoint);
}
public function getPosition()
{
return 'pre_auth';
}
public function getKey()
{
return 'wsse';
}
public function addConfiguration(NodeDefinition $node)
{
}
}

View File

@ -3,9 +3,7 @@
namespace Wallabag\ApiBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
class WallabagApiExtension extends Extension
{
@ -13,9 +11,6 @@ class WallabagApiExtension extends Extension
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
public function getAlias()

View File

@ -0,0 +1,31 @@
<?php
namespace Wallabag\ApiBundle\Entity;
use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table("oauth2_access_tokens")
* @ORM\Entity
*/
class AccessToken extends BaseAccessToken
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Client")
* @ORM\JoinColumn(nullable=false)
*/
protected $client;
/**
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User")
*/
protected $user;
}

View File

@ -0,0 +1,31 @@
<?php
namespace Wallabag\ApiBundle\Entity;
use FOS\OAuthServerBundle\Entity\AuthCode as BaseAuthCode;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table("oauth2_auth_codes")
* @ORM\Entity
*/
class AuthCode extends BaseAuthCode
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Client")
* @ORM\JoinColumn(nullable=false)
*/
protected $client;
/**
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User")
*/
protected $user;
}

View File

@ -0,0 +1,25 @@
<?php
namespace Wallabag\ApiBundle\Entity;
use FOS\OAuthServerBundle\Entity\Client as BaseClient;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table("oauth2_clients")
* @ORM\Entity
*/
class Client extends BaseClient
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
public function __construct()
{
parent::__construct();
}
}

View File

@ -0,0 +1,31 @@
<?php
namespace Wallabag\ApiBundle\Entity;
use FOS\OAuthServerBundle\Entity\RefreshToken as BaseRefreshToken;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table("oauth2_refresh_tokens")
* @ORM\Entity
*/
class RefreshToken extends BaseRefreshToken
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Client")
* @ORM\JoinColumn(nullable=false)
*/
protected $client;
/**
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User")
*/
protected $user;
}

View File

@ -1,12 +0,0 @@
services:
wsse.security.authentication.provider:
class: Wallabag\ApiBundle\Security\Authentication\Provider\WsseProvider
public: false
arguments: ['', '%kernel.cache_dir%/security/nonces']
wsse.security.authentication.listener:
class: Wallabag\ApiBundle\Security\Firewall\WsseListener
public: false
tags:
- { name: monolog.logger, channel: wsse }
arguments: ['@security.context', '@security.authentication.manager', '@logger']

View File

@ -1,79 +0,0 @@
<?php
namespace Wallabag\ApiBundle\Security\Authentication\Provider;
use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\NonceExpiredException;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Wallabag\ApiBundle\Security\Authentication\Token\WsseUserToken;
class WsseProvider implements AuthenticationProviderInterface
{
private $userProvider;
private $cacheDir;
public function __construct(UserProviderInterface $userProvider, $cacheDir)
{
$this->userProvider = $userProvider;
$this->cacheDir = $cacheDir;
// If cache directory does not exist we create it
if (!is_dir($this->cacheDir)) {
mkdir($this->cacheDir, 0777, true);
}
}
public function authenticate(TokenInterface $token)
{
$user = $this->userProvider->loadUserByUsername($token->getUsername());
if (!$user) {
throw new AuthenticationException('Bad credentials. Did you forgot your username?');
}
if ($user && $this->validateDigest($token->digest, $token->nonce, $token->created, $user->getPassword())) {
$authenticatedToken = new WsseUserToken($user->getRoles());
$authenticatedToken->setUser($user);
return $authenticatedToken;
}
throw new AuthenticationException('The WSSE authentication failed.');
}
protected function validateDigest($digest, $nonce, $created, $secret)
{
// Check created time is not in the future
if (strtotime($created) > time()) {
throw new AuthenticationException('Back to the future...');
}
// Expire timestamp after 5 minutes
if (time() - strtotime($created) > 300) {
throw new AuthenticationException('Too late for this timestamp... Watch your watch.');
}
// Validate nonce is unique within 5 minutes
if (file_exists($this->cacheDir.'/'.$nonce) && file_get_contents($this->cacheDir.'/'.$nonce) + 300 > time()) {
throw new NonceExpiredException('Previously used nonce detected');
}
file_put_contents($this->cacheDir.'/'.$nonce, time());
// Validate Secret
$expected = base64_encode(sha1(base64_decode($nonce).$created.$secret, true));
if ($digest !== $expected) {
throw new AuthenticationException('Bad credentials ! Digest is not as expected.');
}
return $digest === $expected;
}
public function supports(TokenInterface $token)
{
return $token instanceof WsseUserToken;
}
}

View File

@ -1,24 +0,0 @@
<?php
namespace Wallabag\ApiBundle\Security\Authentication\Token;
use Symfony\Component\Security\Core\Authentication\Token\AbstractToken;
class WsseUserToken extends AbstractToken
{
public $created;
public $digest;
public $nonce;
public function __construct(array $roles = array())
{
parent::__construct($roles);
$this->setAuthenticated(count($roles) > 0);
}
public function getCredentials()
{
return '';
}
}

View File

@ -1,62 +0,0 @@
<?php
namespace Wallabag\ApiBundle\Security\Firewall;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Http\Firewall\ListenerInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
use Wallabag\ApiBundle\Security\Authentication\Token\WsseUserToken;
use Psr\Log\LoggerInterface;
class WsseListener implements ListenerInterface
{
protected $securityContext;
protected $authenticationManager;
protected $logger;
public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, LoggerInterface $logger)
{
$this->securityContext = $securityContext;
$this->authenticationManager = $authenticationManager;
$this->logger = $logger;
}
public function handle(GetResponseEvent $event)
{
$request = $event->getRequest();
$wsseRegex = '/UsernameToken Username="([^"]+)", PasswordDigest="([^"]+)", Nonce="([^"]+)", Created="([^"]+)"/';
if (!$request->headers->has('x-wsse') || 1 !== preg_match($wsseRegex, $request->headers->get('x-wsse'), $matches)) {
return;
}
$token = new WsseUserToken();
$token->setUser($matches[1]);
$token->digest = $matches[2];
$token->nonce = $matches[3];
$token->created = $matches[4];
try {
$authToken = $this->authenticationManager->authenticate($token);
$this->securityContext->setToken($authToken);
return;
} catch (AuthenticationException $failed) {
$failedMessage = 'WSSE Login failed for '.$token->getUsername().'. Why ? '.$failed->getMessage();
$this->logger->err($failedMessage);
// Deny authentication with a '403 Forbidden' HTTP response
$response = new Response();
$response->setStatusCode(403);
$response->setContent($failedMessage);
$event->setResponse($response);
return;
}
}
}

View File

@ -2,99 +2,15 @@
namespace Wallabag\ApiBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Wallabag\ApiBundle\Tests\WallabagApiTestCase;
class WallabagRestControllerTest extends WebTestCase
class WallabagRestControllerTest extends WallabagApiTestCase
{
protected static $salt;
/**
* Grab the salt once and store it to be available for all tests.
*/
public static function setUpBeforeClass()
{
$client = self::createClient();
$user = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:User')
->findOneByUsername('admin');
self::$salt = $user->getSalt();
}
/**
* Generate HTTP headers for authenticate user on API.
*
* @param string $username
* @param string $password
*
* @return array
*/
private function generateHeaders($username, $password)
{
$encryptedPassword = sha1($password.$username.self::$salt);
$nonce = substr(md5(uniqid('nonce_', true)), 0, 16);
$now = new \DateTime('now', new \DateTimeZone('UTC'));
$created = (string) $now->format('Y-m-d\TH:i:s\Z');
$digest = base64_encode(sha1(base64_decode($nonce).$created.$encryptedPassword, true));
return array(
'HTTP_AUTHORIZATION' => 'Authorization profile="UsernameToken"',
'HTTP_x-wsse' => 'X-WSSE: UsernameToken Username="'.$username.'", PasswordDigest="'.$digest.'", Nonce="'.$nonce.'", Created="'.$created.'"',
);
}
public function testGetSalt()
{
$client = $this->createClient();
$client->request('GET', '/api/salts/admin.json');
$user = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:User')
->findOneByUsername('admin');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$content = json_decode($client->getResponse()->getContent(), true);
$this->assertArrayHasKey(0, $content);
$this->assertEquals($user->getSalt(), $content[0]);
$client->request('GET', '/api/salts/notfound.json');
$this->assertEquals(404, $client->getResponse()->getStatusCode());
}
public function testWithBadHeaders()
{
$client = $this->createClient();
$entry = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findOneByIsArchived(false);
if (!$entry) {
$this->markTestSkipped('No content found in db.');
}
$badHeaders = array(
'HTTP_AUTHORIZATION' => 'Authorization profile="UsernameToken"',
'HTTP_x-wsse' => 'X-WSSE: UsernameToken Username="admin", PasswordDigest="Wr0ngDig3st", Nonce="n0Nc3", Created="2015-01-01T13:37:00Z"',
);
$client->request('GET', '/api/entries/'.$entry->getId().'.json', array(), array(), $badHeaders);
$this->assertEquals(403, $client->getResponse()->getStatusCode());
}
public function testGetOneEntry()
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$entry = $client->getContainer()
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findOneBy(array('user' => 1, 'isArchived' => false));
@ -103,18 +19,17 @@ class WallabagRestControllerTest extends WebTestCase
$this->markTestSkipped('No content found in db.');
}
$client->request('GET', '/api/entries/'.$entry->getId().'.json', array(), array(), $headers);
$this->client->request('GET', '/api/entries/'.$entry->getId().'.json');
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$content = json_decode($client->getResponse()->getContent(), true);
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertEquals($entry->getTitle(), $content['title']);
$this->assertEquals($entry->getUrl(), $content['url']);
$this->assertCount(count($entry->getTags()), $content['tags']);
$this->assertTrue(
$client->getResponse()->headers->contains(
$this->client->getResponse()->headers->contains(
'Content-Type',
'application/json'
)
@ -123,10 +38,7 @@ class WallabagRestControllerTest extends WebTestCase
public function testGetOneEntryWrongUser()
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$entry = $client->getContainer()
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findOneBy(array('user' => 2, 'isArchived' => false));
@ -135,21 +47,18 @@ class WallabagRestControllerTest extends WebTestCase
$this->markTestSkipped('No content found in db.');
}
$client->request('GET', '/api/entries/'.$entry->getId().'.json', array(), array(), $headers);
$this->client->request('GET', '/api/entries/'.$entry->getId().'.json');
$this->assertEquals(403, $client->getResponse()->getStatusCode());
$this->assertEquals(403, $this->client->getResponse()->getStatusCode());
}
public function testGetEntries()
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$this->client->request('GET', '/api/entries');
$client->request('GET', '/api/entries', array(), array(), $headers);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$content = json_decode($client->getResponse()->getContent(), true);
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThanOrEqual(1, count($content));
$this->assertNotEmpty($content['_embedded']['items']);
@ -158,7 +67,7 @@ class WallabagRestControllerTest extends WebTestCase
$this->assertGreaterThanOrEqual(1, $content['pages']);
$this->assertTrue(
$client->getResponse()->headers->contains(
$this->client->getResponse()->headers->contains(
'Content-Type',
'application/json'
)
@ -167,14 +76,11 @@ class WallabagRestControllerTest extends WebTestCase
public function testGetStarredEntries()
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$this->client->request('GET', '/api/entries', array('star' => 1, 'sort' => 'updated'));
$client->request('GET', '/api/entries', array('star' => 1, 'sort' => 'updated'), array(), $headers);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$content = json_decode($client->getResponse()->getContent(), true);
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThanOrEqual(1, count($content));
$this->assertNotEmpty($content['_embedded']['items']);
@ -183,7 +89,7 @@ class WallabagRestControllerTest extends WebTestCase
$this->assertGreaterThanOrEqual(1, $content['pages']);
$this->assertTrue(
$client->getResponse()->headers->contains(
$this->client->getResponse()->headers->contains(
'Content-Type',
'application/json'
)
@ -192,14 +98,11 @@ class WallabagRestControllerTest extends WebTestCase
public function testGetArchiveEntries()
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$this->client->request('GET', '/api/entries', array('archive' => 1));
$client->request('GET', '/api/entries', array('archive' => 1), array(), $headers);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$content = json_decode($client->getResponse()->getContent(), true);
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThanOrEqual(1, count($content));
$this->assertNotEmpty($content['_embedded']['items']);
@ -208,7 +111,7 @@ class WallabagRestControllerTest extends WebTestCase
$this->assertGreaterThanOrEqual(1, $content['pages']);
$this->assertTrue(
$client->getResponse()->headers->contains(
$this->client->getResponse()->headers->contains(
'Content-Type',
'application/json'
)
@ -217,10 +120,7 @@ class WallabagRestControllerTest extends WebTestCase
public function testDeleteEntry()
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$entry = $client->getContainer()
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findOneByUser(1);
@ -229,36 +129,31 @@ class WallabagRestControllerTest extends WebTestCase
$this->markTestSkipped('No content found in db.');
}
$client->request('DELETE', '/api/entries/'.$entry->getId().'.json', array(), array(), $headers);
$this->client->request('DELETE', '/api/entries/'.$entry->getId().'.json');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($client->getResponse()->getContent(), true);
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertEquals($entry->getTitle(), $content['title']);
$this->assertEquals($entry->getUrl(), $content['url']);
// We'll try to delete this entry again
$headers = $this->generateHeaders('admin', 'mypassword');
$this->client->request('DELETE', '/api/entries/'.$entry->getId().'.json');
$client->request('DELETE', '/api/entries/'.$entry->getId().'.json', array(), array(), $headers);
$this->assertEquals(404, $client->getResponse()->getStatusCode());
$this->assertEquals(404, $this->client->getResponse()->getStatusCode());
}
public function testPostEntry()
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$client->request('POST', '/api/entries.json', array(
$this->client->request('POST', '/api/entries.json', array(
'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html',
'tags' => 'google',
), array(), $headers);
));
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($client->getResponse()->getContent(), true);
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThan(0, $content['id']);
$this->assertEquals('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']);
@ -269,10 +164,7 @@ class WallabagRestControllerTest extends WebTestCase
public function testPatchEntry()
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$entry = $client->getContainer()
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findOneByUser(1);
@ -284,16 +176,16 @@ class WallabagRestControllerTest extends WebTestCase
// hydrate the tags relations
$nbTags = count($entry->getTags());
$client->request('PATCH', '/api/entries/'.$entry->getId().'.json', array(
$this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', array(
'title' => 'New awesome title',
'tags' => 'new tag '.uniqid(),
'star' => true,
'archive' => false,
), array(), $headers);
));
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($client->getResponse()->getContent(), true);
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertEquals($entry->getId(), $content['id']);
$this->assertEquals($entry->getUrl(), $content['url']);
@ -303,10 +195,7 @@ class WallabagRestControllerTest extends WebTestCase
public function testGetTagsEntry()
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$entry = $client->getContainer()
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findOneWithTags(1);
@ -319,20 +208,17 @@ class WallabagRestControllerTest extends WebTestCase
$tags = array();
foreach ($entry->getTags() as $tag) {
$tags[] = array('id' => $tag->getId(), 'label' => $tag->getLabel());
$tags[] = array('id' => $tag->getId(), 'label' => $tag->getLabel(), 'slug' => $tag->getSlug());
}
$client->request('GET', '/api/entries/'.$entry->getId().'/tags', array(), array(), $headers);
$this->client->request('GET', '/api/entries/'.$entry->getId().'/tags');
$this->assertEquals(json_encode($tags, JSON_HEX_QUOT), $client->getResponse()->getContent());
$this->assertEquals(json_encode($tags, JSON_HEX_QUOT), $this->client->getResponse()->getContent());
}
public function testPostTagsOnEntry()
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$entry = $client->getContainer()
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findOneByUser(1);
@ -345,16 +231,16 @@ class WallabagRestControllerTest extends WebTestCase
$newTags = 'tag1,tag2,tag3';
$client->request('POST', '/api/entries/'.$entry->getId().'/tags', array('tags' => $newTags), array(), $headers);
$this->client->request('POST', '/api/entries/'.$entry->getId().'/tags', array('tags' => $newTags));
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($client->getResponse()->getContent(), true);
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertArrayHasKey('tags', $content);
$this->assertEquals($nbTags + 3, count($content['tags']));
$entryDB = $client->getContainer()
$entryDB = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->find($entry->getId());
@ -369,15 +255,13 @@ class WallabagRestControllerTest extends WebTestCase
}
}
public function testDeleteOneTagEntrie()
public function testDeleteOneTagEntry()
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$entry = $client->getContainer()
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findOneByUser(1);
->findOneWithTags(1);
$entry = $entry[0];
if (!$entry) {
$this->markTestSkipped('No content found in db.');
@ -387,11 +271,11 @@ class WallabagRestControllerTest extends WebTestCase
$nbTags = count($entry->getTags());
$tag = $entry->getTags()[0];
$client->request('DELETE', '/api/entries/'.$entry->getId().'/tags/'.$tag->getId().'.json', array(), array(), $headers);
$this->client->request('DELETE', '/api/entries/'.$entry->getId().'/tags/'.$tag->getId().'.json');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($client->getResponse()->getContent(), true);
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertArrayHasKey('tags', $content);
$this->assertEquals($nbTags - 1, count($content['tags']));
@ -399,14 +283,11 @@ class WallabagRestControllerTest extends WebTestCase
public function testGetUserTags()
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$this->client->request('GET', '/api/tags.json');
$client->request('GET', '/api/tags.json', array(), array(), $headers);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$content = json_decode($client->getResponse()->getContent(), true);
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThan(0, $content);
$this->assertArrayHasKey('id', $content[0]);
@ -420,16 +301,21 @@ class WallabagRestControllerTest extends WebTestCase
*/
public function testDeleteUserTag($tag)
{
$client = $this->createClient();
$headers = $this->generateHeaders('admin', 'mypassword');
$this->client->request('DELETE', '/api/tags/'.$tag['id'].'.json');
$client->request('DELETE', '/api/tags/'.$tag['id'].'.json', array(), array(), $headers);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$content = json_decode($client->getResponse()->getContent(), true);
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertArrayHasKey('label', $content);
$this->assertEquals($tag['label'], $content['label']);
$this->assertEquals($tag['slug'], $content['slug']);
$entries = $entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findAllByTagId($this->user->getId(), $tag['id']);
$this->assertCount(0, $entries);
}
}

View File

@ -0,0 +1,51 @@
<?php
namespace Wallabag\ApiBundle\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\BrowserKit\Cookie;
abstract class WallabagApiTestCase extends WebTestCase
{
/**
* @var Client
*/
protected $client = null;
/**
* @var \FOS\UserBundle\Model\UserInterface
*/
protected $user;
public function setUp()
{
$this->client = $this->createAuthorizedClient();
}
/**
* @return Client
*/
protected function createAuthorizedClient()
{
$client = static::createClient();
$container = $client->getContainer();
/** @var $userManager \FOS\UserBundle\Doctrine\UserManager */
$userManager = $container->get('fos_user.user_manager');
/** @var $loginManager \FOS\UserBundle\Security\LoginManager */
$loginManager = $container->get('fos_user.security.login_manager');
$firewallName = $container->getParameter('fos_user.firewall_name');
$this->user = $userManager->findUserBy(array('username' => 'admin'));
$loginManager->loginUser($firewallName, $this->user);
// save the login token into the session and put it in a cookie
$container->get('session')->set('_security_'.$firewallName, serialize($container->get('security.token_storage')->getToken()));
$container->get('session')->save();
$session = $container->get('session');
$client->getCookieJar()->set(new Cookie($session->getName(), $session->getId()));
return $client;
}
}

View File

@ -3,16 +3,7 @@
namespace Wallabag\ApiBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Wallabag\ApiBundle\DependencyInjection\Security\Factory\WsseFactory;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class WallabagApiBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$extension = $container->getExtension('security');
$extension->addSecurityListenerFactory(new WsseFactory());
}
}

View File

@ -8,7 +8,9 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\NullOutput;
use Wallabag\CoreBundle\Entity\User;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Helper\Table;
use Wallabag\CoreBundle\Entity\Config;
class InstallCommand extends ContainerAwareCommand
@ -85,17 +87,18 @@ class InstallCommand extends ContainerAwareCommand
}
$rows[] = array($label, $status, $help);
$this->getHelper('table')
$table = new Table($this->defaultOutput);
$table
->setHeaders(array('Checked', 'Status', 'Recommendation'))
->setRows($rows)
->render($this->defaultOutput);
->render();
if (!$fulfilled) {
throw new \RuntimeException('Some system requirements are not fulfilled. Please check output messages and fix them.');
} else {
$this->defaultOutput->writeln('<info>Success! Your system can run Wallabag properly.</info>');
}
$this->defaultOutput->writeln('<info>Success! Your system can run Wallabag properly.</info>');
$this->defaultOutput->writeln('');
return $this;
@ -107,14 +110,17 @@ class InstallCommand extends ContainerAwareCommand
// user want to reset everything? Don't care about what is already here
if (true === $this->defaultInput->getOption('reset')) {
$this->defaultOutput->writeln('Droping database, creating database and schema');
$this->defaultOutput->writeln('Droping database, creating database and schema, clearing the cache');
$this
->runCommand('doctrine:database:drop', array('--force' => true))
->runCommand('doctrine:database:create')
->runCommand('doctrine:schema:create')
->runCommand('cache:clear')
;
$this->defaultOutput->writeln('');
return $this;
}
@ -127,12 +133,15 @@ class InstallCommand extends ContainerAwareCommand
->runCommand('cache:clear')
;
$this->defaultOutput->writeln('');
return $this;
}
$dialog = $this->getHelper('dialog');
$questionHelper = $this->getHelper('question');
$question = new ConfirmationQuestion('It appears that your database already exists. Would you like to reset it? (y/N)', false);
if ($dialog->askConfirmation($this->defaultOutput, '<question>It appears that your database already exists. Would you like to reset it? (y/N)</question> ', false)) {
if ($questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)) {
$this->defaultOutput->writeln('Droping database, creating database and schema');
$this
@ -141,7 +150,8 @@ class InstallCommand extends ContainerAwareCommand
->runCommand('doctrine:schema:create')
;
} elseif ($this->isSchemaPresent()) {
if ($dialog->askConfirmation($this->defaultOutput, '<question>Seems like your database contains schema. Do you want to reset it? (y/N)</question> ', false)) {
$question = new ConfirmationQuestion('Seems like your database contains schema. Do you want to reset it? (y/N)', false);
if ($questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)) {
$this->defaultOutput->writeln('Droping schema and creating schema');
$this
@ -160,17 +170,6 @@ class InstallCommand extends ContainerAwareCommand
$this->defaultOutput->writeln('Clearing the cache');
$this->runCommand('cache:clear');
/*
if ($this->getHelperSet()->get('dialog')->askConfirmation($this->defaultOutput, '<question>Load fixtures (Y/N)?</question>', false)) {
$doctrineConfig = $this->getContainer()->get('doctrine.orm.entity_manager')->getConnection()->getConfiguration();
$logger = $doctrineConfig->getSQLLogger();
// speed up fixture load
$doctrineConfig->setSQLLogger(null);
$this->runCommand('doctrine:fixtures:load');
$doctrineConfig->setSQLLogger($logger);
}
*/
$this->defaultOutput->writeln('');
return $this;
@ -180,18 +179,27 @@ class InstallCommand extends ContainerAwareCommand
{
$this->defaultOutput->writeln('<info><comment>Step 3 of 4.</comment> Administration setup.</info>');
$dialog = $this->getHelperSet()->get('dialog');
$questionHelper = $this->getHelperSet()->get('question');
$question = new ConfirmationQuestion('Would you like to create a new user ? (y/N)', false);
if (false === $dialog->askConfirmation($this->defaultOutput, '<question>Would you like to create a new user ? (y/N)</question>', true)) {
if (!$questionHelper->ask($this->defaultInput, $this->defaultOutput, $question)) {
return $this;
}
$em = $this->getContainer()->get('doctrine.orm.entity_manager');
$user = new User();
$user->setUsername($dialog->ask($this->defaultOutput, '<question>Username</question> <comment>(default: wallabag)</comment> :', 'wallabag'));
$user->setPassword($dialog->ask($this->defaultOutput, '<question>Password</question> <comment>(default: wallabag)</comment> :', 'wallabag'));
$user->setEmail($dialog->ask($this->defaultOutput, '<question>Email:</question>', ''));
$userManager = $this->getContainer()->get('fos_user.user_manager');
$user = $userManager->createUser();
$question = new Question('Username (default: wallabag) :', 'wallabag');
$user->setUsername($questionHelper->ask($this->defaultInput, $this->defaultOutput, $question));
$question = new Question('Password (default: wallabag) :', 'wallabag');
$user->setPlainPassword($questionHelper->ask($this->defaultInput, $this->defaultOutput, $question));
$question = new Question('Email:', '');
$user->setEmail($questionHelper->ask($this->defaultInput, $this->defaultOutput, $question));
$user->setEnabled(true);
$em->persist($user);
@ -279,10 +287,16 @@ class InstallCommand extends ContainerAwareCommand
try {
$schemaManager = $connection->getSchemaManager();
} catch (\Exception $exception) {
// mysql & sqlite
if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) {
return false;
}
// pgsql
if (false !== strpos($exception->getMessage(), sprintf('database "%s" does not exist', $databaseName))) {
return false;
}
throw $exception;
}

View File

@ -0,0 +1,66 @@
<?php
namespace Wallabag\CoreBundle\Command;
use Doctrine\ORM\NoResultException;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class TagAllCommand extends ContainerAwareCommand
{
protected function configure()
{
$this
->setName('wallabag:tag:all')
->setDescription('Tag all entries using the tagging rules.')
->addArgument(
'username',
InputArgument::REQUIRED,
'User to tag entries for.'
)
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
try {
$user = $this->getUser($input->getArgument('username'));
} catch (NoResultException $e) {
$output->writeln(sprintf('<error>User %s not found.</error>', $input->getArgument('username')));
return 1;
}
$tagger = $this->getContainer()->get('wallabag_core.rule_based_tagger');
$output->write(sprintf('Tagging entries for user « <info>%s</info> »... ', $user->getUserName()));
$entries = $tagger->tagAllForUser($user);
$em = $this->getDoctrine()->getManager();
foreach ($entries as $entry) {
$em->persist($entry);
}
$em->flush();
$output->writeln('<info>Done.</info>');
}
/**
* Fetches a user from its username.
*
* @param string $username
*
* @return \Wallabag\UserBundle\Entity\User
*/
private function getUser($username)
{
return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username);
}
private function getDoctrine()
{
return $this->getContainer()->get('doctrine');
}
}

View File

@ -7,9 +7,11 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;
use Wallabag\CoreBundle\Entity\Config;
use Wallabag\CoreBundle\Entity\User;
use Wallabag\CoreBundle\Entity\TaggingRule;
use Wallabag\UserBundle\Entity\User;
use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
use Wallabag\CoreBundle\Form\Type\UserInformationType;
use Wallabag\CoreBundle\Form\Type\TaggingRuleType;
use Wallabag\CoreBundle\Form\Type\NewUserType;
use Wallabag\CoreBundle\Form\Type\RssType;
use Wallabag\CoreBundle\Tools\Utils;
@ -25,10 +27,11 @@ class ConfigController extends Controller
{
$em = $this->getDoctrine()->getManager();
$config = $this->getConfig();
$userManager = $this->container->get('fos_user.user_manager');
$user = $this->getUser();
// handle basic config detail (this form is defined as a service)
$configForm = $this->createForm('config', $config);
$configForm = $this->createForm('config', $config, array('action' => $this->generateUrl('config')));
$configForm->handleRequest($request);
if ($configForm->isValid()) {
@ -41,20 +44,19 @@ class ConfigController extends Controller
$this->get('session')->getFlashBag()->add(
'notice',
'Config saved'
'Config saved. Some parameters will be considered after disconnection.'
);
return $this->redirect($this->generateUrl('config'));
}
// handle changing password
$pwdForm = $this->createForm(new ChangePasswordType());
$pwdForm = $this->createForm(new ChangePasswordType(), null, array('action' => $this->generateUrl('config').'#set4'));
$pwdForm->handleRequest($request);
if ($pwdForm->isValid()) {
$user->setPassword($pwdForm->get('new_password')->getData());
$em->persist($user);
$em->flush();
$user->setPlainPassword($pwdForm->get('new_password')->getData());
$userManager->updateUser($user, true);
$this->get('session')->getFlashBag()->add(
'notice',
@ -65,12 +67,14 @@ class ConfigController extends Controller
}
// handle changing user information
$userForm = $this->createForm(new UserInformationType(), $user, array('validation_groups' => array('Profile')));
$userForm = $this->createForm(new UserInformationType(), $user, array(
'validation_groups' => array('Profile'),
'action' => $this->generateUrl('config').'#set3',
));
$userForm->handleRequest($request);
if ($userForm->isValid()) {
$em->persist($user);
$em->flush();
$userManager->updateUser($user, true);
$this->get('session')->getFlashBag()->add(
'notice',
@ -81,7 +85,7 @@ class ConfigController extends Controller
}
// handle rss information
$rssForm = $this->createForm(new RssType(), $config);
$rssForm = $this->createForm(new RssType(), $config, array('action' => $this->generateUrl('config').'#set2'));
$rssForm->handleRequest($request);
if ($rssForm->isValid()) {
@ -96,13 +100,36 @@ class ConfigController extends Controller
return $this->redirect($this->generateUrl('config'));
}
// handle tagging rule
$taggingRule = new TaggingRule();
$newTaggingRule = $this->createForm(new TaggingRuleType(), $taggingRule, array('action' => $this->generateUrl('config').'#set5'));
$newTaggingRule->handleRequest($request);
if ($newTaggingRule->isValid()) {
$taggingRule->setConfig($config);
$em->persist($taggingRule);
$em->flush();
$this->get('session')->getFlashBag()->add(
'notice',
'Tagging rules updated'
);
return $this->redirect($this->generateUrl('config'));
}
// handle adding new user
$newUser = new User();
$newUserForm = $this->createForm(new NewUserType(), $newUser, array('validation_groups' => array('Profile')));
$newUser = $userManager->createUser();
// enable created user by default
$newUser->setEnabled(true);
$newUserForm = $this->createForm(new NewUserType(), $newUser, array(
'validation_groups' => array('Profile'),
'action' => $this->generateUrl('config').'#set5',
));
$newUserForm->handleRequest($request);
if ($newUserForm->isValid()) {
$em->persist($newUser);
if ($newUserForm->isValid() && $this->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) {
$userManager->updateUser($newUser, true);
$config = new Config($newUser);
$config->setTheme($this->container->getParameter('theme'));
@ -129,6 +156,7 @@ class ConfigController extends Controller
'pwd' => $pwdForm->createView(),
'user' => $userForm->createView(),
'new_user' => $newUserForm->createView(),
'new_tagging_rule' => $newTaggingRule->createView(),
),
'rss' => array(
'username' => $user->getUsername(),
@ -160,6 +188,33 @@ class ConfigController extends Controller
return $request->headers->get('referer') ? $this->redirect($request->headers->get('referer')) : $this->redirectToRoute('config');
}
/**
* Deletes a tagging rule and redirect to the config homepage.
*
* @param TaggingRule $rule
*
* @Route("/tagging-rule/delete/{id}", requirements={"id" = "\d+"}, name="delete_tagging_rule")
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
public function deleteTaggingRule(TaggingRule $rule)
{
if ($this->getUser()->getId() != $rule->getConfig()->getUser()->getId()) {
throw $this->createAccessDeniedException('You can not access this tagging ryle.');
}
$em = $this->getDoctrine()->getManager();
$em->remove($rule);
$em->flush();
$this->get('session')->getFlashBag()->add(
'notice',
'Tagging rule deleted'
);
return $this->redirect($this->generateUrl('config'));
}
/**
* Retrieve config for the current user.
* If no config were found, create a new one.

View File

@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Form\Type\NewEntryType;
use Wallabag\CoreBundle\Form\Type\EditEntryType;
@ -14,6 +15,23 @@ use Pagerfanta\Pagerfanta;
class EntryController extends Controller
{
/**
* @param Entry $entry
*/
private function updateEntry(Entry $entry)
{
try {
$entry = $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
$em = $this->getDoctrine()->getManager();
$em->persist($entry);
$em->flush();
} catch (\Exception $e) {
return false;
}
return true;
}
/**
* @param Request $request
*
@ -30,12 +48,20 @@ class EntryController extends Controller
$form->handleRequest($request);
if ($form->isValid()) {
$entry = $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
// check for existing entry, if it exists, redirect to it with a message
$existingEntry = $this->get('wallabag_core.entry_repository')
->existByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
$em = $this->getDoctrine()->getManager();
$em->persist($entry);
$em->flush();
if (false !== $existingEntry) {
$this->get('session')->getFlashBag()->add(
'notice',
'Entry already saved on '.$existingEntry['createdAt']->format('d-m-Y')
);
return $this->redirect($this->generateUrl('view', array('id' => $existingEntry['id'])));
}
$this->updateEntry($entry);
$this->get('session')->getFlashBag()->add(
'notice',
'Entry saved'
@ -49,6 +75,22 @@ class EntryController extends Controller
));
}
/**
* @param Request $request
*
* @Route("/bookmarklet", name="bookmarklet")
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function addEntryViaBookmarklet(Request $request)
{
$entry = new Entry($this->getUser());
$entry->setUrl($request->get('url'));
$this->updateEntry($entry);
return $this->redirect($this->generateUrl('homepage'));
}
/**
* @param Request $request
*
@ -192,7 +234,7 @@ class EntryController extends Controller
throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
}
$form = $this->get('form.factory')->create(new EntryFilterType());
$form = $this->get('form.factory')->create(new EntryFilterType($repository, $this->getUser()));
if ($request->query->has($form->getName())) {
// manually bind values from the request
@ -237,6 +279,33 @@ class EntryController extends Controller
);
}
/**
* Reload an entry.
* Refetch content from the website and make it readable again.
*
* @param Entry $entry
*
* @Route("/reload/{id}", requirements={"id" = "\d+"}, name="reload_entry")
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
public function reloadAction(Entry $entry)
{
$this->checkUserAction($entry);
$message = 'Entry reloaded';
if (false === $this->updateEntry($entry)) {
$message = 'Failed to reload entry';
}
$this->get('session')->getFlashBag()->add(
'notice',
$message
);
return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
}
/**
* Changes read status for an entry.
*
@ -288,7 +357,7 @@ class EntryController extends Controller
}
/**
* Deletes entry and redirect to the homepage.
* Deletes entry and redirect to the homepage or the last viewed page.
*
* @param Entry $entry
*
@ -296,10 +365,18 @@ class EntryController extends Controller
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
public function deleteEntryAction(Entry $entry)
public function deleteEntryAction(Request $request, Entry $entry)
{
$this->checkUserAction($entry);
// generates the view url for this entry to check for redirection later
// to avoid redirecting to the deleted entry. Ugh.
$url = $this->generateUrl(
'view',
array('id' => $entry->getId()),
UrlGeneratorInterface::ABSOLUTE_URL
);
$em = $this->getDoctrine()->getManager();
$em->remove($entry);
$em->flush();
@ -309,7 +386,8 @@ class EntryController extends Controller
'Entry deleted'
);
return $this->redirect($this->generateUrl('homepage'));
// don't redirect user to the deleted entry
return $this->redirect($url !== $request->headers->get('referer') ? $request->headers->get('referer') : $this->generateUrl('homepage'));
}
/**

View File

@ -0,0 +1,65 @@
<?php
namespace Wallabag\CoreBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Wallabag\CoreBundle\Entity\Entry;
/**
* The try/catch can be removed once all formats will be implemented.
* Still need implementation: txt.
*/
class ExportController extends Controller
{
/**
* Gets one entry content.
*
* @param Entry $entry
*
* @Route("/export/{id}.{format}", name="export_entry", requirements={
* "format": "epub|mobi|pdf|json|xml|txt|csv",
* "id": "\d+"
* })
*/
public function downloadEntryAction(Entry $entry, $format)
{
try {
return $this->get('wallabag_core.helper.entries_export')
->setEntries($entry)
->updateTitle('entry')
->exportAs($format);
} catch (\InvalidArgumentException $e) {
throw new NotFoundHttpException($e->getMessage());
}
}
/**
* Export all entries for current user.
*
* @Route("/export/{category}.{format}", name="export_entries", requirements={
* "format": "epub|mobi|pdf|json|xml|txt|csv",
* "category": "all|unread|starred|archive"
* })
*/
public function downloadEntriesAction($format, $category)
{
$method = ucfirst($category);
$methodBuilder = 'getBuilderFor'.$method.'ByUser';
$entries = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->$methodBuilder($this->getUser()->getId())
->getQuery()
->getResult();
try {
return $this->get('wallabag_core.helper.entries_export')
->setEntries($entries)
->updateTitle($method)
->exportAs($format);
} catch (\InvalidArgumentException $e) {
throw new NotFoundHttpException($e->getMessage());
}
}
}

View File

@ -5,7 +5,7 @@ namespace Wallabag\CoreBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Wallabag\CoreBundle\Entity\User;
use Wallabag\UserBundle\Entity\User;
use Wallabag\CoreBundle\Entity\Entry;
use Pagerfanta\Adapter\DoctrineORMAdapter;
use Pagerfanta\Pagerfanta;
@ -16,7 +16,7 @@ class RssController extends Controller
* Shows unread entries for current user.
*
* @Route("/{username}/{token}/unread.xml", name="unread_rss", defaults={"_format"="xml"})
* @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter")
* @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter")
*
* @return \Symfony\Component\HttpFoundation\Response
*/
@ -29,7 +29,7 @@ class RssController extends Controller
* Shows read entries for current user.
*
* @Route("/{username}/{token}/archive.xml", name="archive_rss")
* @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter")
* @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter")
*
* @return \Symfony\Component\HttpFoundation\Response
*/
@ -42,7 +42,7 @@ class RssController extends Controller
* Shows starred entries for current user.
*
* @Route("/{username}/{token}/starred.xml", name="starred_rss")
* @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter")
* @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter")
*
* @return \Symfony\Component\HttpFoundation\Response
*/

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