mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
dbeaver/pro#8142 remove public url param (#4119)
* dbeaver/pro#8142 remove public url param * dbeaver/pro#8142 remove server url in all products --------- Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
This commit is contained in:
-3
@@ -80,9 +80,6 @@ public interface ServletApplication extends DBPApplication {
|
||||
@NotNull
|
||||
DBFileController createFileController(@NotNull SMCredentialsProvider credentialsProvider);
|
||||
|
||||
@Nullable
|
||||
String getServerURL();
|
||||
|
||||
@NotNull
|
||||
default String getServicesURI() {
|
||||
return "/";
|
||||
|
||||
@@ -277,6 +277,11 @@ public class WebSession extends BaseWebSession
|
||||
return connectListener;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getClientOrigin() {
|
||||
return clientOrigin;
|
||||
}
|
||||
|
||||
public void updateClientOrigin(@NotNull String originFromRequest) {
|
||||
this.clientOrigin = originFromRequest;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ public class CBConstants {
|
||||
public static final String PARAM_SUPPORTED_HOSTS = "supportedHosts";
|
||||
public static final String PARAM_SSL_CONFIGURATION_PATH = "sslConfigurationPath";
|
||||
public static final String PARAM_CONTENT_ROOT = "contentRoot";
|
||||
public static final String PARAM_SERVER_URL = "serverURL";
|
||||
public static final String PARAM_ROOT_URI = "rootURI";
|
||||
public static final String PARAM_SERVICES_URI = "serviceURI";
|
||||
public static final String PARAM_DRIVERS_LOCATION = "driversLocation";
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class CBWebServerConfig extends WebServerConfig {
|
||||
|
||||
@Property
|
||||
public String getServerURL() {
|
||||
return CommonUtils.notEmpty(cbApp.getServerConfiguration().getServerURL());
|
||||
return ""; // backward compatibility
|
||||
}
|
||||
|
||||
@Property
|
||||
|
||||
-9
@@ -31,7 +31,6 @@ public class CBServerConfig implements WebServerConfiguration {
|
||||
|
||||
private static final Log log = Log.getLog(CBServerConfig.class);
|
||||
|
||||
protected String serverURL;
|
||||
@NotNull
|
||||
protected List<String> supportedHosts = new ArrayList<>();
|
||||
protected boolean forceHttps;
|
||||
@@ -62,10 +61,6 @@ public class CBServerConfig implements WebServerConfiguration {
|
||||
this.securityManagerConfiguration = createSecurityManagerConfiguration();
|
||||
}
|
||||
|
||||
public String getServerURL() {
|
||||
return serverURL;
|
||||
}
|
||||
|
||||
public int getServerPort() {
|
||||
return serverPort;
|
||||
}
|
||||
@@ -108,10 +103,6 @@ public class CBServerConfig implements WebServerConfiguration {
|
||||
return staticContent;
|
||||
}
|
||||
|
||||
public void setServerURL(String serverURL) {
|
||||
this.serverURL = serverURL;
|
||||
}
|
||||
|
||||
public void setServerPort(int serverPort) {
|
||||
this.serverPort = serverPort;
|
||||
}
|
||||
|
||||
@@ -119,11 +119,6 @@ public abstract class CBApplication<T extends CBServerConfig>
|
||||
this.homeDirectory = new File(initHomeFolder());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getServerURL() {
|
||||
return getServerConfiguration().getServerURL();
|
||||
}
|
||||
|
||||
// Port this server listens on. If set the 0 a random port is assigned which may be obtained with getLocalPort()
|
||||
@Override
|
||||
public int getServerPort() {
|
||||
@@ -259,9 +254,6 @@ public abstract class CBApplication<T extends CBServerConfig>
|
||||
//log.debug("\tProduct details: " + application.getInfoDetails());
|
||||
log.debug("\tListen port: " + getServerPort() + (CommonUtils.isEmpty(getServerHost()) ? " on all interfaces" : " on " + getServerHost()));
|
||||
log.debug("\tBase URI: " + getServicesURI());
|
||||
if (!isConfigurationMode()) {
|
||||
log.debug("\tGlobal access server URL: " + getServerConfiguration().getServerURL());
|
||||
}
|
||||
if (isDevelMode()) {
|
||||
log.debug("\tDevelopment mode");
|
||||
} else {
|
||||
@@ -356,7 +348,6 @@ public abstract class CBApplication<T extends CBServerConfig>
|
||||
*/
|
||||
protected void performAutoConfiguration(Path configPath) {
|
||||
String autoServerName = System.getenv(CBConstants.VAR_AUTO_CB_SERVER_NAME);
|
||||
String autoServerURL = System.getenv(CBConstants.VAR_AUTO_CB_SERVER_URL);
|
||||
String autoAdminName = System.getenv(CBConstants.VAR_AUTO_CB_ADMIN_NAME);
|
||||
String autoAdminPassword = System.getenv(CBConstants.VAR_AUTO_CB_ADMIN_PASSWORD);
|
||||
|
||||
@@ -371,7 +362,6 @@ public abstract class CBApplication<T extends CBServerConfig>
|
||||
autoProps.load(is);
|
||||
|
||||
autoServerName = autoProps.getProperty(CBConstants.VAR_AUTO_CB_SERVER_NAME);
|
||||
autoServerURL = autoProps.getProperty(CBConstants.VAR_AUTO_CB_SERVER_URL);
|
||||
autoAdminName = autoProps.getProperty(CBConstants.VAR_AUTO_CB_ADMIN_NAME);
|
||||
autoAdminPassword = autoProps.getProperty(CBConstants.VAR_AUTO_CB_ADMIN_PASSWORD);
|
||||
} catch (IOException e) {
|
||||
@@ -389,7 +379,6 @@ public abstract class CBApplication<T extends CBServerConfig>
|
||||
}
|
||||
CBServerConfig serverConfig = new CBServerConfig();
|
||||
serverConfig.setServerName(autoServerName);
|
||||
serverConfig.setServerURL(autoServerURL);
|
||||
serverConfig.setMaxSessionIdleTime(getMaxSessionIdleTime());
|
||||
try {
|
||||
finishConfiguration(
|
||||
|
||||
-18
@@ -167,14 +167,6 @@ public abstract class CBServerConfigurationController<T extends CBServerConfig>
|
||||
|
||||
public T parseServerConfiguration() {
|
||||
var config = getServerConfiguration();
|
||||
if (config.getServerURL() == null) {
|
||||
String hostName = config.getServerHost();
|
||||
if (CommonUtils.isEmpty(hostName)) {
|
||||
hostName = getLocalHostAddress();
|
||||
}
|
||||
config.setServerURL("http://" + hostName + ":" + config.getServerPort());
|
||||
}
|
||||
|
||||
config.setContentRoot(ServletAppUtils.getRelativePath(config.getContentRoot(), homeDirectory));
|
||||
config.setRootURI(readRootUri(config.getRootURI()));
|
||||
config.setDriversLocation(ServletAppUtils.getRelativePath(config.getDriversLocation(), homeDirectory));
|
||||
@@ -383,12 +375,6 @@ public abstract class CBServerConfigurationController<T extends CBServerConfig>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public synchronized void updateServerUrl(@NotNull SMCredentialsProvider credentialsProvider,
|
||||
@Nullable String newPublicUrl) throws DBException {
|
||||
getServerConfiguration().setServerURL(newPublicUrl);
|
||||
}
|
||||
|
||||
protected Map<String, Object> collectConfigurationProperties(
|
||||
@NotNull CBServerConfig serverConfig,
|
||||
@NotNull CBAppConfig appConfig
|
||||
@@ -523,10 +509,6 @@ public abstract class CBServerConfigurationController<T extends CBServerConfig>
|
||||
CBConstants.PARAM_SERVER_NAME,
|
||||
serverConfig.getServerName());
|
||||
}
|
||||
if (!CommonUtils.isEmpty(serverConfig.getServerURL())) {
|
||||
copyConfigValue(
|
||||
originServerConfig, serverConfigProperties, CBConstants.PARAM_SERVER_URL, serverConfig.getServerURL());
|
||||
}
|
||||
if (serverConfig.getMaxSessionIdleTime() > 0) {
|
||||
copyConfigValue(
|
||||
originServerConfig,
|
||||
|
||||
-1
@@ -39,7 +39,6 @@ public class CBServerContextListener implements ServletContextListener {
|
||||
//scf.setDomain(domain);
|
||||
//scf.setMaxAge(CB_SESSION_LIFE_TIME);
|
||||
cookieConfig.setPath(CBApplication.getInstance().getRootURI());
|
||||
// cookieConfig.setSecure(application.getServerURL().startsWith("https"));
|
||||
cookieConfig.setHttpOnly(true);
|
||||
cookieConfig.setName(CBConstants.CB_SESSION_COOKIE_NAME);
|
||||
}
|
||||
|
||||
-10
@@ -34,7 +34,6 @@ public class AdminServerConfig {
|
||||
private static final Log log = Log.getLog(AdminServerConfig.class);
|
||||
|
||||
private String serverName;
|
||||
private String serverURL;
|
||||
|
||||
private String adminName;
|
||||
private String adminPassword;
|
||||
@@ -60,7 +59,6 @@ public class AdminServerConfig {
|
||||
|
||||
public AdminServerConfig(Map<String, Object> params) {
|
||||
this.serverName = JSONUtils.getString(params, "serverName");
|
||||
this.serverURL = JSONUtils.getString(params, "serverURL");
|
||||
this.adminName = JSONUtils.getString(params, "adminName");
|
||||
this.adminPassword = JSONUtils.getString(params, "adminPassword");
|
||||
|
||||
@@ -133,14 +131,6 @@ public class AdminServerConfig {
|
||||
this.serverName = serverName;
|
||||
}
|
||||
|
||||
public String getServerURL() {
|
||||
return serverURL;
|
||||
}
|
||||
|
||||
public void setServerURL(String serverURL) {
|
||||
this.serverURL = serverURL;
|
||||
}
|
||||
|
||||
public String getAdminName() {
|
||||
return adminName;
|
||||
}
|
||||
|
||||
-2
@@ -576,7 +576,6 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
CBAppConfig appConfig = new CBAppConfig(CBApplication.getInstance().getAppConfiguration());
|
||||
CBServerConfig serverConfig = new CBServerConfig();
|
||||
serverConfig.setServerName(CBApplication.getInstance().getServerName());
|
||||
serverConfig.setServerURL(CBApplication.getInstance().getServerURL());
|
||||
serverConfig.setMaxSessionIdleTime(CBApplication.getInstance().getMaxSessionIdleTime());
|
||||
String adminName = null;
|
||||
String adminPassword = null;
|
||||
@@ -606,7 +605,6 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
adminName = config.getAdminName();
|
||||
adminPassword = config.getAdminPassword();
|
||||
serverConfig.setServerName(config.getServerName());
|
||||
serverConfig.setServerURL(config.getServerURL());
|
||||
serverConfig.setMaxSessionIdleTime(config.getSessionExpireTime());
|
||||
if (config.getForceHttps() != null) {
|
||||
serverConfig.setForceHttps(config.getForceHttps());
|
||||
|
||||
Reference in New Issue
Block a user