From 7f5d560baeebf210785418e88babe7c9cc3b4d4a Mon Sep 17 00:00:00 2001 From: Felisp Date: Tue, 13 Aug 2024 03:12:43 +0200 Subject: [PATCH] Added documented default config --- res/ExampleConfig-documented.edn | 47 ++++++++++++++++++++++++++++++++ res/ExampleConfig.edn | 34 ----------------------- 2 files changed, 47 insertions(+), 34 deletions(-) create mode 100644 res/ExampleConfig-documented.edn delete mode 100644 res/ExampleConfig.edn diff --git a/res/ExampleConfig-documented.edn b/res/ExampleConfig-documented.edn new file mode 100644 index 0000000..87d2a8f --- /dev/null +++ b/res/ExampleConfig-documented.edn @@ -0,0 +1,47 @@ +{:port 6969 ;Port to listen on + :default-board "/mlp/" ;Board to be used when no board=x param given + ;; Message displayed when requested board is not enabled + :board-disabled-message "This board is not enabled for feed generation.\n\nYou can contact me here: [contact]" + ;; :enable-board-listing true ;Whether to show list of enabled boards in /boards UNIMPLEMENTED + + ;; This map defines default values for all enabled boards, if you wish for some board + ;; to use different values, specify them bellow in :borads-enabled + :boards-defaults { + ;; After how many seconds get fresh catalog.json from :target + :refresh-rate 300 + ;; Page from which to start indexing threads, threads on pages with lower + ;; numbers will not be detectable by the feed watcher + :starting-page 7 + ;; Default ChOD to use if none is specified by the user + :default-chod 94 + ;; If you want to do some preprocessing beforehand, you can override + ;; Target URL for the board, but the response must be same the 4chan API would return + ;; /$board/catalog.json will be appended to this link + :target "https://api.4chan.org" + ;; Commented parts bellow are still unimplemented + ;; ------ + ;; Only download catalog when someone requests feed and cache is old + ;; Saves requests to 4chan, usefull for boards that are checked rarely + ;; Generally the better option, first request in taken in :refresh-rate may take longer + ;; Currently the only option + :lazy-load true + ;; Whether to allow regex search thru the threads (&qr= param) UNIMPLEMENTED + ;; :regex-enable true + ;; Wheter to create cache by downloading whole catalog or every required + ;; page one by one UNIMPLEMENTED + ;; :request-type [:catalog] :pages + } + ;; List of all boards that are enabled for feed generation + ;; Yes they must be all listed manualy for now + ;; Each such board must have map of altered config options if aplicable + ;; otherwise empty one must be provided + :boards-enabled {"/mlp/" {} ;; Empty override map means that defaults are used + ;; This means that board "/g/" will have :starting-page set to 7 but all + ;; the other config options are copied from :board-defaults + "/g/" {:starting-page 7} + "/po/" {:starting-page 8 + :refresh-rate 86400} ;1 day + "/p/" {:starting-page 8 + :refresh-rate 1800} ;30 min + } +} diff --git a/res/ExampleConfig.edn b/res/ExampleConfig.edn deleted file mode 100644 index 7ed8364..0000000 --- a/res/ExampleConfig.edn +++ /dev/null @@ -1,34 +0,0 @@ -;; :board-defaults is default config for every board and can be -;; overriden for every board -{:port 6969 - :default-board "/mlp/" ;Board to be used when no board=x param given - :board-disabled-message "This board is not enabled for feed generation.\n\nYou can contact me here: [contact]" - :enable-board-listing true ;Whether to show list of enabled boards in /boards - :boards-defaults {:refresh-rate 300 ;how often new data should be downloaded in seconds - :starting-page 7 - :default-chod 94 - ;; If you want to do some preprocessing beforehand, you can override - ;; Target URL for the board, but the response must be same 4chan API would return - ;; /$board/catalog.json will be appended to this link - :target "https://api.4chan.org" - ;; Commented parts bellow are still unimplemented - ;; Only download catalog when someone requests feed and cache is old - ;; Saves request to 4chan, usefull for borads that are checked rarely - ;; Generally the better option, first request in :refresh-rate may take longer - :lazy-load true - ;; Whether to allow regex search thru the threads (&qr= param) - ;; :regex-enable true - ;; Wheter to create cache by downloading whole catalog or every required - ;; one by one - ;; :request-type [:catalog] :pages - } - ;; List of all boards that are enabled for feed generation - ;; Yes they must be all listed manualy for now - :boards-enabled {"/mlp/" {} ;; Empty override map means that defaults are used - "/g/" {} - "/po/" {} - "/p/" {:starting-page 8 - :refresh-rate 1800} ;30 min - } - ;; When user requests board that is not enabled, this message is returned - }