mirror of
https://github.com/wallabag/wallabag.git
synced 2025-02-08 15:02:23 +00:00
Merge remote-tracking branch 'origin/master' into 2.2
This commit is contained in:
commit
e4cf672ccf
74 changed files with 1595 additions and 1519 deletions
2245
CHANGELOG.md
2245
CHANGELOG.md
File diff suppressed because it is too large
Load diff
43
Makefile
Executable file
43
Makefile
Executable 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
|
15
README.md
15
README.md
|
@ -6,23 +6,22 @@
|
||||||
wallabag is a self hostable application allowing you to not miss any content anymore.
|
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.
|
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
|
# 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:
|
Then you can install wallabag by executing the following commands:
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/wallabag/wallabag.git
|
git clone https://github.com/wallabag/wallabag.git
|
||||||
cd wallabag
|
cd wallabag && make install
|
||||||
git checkout 2.1.1
|
make run
|
||||||
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
|
||||||
php bin/console wallabag:install --env=prod
|
|
||||||
php bin/console server:run --env=prod
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
# License
|
||||||
Copyright © 2013-2016 Nicolas Lœuillet <nicolas@loeuillet.org>
|
Copyright © 2013-2016 Nicolas Lœuillet <nicolas@loeuillet.org>
|
||||||
This work is free. You can redistribute it and/or modify it under the
|
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.
|
terms of the MIT License. See the COPYING file for more details.
|
||||||
|
|
|
@ -1,48 +1,45 @@
|
||||||
## Definition
|
## Definition
|
||||||
|
|
||||||
A release is mostly a git tag of http://github.com/wallabag/wallabag, following [semantic versioning](http://semver.org).
|
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
|
### 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
|
#### Files to edit
|
||||||
|
|
||||||
- `app/config/config.yml` (`wallabag_core.version`)
|
- `app/config/config.yml` (`wallabag_core.version`)
|
||||||
- `README.md` (`composer create-project` command)
|
- `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))
|
||||||
- `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))
|
|
||||||
|
|
||||||
#### Create release on GitHub
|
#### Create release on GitHub
|
||||||
|
|
||||||
- Run these commands to create the tag:
|
- Run these commands to create the tag:
|
||||||
|
|
||||||
```
|
```
|
||||||
git checkout v2
|
git checkout master
|
||||||
git pull origin v2
|
git pull origin master
|
||||||
git checkout -b release-2.0.0-beta.1
|
git checkout -b release-$LAST_WALLABAG_RELEASE
|
||||||
SYMFONY_ENV=prod composer up --no-dev
|
SYMFONY_ENV=prod composer up --no-dev
|
||||||
git add --force composer.lock
|
git add --force composer.lock
|
||||||
git add README.md
|
git commit -m "Release wallabag $LAST_WALLABAG_RELEASE"
|
||||||
git commit -m "Release wallabag 2.0.0-beta.1"
|
git push origin release-$LAST_WALLABAG_RELEASE
|
||||||
git push origin release-2.0.0-beta.1
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- 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.
|
- 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 commands to create the package:
|
- 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
|
make release master /tmp wllbg-release prod
|
||||||
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
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- [Create the new release on GitHub](https://github.com/wallabag/wallabag/releases/new). You have to upload on this page the package.
|
- [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 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)
|
- 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`
|
### `composer.lock`
|
||||||
A release tag must contain a `composer.lock` file. It sets which dependencies were available at the time a release was done,
|
A release tag must contain a `composer.lock` file. It sets which dependencies were available at the time a release was done,
|
||||||
|
|
|
@ -414,9 +414,10 @@ main ul.row {
|
||||||
max-width: 50%;
|
max-width: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card .card-entry-labels li {
|
.card .card-entry-labels li,
|
||||||
|
.card-tag-labels li {
|
||||||
margin: 10px 10px 10px auto;
|
margin: 10px 10px 10px auto;
|
||||||
padding: 5px 12px 5px 16px;
|
padding: 5px 12px 5px 16px !important;
|
||||||
background-color: rgba(0, 151, 167, 0.85);
|
background-color: rgba(0, 151, 167, 0.85);
|
||||||
border-radius: 0 3px 3px 0;
|
border-radius: 0 3px 3px 0;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
@ -447,6 +448,7 @@ main ul.row {
|
||||||
|
|
||||||
.card-entry-tags a,
|
.card-entry-tags a,
|
||||||
.card-entry-labels a,
|
.card-entry-labels a,
|
||||||
|
.card-tag-labels a,
|
||||||
.card-entry-labels-hidden a,
|
.card-entry-labels-hidden a,
|
||||||
#list .chip a {
|
#list .chip a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
|
@ -30,7 +30,7 @@ framework:
|
||||||
assets: ~
|
assets: ~
|
||||||
|
|
||||||
wallabag_core:
|
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"
|
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
|
||||||
languages:
|
languages:
|
||||||
en: 'English'
|
en: 'English'
|
||||||
|
|
|
@ -12,6 +12,11 @@ wallabag_user:
|
||||||
type: annotation
|
type: annotation
|
||||||
prefix: /users
|
prefix: /users
|
||||||
|
|
||||||
|
wallabag_api:
|
||||||
|
resource: "@WallabagApiBundle/Controller/"
|
||||||
|
type: annotation
|
||||||
|
prefix: /
|
||||||
|
|
||||||
wallabag_api:
|
wallabag_api:
|
||||||
resource: "@WallabagApiBundle/Resources/config/routing.yml"
|
resource: "@WallabagApiBundle/Resources/config/routing.yml"
|
||||||
prefix: /
|
prefix: /
|
||||||
|
|
|
@ -65,9 +65,9 @@
|
||||||
"liip/theme-bundle": "~1.1",
|
"liip/theme-bundle": "~1.1",
|
||||||
"lexik/form-filter-bundle": "~5.0",
|
"lexik/form-filter-bundle": "~5.0",
|
||||||
"j0k3r/graby": "~1.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",
|
"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",
|
"scheb/two-factor-bundle": "~2.0",
|
||||||
"grandt/phpepub": "~4.0",
|
"grandt/phpepub": "~4.0",
|
||||||
"wallabag/php-mobi": "~1.0.0",
|
"wallabag/php-mobi": "~1.0.0",
|
||||||
|
|
|
@ -46,6 +46,10 @@ Bearbeite die Datei ``parameters.yml``, um die RabbitMQ Konfiguration einzuricht
|
||||||
rabbitmq_user: guest
|
rabbitmq_user: guest
|
||||||
rabbitmq_password: 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
|
Starte den RabbitMQ Consumer
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
|
@ -35,6 +35,10 @@ Bearbeite die Datei ``parameters.yml``, um die RabbitMQ Konfiguration einzuricht
|
||||||
redis_host: localhost
|
redis_host: localhost
|
||||||
redis_port: 6379
|
redis_port: 6379
|
||||||
|
|
||||||
|
Enable Redis in wallabag
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
In internal settings, in the **Import** section, enable Redis (with the value 1).
|
||||||
|
|
||||||
Starte den Redis Consumer
|
Starte den Redis Consumer
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
10
docs/de/developer/testsuite.rst
Normal file
10
docs/de/developer/testsuite.rst
Normal 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``.
|
|
@ -6,6 +6,20 @@ Voraussetzungen
|
||||||
|
|
||||||
wallabag ist kompatibel mit PHP >= 5.5, inkl. PHP 7.
|
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
|
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.
|
nicht alle folgenden Pakete installieren.
|
||||||
|
|
||||||
|
@ -39,33 +53,20 @@ Installation
|
||||||
Auf einem dedizierten Webserver (empfohlener Weg)
|
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:
|
Um wallabag selbst zu installieren, musst du die folgenden Kommandos ausführen:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
git clone https://github.com/wallabag/wallabag.git
|
git clone https://github.com/wallabag/wallabag.git
|
||||||
cd wallabag
|
cd wallabag && make install
|
||||||
git checkout 2.1.1 --force
|
|
||||||
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
|
||||||
php bin/console wallabag:install --env=prod
|
|
||||||
|
|
||||||
Um PHPs eingebauten Server zu starten und zu testen, ob alles korrekt installiert wurde, kannst du folgendes Kommando ausführen:
|
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::
|
.. 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
|
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``.
|
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
|
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.
|
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
|
Kommando, um den Container zu starten
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
|
@ -108,7 +109,7 @@ Virtualhosts
|
||||||
------------
|
------------
|
||||||
|
|
||||||
Konfiguration von Apache
|
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:
|
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;
|
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::
|
.. 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``.
|
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
|
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):
|
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):
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,10 @@ Edit your ``parameters.yml`` file to edit RabbitMQ configuration. The default on
|
||||||
rabbitmq_user: guest
|
rabbitmq_user: guest
|
||||||
rabbitmq_password: guest
|
rabbitmq_password: guest
|
||||||
|
|
||||||
|
Enable RabbitMQ in wallabag
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
In internal settings, in the **Import** section, enable RabbitMQ (with the value 1).
|
||||||
|
|
||||||
Launch RabbitMQ consumer
|
Launch RabbitMQ consumer
|
||||||
------------------------
|
------------------------
|
||||||
|
|
|
@ -35,6 +35,10 @@ Edit your ``parameters.yml`` file to edit Redis configuration. The default one s
|
||||||
redis_host: localhost
|
redis_host: localhost
|
||||||
redis_port: 6379
|
redis_port: 6379
|
||||||
|
|
||||||
|
Enable Redos in wallabag
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
In internal settings, in the **Import** section, enable Redis (with the value 1).
|
||||||
|
|
||||||
Launch Redis consumer
|
Launch Redis consumer
|
||||||
---------------------
|
---------------------
|
||||||
|
|
10
docs/en/developer/testsuite.rst
Normal file
10
docs/en/developer/testsuite.rst
Normal 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``.
|
|
@ -30,8 +30,8 @@ The documentation is available in other languages:
|
||||||
|
|
||||||
user/faq
|
user/faq
|
||||||
user/installation
|
user/installation
|
||||||
user/upgrade-2.0.x-2.1.y
|
user/upgrade-2.0.x-2.1.1
|
||||||
user/upgrade-2.0.x-2.0.y
|
user/upgrade-2.1.x-2.1.y
|
||||||
user/migration
|
user/migration
|
||||||
user/import
|
user/import
|
||||||
user/create_account
|
user/create_account
|
||||||
|
|
|
@ -35,7 +35,7 @@ After you have filled in your data, push the button Connection test and wait for
|
||||||
:alt: Connection test with your wallabag data
|
:alt: Connection test with your wallabag data
|
||||||
:align: center
|
: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
|
.. image:: ../../img/user/android_configuration_connection_test_success.en.png
|
||||||
:alt: Connection test successful
|
: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
|
:alt: Settings saved the first time
|
||||||
:align: center
|
: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
|
.. 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
|
:align: center
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Known limitations
|
Known limitations
|
||||||
----
|
-----------------
|
||||||
|
|
||||||
2FA
|
2FA
|
||||||
~~~
|
~~~
|
||||||
|
|
|
@ -6,7 +6,21 @@ Requirements
|
||||||
|
|
||||||
wallabag is compatible with PHP >= 5.5, including PHP 7.
|
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-session
|
||||||
- php-ctype
|
- php-ctype
|
||||||
|
@ -38,31 +52,18 @@ Installation
|
||||||
On a dedicated web server (recommended way)
|
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:
|
To install wallabag itself, you must run the following commands:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
git clone https://github.com/wallabag/wallabag.git
|
git clone https://github.com/wallabag/wallabag.git
|
||||||
cd wallabag
|
cd wallabag && make install
|
||||||
git checkout 2.1.1 --force
|
|
||||||
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
|
||||||
php bin/console wallabag:install --env=prod
|
|
||||||
|
|
||||||
To start PHP's build-in server and test if everything did install correctly, you can do:
|
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
|
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
|
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.
|
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``.
|
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
|
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.
|
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
|
Command to launch container
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
|
@ -239,12 +240,12 @@ Rights access to the folders of the project
|
||||||
Test environment
|
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
|
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).
|
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).
|
||||||
|
|
||||||
|
|
50
docs/en/user/parameters.rst
Normal file
50
docs/en/user/parameters.rst
Normal 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"
|
|
@ -1,5 +1,5 @@
|
||||||
Upgrading from 2.0.x to 2.1.y
|
Upgrade from 2.0.x to 2.1.1
|
||||||
=============================
|
===========================
|
||||||
|
|
||||||
.. warning::
|
.. 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.
|
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
|
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/*
|
rm -rf var/cache/*
|
||||||
|
@ -28,23 +26,41 @@ Download the last release of wallabag:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. 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``)
|
(md5 hash of the 2.1.1 package: ``9584a3b60a2b2a4de87f536548caac93``)
|
||||||
|
|
||||||
Extract the archive in your wallabag folder and replace ``app/config/parameters.yml`` with yours.
|
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
|
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_host: localhost
|
||||||
rabbitmq_port: 5672
|
rabbitmq_port: 5672
|
||||||
rabbitmq_user: guest
|
rabbitmq_user: guest
|
||||||
rabbitmq_password: guest
|
rabbitmq_password: guest
|
||||||
|
|
||||||
# Redis processing
|
|
||||||
redis_host: localhost
|
redis_host: localhost
|
||||||
redis_port: 6379
|
redis_port: 6379
|
||||||
|
|
|
@ -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
|
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/*
|
rm -rf var/cache/*
|
||||||
git fetch origin
|
git fetch origin
|
||||||
git fetch --tags
|
git fetch --tags
|
||||||
git checkout 2.0.8
|
git checkout 2.1.2 --force
|
||||||
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
||||||
php bin/console cache:clear --env=prod
|
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
|
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.
|
Extract the archive in your wallabag folder and replace ``app/config/parameters.yml`` with yours.
|
||||||
|
|
|
@ -46,6 +46,10 @@ Modifiez votre fichier ``parameters.yml`` pour éditer la configuration RabbitMQ
|
||||||
rabbitmq_user: guest
|
rabbitmq_user: guest
|
||||||
rabbitmq_password: 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
|
Démarrer les clients RabbitMQ
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
@ -35,6 +35,10 @@ Modifiez votre fichier ``parameters.yml`` pour éditer la configuration Redis. C
|
||||||
redis_host: localhost
|
redis_host: localhost
|
||||||
redis_port: 6379
|
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
|
Démarrer les clients Redis
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
10
docs/fr/developer/testsuite.rst
Normal file
10
docs/fr/developer/testsuite.rst
Normal 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``.
|
|
@ -6,6 +6,20 @@ Pré-requis
|
||||||
|
|
||||||
wallabag est compatible avec PHP >= 5.5, PHP 7 inclus.
|
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.
|
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
|
- php-session
|
||||||
|
@ -36,31 +50,18 @@ Installation
|
||||||
Sur un serveur dédié (méthode conseillée)
|
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 :
|
Pour installer wallabag, vous devez exécuter ces commandes :
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
git clone https://github.com/wallabag/wallabag.git
|
git clone https://github.com/wallabag/wallabag.git
|
||||||
cd wallabag
|
cd wallabag && make install
|
||||||
git checkout 2.1.1 --force
|
|
||||||
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
|
||||||
php bin/console wallabag:install --env=prod
|
|
||||||
|
|
||||||
Pour démarrer le serveur interne à php et vérifier que tout s'est installé correctement, vous pouvez exécuter :
|
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
|
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
|
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.
|
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``.
|
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
|
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.
|
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
|
Commande pour démarrer le containeur
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
|
|
10
scripts/install.sh
Normal file
10
scripts/install.sh
Normal 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
19
scripts/release.sh
Normal 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
13
scripts/update.sh
Normal 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
|
|
@ -1,12 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Wallabag\CoreBundle\Controller;
|
namespace Wallabag\ApiBundle\Controller;
|
||||||
|
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
use Wallabag\ApiBundle\Entity\Client;
|
use Wallabag\ApiBundle\Entity\Client;
|
||||||
use Wallabag\CoreBundle\Form\Type\ClientType;
|
use Wallabag\ApiBundle\Form\Type\ClientType;
|
||||||
|
|
||||||
class DeveloperController extends Controller
|
class DeveloperController extends Controller
|
||||||
{
|
{
|
|
@ -27,7 +27,8 @@ class WallabagRestController extends FOSRestController
|
||||||
*
|
*
|
||||||
* @ApiDoc(
|
* @ApiDoc(
|
||||||
* parameters={
|
* 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();
|
$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', '');
|
$url = $request->query->get('url', '');
|
||||||
|
|
||||||
if (empty($url)) {
|
if (empty($url)) {
|
||||||
|
@ -367,7 +387,7 @@ class WallabagRestController extends FOSRestController
|
||||||
|
|
||||||
$tags = $this->getDoctrine()
|
$tags = $this->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository('WallabagCoreBundle:Tag')
|
||||||
->findAllTagsWithEntries($this->getUser()->getId());
|
->findAllTags($this->getUser()->getId());
|
||||||
|
|
||||||
$json = $this->get('serializer')->serialize($tags, 'json');
|
$json = $this->get('serializer')->serialize($tags, 'json');
|
||||||
|
|
||||||
|
@ -400,6 +420,8 @@ class WallabagRestController extends FOSRestController
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository('WallabagCoreBundle:Entry')
|
||||||
->removeTag($this->getUser()->getId(), $tag);
|
->removeTag($this->getUser()->getId(), $tag);
|
||||||
|
|
||||||
|
$this->cleanOrphanTag($tag);
|
||||||
|
|
||||||
$json = $this->get('serializer')->serialize($tag, 'json');
|
$json = $this->get('serializer')->serialize($tag, 'json');
|
||||||
|
|
||||||
return (new JsonResponse())->setJson($json);
|
return (new JsonResponse())->setJson($json);
|
||||||
|
@ -440,6 +462,8 @@ class WallabagRestController extends FOSRestController
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository('WallabagCoreBundle:Entry')
|
||||||
->removeTags($this->getUser()->getId(), $tags);
|
->removeTags($this->getUser()->getId(), $tags);
|
||||||
|
|
||||||
|
$this->cleanOrphanTag($tags);
|
||||||
|
|
||||||
$json = $this->get('serializer')->serialize($tags, 'json');
|
$json = $this->get('serializer')->serialize($tags, 'json');
|
||||||
|
|
||||||
return (new JsonResponse())->setJson($json);
|
return (new JsonResponse())->setJson($json);
|
||||||
|
@ -464,6 +488,8 @@ class WallabagRestController extends FOSRestController
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository('WallabagCoreBundle:Entry')
|
||||||
->removeTag($this->getUser()->getId(), $tag);
|
->removeTag($this->getUser()->getId(), $tag);
|
||||||
|
|
||||||
|
$this->cleanOrphanTag($tag);
|
||||||
|
|
||||||
$json = $this->get('serializer')->serialize($tag, 'json');
|
$json = $this->get('serializer')->serialize($tag, 'json');
|
||||||
|
|
||||||
return (new JsonResponse())->setJson($json);
|
return (new JsonResponse())->setJson($json);
|
||||||
|
@ -485,6 +511,28 @@ class WallabagRestController extends FOSRestController
|
||||||
return (new JsonResponse())->setJson($json);
|
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.
|
* 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.
|
* If not, throw exception. It means a user try to access information from an other user.
|
||||||
|
|
|
@ -19,7 +19,7 @@ class AccessToken extends BaseAccessToken
|
||||||
protected $id;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity="Client")
|
* @ORM\ManyToOne(targetEntity="Client", inversedBy="accessTokens")
|
||||||
* @ORM\JoinColumn(nullable=false)
|
* @ORM\JoinColumn(nullable=false)
|
||||||
*/
|
*/
|
||||||
protected $client;
|
protected $client;
|
||||||
|
|
|
@ -25,6 +25,16 @@ class Client extends BaseClient
|
||||||
*/
|
*/
|
||||||
protected $name;
|
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()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
|
@ -19,7 +19,7 @@ class RefreshToken extends BaseRefreshToken
|
||||||
protected $id;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity="Client")
|
* @ORM\ManyToOne(targetEntity="Client", inversedBy="refreshTokens")
|
||||||
* @ORM\JoinColumn(nullable=false)
|
* @ORM\JoinColumn(nullable=false)
|
||||||
*/
|
*/
|
||||||
protected $client;
|
protected $client;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Wallabag\CoreBundle\Form\Type;
|
namespace Wallabag\ApiBundle\Form\Type;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\CallbackTransformer;
|
use Symfony\Component\Form\CallbackTransformer;
|
|
@ -9,7 +9,7 @@ use Symfony\Component\Console\Helper\Table;
|
||||||
use Symfony\Component\Console\Input\ArrayInput;
|
use Symfony\Component\Console\Input\ArrayInput;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
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\Output\OutputInterface;
|
||||||
use Symfony\Component\Console\Question\ConfirmationQuestion;
|
use Symfony\Component\Console\Question\ConfirmationQuestion;
|
||||||
use Symfony\Component\Console\Question\Question;
|
use Symfony\Component\Console\Question\Question;
|
||||||
|
@ -97,7 +97,8 @@ class InstallCommand extends ContainerAwareCommand
|
||||||
try {
|
try {
|
||||||
$this->getContainer()->get('doctrine')->getManager()->getConnection()->connect();
|
$this->getContainer()->get('doctrine')->getManager()->getConnection()->connect();
|
||||||
} catch (\Exception $e) {
|
} 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;
|
$fulfilled = false;
|
||||||
$status = '<error>ERROR!</error>';
|
$status = '<error>ERROR!</error>';
|
||||||
$help = 'Can\'t connect to the database: '.$e->getMessage();
|
$help = 'Can\'t connect to the database: '.$e->getMessage();
|
||||||
|
@ -420,16 +421,18 @@ class InstallCommand extends ContainerAwareCommand
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->getApplication()->setAutoExit(false);
|
$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) {
|
if (0 !== $exitCode) {
|
||||||
$this->getApplication()->setAutoExit(true);
|
$this->getApplication()->setAutoExit(true);
|
||||||
|
|
||||||
$errorMessage = sprintf('The command "%s" terminated with an error code: %u.', $command, $exitCode);
|
$this->defaultOutput->writeln('');
|
||||||
$this->defaultOutput->writeln("<error>$errorMessage</error>");
|
$this->defaultOutput->writeln('<error>The command "'.$command.'" generates some errors: </error>');
|
||||||
$exception = new \Exception($errorMessage, $exitCode);
|
$this->defaultOutput->writeln($output->fetch());
|
||||||
|
|
||||||
throw $exception;
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
// PDO does not always close the connection after Doctrine commands.
|
// PDO does not always close the connection after Doctrine commands.
|
||||||
|
|
|
@ -34,10 +34,13 @@ class TagAllCommand extends ContainerAwareCommand
|
||||||
}
|
}
|
||||||
$tagger = $this->getContainer()->get('wallabag_core.rule_based_tagger');
|
$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);
|
$entries = $tagger->tagAllForUser($user);
|
||||||
|
|
||||||
|
$output->writeln('<info>Done.</info>');
|
||||||
|
$output->write(sprintf('Persist entries ... ', $user->getUserName()));
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
foreach ($entries as $entry) {
|
foreach ($entries as $entry) {
|
||||||
$em->persist($entry);
|
$em->persist($entry);
|
||||||
|
|
|
@ -63,10 +63,12 @@ class TagController extends Controller
|
||||||
$entry->removeTag($tag);
|
$entry->removeTag($tag);
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$em->flush();
|
$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->remove($tag);
|
||||||
}
|
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
}
|
||||||
|
|
||||||
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
|
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
|
||||||
|
|
||||||
|
@ -84,10 +86,25 @@ class TagController extends Controller
|
||||||
{
|
{
|
||||||
$tags = $this->getDoctrine()
|
$tags = $this->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->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', [
|
return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
|
||||||
'tags' => $tags,
|
'tags' => $flatTags,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ class RuleBasedTagger
|
||||||
{
|
{
|
||||||
$rules = $this->getRulesForUser($user);
|
$rules = $this->getRulesForUser($user);
|
||||||
$entries = [];
|
$entries = [];
|
||||||
|
$tagsCache = [];
|
||||||
|
|
||||||
foreach ($rules as $rule) {
|
foreach ($rules as $rule) {
|
||||||
$qb = $this->entryRepository->getBuilderForAllByUser($user->getId());
|
$qb = $this->entryRepository->getBuilderForAllByUser($user->getId());
|
||||||
|
@ -62,7 +63,12 @@ class RuleBasedTagger
|
||||||
|
|
||||||
foreach ($entries as $entry) {
|
foreach ($entries as $entry) {
|
||||||
foreach ($rule->getTags() as $label) {
|
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);
|
$entry->addTag($tag);
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,4 +309,24 @@ class EntryRepository extends EntityRepository
|
||||||
|
|
||||||
return $qb->getQuery()->getSingleScalarResult();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,19 +33,23 @@ class TagRepository extends EntityRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find all tags with associated entries per user.
|
* Find all tags per user.
|
||||||
*
|
*
|
||||||
* @param int $userId
|
* @param int $userId
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function findAllTagsWithEntries($userId)
|
public function findAllTags($userId)
|
||||||
{
|
{
|
||||||
return $this->createQueryBuilder('t')
|
return $this->createQueryBuilder('t')
|
||||||
|
->select('t.slug', 't.label', 't.id')
|
||||||
->leftJoin('t.entries', 'e')
|
->leftJoin('t.entries', 'e')
|
||||||
->where('e.user = :userId')->setParameter('userId', $userId)
|
->where('e.user = :userId')->setParameter('userId', $userId)
|
||||||
|
->groupBy('t.slug')
|
||||||
|
->addGroupBy('t.label')
|
||||||
|
->addGroupBy('t.id')
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->getResult();
|
->getArrayResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -29,7 +29,7 @@ services:
|
||||||
arguments:
|
arguments:
|
||||||
- "@doctrine"
|
- "@doctrine"
|
||||||
|
|
||||||
wallabag_core.table_prefix_subscriber:
|
wallabag_core.subscriber.table_prefix:
|
||||||
class: Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber
|
class: Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber
|
||||||
arguments:
|
arguments:
|
||||||
- "%database_table_prefix%"
|
- "%database_table_prefix%"
|
||||||
|
|
|
@ -200,7 +200,7 @@ entry:
|
||||||
description: 'Vises artiklen forkert?'
|
description: 'Vises artiklen forkert?'
|
||||||
edit_title: 'Rediger titel'
|
edit_title: 'Rediger titel'
|
||||||
original_article: 'original'
|
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'
|
created_at: 'Oprettelsesdato'
|
||||||
new:
|
new:
|
||||||
page_title: 'Gem ny artikel'
|
page_title: 'Gem ny artikel'
|
||||||
|
|
|
@ -200,7 +200,7 @@ entry:
|
||||||
description: 'Erscheint dieser Artikel falsch?'
|
description: 'Erscheint dieser Artikel falsch?'
|
||||||
edit_title: 'Titel ändern'
|
edit_title: 'Titel ändern'
|
||||||
original_article: 'original'
|
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'
|
created_at: 'Erstellungsdatum'
|
||||||
new:
|
new:
|
||||||
page_title: 'Neuen Artikel speichern'
|
page_title: 'Neuen Artikel speichern'
|
||||||
|
|
|
@ -200,7 +200,7 @@ entry:
|
||||||
description: 'Does this article appear wrong?'
|
description: 'Does this article appear wrong?'
|
||||||
edit_title: 'Edit title'
|
edit_title: 'Edit title'
|
||||||
original_article: 'original'
|
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'
|
created_at: 'Creation date'
|
||||||
new:
|
new:
|
||||||
page_title: 'Save new entry'
|
page_title: 'Save new entry'
|
||||||
|
|
|
@ -200,7 +200,7 @@ entry:
|
||||||
description: '¿Este artículo no se muestra bien?'
|
description: '¿Este artículo no se muestra bien?'
|
||||||
edit_title: 'Modificar el título'
|
edit_title: 'Modificar el título'
|
||||||
original_article: 'original'
|
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'
|
created_at: 'Fecha de creación'
|
||||||
new:
|
new:
|
||||||
page_title: 'Guardar un nuevo artículo'
|
page_title: 'Guardar un nuevo artículo'
|
||||||
|
|
|
@ -200,7 +200,7 @@ entry:
|
||||||
description: "Est-ce que cet article s'affiche mal ?"
|
description: "Est-ce que cet article s'affiche mal ?"
|
||||||
edit_title: 'Modifier le titre'
|
edit_title: 'Modifier le titre'
|
||||||
original_article: 'original'
|
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'
|
created_at: 'Date de création'
|
||||||
new:
|
new:
|
||||||
page_title: 'Sauvegarder un nouvel article'
|
page_title: 'Sauvegarder un nouvel article'
|
||||||
|
|
|
@ -200,7 +200,7 @@ entry:
|
||||||
description: 'Questo contenuto viene visualizzato male?'
|
description: 'Questo contenuto viene visualizzato male?'
|
||||||
edit_title: 'Modifica titolo'
|
edit_title: 'Modifica titolo'
|
||||||
original_article: 'originale'
|
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'
|
created_at: 'Data di creazione'
|
||||||
new:
|
new:
|
||||||
page_title: 'Salva un nuovo contenuto'
|
page_title: 'Salva un nuovo contenuto'
|
||||||
|
|
|
@ -200,7 +200,7 @@ entry:
|
||||||
description: "Marca mal la presentacion d'aqueste article ?"
|
description: "Marca mal la presentacion d'aqueste article ?"
|
||||||
edit_title: 'Modificar lo títol'
|
edit_title: 'Modificar lo títol'
|
||||||
original_article: 'original'
|
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'
|
created_at: 'Data de creacion'
|
||||||
new:
|
new:
|
||||||
page_title: 'Enregistrar un novèl article'
|
page_title: 'Enregistrar un novèl article'
|
||||||
|
|
|
@ -200,7 +200,7 @@ entry:
|
||||||
description: 'Czy ten artykuł wygląda źle?'
|
description: 'Czy ten artykuł wygląda źle?'
|
||||||
edit_title: 'Edytuj tytuł'
|
edit_title: 'Edytuj tytuł'
|
||||||
original_article: 'oryginalny'
|
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'
|
created_at: 'Czas stworzenia'
|
||||||
new:
|
new:
|
||||||
page_title: 'Zapisz nowy wpis'
|
page_title: 'Zapisz nowy wpis'
|
||||||
|
|
|
@ -200,7 +200,7 @@ entry:
|
||||||
description: 'Îți pare ciudat articolul?'
|
description: 'Îți pare ciudat articolul?'
|
||||||
edit_title: 'Editează titlul'
|
edit_title: 'Editează titlul'
|
||||||
original_article: 'original'
|
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'
|
created_at: 'Data creării'
|
||||||
new:
|
new:
|
||||||
page_title: 'Salvează un nou articol'
|
page_title: 'Salvează un nou articol'
|
||||||
|
|
|
@ -199,7 +199,7 @@ entry:
|
||||||
description: 'Bu makalede herhangi bir yanlışlık mı var?'
|
description: 'Bu makalede herhangi bir yanlışlık mı var?'
|
||||||
edit_title: 'Başlığı düzenle'
|
edit_title: 'Başlığı düzenle'
|
||||||
original_article: 'orijinal'
|
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'
|
created_at: 'Oluşturulma tarihi'
|
||||||
new:
|
new:
|
||||||
page_title: 'Yeni makaleyi kaydet'
|
page_title: 'Yeni makaleyi kaydet'
|
||||||
|
|
|
@ -54,7 +54,6 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</i>
|
</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>
|
<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">
|
<aside class="tags">
|
||||||
<div class="card-entry-tags">
|
<div class="card-entry-tags">
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{% for tag in tags %}
|
{% 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 %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -30,11 +30,16 @@
|
||||||
<meta property="og:title" content="{{ entry.title | raw }}" />
|
<meta property="og:title" content="{{ entry.title | raw }}" />
|
||||||
<meta property="og:type" content="article" />
|
<meta property="og:type" content="article" />
|
||||||
<meta property="og:url" content="{{ app.request.uri }}" />
|
<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 %}
|
{% if entry.previewPicture is not null %}
|
||||||
<meta property="og:image" content="{{ entry.previewPicture }}" />
|
{% set picturePath = entry.previewPicture %}
|
||||||
{% else %}
|
|
||||||
<meta property="og:image" content="{{ app.request.schemeAndHttpHost }}{{ asset('bundles/wallabagcore/themes/_global/img/logo-other_themes.png') }}" />
|
|
||||||
{% endif %}
|
{% 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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
<div class="card-action">
|
<div class="card-action">
|
||||||
<span class="bold">
|
<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>
|
<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">
|
<ul class="tools right">
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -225,7 +225,7 @@
|
||||||
<a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool">
|
<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>
|
<i class="material-icons link">link</i> <span class="link">{{ entry.domainName|removeWww }}</span>
|
||||||
</a>
|
</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">
|
<div id="list">
|
||||||
{% for tag in entry.tags %}
|
{% for tag in entry.tags %}
|
||||||
<div class="chip">
|
<div class="chip">
|
||||||
|
|
|
@ -6,12 +6,19 @@
|
||||||
<div class="results clearfix">
|
<div class="results clearfix">
|
||||||
<div class="nb-results left">{{ 'tag.list.number_on_the_page'|transchoice(tags|length) }}</div>
|
<div class="nb-results left">{{ 'tag.list.number_on_the_page'|transchoice(tags|length) }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<ul class="row data">
|
|
||||||
|
<div class="row">
|
||||||
|
<ul class="card-tag-labels">
|
||||||
{% for tag in tags %}
|
{% 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>
|
<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 %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a>
|
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
<a class="waves-effect" href="{{ path('howto') }}">{{ 'menu.left.howto'|trans }}</a>
|
<a class="waves-effect" href="{{ path('howto') }}">{{ 'menu.left.howto'|trans }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="bold">
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="nav-wrapper nav-panels">
|
<div class="nav-wrapper nav-panels">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Wallabag\CoreBundle\Controller;
|
namespace Tests\Wallabag\ApiBundle\Controller;
|
||||||
|
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
|
||||||
|
@ -33,6 +33,32 @@ class DeveloperControllerTest extends WallabagCoreTestCase
|
||||||
$this->assertContains('My app', $alert[0]);
|
$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()
|
public function testListingClient()
|
||||||
{
|
{
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
|
@ -561,6 +561,8 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||||
*/
|
*/
|
||||||
public function testDeleteUserTag($tag)
|
public function testDeleteUserTag($tag)
|
||||||
{
|
{
|
||||||
|
$tagName = $tag['label'];
|
||||||
|
|
||||||
$this->client->request('DELETE', '/api/tags/'.$tag['id'].'.json');
|
$this->client->request('DELETE', '/api/tags/'.$tag['id'].'.json');
|
||||||
|
|
||||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||||
|
@ -577,6 +579,13 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||||
->findAllByTagId($this->user->getId(), $tag['id']);
|
->findAllByTagId($this->user->getId(), $tag['id']);
|
||||||
|
|
||||||
$this->assertCount(0, $entries);
|
$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()
|
public function testDeleteTagByLabel()
|
||||||
|
@ -794,6 +803,22 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
||||||
$this->assertEquals(true, $content['exists']);
|
$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()
|
public function testGetEntriesExistsWhichDoesNotExists()
|
||||||
{
|
{
|
||||||
$this->client->request('GET', '/api/entries/exists?url=http://google.com/entry2');
|
$this->client->request('GET', '/api/entries/exists?url=http://google.com/entry2');
|
||||||
|
|
|
@ -341,22 +341,23 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$em = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
|
$content = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository('WallabagCoreBundle:Entry')
|
||||||
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
|
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
|
||||||
|
|
||||||
// empty content
|
// empty content
|
||||||
$content->setContent('');
|
$content->setContent('');
|
||||||
$client->getContainer()->get('doctrine.orm.entity_manager')->persist($content);
|
$em->persist($content);
|
||||||
$client->getContainer()->get('doctrine.orm.entity_manager')->flush();
|
$em->flush();
|
||||||
|
|
||||||
$client->request('GET', '/reload/'.$content->getId());
|
$client->request('GET', '/reload/'.$content->getId());
|
||||||
|
|
||||||
$this->assertEquals(302, $client->getResponse()->getStatusCode());
|
$this->assertEquals(302, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $em
|
||||||
->get('doctrine.orm.entity_manager')
|
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository('WallabagCoreBundle:Entry')
|
||||||
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
|
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
|
||||||
|
|
||||||
|
@ -486,9 +487,11 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
|
$em = $client->getContainer()
|
||||||
|
->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
// add a new content to be removed later
|
// add a new content to be removed later
|
||||||
$user = $client->getContainer()
|
$user = $em
|
||||||
->get('doctrine.orm.entity_manager')
|
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository('WallabagUserBundle:User')
|
||||||
->findOneByUserName('admin');
|
->findOneByUserName('admin');
|
||||||
|
|
||||||
|
@ -502,12 +505,8 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
$content->setArchived(true);
|
$content->setArchived(true);
|
||||||
$content->setLanguage('fr');
|
$content->setLanguage('fr');
|
||||||
|
|
||||||
$client->getContainer()
|
$em->persist($content);
|
||||||
->get('doctrine.orm.entity_manager')
|
$em->flush();
|
||||||
->persist($content);
|
|
||||||
$client->getContainer()
|
|
||||||
->get('doctrine.orm.entity_manager')
|
|
||||||
->flush();
|
|
||||||
|
|
||||||
$client->request('GET', '/view/'.$content->getId());
|
$client->request('GET', '/view/'.$content->getId());
|
||||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
namespace Tests\Wallabag\CoreBundle\Controller;
|
namespace Tests\Wallabag\CoreBundle\Controller;
|
||||||
|
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
use Wallabag\CoreBundle\Entity\Tag;
|
||||||
|
|
||||||
class TagControllerTest extends WallabagCoreTestCase
|
class TagControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -134,36 +135,48 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
$client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId());
|
$client->request('GET', '/remove-tag/'.$entry->getId().'/'.$tag->getId());
|
||||||
|
|
||||||
$this->assertEquals(404, $client->getResponse()->getStatusCode());
|
$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()
|
public function testShowEntriesForTagAction()
|
||||||
{
|
{
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
$em = $client->getContainer()
|
||||||
|
->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
|
$tag = new Tag();
|
||||||
|
$tag->setLabel($this->tagName);
|
||||||
|
|
||||||
$entry = $client->getContainer()
|
$entry = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository('WallabagCoreBundle:Entry')
|
||||||
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getLoggedInUserId());
|
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getLoggedInUserId());
|
||||||
|
|
||||||
$tag = $client->getContainer()
|
$tag->addEntry($entry);
|
||||||
->get('doctrine.orm.entity_manager')
|
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
|
||||||
->findOneByEntryAndTagLabel($entry, 'foo');
|
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/tag/list/'.$tag->getSlug());
|
$em->persist($entry);
|
||||||
|
$em->persist($tag);
|
||||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
$em->flush();
|
||||||
$this->assertCount(2, $crawler->filter('div[class=entry]'));
|
|
||||||
|
|
||||||
$tag = $client->getContainer()
|
$tag = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository('WallabagCoreBundle:Tag')
|
||||||
->findOneByLabel('baz');
|
->findOneByEntryAndTagLabel($entry, $this->tagName);
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/tag/list/'.$tag->getSlug());
|
$crawler = $client->request('GET', '/tag/list/'.$tag->getSlug());
|
||||||
|
|
||||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
$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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,9 +90,7 @@ abstract class WallabagCoreTestCase extends WebTestCase
|
||||||
try {
|
try {
|
||||||
$this->client->getContainer()->get('wallabag_core.redis.client')->connect();
|
$this->client->getContainer()->get('wallabag_core.redis.client')->connect();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->markTestSkipped(
|
$this->markTestSkipped('Redis is not installed/activated');
|
||||||
'Redis is not installed/activated'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
public function testImportChromeWithRedisEnabled()
|
public function testImportChromeWithRedisEnabled()
|
||||||
{
|
{
|
||||||
|
$this->checkRedis();
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
$client->getContainer()->get('craue_config')->set('import_with_redis', 1);
|
$client->getContainer()->get('craue_config')->set('import_with_redis', 1);
|
||||||
|
|
|
@ -54,6 +54,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
public function testImportFirefoxWithRedisEnabled()
|
public function testImportFirefoxWithRedisEnabled()
|
||||||
{
|
{
|
||||||
|
$this->checkRedis();
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
$client->getContainer()->get('craue_config')->set('import_with_redis', 1);
|
$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
Loading…
Reference in a new issue