mirror of
https://github.com/simon987/sist2.git
synced 2025-04-22 03:36:48 +00:00
Compare commits
No commits in common. "d8c0b805242459a34253d15a13c03289ec224918" and "dfb8c6749014a29a71f787a8415260018d162a0a" have entirely different histories.
d8c0b80524
...
dfb8c67490
@ -51,7 +51,7 @@ sist2 (Simple incremental search tool)
|
|||||||
1. Download sist2 executable
|
1. Download sist2 executable
|
||||||
1. Download the [latest sist2 release](https://github.com/simon987/sist2/releases) *
|
1. Download the [latest sist2 release](https://github.com/simon987/sist2/releases) *
|
||||||
1. *(or)* Download a [development snapshot](https://files.simon987.net/.gate/sist2/simon987_sist2/) *(Not recommended!)*
|
1. *(or)* Download a [development snapshot](https://files.simon987.net/.gate/sist2/simon987_sist2/) *(Not recommended!)*
|
||||||
1. *(or)* `docker pull simon987/sist2:2.10.2-x64-linux`
|
1. *(or)* `docker pull simon987/sist2:2.10.1-x64-linux`
|
||||||
|
|
||||||
1. See [Usage guide](docs/USAGE.md)
|
1. See [Usage guide](docs/USAGE.md)
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#define EPILOG "Made by simon987 <me@simon987.net>. Released under GPL-3.0"
|
#define EPILOG "Made by simon987 <me@simon987.net>. Released under GPL-3.0"
|
||||||
|
|
||||||
|
|
||||||
static const char *const Version = "2.10.2";
|
static const char *const Version = "2.10.1";
|
||||||
static const char *const usage[] = {
|
static const char *const usage[] = {
|
||||||
"sist2 scan [OPTION]... PATH",
|
"sist2 scan [OPTION]... PATH",
|
||||||
"sist2 index [OPTION]... INDEX",
|
"sist2 index [OPTION]... INDEX",
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<nav class="navbar navbar-expand-lg">
|
<nav class="navbar navbar-expand-lg">
|
||||||
<a class="navbar-brand" href="/">sist2</a>
|
<a class="navbar-brand" href="/">sist2</a>
|
||||||
<span class="badge badge-pill version">2.10.2</span>
|
<span class="badge badge-pill version">2.10.1</span>
|
||||||
<span class="tagline">Lightning-fast file system indexer and search tool </span>
|
<span class="tagline">Lightning-fast file system indexer and search tool </span>
|
||||||
<a class="btn ml-auto" href="stats">Stats</a>
|
<a class="btn ml-auto" href="stats">Stats</a>
|
||||||
<button class="btn" type="button" data-toggle="modal" data-target="#settings" onclick="loadSettings()">Settings
|
<button class="btn" type="button" data-toggle="modal" data-target="#settings" onclick="loadSettings()">Settings
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<nav class="navbar navbar-expand-lg">
|
<nav class="navbar navbar-expand-lg">
|
||||||
<a class="navbar-brand" href="/">sist2</a>
|
<a class="navbar-brand" href="/">sist2</a>
|
||||||
<span class="badge badge-pill version">2.10.2</span>
|
<span class="badge badge-pill version">2.10.1</span>
|
||||||
<span class="tagline">Lightning-fast file system indexer and search tool </span>
|
<span class="tagline">Lightning-fast file system indexer and search tool </span>
|
||||||
<a style="margin-left: auto" class="btn" href="/">Back</a>
|
<a style="margin-left: auto" class="btn" href="/">Back</a>
|
||||||
<button class="btn" type="button" data-toggle="modal" data-target="#settings"
|
<button class="btn" type="button" data-toggle="modal" data-target="#settings"
|
||||||
|
@ -220,10 +220,7 @@ void serve_file_from_url(cJSON *json, index_t *idx, struct mg_connection *nc) {
|
|||||||
dyn_buffer_t encoded = url_escape(url);
|
dyn_buffer_t encoded = url_escape(url);
|
||||||
dyn_buffer_write_char(&encoded, '\0');
|
dyn_buffer_write_char(&encoded, '\0');
|
||||||
|
|
||||||
char location_header[8192];
|
mg_http_reply(nc, 308, "Location: %s", encoded.buf);
|
||||||
snprintf(location_header, sizeof(location_header), "Location: %s\r\n", encoded.buf);
|
|
||||||
|
|
||||||
mg_http_reply(nc, 308, location_header, "");
|
|
||||||
dyn_buffer_destroy(&encoded);
|
dyn_buffer_destroy(&encoded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -534,7 +531,7 @@ int validate_auth(struct mg_connection *nc, struct mg_http_message *hm) {
|
|||||||
|
|
||||||
mg_http_creds(hm, user, sizeof(user), pass, sizeof(pass));
|
mg_http_creds(hm, user, sizeof(user), pass, sizeof(pass));
|
||||||
if (strcmp(user, WebCtx.auth_user) != 0 || strcmp(pass, WebCtx.auth_pass) != 0) {
|
if (strcmp(user, WebCtx.auth_user) != 0 || strcmp(pass, WebCtx.auth_pass) != 0) {
|
||||||
mg_http_reply(nc, 401, "WWW-Authenticate: Basic realm=\"sist2\"\r\n", "");
|
mg_http_reply(nc, 401, "WWW-Authenticate: Basic realm=\"sist2\"", "");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -547,6 +544,7 @@ static void ev_router(struct mg_connection *nc, int ev, void *ev_data, UNUSED(vo
|
|||||||
|
|
||||||
if (WebCtx.auth_enabled == TRUE) {
|
if (WebCtx.auth_enabled == TRUE) {
|
||||||
if (!validate_auth(nc, hm)) {
|
if (!validate_auth(nc, hm)) {
|
||||||
|
nc->is_closing = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -577,6 +575,7 @@ static void ev_router(struct mg_connection *nc, int ev, void *ev_data, UNUSED(vo
|
|||||||
stats_files(nc, hm);
|
stats_files(nc, hm);
|
||||||
} else if (mg_http_match_uri(hm, "/tag/*")) {
|
} else if (mg_http_match_uri(hm, "/tag/*")) {
|
||||||
if (WebCtx.tag_auth_enabled == TRUE && !validate_auth(nc, hm)) {
|
if (WebCtx.tag_auth_enabled == TRUE && !validate_auth(nc, hm)) {
|
||||||
|
nc->is_closing = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tag(nc, hm);
|
tag(nc, hm);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user