From d11fb35b34e44744c8b1f9226321f133af4eb151 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Wed, 13 May 2020 19:12:50 +0200 Subject: [PATCH] add blacklist support --- src/be/nikiroo/fanfix/bundles/Config.java | 5 +- .../nikiroo/fanfix/library/RemoteLibrary.java | 10 +- .../fanfix/library/RemoteLibraryServer.java | 167 +++++++++++------- .../fanfix/library/WebLibraryServer.java | 161 +++++++++-------- 4 files changed, 194 insertions(+), 149 deletions(-) diff --git a/src/be/nikiroo/fanfix/bundles/Config.java b/src/be/nikiroo/fanfix/bundles/Config.java index c96ed22a..86744b45 100644 --- a/src/be/nikiroo/fanfix/bundles/Config.java +++ b/src/be/nikiroo/fanfix/bundles/Config.java @@ -102,9 +102,12 @@ public enum Config { @Meta(description = "Allow write access to the clients (download story, move story...) without RW subkeys", // format = Format.BOOLEAN, def = "true") SERVER_RW, // - @Meta(description = "If not empty, only the EXACT listed sources will be available for clients without BL subkeys",// + @Meta(description = "If not empty, only the EXACT listed sources will be available for clients without a WL subkey",// array = true, format = Format.STRING, def = "") SERVER_WHITELIST, // + @Meta(description = "Those sources will not be available for clients without a BL subkey",// + array = true, format = Format.STRING, def = "") + SERVER_BLACKLIST, // @Meta(description = "The subkeys that the server will allow, including the modes\nA subkey is used as a login for HTTP (clear text protocol) and HTTPS modes", // array = true, format = Format.STRING, def = "") SERVER_ALLOWED_SUBKEYS, // diff --git a/src/be/nikiroo/fanfix/library/RemoteLibrary.java b/src/be/nikiroo/fanfix/library/RemoteLibrary.java index 9fa8c661..83bb2124 100644 --- a/src/be/nikiroo/fanfix/library/RemoteLibrary.java +++ b/src/be/nikiroo/fanfix/library/RemoteLibrary.java @@ -62,7 +62,7 @@ public class RemoteLibrary extends BasicLibrary { * Create a {@link RemoteLibrary} linked to the given server. *

* Note that the key is structured: - * xxx(|yyy|wl)(|rw) + * xxx(|yyy(|wl)(|bl)(|rw) *

* Note that anything before the first pipe (|) character is * considered to be the encryption key, anything after that character is @@ -77,16 +77,16 @@ public class RemoteLibrary extends BasicLibrary { *

  • yyy: the secondary key
  • *
  • rw: flag to allow read and write access if it is not the * default on this server
  • - *
  • wl: flag to allow access to all the stories (bypassing the - * whitelist if it exists)
  • + *
  • bl: flag to bypass the blacklist (if it exists)
  • + *
  • wl: flag to bypass the whitelist if it exists
  • * *

    * Some examples: *