From c43d0dcae3686e7627c53565e37bed05bbd14c04 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Mon, 14 Dec 2020 20:09:38 -0500 Subject: [PATCH] Groundwork for filtering rules --- docs/en/030_Supported_Protocols/005_Miniflux.md | 9 ++++++++- sql/MySQL/6.sql | 3 +++ sql/PostgreSQL/6.sql | 3 +++ sql/SQLite3/6.sql | 7 +++++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/en/030_Supported_Protocols/005_Miniflux.md b/docs/en/030_Supported_Protocols/005_Miniflux.md index 84e7d283..b29c0825 100644 --- a/docs/en/030_Supported_Protocols/005_Miniflux.md +++ b/docs/en/030_Supported_Protocols/005_Miniflux.md @@ -10,7 +10,7 @@
API endpoint
/v1/
Specifications
-
API Reference
+
API Reference, Filtering Rules
The Miniflux protocol is a fairly well-designed protocol supporting a wide variety of operations on newsfeeds, folders (termed "categories"), and articles; it also allows for user administration, and native OPML importing and exporting. Architecturally it is similar to the Nextcloud News protocol, but is generally more efficient and has more capabilities. @@ -33,6 +33,13 @@ Miniflux version 2.0.26 is emulated, though not all features are implemented - Only the URL should be considered reliable in feed discovery results - The "All" category is treated specially (see below for details) - Category names consisting only of whitespace are rejected along with the empty string +- Filtering rules may not function identically (see below for details) + +# Behaviour of filtering (block and keep) rules + +The Miniflux documentation gives only a brief example of a pattern for its filtering rules; the allowed syntax is described in full [in Google's documentation for RE2](https://github.com/google/re2/wiki/Syntax). Being a PHP application, The Arsse instead accepts [PCRE syntax](http://www.pcre.org/original/doc/html/pcresyntax.html) (or since PHP 7.3 [PCRE2 syntax](https://www.pcre.org/current/doc/html/pcre2syntax.html)), specifically in UTF-8 mode. Delimiters should not be included, and slashes should not be escaped; anchors may be used if desired. For example `^(?i)RE/MAX$` is a valid pattern. + +For convenience the patterns are tested after collapsing whitespace. Unlike Miniflux, The Arsse tests the patterns against an article's author-supplied categories if they do not match its title. # Special handling of the "All" category diff --git a/sql/MySQL/6.sql b/sql/MySQL/6.sql index 36b2d6e4..9370e274 100644 --- a/sql/MySQL/6.sql +++ b/sql/MySQL/6.sql @@ -6,6 +6,9 @@ alter table arsse_tokens add column data longtext default null; +alter table arsse_subscriptions add column keep_rule longtext default null; +alter table arsse_subscriptions add column block_rule longtext default null; + alter table arsse_users add column num bigint unsigned unique; alter table arsse_users add column admin boolean not null default 0; create temporary table arsse_users_existing( diff --git a/sql/PostgreSQL/6.sql b/sql/PostgreSQL/6.sql index a32eb0c0..f936b87a 100644 --- a/sql/PostgreSQL/6.sql +++ b/sql/PostgreSQL/6.sql @@ -6,6 +6,9 @@ alter table arsse_tokens add column data text default null; +alter table arsse_subscriptions add column keep_rule text default null; +alter table arsse_subscriptions add column block_rule text default null; + alter table arsse_users add column num bigint unique; alter table arsse_users add column admin smallint not null default 0; create temp table arsse_users_existing( diff --git a/sql/SQLite3/6.sql b/sql/SQLite3/6.sql index 81e9e821..752c0568 100644 --- a/sql/SQLite3/6.sql +++ b/sql/SQLite3/6.sql @@ -6,8 +6,11 @@ -- This is a speculative addition to support OAuth login in the future alter table arsse_tokens add column data text default null; --- Add num and admin columns to the users table --- In particular this adds a numeric identifier for each user, which Miniflux requires +-- Add columns to subscriptions to store "keep" and "block" filtering rules from Miniflux +alter table arsse_subscriptions add column keep_rule text default null; +alter table arsse_subscriptions add column block_rule text default null; + +-- Add numeric identifier and admin columns to the users table create table arsse_users_new( -- users id text primary key not null collate nocase, -- user id