Skip to content

Commit

Permalink
Merge branch 'devel' into CB-4099
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgeniaBzzz authored Oct 23, 2023
2 parents 32ea853 + f7832b5 commit 803ffda
Show file tree
Hide file tree
Showing 194 changed files with 2,255 additions and 840 deletions.
12 changes: 9 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///*": "${workspaceFolder}/../*"
}
},
"skipFiles": [
"<node_internals>/**",
"**/node_modules/**",
"${workspaceFolder}/webapp/**/node_modules/**/*.js",
"${workspaceFolder}/webapp/**/dist/**/*.js"
]
},
{
"type": "java",
Expand All @@ -24,7 +30,7 @@
"request": "launch",
"mainClass": "org.eclipse.equinox.launcher.Main",
"classPaths": [
"${workspaceFolder}/../eclipse/eclipse/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar"
"${workspaceFolder}/../eclipse/eclipse/plugins/org.eclipse.equinox.launcher_1.6.500.v20230717-2134.jar"
],
"args": [
"-product",
Expand Down Expand Up @@ -59,7 +65,7 @@
"request": "launch",
"mainClass": "org.eclipse.equinox.launcher.Main",
"classPaths": [
"${workspaceFolder}/../eclipse/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar"
"${workspaceFolder}/../eclipse/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.equinox.launcher_1.6.500.v20230717-2134.jar"
],
"args": [
"-product",
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ You can see live demo of CloudBeaver here: https://demo.cloudbeaver.io

## Changelog

### CloudBeaver 23.2.3 - 2023-10-23

- The SSL option is available for establishing a connection in SQL Server;
- Added the ability to edit binary values in a table;
- Different bug fixes and enhancements have been made.

### CloudBeaver 23.2.2 - 2023-10-09

- The 'Save credentials' checkbox has been removed from a template creating form as credentials are not stored in templates;
Expand Down
2 changes: 1 addition & 1 deletion deploy/scripts/run-server.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ IF NOT EXIST workspace\.metadata (
)
)

java %JAVA_OPTS% --add-modules=ALL-SYSTEM --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/jdk.internal.vm=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.security.ssl=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.security.util=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.jgss=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -jar %launcherJar% -product io.cloudbeaver.product.ce.product -web-config conf/cloudbeaver.conf -nl en -registryMultiLanguage
java %JAVA_OPTS% -Dfile.encoding=UTF-8 --add-modules=ALL-SYSTEM --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/jdk.internal.vm=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.security.ssl=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.security.util=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.jgss=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -jar %launcherJar% -product io.cloudbeaver.product.ce.product -web-config conf/cloudbeaver.conf -nl en -registryMultiLanguage
2 changes: 1 addition & 1 deletion deploy/scripts/run-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ echo "Starting Cloudbeaver Server"

[ ! -d "workspace/.metadata" ] && mkdir -p workspace/.metadata && mkdir -p workspace/GlobalConfiguration/.dbeaver && [ ! -f "workspace/GlobalConfiguration/.dbeaver/data-sources.json" ] && cp conf/initial-data-sources.conf workspace/GlobalConfiguration/.dbeaver/data-sources.json

java ${JAVA_OPTS} --add-modules=ALL-SYSTEM --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/jdk.internal.vm=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.security.ssl=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.security.util=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.jgss=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -jar ${launcherJar} -product io.cloudbeaver.product.ce.product -web-config conf/cloudbeaver.conf -nl en -registryMultiLanguage
java ${JAVA_OPTS} -Dfile.encoding=UTF-8 --add-modules=ALL-SYSTEM --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/jdk.internal.vm=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.security.ssl=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.security.util=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.jgss=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -jar ${launcherJar} -product io.cloudbeaver.product.ce.product -web-config conf/cloudbeaver.conf -nl en -registryMultiLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public RMController getResourceController() {
return resourceController;
}

@NotNull
@Override
public RMProject getRMProject() {
return project;
}

@Override
public boolean isVirtual() {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public String getDescription() {
}
}

@Property
public String getHint() {
return property.getHint();
}

@Property
public int getOrder() {
return property instanceof ObjectPropertyDescriptor ? ((ObjectPropertyDescriptor) property).getOrderNumber() : -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.jkiss.dbeaver.model.auth.impl.AbstractSessionPersistent;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.websocket.event.WSEvent;
import org.jkiss.dbeaver.model.websocket.event.WSEventDeleteTempFile;
import org.jkiss.dbeaver.model.websocket.event.session.WSSessionExpiredEvent;

import java.time.Instant;
Expand Down Expand Up @@ -166,6 +167,8 @@ public synchronized WebUserContext getUserContext() {
public void close() {
super.close();
var sessionExpiredEvent = new WSSessionExpiredEvent();
application.getEventController().addEvent(sessionExpiredEvent);
application.getEventController().addEvent(new WSEventDeleteTempFile(getSessionId()));
synchronized (sessionEventHandlers) {
for (CBWebSessionEventHandler sessionEventHandler : sessionEventHandlers) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,15 @@
import org.jkiss.dbeaver.runtime.jobs.DisconnectJob;
import org.jkiss.utils.CommonUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.lang.reflect.InvocationTargetException;
import java.time.Instant;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
* Web session.
* Is the main source of data in web application
Expand All @@ -99,7 +98,6 @@ public class WebSession extends BaseWebSession
public static final SMSessionType CB_SESSION_TYPE = new SMSessionType("CloudBeaver");
private static final String WEB_SESSION_AUTH_CONTEXT_TYPE = "web-session";
private static final String ATTR_LOCALE = "locale";

private static final AtomicInteger TASK_ID = new AtomicInteger();

private final AtomicInteger taskCount = new AtomicInteger();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ public interface CBWebSessionEventHandler {
void handleWebSessionEvent(WSEvent event) throws DBException;

void close();

}
7 changes: 6 additions & 1 deletion server/bundles/io.cloudbeaver.server/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
<extension point="org.jkiss.dbeaver.ws.event.handler">
<eventHandler class="io.cloudbeaver.server.events.WSDefaultEventHandler">
<topic id="cb_config"/>
<topic id="cb_workspace_configuration"/>
</eventHandler>
<eventHandler class="io.cloudbeaver.server.events.WSDataSourceUpdatedEventHandlerImpl">
<topic id="cb_datasource"/>
Expand All @@ -73,6 +72,12 @@
<eventHandler class="io.cloudbeaver.server.events.WSLogEventHandler">
<topic id="cb_session_log"/>
</eventHandler>
<eventHandler class="io.cloudbeaver.server.events.WSEventHandlerWorkspaceConfigUpdate">
<topic id="cb_workspace_configuration"/>
</eventHandler>
<eventHandler class="io.cloudbeaver.server.events.WSDeleteTempFileHandler">
<topic id="cb_delete_temp_folder"/>
</eventHandler>
</extension>

</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ input PageInput {
offset: Int
}

directive @since(version: String!) on OBJECT|SCALAR|QUERY|MUTATION|FIELD|VARIABLE_DEFINITION|OBJECT|FIELD_DEFINITION|ARGUMENT_DEFINITION|INTERFACE|ENUM|ENUM_VALUE|INPUT_OBJECT|INPUT_FIELD_DEFINITION
directive @since(version: String!) repeatable on OBJECT|SCALAR|QUERY|MUTATION|FIELD|VARIABLE_DEFINITION|OBJECT|FIELD_DEFINITION|ARGUMENT_DEFINITION|INTERFACE|ENUM|ENUM_VALUE|INPUT_OBJECT|INPUT_FIELD_DEFINITION

type Query

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ type ObjectPropertyInfo {
displayName: String
# Property description
description: String
# Property hint
hint: String @since(version: "23.2.3")
# Property category (may be used if object has a lot of properties)
category: String
# Property data type (int, String, etc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ enum CBEventTopic {
cb_projects,
cb_object_permissions,
cb_subject_permissions,
cb_database_output_log
cb_database_output_log,
cb_delete_temp_folder
}

# Base server event interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,21 +325,21 @@ protected void startServer() {

}

{
try {
initializeSecurityController();
} catch (Exception e) {
log.error("Error initializing database", e);
return;
}
}
try {
initializeServer();
} catch (DBException e) {
log.error("Error initializing server", e);
return;
}

try {
initializeSecurityController();
} catch (Exception e) {
log.error("Error initializing database", e);
return;
}


if (configurationMode) {
// Try to configure automatically
performAutoConfiguration(configPath.toFile().getParentFile());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
import io.cloudbeaver.server.jobs.WebSessionMonitorJob;
import io.cloudbeaver.service.session.WebSessionManager;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
Expand All @@ -39,6 +41,7 @@
import org.jkiss.dbeaver.model.preferences.DBPPreferenceStore;
import org.jkiss.dbeaver.model.qm.QMRegistry;
import org.jkiss.dbeaver.model.qm.QMUtils;
import org.jkiss.dbeaver.model.runtime.AbstractJob;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor;
import org.jkiss.dbeaver.registry.BasePlatformImpl;
Expand All @@ -49,6 +52,7 @@
import org.jkiss.dbeaver.runtime.qm.QMRegistryImpl;
import org.jkiss.dbeaver.utils.ContentUtils;
import org.jkiss.dbeaver.utils.GeneralUtils;
import org.jkiss.utils.IOUtils;
import org.osgi.framework.Bundle;

import java.io.IOException;
Expand All @@ -67,6 +71,7 @@ public class CBPlatform extends BasePlatformImpl {
public static final String PLUGIN_ID = "io.cloudbeaver.server"; //$NON-NLS-1$

private static final Log log = Log.getLog(CBPlatform.class);
private static final String TEMP_FILE_FOLDER = "temp-sql-upload-files";

public static final String WORK_DATA_FOLDER_NAME = ".work-data";

Expand Down Expand Up @@ -159,6 +164,17 @@ protected void initialize() {
new SessionStateJob(this)
.scheduleMonitor();

new AbstractJob("Delete temp folder") {
@Override
protected IStatus run(DBRProgressMonitor monitor) {
try {
IOUtils.deleteDirectory(getTempFolder(monitor, TEMP_FILE_FOLDER));
} catch (IOException e) {
throw new RuntimeException(e);
}
return Status.OK_STATUS;
}
}.schedule();
log.info("Web platform initialized (" + (System.currentTimeMillis() - startTime) + "ms)");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2023 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.cloudbeaver.server.events;

import io.cloudbeaver.server.CBPlatform;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor;
import org.jkiss.dbeaver.model.websocket.WSEventHandler;
import org.jkiss.dbeaver.model.websocket.event.WSEventDeleteTempFile;
import org.jkiss.utils.IOUtils;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

public class WSDeleteTempFileHandler implements WSEventHandler<WSEventDeleteTempFile> {

private static final Log log = Log.getLog(WSDeleteTempFileHandler.class);
private static final String TEMP_FILE_FOLDER = "temp-sql-upload-files";

public void resetTempFolder(String sessionId) {
Path path = CBPlatform.getInstance()
.getTempFolder(new VoidProgressMonitor(), TEMP_FILE_FOLDER)
.resolve(sessionId);
if (Files.exists(path)) {
try {
IOUtils.deleteDirectory(path);
} catch (IOException e) {
log.error("Error deleting temp path", e);
}
}
}

@Override
public void handleEvent(@NotNull WSEventDeleteTempFile event) {
resetTempFolder(event.getSessionId());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2023 DBeaver Corp
*
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of DBeaver Corp and its suppliers, if any.
* The intellectual and technical concepts contained
* herein are proprietary to DBeaver Corp and its suppliers
* and may be covered by U.S. and Foreign Patents,
* patents in process, and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from DBeaver Corp.
*/
package io.cloudbeaver.server.events;

import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.WorkspaceConfigEventManager;
import org.jkiss.dbeaver.model.websocket.event.WSEventType;
import org.jkiss.dbeaver.model.websocket.event.WSWorkspaceConfigurationChangedEvent;

public class WSEventHandlerWorkspaceConfigUpdate extends WSDefaultEventHandler<WSWorkspaceConfigurationChangedEvent> {
private static final Log log = Log.getLog(WSEventHandlerWorkspaceConfigUpdate.class);

@Override
public void handleEvent(@NotNull WSWorkspaceConfigurationChangedEvent event) {
String configFileName = event.getConfigFilePath();
WorkspaceConfigEventManager.fireConfigChangedEvent(configFileName);
super.handleEvent(event);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ public void onWebSocketError(Throwable cause) {
public void handleWebSessionEvent(WSEvent event) {
super.handleEvent(event);
}

@Override
protected void handleEventException(Exception e) {
super.handleEventException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
*/
package io.cloudbeaver.service.sql;

import io.cloudbeaver.service.DBWService;
import io.cloudbeaver.DBWebException;
import io.cloudbeaver.WebAction;
import io.cloudbeaver.model.WebAsyncTaskInfo;
import io.cloudbeaver.model.WebConnectionInfo;
import io.cloudbeaver.model.session.WebSession;
import io.cloudbeaver.service.DBWService;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
Expand Down
Loading

0 comments on commit 803ffda

Please sign in to comment.