|
|
|
@ -53,7 +53,6 @@
@@ -53,7 +53,6 @@
|
|
|
|
|
#include "base/utils/bytearray.h" |
|
|
|
|
#include "base/utils/fs.h" |
|
|
|
|
#include "base/utils/misc.h" |
|
|
|
|
#include "base/utils/net.h" |
|
|
|
|
#include "base/utils/random.h" |
|
|
|
|
#include "base/utils/string.h" |
|
|
|
|
#include "api/apierror.h" |
|
|
|
@ -426,9 +425,6 @@ void WebApplication::configure()
@@ -426,9 +425,6 @@ void WebApplication::configure()
|
|
|
|
|
{ |
|
|
|
|
const auto pref = Preferences::instance(); |
|
|
|
|
|
|
|
|
|
m_domainList = pref->getServerDomains().split(';', QString::SkipEmptyParts); |
|
|
|
|
std::for_each(m_domainList.begin(), m_domainList.end(), [](QString &entry) { entry = entry.trimmed(); }); |
|
|
|
|
|
|
|
|
|
const QString rootFolder = Utils::Fs::expandPathAbs( |
|
|
|
|
!pref->isAltWebUiEnabled() ? WWW_FOLDER : pref->getWebUiRootFolder()); |
|
|
|
|
if (rootFolder != m_rootFolder) { |
|
|
|
@ -442,6 +438,13 @@ void WebApplication::configure()
@@ -442,6 +438,13 @@ void WebApplication::configure()
|
|
|
|
|
m_translatedFiles.clear(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
m_isLocalAuthEnabled = pref->isWebUiLocalAuthEnabled(); |
|
|
|
|
m_isAuthSubnetWhitelistEnabled = pref->isWebUiAuthSubnetWhitelistEnabled(); |
|
|
|
|
m_authSubnetWhitelist = pref->getWebUiAuthSubnetWhitelist(); |
|
|
|
|
|
|
|
|
|
m_domainList = pref->getServerDomains().split(';', QString::SkipEmptyParts); |
|
|
|
|
std::for_each(m_domainList.begin(), m_domainList.end(), [](QString &entry) { entry = entry.trimmed(); }); |
|
|
|
|
|
|
|
|
|
m_isClickjackingProtectionEnabled = pref->isWebUiClickjackingProtectionEnabled(); |
|
|
|
|
m_isCSRFProtectionEnabled = pref->isWebUiCSRFProtectionEnabled(); |
|
|
|
|
m_isHttpsEnabled = pref->isWebUiHttpsEnabled(); |
|
|
|
@ -619,11 +622,9 @@ QString WebApplication::generateSid() const
@@ -619,11 +622,9 @@ QString WebApplication::generateSid() const
|
|
|
|
|
|
|
|
|
|
bool WebApplication::isAuthNeeded() |
|
|
|
|
{ |
|
|
|
|
qDebug("Checking auth rules against client address %s", qPrintable(m_env.clientAddress.toString())); |
|
|
|
|
const Preferences *pref = Preferences::instance(); |
|
|
|
|
if (!pref->isWebUiLocalAuthEnabled() && Utils::Net::isLoopbackAddress(m_env.clientAddress)) |
|
|
|
|
if (!m_isLocalAuthEnabled && Utils::Net::isLoopbackAddress(m_env.clientAddress)) |
|
|
|
|
return false; |
|
|
|
|
if (pref->isWebUiAuthSubnetWhitelistEnabled() && Utils::Net::isIPInRange(m_env.clientAddress, pref->getWebUiAuthSubnetWhitelist())) |
|
|
|
|
if (m_isAuthSubnetWhitelistEnabled && Utils::Net::isIPInRange(m_env.clientAddress, m_authSubnetWhitelist)) |
|
|
|
|
return false; |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|