Commit Graph

106 Commits

Author SHA1 Message Date
Alexandre Alapetite
6a643d180e Fix CLI install for SQLite (#2648)
One forgotten condition. Related to
https://github.com/FreshRSS/FreshRSS/pull/2646 and
https://github.com/FreshRSS/FreshRSS/pull/2635
2019-11-09 01:47:58 +01:00
Alexandre Alapetite
f1d1d46651 Fix CLI bug regarding an empty user (#2646)
Fix https://github.com/FreshRSS/FreshRSS/issues/2644
2019-11-08 23:11:35 +01:00
Alexandre Alapetite
22030155f8 Fix database autocreate at install (#2635)
* Fix database autocreate at install

Several bugs prevented the auto-creation of the database in Web and CLI
installs.
Fix
https://github.com/YunoHost-Apps/freshrss_ynh/issues/84#issuecomment-549818408

* initDb

https://github.com/FreshRSS/FreshRSS/pull/2635#discussion_r343107795
2019-11-06 15:16:00 +01:00
Alexis Degrugillier
cc0db9af4f Feature/new archiving (#2335)
* Change archiving config page layout

I've changed some wording and moved actions into a
maintenance section.

* Update purge action

Now we have more control on the purge action. The configuration allows
us to choose what to keep and what to discard in a more precise way.
At the moment, the configuration applies for all feeds.

* Add purge configuration on feed level

Now the extend purge configuration is available on feed level.
It is stored as attributes and will be used in the purge action.

* Update purge action

Now the purge action uses the feed configuration if it exists and
defaults on user configuration if not.

* Add empty option in period list

* Fix configuration warnings

* Add archiving configuration on categories

See #2369

* Add user info back

* Add explanations in UI

* Fixes for SQLite + error + misc.

* Fix invalid feed reference

* Short array syntax

Only for new code, so far

* Fix prefix error

* Query performance, default values

Work in progress

* Fix default values and confirm before leaving

Form cancel and confirm changes before leaving were broken.
And start taking advantage of the short echo syntax `<?= ?>` as we have
moved to PHP 5.4+

* More work

* Tuning SQL

* Fix MariaDB + performance issue

* SQL performance

* Fix SQLite bug

* Fix some attributes JSON encoding bugs

Especially for SQLite export/import

* More uniform, fix bugs

More uniform between global, category, feed settings

* Drop special cases for old articles during refresh

Instead will use lastSeen date with the new archiving logic.
This was generating problems anyway
https://github.com/FreshRSS/FreshRSS/issues/2154

* Draft drop index keep_history

Not needed anymore

* MySQL typo

Now properly tested with MySQL, PostgreSQL, SQLite

* More work for legacy values

Important to avoid overriding user's preference and risking deleting
data erroneously

* Fix PHP 7.3 / 7.4 warnings

@aledeg "Trying to use values of type null, bool, int, float or resource
as an array (such as $null["key"]) will now generate a notice. "
https://php.net/migration74.incompatible

* Reintroduce min articles and take care of legacy parameters

* A few changes forgotten

* Draft of migration + DROP of feed.keep_history

* Fix several errors

And give up using const for SQL to allow multiple database types (and we
cannot redefine a const)

* Add keep_min to categories + factorise archiving logic

* Legacy fix

* Fix bug yield from

* Minor: Use JSON_UNESCAPED_SLASHE for attributes

And make more uniform

* Fix sign and missing variable

* Fine tune the logic
2019-10-23 00:52:15 +02:00
Alexandre Alapetite
37b52b7361 Trim whitespace (#2544) 2019-10-01 18:12:21 +02:00
Alexandre Alapetite
e3e5954394 PDO refactoring for code simplification (#2522)
* PDO refactor

* Automatic prefix when using the syntax `_tableName`
* Uniformity: MySQL is now PDO::ATTR_EMULATE_PREPARES = false just like SQLite and PostgreSQL, with consequences such as only one statement per query
* Use PDO methods exec(), query(), prepare() + execute() in a more efficient way
* Remove auto-update SQL code for versions older than FreshRSS 1.5 (3 years old)
* The name of the default category is set in PHP instead of in the DB (simplies SQL and allows changing the name according to the FreshRSS language)
* Rename `->bd` to `->pdo` (less of a frenshism, and more informative)
* Fix some requests, which were not compatible with MySQL prepared statements

* Whitespace

* Fix syntax for PostgreSQL sequences

+ MySQL install

* Minor formatting

* Fix lastInsertId for PostgreSQL

* Use PHP 5.6+ const

Take advantage of https://github.com/FreshRSS/FreshRSS/pull/2527
https://www.php.net/manual/en/migration56.new-features.php

* A bit of forgotten PHP 5.6 simplification for cURL

* Forgotten $s

* Mini fix custom user config

https://github.com/FreshRSS/FreshRSS/pull/2490/files#r326290346

* More work on install.php but not finished

* install.php working

* More cleaning of PDO in install

* Even more simplification

Take advantage of PDO->exec() to run multiple statements

* Disallow changing the name of the default category

https://github.com/FreshRSS/FreshRSS/pull/2522#discussion_r326967724
2019-09-29 16:22:50 +02:00
Alexandre Alapetite
c76a318193 CLI to export/import any database to/from SQLite (#2496)
* CLI to export/import any database to/from SQLite

Require PHP 5.5+ https://github.com/FreshRSS/FreshRSS/pull/2495

* Travis

* Execution rights

* Fix wrong static fields

* Fix MySQL bad default buffering

https://stackoverflow.com/questions/6895098/pdo-mysql-memory-consumption-with-large-result-set/6935271#6935271
https://php.net/manual/ref.pdo-mysql

* Fix count on progression

* Avoid static DB information

To ease working with two DBs at the same time

* Less static, simplify

Needs some testing

* Small corrections

* Special case for SQLite to SQLite

* Modify special case for SQLite

* Remove special case for SQLite

More uniform logic for the 3 databases.
Fix wrong DROP TABLE for SQLite.

* Drop indexes

* Revert "Drop indexes"

This reverts commit f28d2bae09.

* Fix deletion

* Fix classic export

* Update cli/README.md

Co-Authored-By: Marien Fressinaud <dev@marienfressinaud.fr>

* Addressing part of review

* Remove goto 😢

* Travis

* Comment for SQLite case

* Fix missing fields when inserting
2019-09-15 21:36:53 +02:00
wtoscer
5f4daa9c63 Add lemmy share (#2510) 2019-08-29 17:25:04 +02:00
Marien Fressinaud
75632e70f0 Provide email address verification feature (#2481)
* Add an email field to the profile page

I reuse the `mail_login` from the configuration. I'm not sure if it's
useful today (I would say it was used when Persona login was available).

A good improvement would be to rename `mail_login` into `email` so it
would be more intuitive to use.

* Add boolean to the conf to force email validation

This commit only adds a configuration item.

* Add email during registration if email must be validated

* Set email token to validate when email changes

* Block access to FreshRSS if email is not validated

* Send email when address is changed

* Allow to resend the validation email

* Allow the user to change its email while blocked

* Document the email validation feature

* fixup! Allow the user to change its email while blocked

* tec: Autoload PHPMailer lib

* Validate email address format

* Add feedback on validation email resend action

* Allow to logout when user is blocked

* fix: Change default email "from"

* Reorganize i18n keys

* Complete all the locales with default english

* Hide sidebar (profile page) if email is not validated

* Check email requirements on registration

* Allow admin to specify email when creating users

* Don't check email format if value is empty

* Remove trailing comma in userController

Co-Authored-By: Alexandre Alapetite <alexandre@alapetite.fr>

* Set PHPMailer validator to html5 before sending email

* fixup! Remove trailing comma in userController
2019-08-29 12:02:05 +02:00
Frans de Jonge
0ec7f53153 [i18n] Finish Dutch translation (#2503)
Add a couple of new strings, minor grammar and style improvements, and ignore everything that should be ignored for 100 %.
2019-08-21 09:27:32 +02:00
Tibor Repček
520676893f [i18n] Slovak (slovenčina) - added new language (#2497) 2019-08-20 21:20:57 +02:00
Marien Fressinaud
c82aff177e fix: Generate correct htaccess in cli/prepare (#2480)
Bug introduced in https://github.com/FreshRSS/FreshRSS/pull/2461
2019-08-14 15:25:28 +02:00
koocotte
f5fbc0c7f0 Patch for #2460: Run on Apache 2.4+ without mod_access_compat (#2461)
* Update .htaccess

* Update htaccess for apache2.4

* Update htaccess for apache2.4

* Update htaccess for apache2.4
2019-07-31 13:48:06 +02:00
Gaurav Thakur
e99e4353d4 Remove Google+ support as it is dead. (#2464) 2019-07-30 16:34:04 +02:00
Leepic
48ad3059e4 Adding a note about cron and stderr informations (#2457)
Avoid cron sending email in case of success command
2019-07-23 09:34:42 +02:00
Alexis Degrugillier
8be28399ef Fix quote escaping on CLI (#2355)
for translation manipulations
2019-04-07 10:14:51 +02:00
Alexis Degrugillier
f2925594c7 Add header to cli (#2296)
* Add header to cli

Now there is a switch to display the header on user info.
While doing that, I've changed how the command is working to display
all users by default and to accept more than one user at once.
I also changed the display to make it more pleasing.

As this command displays all users by default. I wonder if we still
need the list user command.

See #2294

* Minor format
2019-03-23 23:17:22 +01:00
Alexandre Alapetite
e7a57915f9 CLI user-info fixes (#2292)
* CLI missing exit codes

https://github.com/FreshRSS/FreshRSS/issues/2291

* CLI catch for outdated databases

https://github.com/FreshRSS/FreshRSS/issues/2291#issuecomment-475856890
2019-03-23 12:08:35 +01:00
Alexis Degrugillier
71b4226dc7 Add an option validation on cli commands (#2278)
If an option used on cli is not recognized, the command
aborts and displays an error message.
If the typed option is similar to one of the recognized
options, a hint is displayed.

At the moment, there is a limitation on long options.
Short options are not validated at the moment.

See #2046
2019-03-19 20:27:06 +01:00
hoilc
e6888bbf23 update zh-cn (i18n) (#2280) 2019-03-18 10:55:50 +01:00
Seokseong Jeon
3b3accf6ce i18n Korean (#2242) 2019-02-05 15:05:40 +01:00
Alexandre Alapetite
743c1b740b Export labels (#2217)
* Export labels

https://github.com/FreshRSS/FreshRSS/issues/2196

* Small fixes

* Backport code from 1.14.0

4888f919f1

* More fixes
2019-01-16 22:26:43 +01:00
Alexandre Alapetite
802c264574 Copy syslog to STDERR (#2208)
* Use openlog before syslog
In order to have a copy on stderr when syslog is not available.

* Take advantage of syslog for actualization
Pipe cron job STDERR and syslog to Docker log
Cf. 00bd467655
2019-01-06 00:46:48 +01:00
Alexandre Alapetite
512d047f02 Update naming to WebSub (#2184)
Instead of PubSubHubbub / PuSH
2018-12-16 17:02:03 +01:00
Quentí
396c714df9 [i18n] Add the Occitan locale (#2110)
* Create oc.php

L27 : ajout de l’occitan

* Create admin.php

* Create conf.php

* Create feedback.php

* Create gen.php

* Create index.php

* Create install.php

* Create sub.php

* Delete conf.php

* Create conf.php

* Update gen.php

* Update gen.php

* Update gen.php

* Update gen.php

* Update gen.php

* Update gen.php

* Update gen.php

* Update gen.php

* Update gen.php

* Update gen.php

* Update gen.php

* Update gen.php

* Update gen.php

* Update gen.php

* Update oc.php

* Update admin.php

* Update conf.php

* Update feedback.php

* Update gen.php

* Update index.php

* Update install.php

* Update sub.php

* Update oc.php
2018-11-04 13:46:08 +01:00
Alexandre Alapetite
8ee8a573f1 Custom labels (#2027)
* First draft of custom tags

https://github.com/FreshRSS/FreshRSS/issues/928
https://github.com/FreshRSS/FreshRSS/issues/1367

* SMALLINT to BIGINT for id_entry

And uppercase SQL types

* Fix layout for unreads

* Start UI menu

* Change menu order

* Clean database helpers

https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r217971535

* Travis rules do not understand PostgreSQL constants

Grrr

* Tag controller + UI

* Add column attributes to tags

* Use only favicon for now, for label

* Fix styling for different themes

* Constant for maximum InnoDB index length in Unicode

https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r219052200
(I would have personnally prefered keeping the readability of a real
value instead of a constant, in this case of many SQL fields)

* Use FreshRSS_Factory::createCategoryDao

* Add view of all articles containing any tag

* Fix search in tags

* Mark as read tags

* Partial auto-update unread tags

* More auto update tag unreads

* Add tag deletion

* Do not purge tagged articles

* Minor comment

* Fix SQLite and UI bug

* Google Reader API support for user tags

Add SQL check that tag names must be distinct from category names

* whitespace

* Add missing API for EasyRSS

* Compatibility SQLite

Problematic parentheses

* Add SQL DISTINCT for cases with multiple tags

* Fix for PostgreSQL

PostgreSQL needs some additional type hint to avoid "could not determine
data type of parameter $1"

http://www.postgresql-archive.org/Could-not-determine-data-type-of-parameter-1-tp2171092p2171094.html
2018-09-29 20:47:17 +02:00
Alexandre Alapetite
aafb1cd0e4 Better test if server has public address (#2010)
* Better test if server has public address

* Wrong trailing slash in documentation
2018-09-09 00:50:24 +02:00
Alexandre Alapetite
58fb9ea5b3 Fix CLI no_default_feeds (#1900)
* Fix CLI no_default_feeds

The option was not working anymore

* Changelog 1900

https://github.com/FreshRSS/FreshRSS/pull/1900
2018-05-28 22:14:10 +02:00
Kevin Papst
8f1bad60d0 Add Fever API and user documentation (#1836)
* added fever api and documentation

* spaces to tabs

* fixed code format

* added links

* added utf8 to header

* removed XML support

* removed before check, as we have to convert it afterwards

* added sandboxed setting (currently disabled)
added support for extensions using entry_before_display

* listFeedsOrderUpdate LIMIT

https://github.com/FreshRSS/FreshRSS/pull/1836/files#r175287881

* removed custom sql by using FreshRSS_FeedDAO::listFeedsOrderUpdate()

* fixed mark all as read

* replaced custom sql for getUnread() and getStarred() with dao functions

* removed sanitization functions

* Rework fever login

* Fix config bug

Plus documentation

* Fix array syntax

For compatibility with PHP 5.3

* Disable cookies and session for API

* Fix currentUser

* added response header and error log

* adjusted phpdoc to match new authentication

* Mechanism to delete old keys

* replace PHP_INT_MAX with zero to disable limit

* replace method_exists with check for explicit methods

* removed Press support and smaller refactoring + updated docu

* Rewrite bindParamArray

Avoid one of the SQL injection risks

* Docs and readme

* Fix API link

* Simplify reverse key check

Using userConfig
2018-05-24 21:53:47 +02:00
Alexis Degrugillier
a891df3283 Merge pull request #1829 from aledeg/improve-i18n-tools
Improve i18n tools
2018-03-12 23:37:26 +01:00
Alexandre Alapetite
ebfb170b14 Minor docs 2018-03-12 21:24:24 +01:00
Alexis Degrugillier
f4da012940 Add option to ignore keys in cli tool 2018-03-11 10:53:32 +01:00
Alexis Degrugillier
2f98978f6d Improve error catching 2018-03-10 16:32:35 +01:00
Alexis Degrugillier
948b44ee1e Change code to be more robust
The code doesn't rely on positionnal arguments anymore. It uses options.
I've added some check to validate that the action performed are configured
properly.
2018-03-10 16:23:00 +01:00
Alexis Degrugillier
67c173f79b Add new tools to manipulate translations (#1818)
I've added a tool to add a new translation for a specific key and language.
I've added a tool to format the i18n files.

This is one of the steps to improve the translation process.
2018-03-04 14:41:40 +01:00
Alexandre Alapetite
71918dbc5a New Docker (#1813)
* Draft of new Docker

Based on Alpine Linux. Size ~78MB.
https://github.com/FreshRSS/docker-freshrss/issues/4
https://github.com/FreshRSS/FreshRSS/issues/520
https://github.com/FreshRSS/docker-freshrss
https://github.com/FreshRSS/docker-freshrss-production

* Docker readme

* +x execution rights prepare

* Docker readme links to hub.docker.com

https://hub.docker.com/r/freshrss/freshrss/
2018-03-04 01:02:02 +01:00
Alexis Degrugillier
a2312a608a Improve translating tools (#1808)
To ease the use of the translating tools, I've added a formatting method to
keep the output files identicals. This will reduce the amount of time needed
to handle translations.
2018-03-03 10:26:54 +01:00
Alexis Degrugillier
ac3e38359b Allow admin user to reset passwords (#1765)
See #960
2018-02-14 22:15:34 +01:00
Seokseong Jeon
fb541b1bac [i18n] Translated to Korean (#1776) 2018-01-31 10:06:45 +01:00
hoilc
b285a83c65 [i18n] Add ignore/zh-cn and update simplified Chinese translation (#1769)
* update Simplified Chinese translation

* update the description of buttons #1766

* trim space to pass PHPCS
2018-01-16 17:41:49 +01:00
Frans de Jonge
568eccd3a8 [i18n] Add translation ignore/nl (#1752) 2017-12-25 22:48:21 +01:00
Jan
f172bee12d Fixes link to the "update guidelines" (#1740) 2017-12-19 18:40:48 +01:00
Alexandre Alapetite
52d0988655 Use __DIR__ for relative include and require
For uniformity, and to avoid having PHP searching in include_path.
http://php.net/manual/function.include.php
https://github.com/FreshRSS/FreshRSS/pull/1715
https://github.com/FreshRSS/FreshRSS/pull/1711#issuecomment-350581350
2017-12-11 21:11:34 +01:00
Kevin Papst
5c52d9b34b Check requirement in CLI script (#1711)
* check requirements in actualize_script before executing, fixes #1710

* removed empty whiteline

* testing all requirements

* incorporated code review feedback

* removed code that is already executed in _cli.php

* added newline at eof

* fixed include problems

* fixed include problems
2017-12-10 22:09:54 +01:00
Kevin Papst
b562639155 Documentation updates (#1697)
* added documentation about updating FreshRSS
moved Installation to admin directory
linked some already existing documentation files
2017-12-02 13:43:28 +01:00
Alexis Degrugillier
05b1901fcd Move translation tools into the cli folder (#1673)
Translation tools must be used on cli. It is better to have them in the cli folder.
2017-11-04 21:17:08 +01:00
Alexandre Alapetite
f632a34626 CLI optimize database (#1663)
CLI optimize database https://github.com/FreshRSS/FreshRSS/issues/1583
And VACUUM in SQLite https://github.com/FreshRSS/FreshRSS/issues/918
Add VACUUM for PostgreSQL (Not tested yet)
2017-10-12 20:11:06 +02:00
Frans de Jonge
4e174ed9dd [ci] Add Travis (#1619)
* [ci] Add Travis

* Exclude some libs

* Semi-auto whitespace fixes

* line length in SQLite

* Exclude tests from line length

* Feed.php line length

* Feed.php: get rid of unnecessary concat

* Feed.php: line length

* bootstrap.php: no newline at end of file

* Allow concatenating across multiple lines

* Add Travis badge

* do-install line length

* update-or-create-user line length

* cli/create-user line length

* tests/app/Models/SearchTest.php fix indentation

* tests/app/Models/UserQueryTest.php fix indentation

* tests/app/Models/CategoryTest.php fix indentation

* [fix] PHP 5.3 on precise

* cli/do-install no spaces

* cli/list-users line length

* cli/reconfigure line length

* empty catch statements

* api/index line length nonsense

* spaces before semicolon

* app/Models/EntryDAO bunch of indentation

* extra blank lines

* spaces before comma in function call

* testing tabwidth

* increase to 10

* comment out tabwidth line

* try older phpcs version 3.0.0RC4

* line length exception for app/install.php

* proper spaces

* stray spaces in i18n

* Minz/ModelPdo line length

* Minz whitespace

* greader line length

* greader elseif placement

* app/Models/Feed.php spacing in function argument

* ignore php 5.3

* app/Models/ConfigurationSetter.php stray whitespace

* EntryDAOSQLite line length

* I vote for higher max line length =P

* ignore SQL

* remove classname complaint

* line length/more legible SQL

* ignore line length nonsense

* greader line length

* feedController issues

* uppercase TRUE, FALSE, NULL

* revert

* importExportController lowercase null

* Share.php default value not necessary because ! is_array () a few lines down

* CategoryDAO constants should be UPPERCASE

* EntryDAO reduce line length

* contentious autofix

* Allow failures on all versions of PHP except 7.1 because reasons
2017-09-22 12:13:46 +02:00
Alexandre Alapetite
d0281a9f35 typo update-or-create-user 2017-08-19 16:19:03 +02:00
Alexandre Alapetite
5d4e4a8dd0 Fix script name in usage 2017-08-05 23:10:02 +02:00