Browse Source

mergerfs_webui.cpp

webui
Antonio SJ Musumeci 2 days ago
parent
commit
4eeb33464c
  1. 7
      index.html
  2. 48
      src/mergerfs_webui.cpp

7
index.html

@ -1237,13 +1237,6 @@
</div>
</div>
</div>
<div class="help-text" style="margin-top: 20px;">
<strong>Commands:</strong><br>
• GC: Comprehensive cleanup of internal caches and resources<br>
• Quick GC: Lightweight cleanup that runs automatically every ~15 minutes<br>
• Invalidate: Forces FUSE to release cached file information (use for debugging)
</div>
</div>
</main>

48
src/mergerfs_webui.cpp

@ -412,6 +412,30 @@ _execute_command(const httplib::Request &req_,
}
}
static
bool
_check_auth(const httplib::Request &req_)
{
if (g_password.empty())
{
return true;
}
std::string auth_header = req_.get_header_value("Authorization");
if (auth_header.empty())
{
return false;
}
if (auth_header.substr(0, 7) == "Bearer ")
{
std::string token = auth_header.substr(7);
return _validate_password(token);
}
return false;
}
static
void
_post_kvs_key(const httplib::Request &req_,
@ -518,30 +542,6 @@ _post_auth_verify(const httplib::Request &req_,
}
}
static
bool
_check_auth(const httplib::Request &req_)
{
if (g_password.empty())
{
return true;
}
std::string auth_header = req_.get_header_value("Authorization");
if (auth_header.empty())
{
return false;
}
if (auth_header.substr(0, 7) == "Bearer ")
{
std::string token = auth_header.substr(7);
return _validate_password(token);
}
return false;
}
int
mergerfs::webui::main(const int argc_,
char **argv_)

Loading…
Cancel
Save