From c91f1830ed4f2947d04d14a60b537571fed4d92f Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Wed, 13 May 2020 23:28:47 +0200 Subject: [PATCH] update from master --- bundles/Config.java | 5 +- library/BasicLibrary.java | 6 +- library/RemoteLibrary.java | 13 +- library/RemoteLibraryServer.java | 167 +++-- library/WebLibrary.java | 40 +- library/WebLibraryServer.java | 1072 ++++-------------------------- library/WebLibraryUrls.java | 67 ++ 7 files changed, 321 insertions(+), 1049 deletions(-) create mode 100644 library/WebLibraryUrls.java diff --git a/bundles/Config.java b/bundles/Config.java index c96ed22a..86744b45 100644 --- a/bundles/Config.java +++ b/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/library/BasicLibrary.java b/library/BasicLibrary.java index 78f0f620..af7920bf 100644 --- a/library/BasicLibrary.java +++ b/library/BasicLibrary.java @@ -41,11 +41,11 @@ abstract public class BasicLibrary { READ_WRITE, /** The library is ready, but read-only. */ READ_ONLY, - /** The library is invalid (not correctly set up). */ - INVALID, /** You are not allowed to access this library. */ UNAUTHORIZED, - /** The library is currently out of commission. */ + /** The library is invalid, and will never work as is. */ + INVALID, + /** The library is currently out of commission, but may work later. */ UNAVAILABLE; /** diff --git a/library/RemoteLibrary.java b/library/RemoteLibrary.java index 9fa8c661..3a60e02c 100644 --- a/library/RemoteLibrary.java +++ b/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: *