Merge remote-tracking branch 'origin/master' into 2.2

This commit is contained in:
Jeremy Benoist 2016-10-11 21:01:30 +02:00
commit e4cf672ccf
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
74 changed files with 1595 additions and 1519 deletions

File diff suppressed because it is too large Load diff

43
Makefile Executable file
View file

@ -0,0 +1,43 @@
TMP_FOLDER=/tmp
RELEASE_FOLDER=wllbg-release
ifndef ENV
ENV=prod
endif
help: ## Display this help menu
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
clean: ## Clear the application cache
@rm -rf var/cache/*
install: ## Install wallabag with the latest version
@sh scripts/install.sh $(ENV)
update: ## Update the wallabag installation to the latest version
@sh scripts/update.sh $(ENV)
run: ## Run the wallabag built-in server
@php bin/console server:run --env=$(ENV)
build: ## Run grunt
@grunt
test: ## Launch wallabag testsuite
@if [ ! -d "vendor/phpunit" ]; then composer install; fi
@ant prepare && vendor/phpunit/phpunit/phpunit -v
release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`).
ifndef VERSION
$(error VERSION is not set)
endif
@sh scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV)
travis: ## Make some stuff for Travis-CI
deploy: ## Deploy wallabag
@bundle exec cap staging deploy
.PHONY: help clean install update build test release travis deploy
.DEFAULT_GOAL := install

View file

@ -6,23 +6,22 @@
wallabag is a self hostable application allowing you to not miss any content anymore.
Click, save and read it when you can. It extracts content so that you can read it when you have time.
More informations on our website: [wallabag.org](https://wallabag.org)
More information on our website: [wallabag.org](https://wallabag.org).
![wallabag logo](https://raw.githubusercontent.com/wallabag/logo/master/_default/typo-horizontal/png/sm/logo-typo-horizontal-black-no-bg-no-border-sm.png)
# Install wallabag
Please read [the documentation to see the wallabag requirements](http://doc.wallabag.org/en/master/user/installation.html#requirements).
If you don't have it yet, please [install composer](https://getcomposer.org/download/) or be sure to use Composer 1.2 (`composer selfupdate` can help you about that). Read [our documentation](http://doc.wallabag.org) to have more information about installation.
Then you can install wallabag by executing the following commands:
```
git clone https://github.com/wallabag/wallabag.git
cd wallabag
git checkout 2.1.1
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=prod
php bin/console server:run --env=prod
git clone https://github.com/wallabag/wallabag.git
cd wallabag && make install
make run
```
## License
# License
Copyright © 2013-2016 Nicolas Lœuillet <nicolas@loeuillet.org>
This work is free. You can redistribute it and/or modify it under the
terms of the MIT License. See the COPYING file for more details.

View file

@ -1,48 +1,45 @@
## Definition
A release is mostly a git tag of http://github.com/wallabag/wallabag, following [semantic versioning](http://semver.org).
The last release at the time of writing is 2.0.0-alpha.2, from the v2 branch.
### Steps to release
During this documentation, we assume the release is `release-2.0.0-beta.1`.
During this documentation, we assume the release is `$LAST_WALLABAG_RELEASE`.
#### Files to edit
- `app/config/config.yml` (`wallabag_core.version`)
- `README.md` (`composer create-project` command)
- `docs/en/user/installation.rst` and its translations (`composer create-project` command)
- `CHANGELOG.md` (by using this command `github_changelog_generator --no-compare-link --future-release "2.x.x"`. [github-changelog-generator is available here](https://github.com/skywinder/github-changelog-generator))
- `CHANGELOG.md` (by using this command `github_changelog_generator --no-compare-link`. [github-changelog-generator is available here](https://github.com/skywinder/github-changelog-generator))
#### Create release on GitHub
- Run these commands to create the tag:
```
git checkout v2
git pull origin v2
git checkout -b release-2.0.0-beta.1
SYMFONY_ENV=prod composer up --no-dev
git add --force composer.lock
git add README.md
git commit -m "Release wallabag 2.0.0-beta.1"
git push origin release-2.0.0-beta.1
git checkout master
git pull origin master
git checkout -b release-$LAST_WALLABAG_RELEASE
SYMFONY_ENV=prod composer up --no-dev
git add --force composer.lock
git commit -m "Release wallabag $LAST_WALLABAG_RELEASE"
git push origin release-$LAST_WALLABAG_RELEASE
```
- Create a new pull request with this title `DON'T MERGE Release wallabag 2.0.0-beta.1`. This pull request is used to launch builds on Travis-CI.
- Run these commands to create the package:
- Create a new pull request with this title `DON'T MERGE Release wallabag $LAST_WALLABAG_RELEASE`. This pull request is used to launch builds on Travis-CI.
- Run these command to create the package:
```
git clone git@github.com:wallabag/wallabag.git -b release-2.0.0-beta.1 release-2.0.0-beta.1
SYMFONY_ENV=prod composer up -d=release-2.0.0-beta.1 --no-dev
tar czf wallabag-release-2.0.0-beta.1.tar.gz --exclude="var/*" --exclude=".git" release-2.0.0-beta.1
make release master /tmp wllbg-release prod
```
- [Create the new release on GitHub](https://github.com/wallabag/wallabag/releases/new). You have to upload on this page the package.
- Delete the `release-2.0.0-beta.1` branch and close the pull request (**DO NOT MERGE IT**).
- Delete the `release-$LAST_WALLABAG_RELEASE` branch and close the pull request (**DO NOT MERGE IT**).
- Update the URL shortener (used on `wllbg.org` to generate links like `http://wllbg.org/latest-v2-package` or `http://wllbg.org/latest-v2`)
- Update [the downloads page](https://github.com/wallabag/wallabag.org/blob/master/content/pages/download.md) on the website (MD5 sum, release date)
- Drink a beer!
- Update Dockerfile https://github.com/wallabag/docker (and create a new tag)
- Update wallabag.org website (downloads, releases and new blog post)
- Put the next patch version suffixed with `-dev` in `app/config/config.yml` (`wallabag_core.version`)
- Drink a :beer:!
### `composer.lock`
A release tag must contain a `composer.lock` file. It sets which dependencies were available at the time a release was done,

View file

@ -414,9 +414,10 @@ main ul.row {
max-width: 50%;
}
.card .card-entry-labels li {
.card .card-entry-labels li,
.card-tag-labels li {
margin: 10px 10px 10px auto;
padding: 5px 12px 5px 16px;
padding: 5px 12px 5px 16px !important;
background-color: rgba(0, 151, 167, 0.85);
border-radius: 0 3px 3px 0;
color: #fff;
@ -447,6 +448,7 @@ main ul.row {
.card-entry-tags a,
.card-entry-labels a,
.card-tag-labels a,
.card-entry-labels-hidden a,
#list .chip a {
text-decoration: none;

View file

@ -30,7 +30,7 @@ framework:
assets: ~
wallabag_core:
version: 2.1.1
version: 2.1.2-dev
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
languages:
en: 'English'

View file

@ -12,6 +12,11 @@ wallabag_user:
type: annotation
prefix: /users
wallabag_api:
resource: "@WallabagApiBundle/Controller/"
type: annotation
prefix: /
wallabag_api:
resource: "@WallabagApiBundle/Resources/config/routing.yml"
prefix: /

View file

@ -65,9 +65,9 @@
"liip/theme-bundle": "~1.1",
"lexik/form-filter-bundle": "~5.0",
"j0k3r/graby": "~1.0",
"friendsofsymfony/user-bundle": "~2.0@dev",
"friendsofsymfony/user-bundle": "dev-master#e168ed64629d034cb9cbbffb9d4350f62ef04fab as 2.0.x-dev",
"friendsofsymfony/oauth-server-bundle": "^1.5",
"stof/doctrine-extensions-bundle": "^1.2@dev",
"stof/doctrine-extensions-bundle": "^1.2",
"scheb/two-factor-bundle": "~2.0",
"grandt/phpepub": "~4.0",
"wallabag/php-mobi": "~1.0.0",

View file

@ -46,6 +46,10 @@ Bearbeite die Datei ``parameters.yml``, um die RabbitMQ Konfiguration einzuricht
rabbitmq_user: guest
rabbitmq_password: guest
Enable RabbitMQ in wallabag
---------------------------
In internal settings, in the **Import** section, enable RabbitMQ (with the value 1).
Starte den RabbitMQ Consumer
----------------------------

View file

@ -35,6 +35,10 @@ Bearbeite die Datei ``parameters.yml``, um die RabbitMQ Konfiguration einzuricht
redis_host: localhost
redis_port: 6379
Enable Redis in wallabag
------------------------
In internal settings, in the **Import** section, enable Redis (with the value 1).
Starte den Redis Consumer
-------------------------

View file

@ -0,0 +1,10 @@
Testsuite
=========
To ensure wallabag development quality, we wrote tests with `PHPUnit <https://phpunit.de>`_.
If you contribute to the project (by translating the application, by fixing bugs or by adding a new feature), please write your own tests.
To launch wallabag testsuite, you need to install `ant <http://ant.apache.org>`_.
Then, execute this command ``make test``.

View file

@ -6,6 +6,20 @@ Voraussetzungen
wallabag ist kompatibel mit PHP >= 5.5, inkl. PHP 7.
.. note::
To install wallabag easily, we create a ``Makefile``, so you need to have the ``make`` tool.
wallabag nutzt eine große Anzahl an Bibliotheken, um zu funktionieren. Diese Bibliotheken müssen mit einem Tool namens Composer installiert werden. Du musst es installieren sofern du es bisher noch nicht gemacht hast.
Composer installieren:
::
curl -s http://getcomposer.org/installer | php
Du kannst eine spezifische Anleitung `hier <https://getcomposer.org/doc/00-intro.md>`__ finden.
Du benötigst die folgenden Extensions damit wallabag funktioniert. Einige von diesen sind vielleicht schon in deiner Version von PHP aktiviert, somit musst du eventuell
nicht alle folgenden Pakete installieren.
@ -39,33 +53,20 @@ Installation
Auf einem dedizierten Webserver (empfohlener Weg)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wallabag nutzt eine große Anzahl an Bibliotheken, um zu funktionieren. Diese Bibliotheken müssen mit einem Tool namens Composer installiert werden. Du musst es installieren sofern du es bisher noch nicht gemacht hast.
Composer installieren:
::
curl -s http://getcomposer.org/installer | php
Du kannst eine spezifische Anleitung `hier <https://getcomposer.org/doc/00-intro.md>`__ finden.
Um wallabag selbst zu installieren, musst du die folgenden Kommandos ausführen:
::
git clone https://github.com/wallabag/wallabag.git
cd wallabag
git checkout 2.1.1 --force
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=prod
cd wallabag && make install
Um PHPs eingebauten Server zu starten und zu testen, ob alles korrekt installiert wurde, kannst du folgendes Kommando ausführen:
::
php bin/console server:run --env=prod
make run
Und wallabag unter http://deineserverip:8000 erreichen
und wallabag unter http://deineserverip:8000 erreichen.
.. tip::
@ -87,18 +88,18 @@ Führe dieses Kommando aus, um das neueste Paket herunterzuladen und zu entpacke
wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
(md5 hash: ``6c33520e29cc754b687f9cee0398dede``)
Du findest die `md5 Hashsumme des neuesten Pakets auf unserer Website <https://www.wallabag.org/pages/download-wallabag.html>`_.
Jetzt lese die Dokumentation, um einen Virtualhost zu erstellen, dann greife auf dein wallabag zu.
Jetzt lies die Dokumentation, um einen Virtualhost zu erstellen, dann greife auf dein wallabag zu.
Wenn du die Datenbankkonfiguration eingestellt hast, MySQL oder PostgreSQL zu nutzen, musst du einen Nutzer über das folgende Kommando erstellen ``php bin/console wallabag:install --env=prod``.
Installation mit Docker
------------------------
~~~~~~~~~~~~~~~~~~~~~~~
Wir stellen ein Docker Image zu Verfügung, um wallabag einfach zu installieren. Schaue in unser Repository in unserem `Docker Hub <https://hub.docker.com/r/wallabag/wallabag/>`__, um mehr Informationen zu erhalten.
Kommando, um den Container zu starten
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
@ -108,7 +109,7 @@ Virtualhosts
------------
Konfiguration von Apache
~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~
Angenommen du willst wallabag in das Verzeichnis ``/var/www/wallabag`` installieren und du willst PHP als Apache Modul nutzen, dann ist hier ein vhost für wallabag:
@ -190,15 +191,14 @@ Angenommen du willst wallabag in das Verzeichnis ``/var/www/wallabag`` installie
access_log /var/log/nginx/wallabag_access.log;
}
Nach dem neuladen oder neustarten von nginx, solltest du nun wallabag unter http://domain.tld erreichen.
Nach dem Neuladen oder Neustarten von nginx solltest du nun wallabag unter http://domain.tld erreichen.
.. tip::
When you want to import large file into wallabag, you need to add this line in your nginx configuration ``client_max_body_size XM; # allows file uploads up to X megabytes``.
Wenn du eine große Datei in wallabag importieren willst, solltest du diese Zeile zu deiner nginx Konfiguration hinzufügen ``client_max_body_size XM; # allows file uploads up to X megabytes``.
Konfiguration von lighttpd
~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~
Angenommen du willst wallabag in das Verzeichnis ``/var/www/wallabag`` installieren, dann ist hier ein Rezept für wallabag (bearbeite deine ``lighttpd.conf`` und füge die Konfiguration dort ein):

View file

@ -46,6 +46,10 @@ Edit your ``parameters.yml`` file to edit RabbitMQ configuration. The default on
rabbitmq_user: guest
rabbitmq_password: guest
Enable RabbitMQ in wallabag
---------------------------
In internal settings, in the **Import** section, enable RabbitMQ (with the value 1).
Launch RabbitMQ consumer
------------------------

View file

@ -35,6 +35,10 @@ Edit your ``parameters.yml`` file to edit Redis configuration. The default one s
redis_host: localhost
redis_port: 6379
Enable Redos in wallabag
------------------------
In internal settings, in the **Import** section, enable Redis (with the value 1).
Launch Redis consumer
---------------------

View file

@ -0,0 +1,10 @@
Testsuite
=========
To ensure wallabag development quality, we wrote tests with `PHPUnit <https://phpunit.de>`_.
If you contribute to the project (by translating the application, by fixing bugs or by adding a new feature), please write your own tests.
To launch wallabag testsuite, you need to install `ant <http://ant.apache.org>`_.
Then, execute this command ``make test``.

View file

@ -30,8 +30,8 @@ The documentation is available in other languages:
user/faq
user/installation
user/upgrade-2.0.x-2.1.y
user/upgrade-2.0.x-2.0.y
user/upgrade-2.0.x-2.1.1
user/upgrade-2.1.x-2.1.y
user/migration
user/import
user/create_account

View file

@ -29,13 +29,13 @@ Fill in your wallabag data. You need to enter your wallabag address. It is impor
:alt: Filled in settings
:align: center
After you have filled in your data, push the button Connection test and wait for the test to finish.
After you have filled in your data, push the button Connection test and wait for the test to finish.
.. image:: ../../img/user/android_configuration_connection_test.en.png
:alt: Connection test with your wallabag data
:align: center
The connection test shall finish with success. If not, you need to fix this first until you proceed.
The connection test should finish with success. If not, you need to fix this first until you proceed.
.. image:: ../../img/user/android_configuration_connection_test_success.en.png
:alt: Connection test successful
@ -65,16 +65,16 @@ After hitting the save button, you get the following screen. The app proposes to
:alt: Settings saved the first time
:align: center
Finally after the syncronisation finished successfully, you are presented the list of unread articles.
Finally after the synchronisation finished successfully, you are presented to the list of unread articles.
.. image:: ../../img/user/android_unread_feed_synced.en.png
:alt: Filled article list cause feeds successfully syncronized
:alt: Filled article list cause feeds successfully synchronized
:align: center
Known limitations
----
-----------------
2FA
~~~
@ -85,7 +85,7 @@ Currently the does not support two-factor authentication. You should disable tha
Limited amount of articles with wallabag v2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In your wallabag web instance you can configure how many items are part of the RSS feed. This option did not exist in wallabag v1, where all articles were part of the feed. So if you set the amount of articles being displayed greater than the number of items being content of your RSS feed, you will only see the number of items in your RSS feed.
In your wallabag web instance you can configure how many items are part of the RSS feed. This option did not exist in wallabag v1, where all articles were part of the feed. So if you set the amount of articles being displayed greater than the number of items being content of your RSS feed, you will only see the number of items in your RSS feed.
SSL/TLS encryption

View file

@ -35,7 +35,7 @@ From Readability
Export your Readability data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On the tools (`https://www.readability.com/tools/<https://www.readability.com/tools/>`_) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).
On the tools (`https://www.readability.com/tools/ <https://www.readability.com/tools/>`_) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).
Import your data into wallabag 2.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -51,7 +51,7 @@ From Instapaper
Export your Instapaper data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On the settings (`https://www.instapaper.com/user<https://www.instapaper.com/user>`_) page, click on "Download .CSV file" in the "Export" section. A CSV file will be downloaded (like ``instapaper-export.csv``).
On the settings (`https://www.instapaper.com/user <https://www.instapaper.com/user>`_) page, click on "Download .CSV file" in the "Export" section. A CSV file will be downloaded (like ``instapaper-export.csv``).
Import your data into wallabag 2.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -6,7 +6,21 @@ Requirements
wallabag is compatible with PHP >= 5.5, including PHP 7.
You'll need the following extensions for wallabag to work. Some of these may already activated in your version of PHP, so you may not have to install all corresponding packages.
.. note::
To install wallabag easily, we create a ``Makefile``, so you need to have the ``make`` tool.
wallabag uses a large number of PHP libraries in order to function. These libraries must be installed with a tool called Composer. You need to install it if you have not already done so and be sure to use the 1.2 version (if you already have Composer, run a ``composer selfupdate``).
Install Composer:
::
curl -s http://getcomposer.org/installer | php
You can find specific instructions `here <https://getcomposer.org/doc/00-intro.md>`__.
You'll also need the following extensions for wallabag to work. Some of these may already activated in your version of PHP, so you may not have to install all corresponding packages.
- php-session
- php-ctype
@ -38,31 +52,18 @@ Installation
On a dedicated web server (recommended way)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wallabag uses a large number of PHP libraries in order to function. These libraries must be installed with a tool called Composer. You need to install it if you have not already done so and be sure to use the 1.2 version (if you already have Composer, run a ``composer selfupdate``).
Install Composer:
::
curl -s http://getcomposer.org/installer | php
You can find specific instructions `here <https://getcomposer.org/doc/00-intro.md>`__.
To install wallabag itself, you must run the following commands:
::
git clone https://github.com/wallabag/wallabag.git
cd wallabag
git checkout 2.1.1 --force
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=prod
cd wallabag && make install
To start PHP's build-in server and test if everything did install correctly, you can do:
::
php bin/console server:run --env=prod
make run
And access wallabag at http://yourserverip:8000
@ -86,18 +87,18 @@ Execute this command to download and extract the latest package:
wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
(md5 hash of the 2.1.1 package: ``9584a3b60a2b2a4de87f536548caac93``)
You will find the `md5 hash of the latest package on our website <https://www.wallabag.org/pages/download-wallabag.html>`_.
Now, read the following documentation to create your virtual host, then access your wallabag.
If you changed the database configuration to use MySQL or PostgreSQL, you need to create a user via this command ``php bin/console wallabag:install --env=prod``.
Installation with Docker
------------------------
~~~~~~~~~~~~~~~~~~~~~~~~
We provide you a Docker image to install wallabag easily. Have a look to our repository on `Docker Hub <https://hub.docker.com/r/wallabag/wallabag/>`__ to have more information.
Command to launch container
~~~~~~~~~~~~~~~~~~~~~~~~~~~
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
@ -239,12 +240,12 @@ Rights access to the folders of the project
Test environment
~~~~~~~~~~~~~~~~
When we just want to test wallabag, we just run the command ``php bin/console server:run --env=prod`` to start our wallabag instance and everything will go smoothly because the user who started the project can access to the current folder naturally, without any problem.
When we just want to test wallabag, we just run the command ``make run`` to start our wallabag instance and everything will go smoothly because the user who started the project can access to the current folder naturally, without any problem.
Production environment
~~~~~~~~~~~~~~~~~~~~~~
As soon as we use Apache or Nginx to access to our wallabag instance, and not from the command ``php bin/console server:run --env=prod`` to start it, we should take care to grant the good rights on the good folders to keep safe all the folders of the project.
As soon as we use Apache or Nginx to access to our wallabag instance, and not from the command ``make run`` to start it, we should take care to grant the good rights on the good folders to keep safe all the folders of the project.
To do so, the folder name, known as ``DocumentRoot`` (for apache) or ``root`` (for Nginx), has to be absolutely accessible by the Apache/Nginx user. Its name is generally ``www-data``, ``apache`` or ``nobody`` (depending on linux system used).

View file

@ -0,0 +1,50 @@
What is the meaning of the parameters?
======================================
.. csv-table:: Database parameters
:header: "name", "default", "description"
"database_driver", "pdo_sqlite", "Should be pdo_sqlite or pdo_mysql or pdo_pgsql"
"database_host", "127.0.0.1", "host of your database (usually localhost or 127.0.0.1)"
"database_port", "~", "port of your database (you can leave ``~`` to use the default one)"
"database_name", "symfony", "name of your database"
"database_user", "root", "user that can write to this database"
"database_password", "~", "password of that user"
"database_path", "``""%kernel.root_dir%/../data/db/wallabag.sqlite""``", "only for SQLite, define where to put the database file. Leave it for other database"
"database_table_prefix", "wallabag_", "all wallabag's tables will be prefixed with that string. You can include a ``_`` for clarity"
"database_socket", "null", "If your database is using a socket instead of tcp, put the path of the socket (other connection parameters will then be ignored"
.. csv-table:: Configuration to send emails from wallabag
:header: "name", "default", "description"
"mailer_transport", "smtp", "The exact transport method to use to deliver emails. Valid values are: smtp, gmail, mail, sendmail, null (which will disable the mailer)"
"mailer_host", "127.0.0.1", "The host to connect to when using smtp as the transport."
"mailer_user", "~", "The username when using smtp as the transport."
"mailer_password", "~", "The password when using smtp as the transport."
.. csv-table:: Other wallabag's option
:header: "name", "default", "description"
"locale", "en", "Default language of your wallabag instance (like en, fr, es, etc.)"
"secret", "ovmpmAWXRCabNlMgzlzFXDYmCFfzGv", "This is a string that should be unique to your application and it's commonly used to add more entropy to security related operations."
"twofactor_auth", "true", "true to enable Two factor authentication"
"twofactor_sender", "no-reply@wallabag.org", "email of the email sender to receive the two factor code"
"fosuser_registration", "true", "true to enable public registration"
"fosuser_confirmation", "true", "true to send a confirmation by email for each registration"
"from_email", "no-reply@wallabag.org", "email address used in From: field in each email"
"rss_limit", "50", "limit for RSS feeds"
.. csv-table:: RabbitMQ configuration
:header: "name", "default", "description"
"rabbitmq_host", "localhost", "Host of your RabbitMQ"
"rabbitmq_port", "5672", "Port of your RabbitMQ"
"rabbitmq_user", "guest", "Usee that can read queues"
"rabbitmq_password", "guest", "Password of that user"
.. csv-table:: Redis configuration
:header: "name", "default", "description"
"redis_scheme", "tcp", "Specifies the protocol used to communicate with an instance of Redis. Valid values are: tcp, unix, http"
"redis_host", "localhost", "IP or hostname of the target server (ignored for unix scheme)"
"redis_port", "6379", "TCP/IP port of the target server (ignored for unix scheme)"
"redis_path", "null", "Path of the UNIX domain socket file used when connecting to Redis using UNIX domain sockets"

View file

@ -1,5 +1,5 @@
Upgrading from 2.0.x to 2.1.y
=============================
Upgrade from 2.0.x to 2.1.1
===========================
.. warning::
Before this migration, if you configured the Pocket import by adding your consumer key in Internal settings, please do a backup of it: you'll have to add it into the Config page after the upgrade.
@ -7,8 +7,6 @@ Before this migration, if you configured the Pocket import by adding your consum
Upgrade on a dedicated web server
---------------------------------
The last release is published on https://www.wallabag.org/pages/download-wallabag.html. In order to upgrade your wallabag installation and get the last version, run the following commands in you wallabag folder (replace ``2.1.1`` by the last release number):
::
rm -rf var/cache/*
@ -28,25 +26,43 @@ Download the last release of wallabag:
.. code-block:: bash
wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
wget http://framabag.org/wallabag-release-2.1.1.tar.gz && tar xvf wallabag-release-2.1.1.tar.gz
(md5 hash of the 2.1.1 package: ``9584a3b60a2b2a4de87f536548caac93``)
Extract the archive in your wallabag folder and replace ``app/config/parameters.yml`` with yours.
Please note that we added new parameters in this version. You have to edit ``app/config/parameters.yml`` by adding these lines (replace with your configuration) :
Please check that your ``app/config/parameters.yml`` contains all the required parameters. Here is a default ``parameters.yml`` file. If you don't know which parameter you need to set, please leave the default one.
.. code-block:: bash
.. code-block:: yml
# RabbitMQ processing
rabbitmq_host: localhost
rabbitmq_port: 5672
rabbitmq_user: guest
rabbitmq_password: guest
# Redis processing
redis_host: localhost
redis_port: 6379
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: null
database_name: symfony
database_user: root
database_password: null
database_path: '%kernel.root_dir%/../data/db/wallabag.sqlite'
database_table_prefix: wallabag_
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
locale: en
secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
fosuser_registration: true
fosuser_confirmation: true
from_email: no-reply@wallabag.org
rss_limit: 50
rabbitmq_host: localhost
rabbitmq_port: 5672
rabbitmq_user: guest
rabbitmq_password: guest
redis_host: localhost
redis_port: 6379
If you use SQLite, you must also copy your ``data/`` folder inside the new installation.

View file

@ -1,17 +1,17 @@
Upgrade from 2.0.x to 2.0.y
===========================
Upgrading from 2.1.x to 2.1.y
=============================
Upgrade on a dedicated web server
---------------------------------
The last release is published on https://www.wallabag.org/pages/download-wallabag.html. In order to upgrade your wallabag installation and get the last version, run the following commands in you wallabag folder (replace ``2.0.8`` by the last release number):
The last release is published on https://www.wallabag.org/pages/download-wallabag.html. In order to upgrade your wallabag installation and get the last version, run the following commands in you wallabag folder (replace ``2.1.2`` by the last release number):
::
rm -rf var/cache/*
git fetch origin
git fetch --tags
git checkout 2.0.8
git checkout 2.1.2 --force
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
php bin/console cache:clear --env=prod
@ -26,7 +26,7 @@ Download the last release of wallabag:
wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
(md5 hash of the 2.0.8 package: ``4f84c725d1d6e3345eae0a406115e5ff``)
(md5 hash of the 2.1.1 package: ``9584a3b60a2b2a4de87f536548caac93``)
Extract the archive in your wallabag folder and replace ``app/config/parameters.yml`` with yours.

View file

@ -46,6 +46,10 @@ Modifiez votre fichier ``parameters.yml`` pour éditer la configuration RabbitMQ
rabbitmq_user: guest
rabbitmq_password: guest
Activer RabbitMQ dans wallabag
------------------------------
Dans les paramètres internes, section **Import**, activez RabbitMQ (avec la valeur 1).
Démarrer les clients RabbitMQ
-----------------------------

View file

@ -35,6 +35,10 @@ Modifiez votre fichier ``parameters.yml`` pour éditer la configuration Redis. C
redis_host: localhost
redis_port: 6379
Activer Redis dans wallabag
---------------------------
Dans les paramètres internes, section **Import**, activez Redis (avec la valeur 1).
Démarrer les clients Redis
--------------------------

View file

@ -0,0 +1,10 @@
Suite de tests
==============
Pour assurer la qualité du développement de wallabag, nous avons écrit des tests avec `PHPUnit <https://phpunit.de>`_.
Si vous contribuez au projet (en traduisant l'application, en corrigeant des bugs ou en ajoutant une nouvelle fonctionnalité), merci d'écrire vos propres tests.
Pour lancer la suite de tests de wallabag, vous devez installer `ant <http://ant.apache.org>`_.
Ensuite, exécutez la commande ``make test``.

View file

@ -36,7 +36,7 @@ Depuis Readability
Exportez vos données de Readability
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sur la page des outils (`https://www.readability.com/tools/<https://www.readability.com/tools/>`_), cliquez sur "Export your data" dans la section "Data Export". Vous allez recevoir un email avec un lien pour télécharger le json.
Sur la page des outils (`https://www.readability.com/tools/ <https://www.readability.com/tools/>`_), cliquez sur "Export your data" dans la section "Data Export". Vous allez recevoir un email avec un lien pour télécharger le json.
Importez vos données dans wallabag 2.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -52,7 +52,7 @@ Depuis Instapaper
Exportez vos données de Instapaper
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sur la page des paramètres (`https://www.instapaper.com/user<https://www.instapaper.com/user>`_), cliquez sur "Download .CSV file" dans la section "Export". Un fichier CSV se téléchargera (``instapaper-export.csv``).
Sur la page des paramètres (`https://www.instapaper.com/user <https://www.instapaper.com/user>`_), cliquez sur "Download .CSV file" dans la section "Export". Un fichier CSV se téléchargera (``instapaper-export.csv``).
Importez vos données dans wallabag 2.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -6,6 +6,20 @@ Pré-requis
wallabag est compatible avec PHP >= 5.5, PHP 7 inclus.
.. note::
Pour installer wallabag facilement, nous avons créé un ``Makefile``, vous avez donc besoin d'avoir installé l'outil ``make``.
wallabag utilise un grand nombre de bibliothèques PHP pour fonctionner. Ces bibliothèques doivent être installées à l'aide d'un outil nommé Composer. Vous devez l'installer si ce n'est déjà fait et vous assurer que vous utilisez bien la version 1.2 (si vous avez déjà Composer, faite un ``composer selfupdate``).
Installation de Composer :
::
curl -s http://getcomposer.org/installer | php
Vous pouvez trouver des instructions spécifiques `ici (en anglais) <https://getcomposer.org/doc/00-intro.md>`__.
Vous aurez besoin des extensions suivantes pour que wallabag fonctionne. Il est possible que certaines de ces extensions soient déjà activées dans votre version de PHP, donc vous n'avez pas forcément besoin d'installer tous les paquets correspondants.
- php-session
@ -36,31 +50,18 @@ Installation
Sur un serveur dédié (méthode conseillée)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wallabag utilise un grand nombre de bibliothèques PHP pour fonctionner. Ces bibliothèques doivent être installées à l'aide d'un outil nommé Composer. Vous devez l'installer si ce n'est déjà fait et vous assurer que vous utilisez bien la version 1.2 (si vous avez déjà Composer, faite un ``composer selfupdate``).
Installation de Composer :
::
curl -s http://getcomposer.org/installer | php
Vous pouvez trouver des instructions spécifiques `ici (en anglais) <https://getcomposer.org/doc/00-intro.md>`__.
Pour installer wallabag, vous devez exécuter ces commandes :
::
git clone https://github.com/wallabag/wallabag.git
cd wallabag
git checkout 2.1.1 --force
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=prod
cd wallabag && make install
Pour démarrer le serveur interne à php et vérifier que tout s'est installé correctement, vous pouvez exécuter :
::
php bin/console server:run --env=prod
make run
Et accéder wallabag à l'adresse http://lipdevotreserveur:8000
@ -83,18 +84,18 @@ Exécutez cette commande pour télécharger et décompresser l'archive :
wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
(hash md5 de l'archive 2.1.1 : ``9584a3b60a2b2a4de87f536548caac93``)
Vous trouverez `le hash md5 du dernier package sur notre site <https://www.wallabag.org/pages/download-wallabag.html>`_.
Maintenant, lisez la documentation ci-dessous pour crééer un virtual host. Accédez ensuite à votre installation de wallabag.
Si vous avez changé la configuration pour modifier le type de stockage (MySQL ou PostgreSQL), vous devrez vous créer un utilisateur via la commande ``php bin/console wallabag:install --env=prod``.
Installation avec Docker
------------------------
~~~~~~~~~~~~~~~~~~~~~~~~
Nous vous proposons une image Docker pour installer wallabag facilement. Allez voir du côté de `Docker Hub <https://hub.docker.com/r/wallabag/wallabag/>`__ pour plus d'informations.
Commande pour démarrer le containeur
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash

10
scripts/install.sh Normal file
View file

@ -0,0 +1,10 @@
#! /usr/bin/env bash
# You can execute this file to install wallabag
# eg: `sh install.sh prod`
ENV=$1
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
git checkout $TAG
SYMFONY_ENV=$ENV composer install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=$ENV

19
scripts/release.sh Normal file
View file

@ -0,0 +1,19 @@
#! /usr/bin/env bash
# You can execute this file to create a new package for wallabag
# eg: `sh release.sh master /tmp wllbg-release prod`
VERSION=$1
TMP_FOLDER=$2
RELEASE_FOLDER=$3
ENV=$4
rm -rf $TMP_FOLDER/$RELEASE_FOLDER
mkdir $TMP_FOLDER/$RELEASE_FOLDER
git clone git@github.com:wallabag/wallabag.git -b $VERSION $TMP_FOLDER/$RELEASE_FOLDER/$VERSION
cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && SYMFONY_ENV=$ENV composer up -n --no-dev
cd $TMP_FOLDER/$RELEASE_FOLDER/$VERSION && php bin/console wallabag:install --env=$ENV
cd $TMP_FOLDER/$RELEASE_FOLDER && tar czf wallabag-$VERSION.tar.gz --exclude="var/cache/*" --exclude="var/logs/*" --exclude="var/sessions/*" --exclude=".git" $VERSION
echo "MD5 checksum of the package for wallabag $VERSION"
md5 $TMP_FOLDER/$RELEASE_FOLDER/wallabag-$VERSION.tar.gz
scp $TMP_FOLDER/$RELEASE_FOLDER/wallabag-$VERSION.tar.gz framasoft_bag@78.46.248.87:/var/www/framabag.org/web
rm -rf $TMP_FOLDER/$RELEASE_FOLDER

13
scripts/update.sh Normal file
View file

@ -0,0 +1,13 @@
#! /usr/bin/env bash
# You can execute this file to update wallabag
# eg: `sh update.sh prod`
ENV=$1
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
rm -rf var/cache/*
git fetch origin
git fetch --tags
git checkout $TAG --force
SYMFONY_ENV=$ENV composer install --no-dev -o --prefer-dist
php bin/console cache:clear --env=$ENV

View file

@ -1,12 +1,12 @@
<?php
namespace Wallabag\CoreBundle\Controller;
namespace Wallabag\ApiBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Wallabag\ApiBundle\Entity\Client;
use Wallabag\CoreBundle\Form\Type\ClientType;
use Wallabag\ApiBundle\Form\Type\ClientType;
class DeveloperController extends Controller
{

View file

@ -27,7 +27,8 @@ class WallabagRestController extends FOSRestController
*
* @ApiDoc(
* parameters={
* {"name"="url", "dataType"="string", "required"=true, "format"="An url", "description"="Url to check if it exists"}
* {"name"="url", "dataType"="string", "required"=true, "format"="An url", "description"="Url to check if it exists"},
* {"name"="urls", "dataType"="string", "required"=false, "format"="An array of urls (?urls[]=http...&urls[]=http...)", "description"="Urls (as an array) to check if it exists"}
* }
* )
*
@ -37,6 +38,25 @@ class WallabagRestController extends FOSRestController
{
$this->validateAuthentication();
$urls = $request->query->get('urls', []);
// handle multiple urls first
if (!empty($urls)) {
$results = [];
foreach ($urls as $url) {
$res = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->findByUrlAndUserId($url, $this->getUser()->getId());
$results[$url] = false === $res ? false : true;
}
$json = $this->get('serializer')->serialize($results, 'json');
return (new JsonResponse())->setJson($json);
}
// let's see if it is a simple url?
$url = $request->query->get('url', '');
if (empty($url)) {
@ -367,7 +387,7 @@ class WallabagRestController extends FOSRestController
$tags = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Tag')
->findAllTagsWithEntries($this->getUser()->getId());
->findAllTags($this->getUser()->getId());
$json = $this->get('serializer')->serialize($tags, 'json');
@ -400,6 +420,8 @@ class WallabagRestController extends FOSRestController
->getRepository('WallabagCoreBundle:Entry')
->removeTag($this->getUser()->getId(), $tag);
$this->cleanOrphanTag($tag);
$json = $this->get('serializer')->serialize($tag, 'json');
return (new JsonResponse())->setJson($json);
@ -440,6 +462,8 @@ class WallabagRestController extends FOSRestController
->getRepository('WallabagCoreBundle:Entry')
->removeTags($this->getUser()->getId(), $tags);
$this->cleanOrphanTag($tags);
$json = $this->get('serializer')->serialize($tags, 'json');
return (new JsonResponse())->setJson($json);
@ -464,6 +488,8 @@ class WallabagRestController extends FOSRestController
->getRepository('WallabagCoreBundle:Entry')
->removeTag($this->getUser()->getId(), $tag);
$this->cleanOrphanTag($tag);
$json = $this->get('serializer')->serialize($tag, 'json');
return (new JsonResponse())->setJson($json);
@ -485,6 +511,28 @@ class WallabagRestController extends FOSRestController
return (new JsonResponse())->setJson($json);
}
/**
* Remove orphan tag in case no entries are associated to it.
*
* @param Tag|array $tags
*/
private function cleanOrphanTag($tags)
{
if (!is_array($tags)) {
$tags = [$tags];
}
$em = $this->getDoctrine()->getManager();
foreach ($tags as $tag) {
if (count($tag->getEntries()) === 0) {
$em->remove($tag);
}
}
$em->flush();
}
/**
* Validate that the first id is equal to the second one.
* If not, throw exception. It means a user try to access information from an other user.

View file

@ -19,7 +19,7 @@ class AccessToken extends BaseAccessToken
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Client")
* @ORM\ManyToOne(targetEntity="Client", inversedBy="accessTokens")
* @ORM\JoinColumn(nullable=false)
*/
protected $client;

View file

@ -25,6 +25,16 @@ class Client extends BaseClient
*/
protected $name;
/**
* @ORM\OneToMany(targetEntity="RefreshToken", mappedBy="client", cascade={"remove"})
*/
protected $refreshTokens;
/**
* @ORM\OneToMany(targetEntity="AccessToken", mappedBy="client", cascade={"remove"})
*/
protected $accessTokens;
public function __construct()
{
parent::__construct();

View file

@ -19,7 +19,7 @@ class RefreshToken extends BaseRefreshToken
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Client")
* @ORM\ManyToOne(targetEntity="Client", inversedBy="refreshTokens")
* @ORM\JoinColumn(nullable=false)
*/
protected $client;

View file

@ -1,6 +1,6 @@
<?php
namespace Wallabag\CoreBundle\Form\Type;
namespace Wallabag\ApiBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\CallbackTransformer;

View file

@ -9,7 +9,7 @@ use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Question\Question;
@ -97,7 +97,8 @@ class InstallCommand extends ContainerAwareCommand
try {
$this->getContainer()->get('doctrine')->getManager()->getConnection()->connect();
} catch (\Exception $e) {
if (false === strpos($e->getMessage(), 'Unknown database')) {
if (false === strpos($e->getMessage(), 'Unknown database')
&& false === strpos($e->getMessage(), 'database "'.$this->getContainer()->getParameter('database_name').'" does not exist')) {
$fulfilled = false;
$status = '<error>ERROR!</error>';
$help = 'Can\'t connect to the database: '.$e->getMessage();
@ -420,16 +421,18 @@ class InstallCommand extends ContainerAwareCommand
}
$this->getApplication()->setAutoExit(false);
$exitCode = $this->getApplication()->run(new ArrayInput($parameters), new NullOutput());
$output = new BufferedOutput();
$exitCode = $this->getApplication()->run(new ArrayInput($parameters), $output);
if (0 !== $exitCode) {
$this->getApplication()->setAutoExit(true);
$errorMessage = sprintf('The command "%s" terminated with an error code: %u.', $command, $exitCode);
$this->defaultOutput->writeln("<error>$errorMessage</error>");
$exception = new \Exception($errorMessage, $exitCode);
$this->defaultOutput->writeln('');
$this->defaultOutput->writeln('<error>The command "'.$command.'" generates some errors: </error>');
$this->defaultOutput->writeln($output->fetch());
throw $exception;
die();
}
// PDO does not always close the connection after Doctrine commands.

View file

@ -34,10 +34,13 @@ class TagAllCommand extends ContainerAwareCommand
}
$tagger = $this->getContainer()->get('wallabag_core.rule_based_tagger');
$output->write(sprintf('Tagging entries for user « <info>%s</info> »... ', $user->getUserName()));
$output->write(sprintf('Tagging entries for user « <comment>%s</comment> »... ', $user->getUserName()));
$entries = $tagger->tagAllForUser($user);
$output->writeln('<info>Done.</info>');
$output->write(sprintf('Persist entries ... ', $user->getUserName()));
$em = $this->getDoctrine()->getManager();
foreach ($entries as $entry) {
$em->persist($entry);

View file

@ -63,10 +63,12 @@ class TagController extends Controller
$entry->removeTag($tag);
$em = $this->getDoctrine()->getManager();
$em->flush();
if (count($tag->getEntries()) == 0) {
// remove orphan tag in case no entries are associated to it
if (count($tag->getEntries()) === 0) {
$em->remove($tag);
$em->flush();
}
$em->flush();
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
@ -84,10 +86,25 @@ class TagController extends Controller
{
$tags = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Tag')
->findAllTagsWithEntries($this->getUser()->getId());
->findAllTags($this->getUser()->getId());
$flatTags = [];
foreach ($tags as $key => $tag) {
$nbEntries = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->countAllEntriesByUserIdAndTagId($this->getUser()->getId(), $tag['id']);
$flatTags[] = [
'id' => $tag['id'],
'label' => $tag['label'],
'slug' => $tag['slug'],
'nbEntries' => $nbEntries,
];
}
return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
'tags' => $tags,
'tags' => $flatTags,
]);
}

View file

@ -55,6 +55,7 @@ class RuleBasedTagger
{
$rules = $this->getRulesForUser($user);
$entries = [];
$tagsCache = [];
foreach ($rules as $rule) {
$qb = $this->entryRepository->getBuilderForAllByUser($user->getId());
@ -62,7 +63,12 @@ class RuleBasedTagger
foreach ($entries as $entry) {
foreach ($rule->getTags() as $label) {
$tag = $this->getTag($label);
// avoid new tag duplicate by manually caching them
if (!isset($tagsCache[$label])) {
$tagsCache[$label] = $this->getTag($label);
}
$tag = $tagsCache[$label];
$entry->addTag($tag);
}

View file

@ -309,4 +309,24 @@ class EntryRepository extends EntityRepository
return $qb->getQuery()->getSingleScalarResult();
}
/**
* Count all entries for a tag and a user.
*
* @param int $userId
* @param int $tagId
*
* @return int
*/
public function countAllEntriesByUserIdAndTagId($userId, $tagId)
{
$qb = $this->createQueryBuilder('e')
->select('count(e.id)')
->leftJoin('e.tags', 't')
->where('e.user=:userId')->setParameter('userId', $userId)
->andWhere('t.id=:tagId')->setParameter('tagId', $tagId)
;
return $qb->getQuery()->getSingleScalarResult();
}
}

View file

@ -33,19 +33,23 @@ class TagRepository extends EntityRepository
}
/**
* Find all tags with associated entries per user.
* Find all tags per user.
*
* @param int $userId
*
* @return array
*/
public function findAllTagsWithEntries($userId)
public function findAllTags($userId)
{
return $this->createQueryBuilder('t')
->select('t.slug', 't.label', 't.id')
->leftJoin('t.entries', 'e')
->where('e.user = :userId')->setParameter('userId', $userId)
->groupBy('t.slug')
->addGroupBy('t.label')
->addGroupBy('t.id')
->getQuery()
->getResult();
->getArrayResult();
}
/**

View file

@ -29,7 +29,7 @@ services:
arguments:
- "@doctrine"
wallabag_core.table_prefix_subscriber:
wallabag_core.subscriber.table_prefix:
class: Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber
arguments:
- "%database_table_prefix%"

View file

@ -200,7 +200,7 @@ entry:
description: 'Vises artiklen forkert?'
edit_title: 'Rediger titel'
original_article: 'original'
# annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
# annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
created_at: 'Oprettelsesdato'
new:
page_title: 'Gem ny artikel'

View file

@ -200,7 +200,7 @@ entry:
description: 'Erscheint dieser Artikel falsch?'
edit_title: 'Titel ändern'
original_article: 'original'
annotations_on_the_entry: '{0} Keine Anmerkungen|{1} Eine Anmerkung|]1,Inf[ %nbAnnotations% Anmerkungen'
annotations_on_the_entry: '{0} Keine Anmerkungen|{1} Eine Anmerkung|]1,Inf[ %count% Anmerkungen'
created_at: 'Erstellungsdatum'
new:
page_title: 'Neuen Artikel speichern'

View file

@ -200,7 +200,7 @@ entry:
description: 'Does this article appear wrong?'
edit_title: 'Edit title'
original_article: 'original'
annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
created_at: 'Creation date'
new:
page_title: 'Save new entry'

View file

@ -200,7 +200,7 @@ entry:
description: '¿Este artículo no se muestra bien?'
edit_title: 'Modificar el título'
original_article: 'original'
annotations_on_the_entry: '{0} Sin anotaciones|{1} Una anotación|]1,Inf[ %nbAnnotations% anotaciones'
annotations_on_the_entry: '{0} Sin anotaciones|{1} Una anotación|]1,Inf[ %count% anotaciones'
created_at: 'Fecha de creación'
new:
page_title: 'Guardar un nuevo artículo'

View file

@ -200,7 +200,7 @@ entry:
description: "Est-ce que cet article s'affiche mal ?"
edit_title: 'Modifier le titre'
original_article: 'original'
annotations_on_the_entry: '{0} Aucune annotation|{1} Une annotation|]1,Inf[ %nbAnnotations% annotations'
annotations_on_the_entry: '{0} Aucune annotation|{1} Une annotation|]1,Inf[ %count% annotations'
created_at: 'Date de création'
new:
page_title: 'Sauvegarder un nouvel article'

View file

@ -200,7 +200,7 @@ entry:
description: 'Questo contenuto viene visualizzato male?'
edit_title: 'Modifica titolo'
original_article: 'originale'
annotations_on_the_entry: '{0} Nessuna annotazione|{1} Una annotazione|]1,Inf[ %nbAnnotations% annotazioni'
annotations_on_the_entry: '{0} Nessuna annotazione|{1} Una annotazione|]1,Inf[ %count% annotazioni'
created_at: 'Data di creazione'
new:
page_title: 'Salva un nuovo contenuto'

View file

@ -200,7 +200,7 @@ entry:
description: "Marca mal la presentacion d'aqueste article ?"
edit_title: 'Modificar lo títol'
original_article: 'original'
annotations_on_the_entry: "{0} Pas cap d'anotacion|{1} Una anotacion|]1,Inf[ %nbAnnotations% anotacions"
annotations_on_the_entry: "{0} Pas cap d'anotacion|{1} Una anotacion|]1,Inf[ %count% anotacions"
created_at: 'Data de creacion'
new:
page_title: 'Enregistrar un novèl article'

View file

@ -200,7 +200,7 @@ entry:
description: 'Czy ten artykuł wygląda źle?'
edit_title: 'Edytuj tytuł'
original_article: 'oryginalny'
annotations_on_the_entry: '{0} Nie ma adnotacji |{1} Jedna adnotacja |]1,Inf[ %nbAnnotations% adnotacji'
annotations_on_the_entry: '{0} Nie ma adnotacji |{1} Jedna adnotacja |]1,Inf[ %count% adnotacji'
created_at: 'Czas stworzenia'
new:
page_title: 'Zapisz nowy wpis'

View file

@ -200,7 +200,7 @@ entry:
description: 'Îți pare ciudat articolul?'
edit_title: 'Editează titlul'
original_article: 'original'
# annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
# annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
created_at: 'Data creării'
new:
page_title: 'Salvează un nou articol'

View file

@ -199,7 +199,7 @@ entry:
description: 'Bu makalede herhangi bir yanlışlık mı var?'
edit_title: 'Başlığı düzenle'
original_article: 'orijinal'
# annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
# annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
created_at: 'Oluşturulma tarihi'
new:
page_title: 'Yeni makaleyi kaydet'

View file

@ -54,7 +54,6 @@
{% endif %}
</i>
{% set nbAnnotations = entry.annotations | length %}
<span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span>
<aside class="tags">
<div class="card-entry-tags">

View file

@ -9,7 +9,7 @@
<ul>
{% for tag in tags %}
<li id="tag-{{ tag.id|e }}"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.entries.getValues | length }})</a></li>
<li id="tag-{{ tag.id|e }}"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.nbEntries | length }})</a></li>
{% endfor %}
</ul>

View file

@ -30,11 +30,16 @@
<meta property="og:title" content="{{ entry.title | raw }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ app.request.uri }}" />
{% set picturePath = app.request.schemeAndHttpHost ~ asset('bundles/wallabagcore/themes/_global/img/logo-other_themes.png') %}
{% if entry.previewPicture is not null %}
<meta property="og:image" content="{{ entry.previewPicture }}" />
{% else %}
<meta property="og:image" content="{{ app.request.schemeAndHttpHost }}{{ asset('bundles/wallabagcore/themes/_global/img/logo-other_themes.png') }}" />
{% set picturePath = entry.previewPicture %}
{% endif %}
<meta property="og:image" content="{{ picturePath }}" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:image" content="{{ picturePath }}" />
<meta name="twitter:site" content="@wallabagapp" />
<meta name="twitter:title" content="{{ entry.title | raw }}" />
<meta name="twitter:description" content="{{ entry.title | raw }}" />
</head>
<body>
<header>

View file

@ -1 +1 @@
<a id="bookmarklet" ondragend="this.click();" href="javascript:var url=location.href||url;var wllbg=window.open('{{ url('bookmarklet') }}?url=' + encodeURI(url),'_blank');wllbg.close();void(0);">bag it!</a>
<a id="bookmarklet" ondragend="this.click();" href="javascript:(function(){var url=location.href||url;var wllbg=window.open('{{ url('bookmarklet') }}?url=' + encodeURI(url),'_blank');})();">bag it!</a>

View file

@ -77,7 +77,7 @@
<div class="card-action">
<span class="bold">
<a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.list.original_article'|trans }}: {{ entry.title|e }} - {{ entry.domainName|removeWww }}" class="tool original grey-text"><span>{{ entry.domainName|removeWww|truncate(18) }}</span></a>
</bold>
</span>
<ul class="tools right">
<li>

View file

@ -225,7 +225,7 @@
<a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool">
<i class="material-icons link">link</i> <span class="link">{{ entry.domainName|removeWww }}</span>
</a>
<span class="tool"><i class="material-icons link">comment</i> <span class="link">{{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span>
<span class="tool"><i class="material-icons link">comment</i></span> <span class="link">{{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span>
<div id="list">
{% for tag in entry.tags %}
<div class="chip">

View file

@ -6,12 +6,19 @@
<div class="results clearfix">
<div class="nb-results left">{{ 'tag.list.number_on_the_page'|transchoice(tags|length) }}</div>
</div>
<br />
<ul class="row data">
{% for tag in tags %}
<li id="tag-{{ tag.id|e }}" class="col l4 m6 s12"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.entries.getValues | length }})</a></li>
{% endfor %}
</ul>
<div class="row">
<ul class="card-tag-labels">
{% for tag in tags %}
<li title="{{tag.label}} ({{ tag.nbEntries }})" id="tag-{{ tag.id }}" class="col l2 m2 s2">
<a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.nbEntries }})</a>
</li>
{% endfor %}
</ul>
</div>
<div>
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a>
</div>

View file

@ -73,7 +73,7 @@
<a class="waves-effect" href="{{ path('howto') }}">{{ 'menu.left.howto'|trans }}</a>
</li>
<li class="bold">
<a class="waves-effect" class="icon icon-power" href="{{ path('fos_user_security_logout') }}">{{ 'menu.left.logout'|trans }}</a>
<a class="waves-effect icon icon-power" href="{{ path('fos_user_security_logout') }}">{{ 'menu.left.logout'|trans }}</a>
</li>
</ul>
<div class="nav-wrapper nav-panels">

View file

@ -1,6 +1,6 @@
<?php
namespace Tests\Wallabag\CoreBundle\Controller;
namespace Tests\Wallabag\ApiBundle\Controller;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
@ -33,6 +33,32 @@ class DeveloperControllerTest extends WallabagCoreTestCase
$this->assertContains('My app', $alert[0]);
}
/**
* @depends testCreateClient
*/
public function testCreateToken()
{
$client = $this->getClient();
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$apiClient = $em->getRepository('WallabagApiBundle:Client')->findOneByName('My app');
$client->request('POST', '/oauth/v2/token', [
'grant_type' => 'password',
'client_id' => $apiClient->getPublicId(),
'client_secret' => $apiClient->getSecret(),
'username' => 'admin',
'password' => 'mypassword',
]);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$data = json_decode($client->getResponse()->getContent(), true);
$this->assertArrayHasKey('access_token', $data);
$this->assertArrayHasKey('expires_in', $data);
$this->assertArrayHasKey('token_type', $data);
$this->assertArrayHasKey('refresh_token', $data);
}
public function testListingClient()
{
$this->logInAs('admin');

View file

@ -561,6 +561,8 @@ class WallabagRestControllerTest extends WallabagApiTestCase
*/
public function testDeleteUserTag($tag)
{
$tagName = $tag['label'];
$this->client->request('DELETE', '/api/tags/'.$tag['id'].'.json');
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -577,6 +579,13 @@ class WallabagRestControllerTest extends WallabagApiTestCase
->findAllByTagId($this->user->getId(), $tag['id']);
$this->assertCount(0, $entries);
$tag = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->findOneByLabel($tagName);
$this->assertNull($tag, $tagName.' was removed because it begun an orphan tag');
}
public function testDeleteTagByLabel()
@ -794,6 +803,22 @@ class WallabagRestControllerTest extends WallabagApiTestCase
$this->assertEquals(true, $content['exists']);
}
public function testGetEntriesExistsWithManyUrls()
{
$url1 = 'http://0.0.0.0/entry2';
$url2 = 'http://0.0.0.0/entry10';
$this->client->request('GET', '/api/entries/exists?urls[]='.$url1.'&urls[]='.$url2);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertArrayHasKey($url1, $content);
$this->assertArrayHasKey($url2, $content);
$this->assertEquals(true, $content[$url1]);
$this->assertEquals(false, $content[$url2]);
}
public function testGetEntriesExistsWhichDoesNotExists()
{
$this->client->request('GET', '/api/entries/exists?url=http://google.com/entry2');

View file

@ -341,22 +341,23 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->logInAs('admin');
$client = $this->getClient();
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
$em = $client->getContainer()
->get('doctrine.orm.entity_manager');
$content = $em
->getRepository('WallabagCoreBundle:Entry')
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
// empty content
$content->setContent('');
$client->getContainer()->get('doctrine.orm.entity_manager')->persist($content);
$client->getContainer()->get('doctrine.orm.entity_manager')->flush();
$em->persist($content);
$em->flush();
$client->request('GET', '/reload/'.$content->getId());
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
$content = $em
->getRepository('WallabagCoreBundle:Entry')
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
@ -486,9 +487,11 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->logInAs('admin');
$client = $this->getClient();
$em = $client->getContainer()
->get('doctrine.orm.entity_manager');
// add a new content to be removed later
$user = $client->getContainer()
->get('doctrine.orm.entity_manager')
$user = $em
->getRepository('WallabagUserBundle:User')
->findOneByUserName('admin');
@ -502,12 +505,8 @@ class EntryControllerTest extends WallabagCoreTestCase
$content->setArchived(true);
$content->setLanguage('fr');
$client->getContainer()
->get('doctrine.orm.entity_manager')
->persist($content);
$client->getContainer()
->get('doctrine.orm.entity_manager')
->flush();
$em->persist($content);
$em->flush();
$client->request('GET', '/view/'.$content->getId());
$this->assertEquals(200, $client->getResponse()->getStatusCode());

View file

@ -3,6 +3,7 @@
namespace Tests\Wallabag\CoreBundle\Controller;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Tag;
class TagControllerTest extends WallabagCoreTestCase
{
@ -134,36 +135,48 @@ class TagControllerTest extends WallabagCoreTestCase
$client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId());
$this->assertEquals(404, $client->getResponse()->getStatusCode());
$tag = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->findOneByLabel($this->tagName);
$this->assertNull($tag, $this->tagName.' was removed because it begun an orphan tag');
}
public function testShowEntriesForTagAction()
{
$this->logInAs('admin');
$client = $this->getClient();
$em = $client->getContainer()
->get('doctrine.orm.entity_manager');
$tag = new Tag();
$tag->setLabel($this->tagName);
$entry = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getLoggedInUserId());
$tag = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->findOneByEntryAndTagLabel($entry, 'foo');
$tag->addEntry($entry);
$crawler = $client->request('GET', '/tag/list/'.$tag->getSlug());
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertCount(2, $crawler->filter('div[class=entry]'));
$em->persist($entry);
$em->persist($tag);
$em->flush();
$tag = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->findOneByLabel('baz');
->findOneByEntryAndTagLabel($entry, $this->tagName);
$crawler = $client->request('GET', '/tag/list/'.$tag->getSlug());
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertCount(1, $crawler->filter('div[class=entry]'));
$this->assertCount(1, $crawler->filter('[id*="entry-"]'));
$entry->removeTag($tag);
$em->remove($tag);
$em->flush();
}
}

View file

@ -90,9 +90,7 @@ abstract class WallabagCoreTestCase extends WebTestCase
try {
$this->client->getContainer()->get('wallabag_core.redis.client')->connect();
} catch (\Exception $e) {
$this->markTestSkipped(
'Redis is not installed/activated'
);
$this->markTestSkipped('Redis is not installed/activated');
}
}
}

View file

@ -54,6 +54,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
public function testImportChromeWithRedisEnabled()
{
$this->checkRedis();
$this->logInAs('admin');
$client = $this->getClient();
$client->getContainer()->get('craue_config')->set('import_with_redis', 1);

View file

@ -54,6 +54,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
public function testImportFirefoxWithRedisEnabled()
{
$this->checkRedis();
$this->logInAs('admin');
$client = $this->getClient();
$client->getContainer()->get('craue_config')->set('import_with_redis', 1);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long