mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-21 05:50:18 +08:00
Added 'Webserver.Security.Disable_authentication' setting.
This is a feature flag to not have authentication even when https has been enabled. Affects issues: - Close #1264
This commit is contained in:
parent
c6416254e9
commit
380f848f62
@ -137,8 +137,10 @@ public class WebServer implements SubSystem {
|
||||
logger.log(L.INFO_COLOR, "§e" + locale.getString(PluginLang.WEB_SERVER_NOTIFY_HTTP_USER_AUTH));
|
||||
server = HttpServer.create(new InetSocketAddress(config.get(WebserverSettings.INTERNAL_IP), port), 10);
|
||||
} else if (server == null) {
|
||||
logger.log(L.INFO_COLOR, "§eWebServer: Proxy HTTPS Override enabled. HTTP Server in use, make sure that your Proxy webserver is routing with HTTPS and AlternativeIP.Link points to the Proxy");
|
||||
logger.log(L.INFO_COLOR, "§e" + locale.getString(PluginLang.WEB_SERVER_NOTIFY_USING_PROXY_MODE));
|
||||
server = HttpServer.create(new InetSocketAddress(config.get(WebserverSettings.INTERNAL_IP), port), 10);
|
||||
} else if (config.isTrue(WebserverSettings.DISABLED_AUTHENTICATION)) {
|
||||
logger.info(locale.getString(PluginLang.WEB_SERVER_NOTIFY_HTTPS_USER_AUTH));
|
||||
}
|
||||
server.createContext("/", requestHandler);
|
||||
|
||||
@ -295,7 +297,7 @@ public class WebServer implements SubSystem {
|
||||
}
|
||||
|
||||
public boolean isAuthRequired() {
|
||||
return isUsingHTTPS();
|
||||
return isUsingHTTPS() && config.isFalse(WebserverSettings.DISABLED_AUTHENTICATION);
|
||||
}
|
||||
|
||||
public String getAccessAddress() {
|
||||
|
@ -38,6 +38,7 @@ public class WebserverSettings {
|
||||
public static final Setting<String> CERTIFICATE_STOREPASS = new StringSetting("Webserver.Security.SSL_certificate.Store_pass");
|
||||
public static final Setting<String> CERTIFICATE_ALIAS = new StringSetting("Webserver.Security.SSL_certificate.Alias");
|
||||
public static final Setting<Boolean> DISABLED = new BooleanSetting("Webserver.Disable_Webserver");
|
||||
public static final Setting<Boolean> DISABLED_AUTHENTICATION = new BooleanSetting("Webserver.Security.Disable_authentication");
|
||||
public static final Setting<String> EXTERNAL_LINK = new StringSetting("Webserver.External_Webserver_address");
|
||||
|
||||
private WebserverSettings() {
|
||||
|
@ -42,7 +42,9 @@ public enum PluginLang implements Lang {
|
||||
WEB_SERVER_FAIL_STORE_LOAD("WebServer FAIL - Store Load", "WebServer: SSL Certificate loading Failed."),
|
||||
WEB_SERVER_NOTIFY_NO_CERT_FILE("WebServer - Notify no Cert file", "WebServer: Certificate KeyStore File not Found: ${0}"),
|
||||
WEB_SERVER_NOTIFY_HTTP("WebServer - Notify HTTP", "WebServer: No Certificate -> Using HTTP-server for Visualization."),
|
||||
WEB_SERVER_NOTIFY_USING_PROXY_MODE("WebServer - Notify Using Proxy", "WebServer: Proxy-mode HTTPS enabled, make sure that your reverse-proxy is routing using HTTPS and Plan AlternativeIP.Link points to the Proxy"),
|
||||
WEB_SERVER_NOTIFY_HTTP_USER_AUTH("WebServer - Notify HTTP User Auth", "WebServer: User Authorization Disabled! (Not secure over HTTP)"),
|
||||
WEB_SERVER_NOTIFY_HTTPS_USER_AUTH("WebServer - Notify HTTPS User Auth", "WebServer: User Authorization Disabled! (Disabled in config)"),
|
||||
|
||||
DISABLED("Disable", "Player Analytics Disabled."),
|
||||
DISABLED_WEB_SERVER("Disable - WebServer", "Webserver has been disabled."),
|
||||
|
@ -50,6 +50,8 @@ Webserver:
|
||||
Key_pass: default
|
||||
Store_pass: default
|
||||
Alias: alias
|
||||
# HTTPS is required for Login.
|
||||
Disable_authentication: false
|
||||
# Cross-Origin Resource Sharing (Requests from non-Plan web pages)
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
||||
CORS:
|
||||
|
@ -52,6 +52,8 @@ Webserver:
|
||||
Key_pass: default
|
||||
Store_pass: default
|
||||
Alias: alias
|
||||
# HTTPS is required for Login.
|
||||
Disable_authentication: false
|
||||
# Cross-Origin Resource Sharing (Requests from non-Plan web pages)
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
||||
CORS:
|
||||
|
Loading…
Reference in New Issue
Block a user