Increased whitelist to 1024 entries. Bound checking on loading. Updated README with new config

This commit is contained in:
matcap 2021-05-11 22:58:34 +02:00
parent 2a2e4b7f15
commit c05d000c00
2 changed files with 4 additions and 2 deletions

View File

@ -37,6 +37,7 @@ server {
js_challenge_html /path/to/body.html;
js_challenge_bucket_duration 3600;
js_challenge_title "Verifying your browser...";
js_challenge_whitelist /path/to/whitelist/file.conf;
location /static {
js_challenge off;
@ -57,6 +58,7 @@ server {
* `js_challenge_html "/path/to/file.html"` Path to html file to be inserted in the `<body>` tag of the interstitial page
* `js_challenge_title "title"` Will be inserted in the `<title>` tag of the interstitial page. DEFAULT: "Verifying your browser..."
* `js_challenge_bucket_duration time` Interval to prompt js challenge, in seconds. DEFAULT: 3600
* `js_challenge_whitelist "/path/to/whitelist/file.conf"` Path to conf file containing whitelisted hosts and networks
### Installation

View File

@ -27,7 +27,7 @@
#define DEFAULT_TITLE "Verifying your browser..."
#define WHITELIST_MAX_LENGTH 256
#define WHITELIST_MAX_LENGTH 1024
typedef struct {
@ -219,7 +219,7 @@ static size_t load_whitelist( const char* file, network_info_t* list, size_t max
}
} while ((token = strtok(NULL, ";")) != NULL);
} while (len < WHITELIST_MAX_LENGTH && ((token = strtok(NULL, ";")) != NULL));
}
free(linebuf);