Compare commits

..
4 Commits
5493 changed files with 61791 additions and 250358 deletions
+29
View File
@@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve CloudBeaver
title: ''
labels: bug, wait for review
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here, e.g. error log.
-61
View File
@@ -1,61 +0,0 @@
name: 🐛 Bug Report
description: Create a report to help us improve our product
labels: [wait for review]
type: Bug
body:
- type: markdown
attributes:
value: |
Thank you for reporting a bug in CloudBeaver!
To ensure we can address the issue as quickly and efficiently as possible, please provide as much detail as you can in the fields below.
- type: textarea
id: description
attributes:
label: Description
description: |
A clear and concise description of the issue being addressed.
- Describe the actual problematic behavior.
- Ensure private information is redacted.
- Include console output or log files if relevant.
- If applicable, add screenshots or screen recordings to help explain your problem.
placeholder: |
Please enter a description of the issue. Here you can also attach log files, screenshots or a video
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce
description: Describe the steps to reproduce the bug
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
- type: textarea
id: expected
attributes:
label: Expected/Desired Behavior
description: |
A clear and concise description of what happens in the software **after** a fix is created and merged.
validations:
required: true
- type: input
id: version
attributes:
label: CloudBeaver Version
description: What version of CloudBeaver are you running?
placeholder: ex. CloudBeaver Community 25.0.0
validations:
required: true
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Any additional context about the environment
placeholder: |
Example:
1. OS: [e.g. iOS, Ubuntu, Windows 11]
2. Browser: [e.g. Chrome, Safari]
validations:
required: false
-14
View File
@@ -1,14 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Read our documentations
url: https://dbeaver.com/docs/cloudbeaver
about: Many articles about product deployment and features.
- name: Try advanced database management features in DBeaver PRO or CloudBeaver EE
url: https://dbeaver.com/download/?utm_source=github&utm_medium=social&utm_campaign=issue
about: Download a 14-day free trial on dbeaver.com. No credit card is needed.
- name: Learn how to use CloudBeaver effectively with our tutorial videos
url: https://www.youtube.com/channel/UC-yOjsQLSaJVEghg6UB3N7A
about: Subscribe to our YouTube channel and watch new tutorials every week.
- name: Follow us on X (ex. Twitter)
url: https://x.com/dbeaver_news
about: Get everyday tips, fresh news, and DBeaver/CloudBeaver feature overviews.
+3 -10
View File
@@ -1,9 +1,8 @@
---
name: Feature Request
about: Provide a description of your feature request for CloudBeaver. Include the problem you are trying to solve, why it is important, and any specific functionality you believe would improve the platform.
name: Feature request
about: Suggest an idea for CloudBeaver
title: ''
labels: wait for review
type: Feature
labels: feature request, wait for review
assignees: ''
---
@@ -13,9 +12,3 @@ A clear and concise description of what the problem is. Ex. I'm always frustrate
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+2 -3
View File
@@ -1,9 +1,8 @@
---
name: Question
about: Is there something unclear? Ask your question.
about: Is there something unclear?
title: ''
labels: wait for review
type: Question
labels: question, wait for review
assignees: ''
---
-42
View File
@@ -1,42 +0,0 @@
name: Backend Build
on:
# Allows you to reuse workflows by referencing their YAML files
workflow_call:
jobs:
build-backend:
name: Build
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: cloudbeaver
- name: Clone Deps Repositories
uses: dbeaver/github-actions/clone-repositories@devel
with:
project_deps_path: "./cloudbeaver/project.deps"
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"
cache: maven
- uses: dbeaver/github-actions/install-maven@devel
- name: Run build script
run: ./build-backend.sh
shell: bash
working-directory: ./cloudbeaver/deploy
# - name: Archive build artifacts
# uses: actions/upload-artifact@v4
# with:
# name: backend-build-artifacts
# path: cloudbeaver/deploy/cloudbeaver
# if-no-files-found: error
-14
View File
@@ -1,14 +0,0 @@
name: Cleanup
on:
pull_request:
types: [closed]
push:
branches:
- devel
jobs:
delete-caches:
name: Cleanup
uses: dbeaver/dbeaver-common/.github/workflows/cleanup-caches.yml@devel
secrets: inherit
@@ -1,93 +0,0 @@
name: Build and Push Docker Image
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to reuse workflows by referencing their YAML files
workflow_call:
jobs:
build-and-push-docker:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download backend artifacts
uses: actions/download-artifact@v4
with:
name: backend-build-artifacts
path: deploy/cloudbeaver/
- name: Download frontend artifacts
uses: actions/download-artifact@v4
with:
name: frontend-build-artifacts
path: deploy/cloudbeaver/web
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run custom Docker build script
run: ./make-docker-container.sh
shell: bash
working-directory: ./deploy/docker
- name: Tag Docker Image
run: |
REPO_NAME=$(basename ${{ github.repository }})
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/$REPO_NAME
BRANCH_NAME=${{ github.head_ref || github.ref_name }}
TAG_NAME=$(echo $BRANCH_NAME | sed 's/[^a-zA-Z0-9._-]/-/g')
docker tag dbeaver/cloudbeaver:dev $IMAGE_NAME:$TAG_NAME
echo "image=$IMAGE_NAME:$TAG_NAME" >> $GITHUB_ENV
# - name: Install Docker Credential Helper
# run: |
# sudo apt-get update
# sudo apt-get install -y gnupg2 pass
# curl -fsSL https://github.com/docker/docker-credential-helpers/releases/download/v0.6.4/docker-credential-pass-v0.6.4-amd64.tar.gz -o docker-credential-pass.tar.gz
# tar xzvf docker-credential-pass.tar.gz
# sudo mv docker-credential-pass /usr/local/bin/docker-credential-pass
# sudo chmod +x /usr/local/bin/docker-credential-pass
# - name: Configure Docker to use Credential Helper
# run: |
# mkdir -p ~/.docker
# echo '{"credsStore":"pass"}' > ~/.docker/config.json
# - name: Initialize Password Store
# run: |
# gpg --batch --gen-key <<EOF
# %no-protection
# Key-Type: default
# Subkey-Type: default
# Name-Real: Docker Credential Helper
# Expire-Date: 0
# %commit
# EOF
# pass init "$(gpg --list-keys --with-colons | grep '^pub' | cut -d: -f5)"
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Push Docker Image
run: docker push ${{ env.image }}
# - name: Comment on Pull Request
# if: github.event_name == 'pull_request'
# uses: actions/github-script@v6
# with:
# github-token: ${{ secrets.PAT }}
# script: |
# const tag = process.env.TAG_NAME;
# const commentBody = `The Docker image has been built and pushed to Docker Hub.\n\nYou can pull the image using the following command:\n\`\`\`\ndocker pull dbeaver/cloudbeaver:${tag}\n\`\`\``;
# github.rest.issues.createComment({
# owner: context.repo.owner,
# repo: context.repo.repo,
# issue_number: context.issue.number,
# body: commentBody
# });
-79
View File
@@ -1,79 +0,0 @@
name: Frontend Build
on:
# Allows you to reuse workflows by referencing their YAML files
workflow_call:
outputs:
build-status:
description: "Build status"
value: ${{ jobs.frontend-build.outputs.build-status }}
test-status:
description: "Test status"
value: ${{ jobs.frontend-build.outputs.test-status }}
inputs:
clean-cache:
required: false
type: boolean
jobs:
frontend-build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
outputs:
build-status: ${{ steps.build.outcome }}
test-status: ${{ steps.test.outcome }}
defaults:
run:
working-directory: ./cloudbeaver/webapp
steps:
- name: Checkout cloudbeaver
uses: actions/checkout@v4
with:
path: cloudbeaver
- name: Clone Deps Repositories
uses: dbeaver/github-actions/clone-repositories@devel
with:
project_deps_path: "./cloudbeaver/project.deps"
token: ${{ secrets.DEVOPS_ISSUE_RO_TOKEN }}
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "yarn"
cache-dependency-path: |
cloudbeaver/webapp/yarn.lock
- name: restore typescript cache
uses: actions/cache@v4
with:
path: |
"cloudbeaver/webapp/common-*/**/*/lib"
"cloudbeaver/webapp/**/packages/*/dist"
key: ${{ runner.os }}-dist-${{ hashFiles('cloudbeaver/webapp/yarn.lock') }}
restore-keys: |
${{ runner.os }}-dist-
- if: inputs.clean-cache
run: yarn clear
- run: yarn install --immutable
- run: yarn bundle
working-directory: ./cloudbeaver/webapp/packages/product-default
- run: yarn test
# - name: Archive build artifacts
# uses: actions/upload-artifact@v4
# with:
# name: frontend-build-artifacts
# path: webapp/packages/product-default/lib
# if-no-files-found: error
-46
View File
@@ -1,46 +0,0 @@
name: Frontend Lint
on:
# Allows you to reuse workflows by referencing their YAML files
workflow_call:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
defaults:
run:
working-directory: ./cloudbeaver/webapp
steps:
- name: Checkout cloudbeaver
uses: actions/checkout@v4
with:
path: cloudbeaver
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "yarn"
cache-dependency-path: "./cloudbeaver/webapp/yarn.lock"
# - run: yarn install --immutable
# working-directory: ./cloudbeaver/webapp/common-typescript
# - run: yarn install --immutable
# working-directory: ./cloudbeaver/webapp/common-react
- run: |
yarn install --immutable
git fetch origin "${{ github.base_ref }}" --depth=1
FILES=$(git diff --name-only 'origin/${{ github.base_ref }}' ${{ github.sha }} -- . | sed 's|^webapp/||')
if [ -n "$FILES" ]; then
yarn lint --pass-on-no-patterns --no-error-on-unmatched-pattern $FILES
else
echo "No files to lint"
fi
-64
View File
@@ -1,64 +0,0 @@
name: CI
on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches: [devel]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
jobs:
build-server:
uses: dbeaver/dbeaver-common/.github/workflows/mvn-package.yml@devel
name: Check
secrets: inherit
with:
mvn-args: -Dplain-api-server -Dheadless-platform
project-directory: ./cloudbeaver/server/product/aggregate
project-deps: ./cloudbeaver/project.deps
timeout-minutes: 5
# build-server:
# name: Server
# uses: ./.github/workflows/backend-build.yml
# secrets: inherit
build-frontend:
name: Frontend
uses: ./.github/workflows/frontend-build.yml
secrets: inherit
lint-server:
name: Server
uses: dbeaver/dbeaver-common/.github/workflows/java-checkstyle.yml@devel
secrets: inherit
lint-frontend:
name: Frontend
uses: ./.github/workflows/frontend-lint.yml
secrets: inherit
# call-frontend-tests:
# name: Frontend Unit Tests
# needs: call-frontend-build
# runs-on: ubuntu-latest
# steps:
# - name: Check if tests passed
# if: ${{ needs.call-frontend-build.outputs.test-status != 'success' }}
# run: |
# echo "Tests failed"
# exit 1
# - name: Continue if tests passed
# if: ${{ needs.call-frontend-build.outputs.test-status == 'success' }}
# run: echo "Tests passed"
# call-docker-build-and-push:
# name: Run
# needs: [call-backend-build, call-frontend-build]
# uses: ./.github/workflows/docker-build-and-push.yml
+5 -13
View File
@@ -16,23 +16,21 @@
*.ear
*.rar
# editor files
.vscode
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# web
/sources/web/node_modules/
dist/
## IDEA configs
*.iml
/idea/
## Mac OS
.DS_Store
## tests
server/test/io.cloudbeaver.test.platform/workspace/.data/
.idea/
## Eclipse configs
@@ -40,11 +38,5 @@ server/test/io.cloudbeaver.test.platform/workspace/.data/
.classpath
.settings/
## Eclipse PDE
*.product.launch
workspace-dev-ce/
deploy/cloudbeaver
server/**/target
apps/**/target
osgi-cache/
-25
View File
@@ -1,25 +0,0 @@
{
"recommendations": [
"shengchen.vscode-checkstyle",
"vscjava.vscode-java-pack",
"yaozheng.vscode-pde",
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"ecmel.vscode-html-css",
"GraphQL.vscode-graphql",
"ms-vscode.js-debug",
"ms-vscode.vscode-js-profile-table",
"rangav.vscode-thunder-client",
"redhat.vscode-xml",
"redhat.vscode-yaml",
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker-russian",
"syler.sass-indented",
"VisualStudioExptTeam.vscodeintellicode",
"yzhang.markdown-all-in-one",
"GraphQL.vscode-graphql-syntax",
"mrmlnc.vscode-json5",
"esbenp.prettier-vscode",
"devnaumov.licensify"
]
}
-76
View File
@@ -1,76 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "CloudBeaver CE",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}/..",
"outFiles": [
"${workspaceFolder}/../cloudbeaver/webapp/packages/**/dist/**/*.{js,jsx}"
],
"smartStep": true,
"sourceMaps": true,
"disableNetworkCache": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"]
},
{
"type": "java",
"name": "CloudBeaver CE Server",
"cwd": "${workspaceFolder}/../dbeaver-workspace/app-workspace/cbce",
"request": "launch",
"mainClass": "org.jkiss.dbeaver.launcher.DBeaverLauncher",
"args": [
"-product",
"io.cloudbeaver.product.ce.product",
"-configuration",
"file:${workspaceFolder}/../dbeaver-workspace/products/CloudbeaverServer.product/",
"-dev",
"file:${workspaceFolder}/../dbeaver-workspace/products/CloudbeaverServer.product/dev.properties",
"-nl",
"en",
"-web-config",
"conf/cloudbeaver.conf",
"-registryMultiLanguage"
],
// "windows": {
// "args": ["-os", "win32", "-ws", "win32", "-arch", "x86_64"]
// },
// "osx": {
// "args": ["-os", "macosx", "-ws", "cocoa", "-arch", "aarch64"]
// },
"vmArgs": [
"-XX:+IgnoreUnrecognizedVMOptions",
"-Xms64m",
"-Xmx1024m",
"-Declipse.pde.launch=true",
"-XstartOnFirstThread",
"-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",
"--add-opens=java.sql/java.sql=ALL-UNNAMED"
]
}
]
}
-49
View File
@@ -1,49 +0,0 @@
{
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.linkedEditing": true,
"task.autoDetect": "off",
"java.configuration.updateBuildConfiguration": "automatic",
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx16G -Xms100m -Xlog:disable",
"java.compile.nullAnalysis.mode": "automatic",
"typescript.preferences.useAliasesForRenames": false,
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.includePackageJsonAutoImports": "on",
"typescript.preferences.quoteStyle": "single",
"typescript.tsdk": "webapp/.yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"prettier.prettierPath": "webapp/.yarn/sdks/prettier/index.cjs",
"eslint.nodePath": "webapp/.yarn/sdks",
"eslint.enable": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"eslint.workingDirectories": [
"webapp"
],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[java]": {
"editor.defaultFormatter": "redhat.java"
},
"files.eol": "\n",
"files.associations": {
"*.css": "postcss"
},
"java.checkstyle.configuration": "${workspaceFolder}/../dbeaver-common/.github/dbeaver-checkstyle-config.xml",
"java.checkstyle.version": "10.12.0"
}
-150
View File
@@ -1,150 +0,0 @@
{
"version": "2.0.0",
"problemMatcher": [],
"presentation": {
"clear": true
},
"options": {
"cwd": "${workspaceFolder}/webapp",
"env": {
"NODE_OPTIONS": "--max-old-space-size=8192",
"MAVEN_OPTS": "-Xmx8192m"
}
},
"tasks": [
{
"label": "Run Tests CE",
"type": "shell",
"command": "yarn",
"group": "test",
"args": ["test"]
},
{
"label": "Run Tests Common Typescript",
"type": "shell",
"command": "yarn",
"group": "test",
"args": ["test"],
"options": {
"cwd": "${workspaceFolder}/webapp/common-typescript"
}
},
{
"label": "Run Tests Common React",
"type": "shell",
"command": "yarn",
"group": "test",
"args": ["test"],
"options": {
"cwd": "${workspaceFolder}/webapp/common-react"
}
},
{
"label": "Run DevServer CE",
"group": "build",
"isBackground": true,
"type": "shell",
"command": "yarn",
"args": ["dev"],
"options": {
"env": {
"server": "${input:stage.ce}"
},
"cwd": "${workspaceFolder}/webapp/packages/product-default"
}
},
{
"label": "Generate Eclipse PDE CloudBeaver",
"type": "shell",
"osx": {
"command": "./generate_workspace.sh"
},
"windows": {
"command": "./generate_workspace.cmd"
},
"options": {
"cwd": "${workspaceFolder}/../cloudbeaver"
},
"presentation": {
"reveal": "silent",
"close": true,
"clear": false
}
},
{
"label": "Build CE",
"type": "shell",
"windows": {
"command": "./build.bat"
},
"osx": {
"command": "./build.sh"
},
"options": {
"cwd": "${workspaceFolder}/deploy"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Run Backend CE",
"type": "shell",
"windows": {
"command": "./run-server.bat"
},
"osx": {
"command": "./run-server.sh"
},
"options": {
"cwd": "${workspaceFolder}/deploy/cloudbeaver"
}
},
{
"label": "Yarn Install",
"type": "shell",
"command": "yarn install",
"args": [],
"presentation": {
"reveal": "silent",
"close": true,
"clear": false
}
},
{
"label": "Clean CE",
"type": "shell",
"command": "yarn clear",
"options": {
"cwd": "${workspaceFolder}/webapp"
}
},
{
"label": "Add Custom Plugin",
"type": "shell",
"command": "yarn run add-plugin",
"options": {
"cwd": "${workspaceFolder}/webapp/packages"
}
},
{
"label": "Run Ui Kit Preview",
"type": "shell",
"command": "yarn",
"options": {
"cwd": "${workspaceFolder}/webapp/common-react/@dbeaver/ui-kit"
},
"args": ["docs"]
}
],
"inputs": [
{
"type": "pickString",
"id": "stage.ce",
"description": "CE Stage servers",
"default": "http://localhost:8978/",
"options": ["http://localhost:8978/"]
}
]
}
-10
View File
@@ -1,10 +0,0 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
[*.{js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2
@@ -1,4 +0,0 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
-14
View File
@@ -1,14 +0,0 @@
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/sdks/**
# Swap the comments on the following lines if you wish to use zero-installs
# In that case, don't forget to run `yarn config set enableGlobalCache false`!
# Documentation here: https://yarnpkg.com/features/caching#zero-installs
#!.yarn/cache
.pnp.*
-5
View File
@@ -1,5 +0,0 @@
{
"recommendations": [
"arcanis.vscode-zipfs"
]
}
-8
View File
@@ -1,8 +0,0 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
@@ -1,5 +0,0 @@
# This file is automatically generated by @yarnpkg/sdks.
# Manual changes might be lost!
integrations:
- vscode
@@ -1,32 +0,0 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsc
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real typescript/bin/tsc your application uses
module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsc`));
@@ -1,32 +0,0 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsserver
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real typescript/bin/tsserver your application uses
module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsserver`));
@@ -1,32 +0,0 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsc.js
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real typescript/lib/tsc.js your application uses
module.exports = wrapWithUserWrapper(absRequire(`typescript/lib/tsc.js`));
@@ -1,248 +0,0 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsserver.js
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
const moduleWrapper = exports => {
return wrapWithUserWrapper(moduleWrapperFn(exports));
};
const moduleWrapperFn = tsserver => {
if (!process.versions.pnp) {
return tsserver;
}
const {isAbsolute} = require(`path`);
const pnpApi = require(`pnpapi`);
const isVirtual = str => str.match(/\/(\$\$virtual|__virtual__)\//);
const isPortal = str => str.startsWith("portal:/");
const normalize = str => str.replace(/\\/g, `/`).replace(/^\/?/, `/`);
const dependencyTreeRoots = new Set(pnpApi.getDependencyTreeRoots().map(locator => {
return `${locator.name}@${locator.reference}`;
}));
// VSCode sends the zip paths to TS using the "zip://" prefix, that TS
// doesn't understand. This layer makes sure to remove the protocol
// before forwarding it to TS, and to add it back on all returned paths.
function toEditorPath(str) {
// We add the `zip:` prefix to both `.zip/` paths and virtual paths
if (isAbsolute(str) && !str.match(/^\^?(zip:|\/zip\/)/) && (str.match(/\.zip\//) || isVirtual(str))) {
// We also take the opportunity to turn virtual paths into physical ones;
// this makes it much easier to work with workspaces that list peer
// dependencies, since otherwise Ctrl+Click would bring us to the virtual
// file instances instead of the real ones.
//
// We only do this to modules owned by the the dependency tree roots.
// This avoids breaking the resolution when jumping inside a vendor
// with peer dep (otherwise jumping into react-dom would show resolution
// errors on react).
//
const resolved = isVirtual(str) ? pnpApi.resolveVirtual(str) : str;
if (resolved) {
const locator = pnpApi.findPackageLocator(resolved);
if (locator && (dependencyTreeRoots.has(`${locator.name}@${locator.reference}`) || isPortal(locator.reference))) {
str = resolved;
}
}
str = normalize(str);
if (str.match(/\.zip\//)) {
switch (hostInfo) {
// Absolute VSCode `Uri.fsPath`s need to start with a slash.
// VSCode only adds it automatically for supported schemes,
// so we have to do it manually for the `zip` scheme.
// The path needs to start with a caret otherwise VSCode doesn't handle the protocol
//
// Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910
//
// 2021-10-08: VSCode changed the format in 1.61.
// Before | ^zip:/c:/foo/bar.zip/package.json
// After | ^/zip//c:/foo/bar.zip/package.json
//
// 2022-04-06: VSCode changed the format in 1.66.
// Before | ^/zip//c:/foo/bar.zip/package.json
// After | ^/zip/c:/foo/bar.zip/package.json
//
// 2022-05-06: VSCode changed the format in 1.68
// Before | ^/zip/c:/foo/bar.zip/package.json
// After | ^/zip//c:/foo/bar.zip/package.json
//
case `vscode <1.61`: {
str = `^zip:${str}`;
} break;
case `vscode <1.66`: {
str = `^/zip/${str}`;
} break;
case `vscode <1.68`: {
str = `^/zip${str}`;
} break;
case `vscode`: {
str = `^/zip/${str}`;
} break;
// To make "go to definition" work,
// We have to resolve the actual file system path from virtual path
// and convert scheme to supported by [vim-rzip](https://github.com/lbrayner/vim-rzip)
case `coc-nvim`: {
str = normalize(resolved).replace(/\.zip\//, `.zip::`);
str = resolve(`zipfile:${str}`);
} break;
// Support neovim native LSP and [typescript-language-server](https://github.com/theia-ide/typescript-language-server)
// We have to resolve the actual file system path from virtual path,
// everything else is up to neovim
case `neovim`: {
str = normalize(resolved).replace(/\.zip\//, `.zip::`);
str = `zipfile://${str}`;
} break;
default: {
str = `zip:${str}`;
} break;
}
} else {
str = str.replace(/^\/?/, process.platform === `win32` ? `` : `/`);
}
}
return str;
}
function fromEditorPath(str) {
switch (hostInfo) {
case `coc-nvim`: {
str = str.replace(/\.zip::/, `.zip/`);
// The path for coc-nvim is in format of /<pwd>/zipfile:/<pwd>/.yarn/...
// So in order to convert it back, we use .* to match all the thing
// before `zipfile:`
return process.platform === `win32`
? str.replace(/^.*zipfile:\//, ``)
: str.replace(/^.*zipfile:/, ``);
} break;
case `neovim`: {
str = str.replace(/\.zip::/, `.zip/`);
// The path for neovim is in format of zipfile:///<pwd>/.yarn/...
return str.replace(/^zipfile:\/\//, ``);
} break;
case `vscode`:
default: {
return str.replace(/^\^?(zip:|\/zip(\/ts-nul-authority)?)\/+/, process.platform === `win32` ? `` : `/`)
} break;
}
}
// Force enable 'allowLocalPluginLoads'
// TypeScript tries to resolve plugins using a path relative to itself
// which doesn't work when using the global cache
// https://github.com/microsoft/TypeScript/blob/1b57a0395e0bff191581c9606aab92832001de62/src/server/project.ts#L2238
// VSCode doesn't want to enable 'allowLocalPluginLoads' due to security concerns but
// TypeScript already does local loads and if this code is running the user trusts the workspace
// https://github.com/microsoft/vscode/issues/45856
const ConfiguredProject = tsserver.server.ConfiguredProject;
const {enablePluginsWithOptions: originalEnablePluginsWithOptions} = ConfiguredProject.prototype;
ConfiguredProject.prototype.enablePluginsWithOptions = function() {
this.projectService.allowLocalPluginLoads = true;
return originalEnablePluginsWithOptions.apply(this, arguments);
};
// And here is the point where we hijack the VSCode <-> TS communications
// by adding ourselves in the middle. We locate everything that looks
// like an absolute path of ours and normalize it.
const Session = tsserver.server.Session;
const {onMessage: originalOnMessage, send: originalSend} = Session.prototype;
let hostInfo = `unknown`;
Object.assign(Session.prototype, {
onMessage(/** @type {string | object} */ message) {
const isStringMessage = typeof message === 'string';
const parsedMessage = isStringMessage ? JSON.parse(message) : message;
if (
parsedMessage != null &&
typeof parsedMessage === `object` &&
parsedMessage.arguments &&
typeof parsedMessage.arguments.hostInfo === `string`
) {
hostInfo = parsedMessage.arguments.hostInfo;
if (hostInfo === `vscode` && process.env.VSCODE_IPC_HOOK) {
const [, major, minor] = (process.env.VSCODE_IPC_HOOK.match(
// The RegExp from https://semver.org/ but without the caret at the start
/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
) ?? []).map(Number)
if (major === 1) {
if (minor < 61) {
hostInfo += ` <1.61`;
} else if (minor < 66) {
hostInfo += ` <1.66`;
} else if (minor < 68) {
hostInfo += ` <1.68`;
}
}
}
}
const processedMessageJSON = JSON.stringify(parsedMessage, (key, value) => {
return typeof value === 'string' ? fromEditorPath(value) : value;
});
return originalOnMessage.call(
this,
isStringMessage ? processedMessageJSON : JSON.parse(processedMessageJSON)
);
},
send(/** @type {any} */ msg) {
return originalSend.call(this, JSON.parse(JSON.stringify(msg, (key, value) => {
return typeof value === `string` ? toEditorPath(value) : value;
})));
}
});
return tsserver;
};
const [major, minor] = absRequire(`typescript/package.json`).version.split(`.`, 2).map(value => parseInt(value, 10));
// In TypeScript@>=5.5 the tsserver uses the public TypeScript API so that needs to be patched as well.
// Ref https://github.com/microsoft/TypeScript/pull/55326
if (major > 5 || (major === 5 && minor >= 5)) {
moduleWrapper(absRequire(`typescript`));
}
// Defer to the real typescript/lib/tsserver.js your application uses
module.exports = moduleWrapper(absRequire(`typescript/lib/tsserver.js`));
@@ -1,248 +0,0 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsserverlibrary.js
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
const moduleWrapper = exports => {
return wrapWithUserWrapper(moduleWrapperFn(exports));
};
const moduleWrapperFn = tsserver => {
if (!process.versions.pnp) {
return tsserver;
}
const {isAbsolute} = require(`path`);
const pnpApi = require(`pnpapi`);
const isVirtual = str => str.match(/\/(\$\$virtual|__virtual__)\//);
const isPortal = str => str.startsWith("portal:/");
const normalize = str => str.replace(/\\/g, `/`).replace(/^\/?/, `/`);
const dependencyTreeRoots = new Set(pnpApi.getDependencyTreeRoots().map(locator => {
return `${locator.name}@${locator.reference}`;
}));
// VSCode sends the zip paths to TS using the "zip://" prefix, that TS
// doesn't understand. This layer makes sure to remove the protocol
// before forwarding it to TS, and to add it back on all returned paths.
function toEditorPath(str) {
// We add the `zip:` prefix to both `.zip/` paths and virtual paths
if (isAbsolute(str) && !str.match(/^\^?(zip:|\/zip\/)/) && (str.match(/\.zip\//) || isVirtual(str))) {
// We also take the opportunity to turn virtual paths into physical ones;
// this makes it much easier to work with workspaces that list peer
// dependencies, since otherwise Ctrl+Click would bring us to the virtual
// file instances instead of the real ones.
//
// We only do this to modules owned by the the dependency tree roots.
// This avoids breaking the resolution when jumping inside a vendor
// with peer dep (otherwise jumping into react-dom would show resolution
// errors on react).
//
const resolved = isVirtual(str) ? pnpApi.resolveVirtual(str) : str;
if (resolved) {
const locator = pnpApi.findPackageLocator(resolved);
if (locator && (dependencyTreeRoots.has(`${locator.name}@${locator.reference}`) || isPortal(locator.reference))) {
str = resolved;
}
}
str = normalize(str);
if (str.match(/\.zip\//)) {
switch (hostInfo) {
// Absolute VSCode `Uri.fsPath`s need to start with a slash.
// VSCode only adds it automatically for supported schemes,
// so we have to do it manually for the `zip` scheme.
// The path needs to start with a caret otherwise VSCode doesn't handle the protocol
//
// Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910
//
// 2021-10-08: VSCode changed the format in 1.61.
// Before | ^zip:/c:/foo/bar.zip/package.json
// After | ^/zip//c:/foo/bar.zip/package.json
//
// 2022-04-06: VSCode changed the format in 1.66.
// Before | ^/zip//c:/foo/bar.zip/package.json
// After | ^/zip/c:/foo/bar.zip/package.json
//
// 2022-05-06: VSCode changed the format in 1.68
// Before | ^/zip/c:/foo/bar.zip/package.json
// After | ^/zip//c:/foo/bar.zip/package.json
//
case `vscode <1.61`: {
str = `^zip:${str}`;
} break;
case `vscode <1.66`: {
str = `^/zip/${str}`;
} break;
case `vscode <1.68`: {
str = `^/zip${str}`;
} break;
case `vscode`: {
str = `^/zip/${str}`;
} break;
// To make "go to definition" work,
// We have to resolve the actual file system path from virtual path
// and convert scheme to supported by [vim-rzip](https://github.com/lbrayner/vim-rzip)
case `coc-nvim`: {
str = normalize(resolved).replace(/\.zip\//, `.zip::`);
str = resolve(`zipfile:${str}`);
} break;
// Support neovim native LSP and [typescript-language-server](https://github.com/theia-ide/typescript-language-server)
// We have to resolve the actual file system path from virtual path,
// everything else is up to neovim
case `neovim`: {
str = normalize(resolved).replace(/\.zip\//, `.zip::`);
str = `zipfile://${str}`;
} break;
default: {
str = `zip:${str}`;
} break;
}
} else {
str = str.replace(/^\/?/, process.platform === `win32` ? `` : `/`);
}
}
return str;
}
function fromEditorPath(str) {
switch (hostInfo) {
case `coc-nvim`: {
str = str.replace(/\.zip::/, `.zip/`);
// The path for coc-nvim is in format of /<pwd>/zipfile:/<pwd>/.yarn/...
// So in order to convert it back, we use .* to match all the thing
// before `zipfile:`
return process.platform === `win32`
? str.replace(/^.*zipfile:\//, ``)
: str.replace(/^.*zipfile:/, ``);
} break;
case `neovim`: {
str = str.replace(/\.zip::/, `.zip/`);
// The path for neovim is in format of zipfile:///<pwd>/.yarn/...
return str.replace(/^zipfile:\/\//, ``);
} break;
case `vscode`:
default: {
return str.replace(/^\^?(zip:|\/zip(\/ts-nul-authority)?)\/+/, process.platform === `win32` ? `` : `/`)
} break;
}
}
// Force enable 'allowLocalPluginLoads'
// TypeScript tries to resolve plugins using a path relative to itself
// which doesn't work when using the global cache
// https://github.com/microsoft/TypeScript/blob/1b57a0395e0bff191581c9606aab92832001de62/src/server/project.ts#L2238
// VSCode doesn't want to enable 'allowLocalPluginLoads' due to security concerns but
// TypeScript already does local loads and if this code is running the user trusts the workspace
// https://github.com/microsoft/vscode/issues/45856
const ConfiguredProject = tsserver.server.ConfiguredProject;
const {enablePluginsWithOptions: originalEnablePluginsWithOptions} = ConfiguredProject.prototype;
ConfiguredProject.prototype.enablePluginsWithOptions = function() {
this.projectService.allowLocalPluginLoads = true;
return originalEnablePluginsWithOptions.apply(this, arguments);
};
// And here is the point where we hijack the VSCode <-> TS communications
// by adding ourselves in the middle. We locate everything that looks
// like an absolute path of ours and normalize it.
const Session = tsserver.server.Session;
const {onMessage: originalOnMessage, send: originalSend} = Session.prototype;
let hostInfo = `unknown`;
Object.assign(Session.prototype, {
onMessage(/** @type {string | object} */ message) {
const isStringMessage = typeof message === 'string';
const parsedMessage = isStringMessage ? JSON.parse(message) : message;
if (
parsedMessage != null &&
typeof parsedMessage === `object` &&
parsedMessage.arguments &&
typeof parsedMessage.arguments.hostInfo === `string`
) {
hostInfo = parsedMessage.arguments.hostInfo;
if (hostInfo === `vscode` && process.env.VSCODE_IPC_HOOK) {
const [, major, minor] = (process.env.VSCODE_IPC_HOOK.match(
// The RegExp from https://semver.org/ but without the caret at the start
/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
) ?? []).map(Number)
if (major === 1) {
if (minor < 61) {
hostInfo += ` <1.61`;
} else if (minor < 66) {
hostInfo += ` <1.66`;
} else if (minor < 68) {
hostInfo += ` <1.68`;
}
}
}
}
const processedMessageJSON = JSON.stringify(parsedMessage, (key, value) => {
return typeof value === 'string' ? fromEditorPath(value) : value;
});
return originalOnMessage.call(
this,
isStringMessage ? processedMessageJSON : JSON.parse(processedMessageJSON)
);
},
send(/** @type {any} */ msg) {
return originalSend.call(this, JSON.parse(JSON.stringify(msg, (key, value) => {
return typeof value === `string` ? toEditorPath(value) : value;
})));
}
});
return tsserver;
};
const [major, minor] = absRequire(`typescript/package.json`).version.split(`.`, 2).map(value => parseInt(value, 10));
// In TypeScript@>=5.5 the tsserver uses the public TypeScript API so that needs to be patched as well.
// Ref https://github.com/microsoft/TypeScript/pull/55326
if (major > 5 || (major === 5 && minor >= 5)) {
moduleWrapper(absRequire(`typescript`));
}
// Defer to the real typescript/lib/tsserverlibrary.js your application uses
module.exports = moduleWrapper(absRequire(`typescript/lib/tsserverlibrary.js`));
@@ -1,32 +0,0 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real typescript your application uses
module.exports = wrapWithUserWrapper(absRequire(`typescript`));
@@ -1,10 +0,0 @@
{
"name": "typescript",
"version": "5.8.3-sdk",
"main": "./lib/typescript.js",
"type": "commonjs",
"bin": {
"tsc": "./bin/tsc",
"tsserver": "./bin/tsserver"
}
}
-7
View File
@@ -1,7 +0,0 @@
# vscode-java-configs
## FAQ
### Typescript Server crashed 5 times
- Open `.pnp.cjs` and replace `bestCandidate.apiPaths.length === 1` with `bestCandidate.apiPaths.length > 0`
-3
View File
@@ -1,3 +0,0 @@
{
"targetPlatform": "./org.jkiss.cloudbeaver.tp.target"
}
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="org.jkiss.cloudbeaver.tp">
<locations>
<location path="../../../dbeaver-workspace/dependencies/plugins" type="Directory"/>
</locations>
</target>
-7
View File
@@ -1,7 +0,0 @@
{
"name": "vscode-java-configs",
"packageManager": "yarn@4.9.2",
"devDependencies": {
"typescript": "^5.8.3"
}
}
-34
View File
@@ -1,34 +0,0 @@
# This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution!
__metadata:
version: 8
cacheKey: 10c0
"typescript@npm:^5.8.3":
version: 5.8.3
resolution: "typescript@npm:5.8.3"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/5f8bb01196e542e64d44db3d16ee0e4063ce4f3e3966df6005f2588e86d91c03e1fb131c2581baf0fb65ee79669eea6e161cd448178986587e9f6844446dbb48
languageName: node
linkType: hard
"typescript@patch:typescript@npm%3A^5.8.3#optional!builtin<compat/typescript>":
version: 5.8.3
resolution: "typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=5786d5"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10c0/39117e346ff8ebd87ae1510b3a77d5d92dae5a89bde588c747d25da5c146603a99c8ee588c7ef80faaf123d89ed46f6dbd918d534d641083177d5fac38b8a1cb
languageName: node
linkType: hard
"vscode-java-configs@workspace:.":
version: 0.0.0-use.local
resolution: "vscode-java-configs@workspace:."
dependencies:
typescript: "npm:^5.8.3"
languageName: unknown
linkType: soft
+47 -44
View File
@@ -1,61 +1,64 @@
<img src="https://github.com/dbeaver/cloudbeaver/wiki/images/cloudbeaver-logo.png" align="right" width="250"/>
# CloudBeaver Community
<img src="https://github.com/dbeaver/cloudbeaver/wiki/images/cloudbeaver-logo.png" width="250"/>
Cloud Database Manager - Community Edition.
CloudBeaver is a web server that provides a rich web interface. The server itself is a Java application, and the web part is written in TypeScript and React.
CloudBeaver is a web server which provides rich web interface. Server itself is a Java application, web part is written on TypeScript and React.
It is free to use and open-source (licensed under [Apache 2](https://github.com/dbeaver/cloudbeaver/blob/devel/LICENSE) license).
See our [WIKI](https://github.com/dbeaver/cloudbeaver/wiki) for more details.
See out [WIKI](https://github.com/dbeaver/cloudbeaver/wiki) for more details.
<a><img src="https://github.com/dbeaver/cloudbeaver/wiki/images/connection-creation-demo.png" width="400"/></a>
<img src="https://github.com/dbeaver/cloudbeaver/wiki/images/gis-demo.png" width="400"/>
<img src="https://github.com/dbeaver/cloudbeaver/wiki/images/data-transfer-demo.png" width="400"/>
<img src="https://github.com/dbeaver/cloudbeaver/wiki/images/sql-editor-demo.png" width="400"/>
![](https://github.com/dbeaver/cloudbeaver/wiki/images/demo_screenshot_1.png)
## Run in Docker
## Build CloudBeaver
- [Official Docker repository](https://hub.docker.com/r/dbeaver/cloudbeaver)
- [Deployment instructions](https://github.com/dbeaver/cloudbeaver/wiki/CloudBeaver-Deployment)
CloudBeaver is the multi-platform server side application.
It can run on Linux, Windows and MacOS X.
[Detailed instructions](https://github.com/dbeaver/cloudbeaver/wiki/Build-and-deploy)
## Demo server
You can see a live demo of CloudBeaver here: https://demo.cloudbeaver.io
You can see live demo of CloudBeaver here: https://demo.cloudbeaver.io
[Database access instructions](https://github.com/dbeaver/cloudbeaver/wiki/Demo-Server)
## Changelog
### 25.2.0 2025-09-01
### Changes since 25.1.0:
- Administration:
- Added support for multiple server URLs to accommodate different access policies for internal and external users, improving flexibility in network-restricted environments. To set it up, use the Allowed Server URLs field in the Server configuration within the Administration section;
- Added the Force HTTPS mode setting in Server Configuration to enforce redirecting from HTTP to HTTPS. This setting helps avoid a potential man-in-the-middle attack. This setting is turned off by default. Please remember to configure your proxy before enabling;
- Added the CLOUDBEAVER_BIND_SESSION_TO_IP option to improve session security by linking user sessions to their IP address. It is disabled by default. When enabled, this helps protect against certain types of session hijacking attacks, where an attacker could try to take over a user’s session. Note: Users will be logged out automatically on the IP address change (switching networks or using mobile data);
- A password confirmation field has been added for administrators in the Easy Config section to prevent accidental misconfigurations.
- SQL Editor:
- Changed the default engine used for autocompletion in the SQL Editor. This Semantic engine offers improved suggestions for database objects, keywords, and functions. You can switch back to the Legacy engine in Preferences > SQL Editor;
- A “Clear” button was added to the output panel.
- Data Editor:
- Column descriptions were added in the Data Editor under column names to provide more metadata context. You can disable this in Preferences > Data Viewer;
- Added an ability to review the script before execution when users edit tables without primary keys.
- General:
- Added a new welcome screen for a freshly opened application. This screen contains shortcuts to create a new connection, open SQL Editor, or documentation;
- Added a search panel for SQL Editor and Value panel: press Ctrl/Cmd + F to open a panel that allows searching and replacing by keyword or regular expression;
- Changed the data transfer mechanism to avoid intermediate file creation. The parameter dataExportFileSizeLimit was removed from the server configuration as deprecated;
- The CloudBeaver default theme matches the device theme by default now. You can change this behavior in user preferences under the Theme section;
- Added the option to display tabs across multiple rows, allowing you to see all tabs without scrolling. You can enable this in Preferences > Interface;
- Improved dark theme accessibility by enhancing color contrast across the app for better readability and compliance with accessibility standards;
- The database navigator now automatically hides empty folders in shared projects, reducing visual clutter and speeding up the process of finding active connections.
- Databases and drivers:
- Clickhouse: fixed the presentation of tuples and map data types in the Data Editor;
- Databend database support has been added (thanks to @hantmac);
- DuckDB: driver has been updated to version 1.3;
- MySQL: Improved performance when retrieving foreign keys metadata;
- PostgreSQL: fixed misplaced comment for table DDL generation.
### CloudBeaver 1.1.0 - 2020-07-14
## Contribution
As a community-driven open-source project, we warmly welcome contributions through GitHub pull requests.
- Connection management and authentication redesign
- Webpack build minimization
- A lot of minor UI improvements
- Many minor UI improvements
[We are happy to reward](https://dbeaver.com/help-dbeaver/) our most active contributors every major sprint.
The most significant contribution to our code for the major release 25.2.0 was made by:
1. [hantmac](https://github.com/hantmac) - added support for Databend in CloudBeaver Community Edition.
### CloudBeaver 1.0.4 - 2020-06-16
- Database navigator refresh
- Data viewer: filters support
- Many minor UI improvements
### CloudBeaver 1.0.3 - 2020-06-02
- Administrative panel
- User management
- Authentication model redesign
- Build artifacts minimization
- Many minor UI improvements
### CloudBeaver 1.0.2 - 2020-05-19
- Data export feature UI was improved
- User authentication and permission management
- Driver management was redesigned
- Clickhouse driver was added
- Build procedure was redesigned
- Many minor bugfixes
### CloudBeaver 1.0.1 - 2020-05-05
- Data export feature added to the data viewer
- H2 embedded database driver was added
- User authentication API was added
- Product configuration framework and API was added
- Embedded database for user management was added
- Many minor bugfixes
-18
View File
@@ -1,18 +0,0 @@
# Security Policy
## Supported Versions
Use this section to tell people about which versions of your project are
currently being supported with security updates.
| Version | Supported |
| ------- | --------- |
| 22.x | yes |
| 23.x | yes |
| 24.x | yes |
## Reporting a Vulnerability
Please report (suspected) security vulnerabilities to devops@dbeaver.com.
You will receive a response from us within 48 hours.
If the issue is confirmed, we will release a patch as soon as possible, depending on complexity, but historically, within a few days.
-27
View File
@@ -1,27 +0,0 @@
# H2 Query Executor
Applications for executing h2 database queries through the console and running queries to fix the CloudBeaver database
## How to build
Use mvn clean install to build executable jar.
## Arguments:
**--db-path** - path to cloudbeaver database
**--db-user** - cloudbeaver database username
**--db-password-path** - path to .database.credentials.dat
**--db-password** - database password(use only password or db-password-path, not both)
**--db-custom-query** - execute custom sql query
**--db-execute-11-migration-fix** - mark that scripts to fix broken migration must be executed
## Example:
java -jar h2-query-executor-1.0.0.jar --db-path=/var/cloudbeaver/workspace/.data/cb.h2.dat.mv.db --db-user=cb-data
--db-password-path=/var/cloudbeaver/workspace/.data/.database-credentials.dat --db-custom-query="show tables"
-56
View File
@@ -1,56 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>io.cloudbeaver</groupId>
<artifactId>h2-query-executor</artifactId>
<version>1.0.0</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.1.214</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.4.2</version>
<configuration>
<archive>
<manifest>
<mainClass>
io.cloudbeaver.H2ExecutorConsoleApplication
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>assemble-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -1,33 +0,0 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 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;
import java.util.HashMap;
import java.util.Map;
public class ArgsParser {
public static Map<String, String> parseArgs(String[] args) {
var result = new HashMap<String, String>();
for (String arg : args) {
var keyValue = arg.split("=");
var key = keyValue[0].replaceAll("--", "");
var value = keyValue.length > 1 ? keyValue[1] : null;
result.put(key, value);
}
return result;
}
}
@@ -1,76 +0,0 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 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;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Map;
import java.util.Properties;
public class H2ExecutorConsoleApplication {
private static final String ARG_DB_PATH = "db-path";
private static final String ARG_DB_USER = "db-user";
private static final String ARG_DB_PASSWORD = "db-password";
private static final String ARG_DB_PASSWORD_PATH = "db-password-path";
private static final String ARG_DB_CUSTOM_QUERY = "db-custom-query";
private static final String ARG_EXECUTE_11_MIGRATION_FIX = "db-execute-11-migration-fix";
public static void main(String[] args) throws Exception {
var parsedArgs = ArgsParser.parseArgs(args);
var dbPath = validateAndGetValue(ARG_DB_PATH, parsedArgs);
var dbUser = validateAndGetValue(ARG_DB_USER, parsedArgs);
String dbPassword = null;
if (parsedArgs.containsKey(ARG_DB_PASSWORD)) {
dbPassword = validateAndGetValue(ARG_DB_PASSWORD, parsedArgs);
} else if (parsedArgs.containsKey(ARG_DB_PASSWORD_PATH)) {
var dbPasswordFilePath = validateAndGetValue(ARG_DB_PASSWORD_PATH, parsedArgs);
dbPassword = Files.readString(Path.of(dbPasswordFilePath));
}
if (dbPassword == null) {
throw new RuntimeException("Database password not specified");
}
var dbUrl = "jdbc:h2:file:" + dbPath.replaceAll(".mv.db", "");
var props = new Properties();
props.put("user", dbUser);
props.put("password", dbPassword);
var executor = new H2QueryExecutor(dbUrl, props);
process(executor, parsedArgs);
}
private static String validateAndGetValue(String argName, Map<String, String> ars) {
String argValue = ars.get(argName);
if (argValue == null) {
throw new RuntimeException(argName + " parameter not specified");
}
return argValue;
}
public static void process(H2QueryExecutor executor, Map<String, String> args) throws Exception {
if (args.containsKey(ARG_DB_CUSTOM_QUERY)) {
var customQuery = validateAndGetValue(ARG_DB_CUSTOM_QUERY, args);
executor.executeQuery(customQuery);
}
if (args.containsKey(ARG_EXECUTE_11_MIGRATION_FIX)) {
System.out.println("Start to execute migration fix");
executor.execute11MigrationFix();
}
}
}
@@ -1,63 +0,0 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 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;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
public class H2QueryExecutor {
private final String dbUrl;
private final Properties dbProperties;
public H2QueryExecutor(String dbUrl, Properties dbProperties) {
this.dbUrl = dbUrl;
this.dbProperties = dbProperties;
}
public void executeQuery(String query) throws SQLException, ClassNotFoundException {
System.out.println("Execute query: " + query);
try (
var connection = DriverManager.getConnection(dbUrl, dbProperties);
var statement = connection.createStatement()
) {
statement.execute(query);
var result = statement.getResultSet();
if (result == null) {
return;
}
var meta = result.getMetaData();
while (result.next()) {
for (var i = 1; i <= meta.getColumnCount(); i++) {
var className = meta.getColumnClassName(i);
var clazz = Class.forName(className);
System.out.print(result.getObject(i, clazz) + " ");
}
System.out.println();
}
}
}
public void execute11MigrationFix() throws SQLException, ClassNotFoundException {
var queries = SqlConsts.fix11MigrationQueries.split(";");
for (String query : queries) {
executeQuery(query);
}
}
}
@@ -1,53 +0,0 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 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;
public class SqlConsts {
public static final String fix11MigrationQueries = "" +
"CREATE TABLE CB_USER_TEAM\n" +
"(\n" +
" USER_ID VARCHAR(128) NOT NULL,\n" +
" TEAM_ID VARCHAR(128) NOT NULL,\n" +
"\n" +
" GRANT_TIME TIMESTAMP NOT NULL,\n" +
" GRANTED_BY VARCHAR(128) NOT NULL,\n" +
"\n" +
" PRIMARY KEY (USER_ID, TEAM_ID),\n" +
" FOREIGN KEY (USER_ID) REFERENCES CB_USER (USER_ID) ON DELETE CASCADE,\n" +
" FOREIGN KEY (TEAM_ID) REFERENCES CB_TEAM (TEAM_ID) ON DELETE NO ACTION\n" +
");\n" +
"\n" +
"INSERT INTO CB_USER_TEAM (USER_ID, TEAM_ID, GRANT_TIME, GRANTED_BY)\n" +
"SELECT USER_ID, ROLE_ID, GRANT_TIME, GRANTED_BY FROM CB_USER_ROLE;\n" +
"\n" +
"CREATE TABLE CB_EXTERNAL_TEAM\n" +
"(\n" +
" TEAM_ID VARCHAR(128) NOT NULL,\n" +
" EXTERNAL_TEAM_ID VARCHAR(128) NOT NULL,\n" +
"\n" +
" PRIMARY KEY (TEAM_ID,EXTERNAL_TEAM_ID),\n" +
" FOREIGN KEY (TEAM_ID) REFERENCES CB_TEAM (TEAM_ID) ON DELETE CASCADE\n" +
");\n" +
"\n" +
"DROP TABLE CB_USER_ROLE;\n" +
"DROP TABLE CB_ROLE;\n" +
"\n" +
"\n" +
"DELETE FROM CB_SCHEMA_INFO where VERSION > 0;\n" +
"INSERT INTO CB_SCHEMA_INFO (VERSION,UPDATE_TIME) VALUES(11,CURRENT_TIMESTAMP)\n" +
"\n";
}
@@ -1,4 +0,0 @@
{
"folders": {},
"connections": {}
}
-99
View File
@@ -1,99 +0,0 @@
{
server: {
serverPort: "${CLOUDBEAVER_WEB_SERVER_PORT:8978}",
forceHttps: "${CLOUDBEAVER_FORCE_HTTPS:false}",
contentRoot: "web",
driversLocation: "drivers",
sslConfigurationPath:"${CLOUDBEAVER_SSL_CONF_PATH:workspace/.data/ssl-config.xml}",
rootURI: "${CLOUDBEAVER_ROOT_URI:/}",
serviceURI: "/api/",
supportedHosts: [],
productSettings: {
# Global properties
core.theming.theme: "${CLOUDBEAVER_CORE_THEMING_THEME:system}",
core.localization.language: "${CLOUDBEAVER_CORE_LOCALIZATION:en}",
plugin.sql-editor.autoSave: "${CLOUDBEAVER_SQL_EDITOR_AUTOSAVE:true}",
plugin.sql-editor.disabled: "${CLOUDBEAVER_SQL_EDITOR_DISABLED:false}",
# max size of the file that can be uploaded to the editor (in kilobytes)
plugin.sql-editor.maxFileSize: "${CLOUDBEAVER_SQL_EDITOR_MAX_FILE_SIZE:10240}",
plugin.log-viewer.disabled: "${CLOUDBEAVER_LOG_VIEWER_DISABLED:false}",
plugin.log-viewer.logBatchSize: "${CLOUDBEAVER_LOG_VIEWER_LOG_BATCH_SIZE:1000}",
plugin.log-viewer.maxLogRecords: "${CLOUDBEAVER_LOG_VIEWER_MAX_LOG_RECORDS:2000}",
sql.proposals.insert.table.alias: "${CLOUDBEAVER_SQL_PROPOSALS_INSERT_TABLE_ALIAS:PLAIN}",
SQLEditor.ContentAssistant.experimental.mode: "${CLOUDBEAVER_SQL_EDITOR_CONTENT_ASSISTANT_EXPERIMENTAL_MODE:NEW}"
},
expireSessionAfterPeriod: "${CLOUDBEAVER_EXPIRE_SESSION_AFTER_PERIOD:1800000}",
bindSessionToIp: "${CLOUDBEAVER_BIND_SESSION_TO_IP:disable}",
develMode: "${CLOUDBEAVER_DEVEL_MODE:false}",
enableSecurityManager: false,
sm: {
enableBruteForceProtection: "${CLOUDBEAVER_BRUTE_FORCE_PROTECTION_ENABLED:true}",
maxFailedLogin: "${CLOUDBEAVER_MAX_FAILED_LOGINS:10}",
minimumLoginTimeout: "${CLOUDBEAVER_MINIMUM_LOGIN_TIMEOUT:1}",
blockLoginPeriod: "${CLOUDBEAVER_BLOCK_PERIOD:300}",
passwordPolicy: {
minLength: "${CLOUDBEAVER_POLICY_MIN_LENGTH:8}",
requireMixedCase: "${CLOUDBEAVER_POLICY_REQUIRE_MIXED_CASE:true}",
minNumberCount: "${CLOUDBEAVER_POLICY_MIN_NUMBER_COUNT:1}",
minSymbolCount: "${CLOUDBEAVER_POLICY_MIN_SYMBOL_COUNT:0}"
}
},
database: {
driver: "${CLOUDBEAVER_DB_DRIVER:h2_embedded_v2}",
url: "${CLOUDBEAVER_DB_URL:jdbc:h2:${workspace}/.data/cb.h2v2.dat}",
schema: "${CLOUDBEAVER_DB_SCHEMA:''}",
user: "${CLOUDBEAVER_DB_USER:''}",
password: "${CLOUDBEAVER_DB_PASSWORD:''}",
initialDataConfiguration: "${CLOUDBEAVER_DB_INITIAL_DATA:conf/initial-data.conf}",
pool: {
minIdleConnections: "${CLOUDBEAVER_DB_MIN_IDLE_CONNECTIONS:4}",
maxIdleConnections: "${CLOUDBEAVER_DB_MAX_IDLE_CONNECTIONS:10}",
maxConnections: "${CLOUDBEAVER_DB_MAX_CONNECTIONS:100}",
validationQuery: "${CLOUDBEAVER_DB_VALIDATION_QUERY:SELECT 1}"
},
backupEnabled: "${CLOUDBEAVER_DB_BACKUP_ENABLED:true}"
}
},
app: {
anonymousAccessEnabled: "${CLOUDBEAVER_APP_ANONYMOUS_ACCESS_ENABLED:true}",
anonymousUserRole: user,
defaultUserTeam: "${CLOUDBEAVER_APP_DEFAULT_USER_TEAM:user}",
grantConnectionsAccessToAnonymousTeam: "${CLOUDBEAVER_APP_GRANT_CONNECTIONS_ACCESS_TO_ANONYMOUS_TEAM:false}",
supportsCustomConnections: "${CLOUDBEAVER_APP_SUPPORTS_CUSTOM_CONNECTIONS:false}",
showReadOnlyConnectionInfo: "${CLOUDBEAVER_APP_READ_ONLY_CONNECTION_INFO:false}",
systemVariablesResolvingEnabled: "${CLOUDBEAVER_SYSTEM_VARIABLES_RESOLVING_ENABLED:false}",
forwardProxy: "${CLOUDBEAVER_APP_FORWARD_PROXY:false}",
publicCredentialsSaveEnabled: "${CLOUDBEAVER_APP_PUBLIC_CREDENTIALS_SAVE_ENABLED:true}",
adminCredentialsSaveEnabled: "${CLOUDBEAVER_APP_ADMIN_CREDENTIALS_SAVE_ENABLED:true}",
resourceManagerEnabled: "${CLOUDBEAVER_APP_RESOURCE_MANAGER_ENABLED:true}",
resourceQuotas: {
resourceManagerFileSizeLimit: "${CLOUDBEAVER_RESOURCE_QUOTA_RESOURCE_MANAGER_FILE_SIZE_LIMIT:500000}",
sqlMaxRunningQueries: "${CLOUDBEAVER_RESOURCE_QUOTA_SQL_MAX_RUNNING_QUERIES:100}",
sqlResultSetRowsLimit: "${CLOUDBEAVER_RESOURCE_QUOTA_SQL_RESULT_SET_ROWS_LIMIT:100000}",
sqlTextPreviewMaxLength: "${CLOUDBEAVER_RESOURCE_QUOTA_SQL_TEXT_PREVIEW_MAX_LENGTH:4096}",
sqlBinaryPreviewMaxLength: "${CLOUDBEAVER_RESOURCE_QUOTA_SQL_BINARY_PREVIEW_MAX_LENGTH:261120}"
},
enabledAuthProviders: [
"local"
],
disabledBetaFeatures: [
]
}
}
-16
View File
@@ -1,16 +0,0 @@
{
teams: [
{
subjectId: "admin",
teamName: "Admin",
description: "Administrative access. Has all permissions.",
permissions: [ "admin" ]
},
{
subjectId: "user",
teamName: "User",
description: "All users, including anonymous.",
permissions: [ ]
}
]
}
-21
View File
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%d{dd-MM-yyyy HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n
</Pattern>
</layout>
</appender>
<!-- Disable logback status messages -->
<statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
<logger name="org.jkiss" level="DEBUG"/>
<logger name="io.cloudbeaver" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
</configuration>
-45
View File
@@ -1,45 +0,0 @@
#!/bin/bash
set -Eeo pipefail
set +u
echo "Clone and build Cloudbeaver"
rm -rf ./drivers
rm -rf ./cloudbeaver
mkdir ./cloudbeaver
mkdir ./cloudbeaver/server
mkdir ./cloudbeaver/conf
mkdir ./cloudbeaver/workspace
echo "Pull cloudbeaver platform"
cd ../..
echo "Pull dbeaver platform"
[ ! -d dbeaver ] && git clone --depth 1 https://github.com/dbeaver/dbeaver.git
[ ! -d dbeaver-common ] && git clone --depth 1 https://github.com/dbeaver/dbeaver-common.git
[ ! -d dbeaver-jdbc-libsql ] && git clone --depth 1 https://github.com/dbeaver/dbeaver-jdbc-libsql.git
cd cloudbeaver/deploy
echo "Build CloudBeaver server"
cd ../server/product/aggregate
mvn clean verify $MAVEN_COMMON_OPTS -Dheadless-platform
if [[ "$?" -ne 0 ]] ; then
echo 'Could not perform package'; exit $rc
fi
cd ../../../deploy
echo "Copy server packages"
cp -rp ../server/product/web-server/target/products/io.cloudbeaver.product/all/all/all/* ./cloudbeaver/server
cp -p ./scripts/* ./cloudbeaver
mkdir cloudbeaver/samples
cp -rp ../config/core/* cloudbeaver/conf
cp -rp ../config/GlobalConfiguration/.dbeaver/data-sources.json cloudbeaver/conf/initial-data-sources.conf
mv drivers cloudbeaver
echo "End of backend build"
-31
View File
@@ -1,31 +0,0 @@
#!/bin/bash
set -Eeuo pipefail
echo "Build static content"
mkdir -p ./cloudbeaver/web
cd ../../cloudbeaver/webapp
yarn install --immutable
cd ./packages/product-default
yarn run bundle
if [[ "$?" -ne 0 ]] ; then
echo 'Application build failed'; exit $rc
fi
cd ../../
yarn test
if [[ "$?" -ne 0 ]] ; then
echo 'Frontend tests failed'; exit $rc
fi
cd ../deploy
echo "Copy static content"
cp -rp ../webapp/packages/product-default/lib/* cloudbeaver/web
echo "Cloudbeaver is ready. Run run-server.sh in cloudbeaver folder to start the server."
+11 -36
View File
@@ -1,7 +1,4 @@
@echo off
rem command line arguments
echo Clone and build Cloudbeaver
IF EXIST drivers rmdir /S /Q drivers
@@ -12,22 +9,16 @@ mkdir cloudbeaver\conf
mkdir cloudbeaver\workspace
mkdir cloudbeaver\web
echo Pull cloudbeaver platform
cd ..\..
echo Pull dbeaver platform
cd ../..
IF NOT EXIST dbeaver git clone https://github.com/dbeaver/dbeaver.git
IF NOT EXIST dbeaver-common git clone https://github.com/dbeaver/dbeaver-common.git
IF NOT EXIST dbeaver-jdbc-libsql git clone https://github.com/dbeaver/dbeaver-jdbc-libsql.git
cd cloudbeaver\deploy
echo Build cloudbeaver server
cd ..\server\product\aggregate
call mvn clean verify -Dheadless-platform
call mvn clean package -Dheadless-platform
cd ..\..\..\deploy
@@ -36,42 +27,26 @@ echo Copy server packages
xcopy /E /Q ..\server\product\web-server\target\products\io.cloudbeaver.product\all\all\all\* cloudbeaver\server >NUL
copy scripts\* cloudbeaver >NUL
mkdir cloudbeaver\samples
copy ..\config\core\* cloudbeaver\conf >NUL
copy ..\config\DefaultConfiguration\GlobalConfiguration\.dbeaver\data-sources.json cloudbeaver\conf\initial-data-sources.conf >NUL
mkdir cloudbeaver\samples\db
xcopy /E /Q ..\samples\sample-databases\db cloudbeaver\samples\db >NUL
copy ..\samples\sample-databases\GlobalConfiguration\.dbeaver\data-sources.json cloudbeaver\conf\initial-data-sources.conf >NUL
copy ..\samples\sample-databases\*.conf cloudbeaver\conf >NUL
move drivers cloudbeaver >NUL
echo "Build static content"
mkdir .\cloudbeaver\web
echo Build static content
cd ..\webapp
call yarn
cd .\packages\product-default
call yarn run bundle
if %ERRORLEVEL% neq 0 (
echo 'Application build failed'
exit /b %ERRORLEVEL%
)
cd ..\..\
call yarn test
if %ERRORLEVEL% neq 0 (
echo 'Frontend tests failed'
exit /b %ERRORLEVEL%
)
call lerna bootstrap
call lerna run build --stream --scope=@cloudbeaver/product-default -- -- --mode=production
cd ..\deploy
echo "Copy static content"
echo Copy static content
xcopy /E /Q ..\webapp\packages\product-default\lib cloudbeaver\web >NUL
echo "Cloudbeaver is ready. Run run-server.bat in cloudbeaver folder to start the server."
echo Cloudbeaver is ready. Run run-server.bat in cloudbeaver folder to start the server.
pause
+52 -3
View File
@@ -1,5 +1,54 @@
#!/bin/bash
set -Eeuo pipefail
set -e
source build-backend.sh
source build-frontend.sh
echo "Clone and build Cloudbeaver"
rm -rf ./drivers
rm -rf ./cloudbeaver
mkdir ./cloudbeaver
mkdir ./cloudbeaver/server
mkdir ./cloudbeaver/conf
mkdir ./cloudbeaver/workspace
mkdir ./cloudbeaver/web
echo "Clone dbeaver platform"
cd ../..
[ ! -d dbeaver ] && git clone https://github.com/dbeaver/dbeaver.git
cd cloudbeaver/deploy
echo "Build CloudBeaver server"
cd ../server/product/aggregate
mvn clean package -Dheadless-platform
if [[ "$?" -ne 0 ]] ; then
echo 'Could not perform package'; exit $rc
fi
cd ../../../deploy
echo "Copy server packages"
cp -rp ../server/product/web-server/target/products/io.cloudbeaver.product/all/all/all/* ./cloudbeaver/server
cp -p ./scripts/* ./cloudbeaver
mkdir cloudbeaver/samples
mkdir cloudbeaver/samples/db
cp -rp ../samples/sample-databases/db cloudbeaver/samples/
cp -rp ../samples/sample-databases/GlobalConfiguration/.dbeaver/data-sources.json cloudbeaver/conf/initial-data-sources.conf
cp -p ../samples/sample-databases/*.conf cloudbeaver/conf/
mv drivers cloudbeaver
echo "Build static content"
cd ../webapp
yarn
lerna run bootstrap
lerna run build --stream --scope=@cloudbeaver/product-default -- -- --mode=production
cd ../deploy
echo "Copy static content"
cp -rp ../webapp/packages/product-default/lib/* cloudbeaver/web
echo "Cloudbeaver is ready. Run run-server.bat in cloudbeaver folder to start the server."
+18
View File
@@ -0,0 +1,18 @@
FROM adoptopenjdk/openjdk11:x86_64-ubuntu-jdk-11.0.7_10
RUN apt-get update
RUN apt-get install -y supervisor
#RUN mkdir -p /opt/cloudbeaver
COPY cloudbeaver /opt/cloudbeaver
#RUN ["chmod", "+x", "/opt/cloudbeaver/run-server.sh"]
COPY supervisor/cloudbeaver.conf /etc/supervisor/conf.d/cloudbeaver.conf
EXPOSE 8978
#CMD ["/usr/bin/supervisord"]
WORKDIR /opt/cloudbeaver/
ENTRYPOINT ["./run-server.sh"]
-46
View File
@@ -1,46 +0,0 @@
FROM ubuntu:24.04
MAINTAINER DBeaver Corp, devops@dbeaver.com
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update && \
apt-get dist-upgrade -y --no-install-recommends && \
apt-get install -y --no-install-recommends \
# curl required for historical reasons, see https://github.com/adoptium/containers/issues/255
curl \
# java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory
# java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager
# https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077
fontconfig \
# utilities for keeping Ubuntu and OpenJDK CA certificates in sync
# https://github.com/adoptium/containers/issues/293
ca-certificates p11-kit \
# jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351
# Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory
binutils \
tzdata \
# locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8
locales \
nano && \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \
locale-gen en_US.UTF-8; \
rm -rf /var/lib/apt/lists/*
ENV LANG=en_US.UTF-8
ENV JAVA_HOME=/opt/java/openjdk
COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"
RUN set -eux; \
# https://github.com/docker-library/openjdk/issues/331#issuecomment-498834472
find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/ld.so.conf.d/docker-openjdk.conf; \
ldconfig; \
# https://github.com/docker-library/openjdk/issues/212#issuecomment-420979840
# https://openjdk.java.net/jeps/341
java -Xshare:dump;
### Patch java security
COPY java.security* ${JAVA_HOME}/conf/security/java.security
-21
View File
@@ -1,21 +0,0 @@
ARG BASE_JAVA_TAG="stable"
FROM dbeaver/base-java:${BASE_JAVA_TAG}
MAINTAINER DBeaver Corp, devops@dbeaver.com
ENV DBEAVER_GID=8978
ENV DBEAVER_UID=8978
RUN groupadd -g $DBEAVER_GID dbeaver && \
useradd -g $DBEAVER_GID -m -u $DBEAVER_UID -s /bin/bash dbeaver
COPY cloudbeaver /opt/cloudbeaver
COPY scripts/launch-product.sh /opt/cloudbeaver/launch-product.sh
EXPOSE 8978
RUN find /opt/cloudbeaver -type d -exec chmod 775 {} \;
WORKDIR /opt/cloudbeaver/
RUN chmod +x "run-server.sh" "/opt/cloudbeaver/launch-product.sh"
ENTRYPOINT ["./launch-product.sh"]
+1 -1
View File
@@ -1,3 +1,3 @@
cd ..
docker build -t dbeaver/cloudbeaver:dev . --file ./docker/cloudbeaver-ce/Dockerfile
docker build -t dbeaver/cloudbeaver:dev . --file ./docker/Dockerfile
-19
View File
@@ -1,19 +0,0 @@
#!/bin/bash
# This script is needed to change ownership and run the application as user dbeaver during the upgrade from version 24.2.0
# Change ownership of the WORKDIR to the dbeaver user and group
# Variables DBEAVER_<UID|GID> are defined in the Dockerfile and exported to the runtime environment
# PWD equals WORKDIR value from product Dockerfile
if [ "$(id -u)" -eq 0 ]; then
TARGET_USER=${TARGET_USER:-dbeaver}
TARGET_UID=${TARGET_UID:-$DBEAVER_UID}
TARGET_GID=${TARGET_GID:-$DBEAVER_GID}
chown -R $DBEAVER_UID:$DBEAVER_GID $PWD/workspace
# Execute run-server.sh as the dbeaver user with the JAVA_HOME and PATH environment variables
exec su "$TARGET_USER" -c "JAVA_HOME=$JAVA_HOME PATH=$PATH ./run-server.sh"
else
exec ./run-server.sh
fi
+5 -41
View File
@@ -1,47 +1,11 @@
@echo off
for /f %%a in ('dir /B /S server\plugins\org.jkiss.dbeaver.launcher*.jar') do SET launcherJar="%%a"
@rem echo off
for /f %%a in ('dir /B /S server\plugins\org.eclipse.equinox.launcher*.jar') do SET launcherJar="%%a"
echo "Starting Cloudbeaver Server"
IF NOT EXIST workspace\.metadata (
IF NOT EXIST workspace\GlobalConfiguration\.dbeaver (
mkdir workspace\GlobalConfiguration\.dbeaver\
copy conf\initial-data-sources.conf workspace\GlobalConfiguration\.dbeaver\data-sources.json
)
mkdir workspace\GlobalConfiguration\.dbeaver\
copy conf\initial-data-sources.conf workspace\GlobalConfiguration\.dbeaver\data-sources.json
)
SET VMARGS_OPTS = ""
If Not Defined JAVA_OPTS (
SET VMARGS_OPTS = "-Xmx2048M"
)
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 ^
--add-opens=java.sql/java.sql=ALL-UNNAMED ^
-jar %launcherJar% ^
-product io.cloudbeaver.product.ce.product ^
-data %workspacePath% ^
-web-config conf/cloudbeaver.conf ^
-nl en ^
-registryMultiLanguage
java -jar %launcherJar% -product io.cloudbeaver.product.ce.product -web-config conf/cloudbeaver.conf -nl en -registryMultiLanguage -vmargs -Xmx2048M
+3 -35
View File
@@ -1,41 +1,9 @@
#!/bin/bash
launcherJar=( server/plugins/org.jkiss.dbeaver.launcher*.jar )
launcherJar=( server/plugins/org.eclipse.equinox.launcher*.jar )
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
[ ! -d "workspace/.metadata" ] && mkdir -p workspace/GlobalConfiguration/.dbeaver && cp conf/initial-data-sources.conf workspace/GlobalConfiguration/.dbeaver/data-sources.json
exec 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 \
--add-opens=java.sql/java.sql=ALL-UNNAMED \
-jar ${launcherJar} \
-product io.cloudbeaver.product.ce.product \
-web-config conf/cloudbeaver.conf \
${CLI_OPTS} \
-nl en \
-registryMultiLanguage
java -jar ${launcherJar} -product io.cloudbeaver.product.ce.product -web-config conf/cloudbeaver.conf -nl en -registryMultiLanguage -vmargs -Xmx2048M
-8
View File
@@ -1,8 +0,0 @@
#!/bin/bash
set -Eeo pipefail
CLI_OPTS="$@"
if [[ $# -eq 0 ]] ;
then
CLI_OPTS='-help'
fi
source run-server.sh
+10
View File
@@ -0,0 +1,10 @@
[program:cloudbeaver]
directory=/opt/cloudbeaver/
command=/opt/cloudbeaver/run-server.sh
stopasgroup=true
killasgroup=true
stopsignal=INT
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/cloudbeaver-server.log
-2
View File
@@ -1,2 +0,0 @@
@echo off
%~dp0\..\idea-rcp-launch-config-generator\runGenerator.cmd -f %~dp0
-6
View File
@@ -1,6 +0,0 @@
#!/usr/bin/env sh
script_dir="$(realpath "$(dirname "$0")")"
repositories_root_dir="$(realpath "$script_dir/..")"
"$repositories_root_dir"/idea-rcp-launch-config-generator/runGenerator.sh "$script_dir"
-15
View File
@@ -1,15 +0,0 @@
lefthook: |
cd webapp
yarn dlx --quiet lefthook
output: false
pre-commit:
commands:
check-license:
skip:
- merge
- rebase
root: webapp
glob: "*.{ts,tsx}"
exclude:
- "**/locales/**"
run: yarn core-cli-check-license {staged_files}
-37
View File
@@ -1,37 +0,0 @@
workspaceName=cloudbeaver-ce
featuresPaths=\
dbeaver/features;\
cloudbeaver/server/features;
bundlesPaths=\
dbeaver-common/modules;\
dbeaver/plugins;\
cloudbeaver/server/bundles;\
dbeaver-jdbc-libsql;\
cloudbeaver/server/test
testLibraries=\
org.junit;\
org.mockito.mockito-core;\
junit-jupiter-api;\
org.opentest4j;\
org.hamcrest.core;\
org.hamcrest
repositories=\
https://repo.dbeaver.net/p2/ce/latest/;\
https://download.eclipse.org/releases/${eclipse-version}/;
testBundles=\
org.junit;\
org.mockito.mockito-core;\
junit-jupiter-api;\
org.opentest4j
productsPaths=\
dbeaver/product/community/DBeaver.product;\
cloudbeaver/server/product/web-server/CloudbeaverServer.product:../../opt/cloudbeaver;\
cloudbeaver/server/product/web-server-test/CloudbeaverServerUnitTest.product:../../opt/cloudbeaver;
ideaConfigurationFilesPaths=\
dbeaver/.ide/.idea;
additionalModuleRoots=\
opt;
optionalFeatureRepositories=\
dbeaver/product/repositories
excludeOutputs=\
cloudbeaver/webapp/node_modules
-3
View File
@@ -1,3 +0,0 @@
dbeaver-common
dbeaver-jdbc-libsql
dbeaver
@@ -0,0 +1,39 @@
{
"folders": {},
"connections": {
"sqlite_xerial-sample-database": {
"provider": "generic",
"driver": "sqlite_jdbc",
"name": "SQLite - Chinook (Sample)",
"save-password": true,
"navigator-show-only-entities": false,
"navigator-hide-folders": false,
"read-only": false,
"template": false,
"configuration": {
"database": "${application.path}/../samples/db/Chinook.sqlitedb",
"type": "dev",
"auth-model": "native"
}
},
"postgresql-template-1": {
"provider": "postgresql",
"driver": "postgres-jdbc",
"name": "PostgreSQL (Template)",
"save-password": false,
"show-system-objects": false,
"read-only": true,
"template": true,
"configuration": {
"host": "localhost",
"port": "5432",
"database": "postgres",
"url": "jdbc:postgresql://localhost:5432/postgres",
"type": "dev",
"provider-properties": {
"@dbeaver-show-non-default-db@": "false"
}
}
}
}
}
+3
View File
@@ -0,0 +1,3 @@
### Sample databases
Provides access to locally deployed SQLite sample database
+55
View File
@@ -0,0 +1,55 @@
{
server: {
serverPort: 8978,
workspaceLocation: "workspace",
contentRoot: "web",
driversLocation: "drivers",
rootURI: "/",
serviceURI: "/dbeaver/",
productConfiguration: "conf/product.conf",
expireSessionAfterPeriod: 1800000,
develMode: false,
database: {
driver="h2_embedded",
url: "jdbc:h2:${workspace}/.data/cb.h2.dat",
createDatabase: true,
initialDataConfiguration: "conf/initial-data.conf",
pool: {
minIdleConnections: 4,
maxIdleConnections: 10,
maxConnections: 100,
validationQuery: "SELECT 1"
}
}
},
app: {
anonymousAccessEnabled: true,
authenticationEnabled: true,
anonymousUserRole: "user",
supportsCustomConnections: false
/*
enabledDrivers: [
"postgresql:postgres-jdbc",
"mysql:mysql8",
"mysql:mariaDB",
"generic:sqlite_jdbc",
"generic:derby_server",
"generic:h2_embedded",
"jaybird:jaybird",
]
*/
}
}
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
Chinook Database - Version 1.3
Script: Chinook_Sqlite.sql
Description: Creates and populates the Chinook database.
DB Server: Sqlite
Author: Luis Rocha
License: http://www.codeplex.com/ChinookDatabase/license
@@ -0,0 +1,16 @@
{
roles: [
{
roleId: "admin",
name: "Admin",
description: "Administrative access. Has all permissions.",
permissions: [ "public", "admin" ]
},
{
roleId: "user",
name: "User",
description: "Standard user.",
permissions: [ "public" ]
}
]
}
+25
View File
@@ -0,0 +1,25 @@
// Product configuration. Customized web application behavior
// It is in JSONC format
{
// Global properties
core: {
// User defaults
user: {
defaultTheme: "light",
defaultLanguage: "en"
},
app: {
// Log viewer config
logViewer: {
refreshTimeout: 3000,
logBatchSize: 1000,
maxLogRecords: 2000,
maxFailedRequests: 3
}
}
},
// Notifications config
core_events: {
notificationsPool: 5
}
}
-9
View File
@@ -1,9 +0,0 @@
projects:
schema:
include: ./**/*.graphqls
schema: "gql.ce"
extensions:
endpoints:
Default GraphQL Endpoint:
url: http://localhost:8080/api/gql
introspect: false
@@ -0,0 +1,22 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Vendor: %Bundle-Vendor
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: io.cloudbeaver.connect.provider.sample;singleton:=true
Bundle-Version: 1.0.15.qualifier
Bundle-Release-Date: 20201019
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.expressions,
org.apache.commons.logging,
org.eclipse.core.commands,
org.eclipse.core.resources,
io.cloudbeaver.server,
com.google.gson,
org.jkiss.bundle.graphql.java,
org.jkiss.dbeaver.model,
org.jkiss.dbeaver.model.sql
Bundle-Localization: OSGI-INF/l10n/bundle
Automatic-Module-Name: io.cloudbeaver.connect.provider.sample
@@ -0,0 +1,2 @@
Bundle-Vendor = DBeaver Corp
Bundle-Name = Cloudbeaver - Connections configuration - Sample
@@ -0,0 +1,6 @@
source.. = src/
output.. = target/classes/
bin.includes = .,\
META-INF/,\
OSGI-INF/,\
plugin.xml
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension point="org.jkiss.dbeaver.dataSourceStorage">
<storage id="sample" name="Sample configuration storage" description="Preconfigured sample connection set" class="io.cloudbeaver.connect.provider.sample.SampleDataSourceConfigurationStorage">
</storage>
</extension>
</plugin>
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.cloudbeaver</groupId>
<artifactId>bundles</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>io.cloudbeaver.connect.provider.sample</artifactId>
<version>1.0.15-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
@@ -0,0 +1,87 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2020 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.connect.provider.sample;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.DBPDataSourceConfigurationStorage;
import org.jkiss.dbeaver.model.DBPDataSourceContainer;
import org.jkiss.dbeaver.model.app.DBPDataSourceRegistry;
import java.io.File;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* Sample configuration storage.
* Is the main source of data in web application
*/
public class SampleDataSourceConfigurationStorage implements DBPDataSourceConfigurationStorage {
private static final Log log = Log.getLog(SampleDataSourceConfigurationStorage.class);
public static final String SAMPLE_CONFIG_NAME = "provided-connections.json";
@Override
public String getStorageId() {
return "Sample";
}
@Override
public boolean isValid() {
return false;
}
@Override
public boolean isDefault() {
return false;
}
@Override
public boolean isDynamic() {
return false;
}
@Override
public String getStatus() {
return "Valid";
}
@Override
public List<? extends DBPDataSourceContainer> loadDataSources(DBPDataSourceRegistry registry, Map<String, Object> options) throws DBException {
File metadataFolder = registry.getProject().getMetadataFolder(false);
if (metadataFolder.exists()) {
File sampleConfigFile = new File(metadataFolder, SAMPLE_CONFIG_NAME);
if (sampleConfigFile.exists()) {
log.debug("Loading provided connections from [" + sampleConfigFile.getAbsolutePath() + "]");
List<? extends DBPDataSourceContainer> dsList = registry.loadDataSourcesFromFile(this, sampleConfigFile);
// for (DBPDataSourceContainer ds : dsList) {
// log.debug("\tProvided connection: " + ds.getName());
// }
return dsList;
}
}
return Collections.emptyList();
}
@Override
public String getConfigurationFileSuffix() {
return "-sample";
}
}
@@ -1,54 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Vendor: DBeaver Corp
Bundle-Name: Cloudbeaver Web Model
Bundle-SymbolicName: io.cloudbeaver.model;singleton:=true
Bundle-Version: 1.0.85.qualifier
Bundle-Release-Date: 20250922
Bundle-RequiredExecutionEnvironment: JavaSE-21
Bundle-ActivationPolicy: lazy
Require-Bundle: org.jkiss.dbeaver.data.gis;visibility:=reexport,
org.jkiss.dbeaver.model;visibility:=reexport,
org.jkiss.dbeaver.model.cli;visibility:=reexport,
org.jkiss.dbeaver.model.sm;visibility:=reexport,
org.jkiss.dbeaver.model.event;visibility:=reexport,
org.jkiss.dbeaver.model.nio;visibility:=reexport,
org.jkiss.dbeaver.registry;visibility:=reexport,
org.jkiss.dbeaver.net.ssh,
org.jkiss.bundle.graphql;visibility:=reexport,
org.jkiss.bundle.apache.dbcp,
com.google.gson;visibility:=reexport,
jakarta.servlet-api;bundle-version:="6.0.0";visibility:=reexport
Export-Package: io.cloudbeaver,
io.cloudbeaver.auth,
io.cloudbeaver.auth.provider,
io.cloudbeaver.auth.provider.fa,
io.cloudbeaver.auth.provider.local,
io.cloudbeaver.auth.provisioning,
io.cloudbeaver.websocket,
io.cloudbeaver.model,
io.cloudbeaver.model.app,
io.cloudbeaver.model.config,
io.cloudbeaver.model.apilog,
io.cloudbeaver.model.cli,
io.cloudbeaver.model.events,
io.cloudbeaver.model.fs,
io.cloudbeaver.model.log,
io.cloudbeaver.model.rm,
io.cloudbeaver.model.rm.local,
io.cloudbeaver.model.rm.lock,
io.cloudbeaver.model.session,
io.cloudbeaver.model.user,
io.cloudbeaver.model.utils,
io.cloudbeaver.registry,
io.cloudbeaver.server,
io.cloudbeaver.server.filters,
io.cloudbeaver.service,
io.cloudbeaver.service.admin,
io.cloudbeaver.service.security,
io.cloudbeaver.service.sql,
io.cloudbeaver.test,
io.cloudbeaver.utils,
io.cloudbeaver.utils.file
Automatic-Module-Name: io.cloudbeaver.model
Import-Package: org.slf4j
@@ -1,19 +0,0 @@
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.osInfo.name=OS
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.memoryAvailable.name=Memory available
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.javaVersion.name=Java version
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.javaParameters.name=JVM parameters
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.productName.name=Product name
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.productVersion.name=Product version
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.workspacePath.name=Workspace path
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.installPath.name=Install path
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.deploymentType.name=Deployment type
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.smDbUrl.name=Security manager database URL
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.smDbDriverName.name=Security manager database driver name
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.smDbProductName.name=Security manager database product name
meta.io.cloudbeaver.model.app.ServletSystemInformationCollector.smDbProductVersion.name=Security manager database product version
meta.io.cloudbeaver.model.WebExpertSettingsProperties.readOnly.name = Read-only connection
meta.io.cloudbeaver.model.WebExpertSettingsProperties.autoCommit.name = Auto-commit
meta.io.cloudbeaver.model.WebExpertSettingsProperties.keepAliveInterval.name = Keep-alive interval (seconds)
meta.io.cloudbeaver.model.WebExpertSettingsProperties.defaultSchema.name = Default schema
meta.io.cloudbeaver.model.WebExpertSettingsProperties.defaultCatalog.name = Default catalog
@@ -1,2 +0,0 @@
meta.io.cloudbeaver.model.WebExpertSettingsProperties.keepAliveInterval.name = Garder actif (en secondes)
meta.io.cloudbeaver.model.WebExpertSettingsProperties.keepAliveInterval.description = Pas de déconnexion automatique
@@ -1,5 +0,0 @@
meta.io.cloudbeaver.model.WebExpertSettingsProperties.readOnly.name = Только для чтения
meta.io.cloudbeaver.model.WebExpertSettingsProperties.autoCommit.name = Авто-коммит
meta.io.cloudbeaver.model.WebExpertSettingsProperties.keepAliveInterval.name = Интервал Keep-alive (в секундах)
meta.io.cloudbeaver.model.WebExpertSettingsProperties.defaultSchema.name = Схема по умолчанию
meta.io.cloudbeaver.model.WebExpertSettingsProperties.defaultCatalog.name = Каталог по умолчанию
@@ -1,4 +0,0 @@
meta.io.cloudbeaver.model.WebExpertSettingsProperties.readOnly.name = Kết nối chỉ đọc
meta.io.cloudbeaver.model.WebExpertSettingsProperties.autoCommit.name = Tự động commit
meta.io.cloudbeaver.model.WebExpertSettingsProperties.keepAliveInterval.name = Giữ kết nối (tính bằng giây)
meta.io.cloudbeaver.model.WebExpertSettingsProperties.keepAliveInterval.description = Không tự động ngắt kết nối
@@ -1,3 +0,0 @@
meta.io.cloudbeaver.model.WebExpertSettingsProperties.autoCommit.name = 自动提交
meta.io.cloudbeaver.model.WebExpertSettingsProperties.keepAliveInterval.name = 保持连接 (秒)
meta.io.cloudbeaver.model.WebExpertSettingsProperties.keepAliveInterval.description = 无自动断开连接
@@ -1,7 +0,0 @@
source.. = src/
output.. = target/classes/
bin.includes = .,\
META-INF/,\
OSGI-INF/,\
plugin.xml,\
schema/
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension-point id="io.cloudbeaver.service" name="Web services" schema="schema/io.cloudbeaver.service.exsd"/>
<extension-point id="io.cloudbeaver.feature" name="Web features" schema="schema/io.cloudbeaver.feature.exsd"/>
<extension-point id="io.cloudbeaver.server.feature" name="Web server features" schema="schema/io.cloudbeaver.server.feature.exsd"/>
<extension-point id="io.cloudbeaver.valueSerializer" name="Web value serializers" schema="schema/io.cloudbeaver.valueSerializer.exsd"/>
<extension-point id="org.jkiss.dbeaver.auth.provider" name="%extension-point.org.jkiss.dbeaver.authProvider.name" schema="schema/org.jkiss.dbeaver.authProvider.exsd"/>
<extension-point id="io.cloudbeaver.metaParameters" name="Meta parameters" schema="schema/io.cloudbeaver.metaParameters.exsd"/>
<extension-point id="io.cloudbeaver.rm.file.handler" name="RM file operations handler"
schema="schema/io.cloudbeaver.rmFileHandler.exsd"/>
<extension point="io.cloudbeaver.metaParameters">
<metaParameters type="user">
<propertyGroup label="Main">
<property id="firstName" label="First Name" type="string" description="User first name"/>
<property id="lastName" label="Last Name" type="string" description="User last name"/>
</propertyGroup>
</metaParameters>
</extension>
<extension point="com.dbeaver.secretController">
<controller id="void-secret" class="io.cloudbeaver.model.app.VoidSecretController"
label="Default secret controller" description="Default void secret controller"/>
</extension>
</plugin>
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.cloudbeaver</groupId>
<artifactId>bundles</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>io.cloudbeaver.model</artifactId>
<version>1.0.85-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
@@ -1,34 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="io.cloudbeaver.model" id="io.cloudbeaver.feature" name="Web features"/>
</appInfo>
<documentation>
Web feature
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="feature"/>
</sequence>
</complexType>
</element>
<element name="feature">
<annotation>
<documentation>
Web service description
</documentation>
</annotation>
</element>
</schema>
@@ -1,28 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="io.cloudbeaver.model" id="io.cloudbeaver.metaParameters" name="Subject meta parameters"/>
</appInfo>
<documentation>
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
</element>
<element name="driver">
<annotation>
<documentation>
Web service description
</documentation>
</annotation>
</element>
</schema>
@@ -1,11 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="io.cloudbeaver.rm.file.handler" id="io.cloudbeaver.rm.file.handler" name="RM file operations handler"/>
</appInfo>
<documentation>
RM file operations handler
</documentation>
</annotation>
</schema>
@@ -1,34 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="io.cloudbeaver.model" id="io.cloudbeaver.server.feature" name="Web features"/>
</appInfo>
<documentation>
Web feature
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="feature"/>
</sequence>
</complexType>
</element>
<element name="feature">
<annotation>
<documentation>
Web service description
</documentation>
</annotation>
</element>
</schema>
@@ -1,34 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="io.cloudbeaver.server" id="io.cloudbeaver.valueSerializer" name="Web value serializers"/>
</appInfo>
<documentation>
DBeaver web value serializers
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="serializer"/>
</sequence>
</complexType>
</element>
<element name="serializer">
<annotation>
<documentation>
DBeaver web value serializer
</documentation>
</annotation>
</element>
</schema>
@@ -1,47 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<schema targetNamespace="org.jkiss.dbeaver.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appInfo>
<meta.schema plugin="io.cloudbeaver.model" id="org.jkiss.dbeaver.auth.provider" name="Authentication provider"/>
</appInfo>
<documentation>
DBeaver auth provider
</documentation>
</annotation>
<element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
</element>
<element name="model">
<annotation>
<documentation>
Data source auth model description
</documentation>
</annotation>
</element>
<annotation>
<appInfo>
<meta.section type="appInfo"/>
</appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>
@@ -1,153 +0,0 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 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;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.app.DBPWorkspace;
import org.jkiss.dbeaver.model.auth.SMSessionContext;
import org.jkiss.dbeaver.model.impl.app.BaseProjectImpl;
import org.jkiss.dbeaver.model.rm.RMController;
import org.jkiss.dbeaver.model.rm.RMControllerProvider;
import org.jkiss.dbeaver.model.rm.RMProject;
import org.jkiss.dbeaver.model.rm.RMProjectType;
import org.jkiss.utils.CommonUtils;
import org.jkiss.utils.Pair;
import java.nio.file.Path;
import java.util.Collection;
public abstract class BaseWebProjectImpl extends BaseProjectImpl implements RMControllerProvider {
@NotNull
private final RMProject project;
@NotNull
private final Path path;
@NotNull
private final RMController resourceController;
public BaseWebProjectImpl(
@NotNull DBPWorkspace workspace,
@NotNull RMController resourceController,
@NotNull SMSessionContext sessionContext,
@NotNull RMProject project,
@NotNull Path path
) {
super(workspace, sessionContext);
this.resourceController = resourceController;
this.path = path;
this.project = project;
}
@NotNull
public RMController getResourceController() {
return resourceController;
}
@NotNull
@Override
public RMProject getRMProject() {
return project;
}
@Override
public boolean isVirtual() {
return true;
}
@NotNull
@Override
public String getName() {
return project.getDisplayName();
}
@NotNull
@Override
public String getId() {
return project.getId();
}
@NotNull
@Override
public Path getAbsolutePath() {
return path;
}
@Override
public boolean isOpen() {
return true;
}
@Override
public void ensureOpen() {
}
@Override
public boolean isUseSecretStorage() {
return false;
}
/**
* Method for Bulk Update of resources properties paths
*
* @param oldToNewPaths collection of OldPath to NewPath pairs
*/
public void moveResourcePropertiesBatch(@NotNull Collection<Pair<String, String>> oldToNewPaths) {
loadMetadata();
synchronized (metadataSync) {
for (var pathsPair : oldToNewPaths) {
final var oldResourcePath = CommonUtils.normalizeResourcePath(pathsPair.getFirst());
final var newResourcePath = CommonUtils.normalizeResourcePath(pathsPair.getSecond());
final var resProps = resourceProperties.remove(oldResourcePath);
if (resProps != null) {
resourceProperties.put(newResourcePath, resProps);
}
}
}
flushMetadata();
}
/**
* Method for Bulk Remove of resources properties
*/
public boolean resetResourcesPropertiesBatch(@NotNull Collection<String> resourcesPaths) {
loadMetadata();
boolean propertiesChanged = false;
synchronized (metadataSync) {
for (var resourcePath : resourcesPaths) {
var removedProperties = resourceProperties.remove(CommonUtils.normalizeResourcePath(resourcePath));
if (removedProperties != null) {
propertiesChanged = true;
}
}
}
if (propertiesChanged) {
flushMetadata();
}
return propertiesChanged;
}
public Path getMetadataFilePath() {
return getMetadataPath().resolve(METADATA_STORAGE_FILE);
}
@Override
public boolean isPrivateProject() {
return RMProjectType.USER.equals(getRMProject().getType());
}
}
@@ -1,52 +0,0 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2025 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;
import org.jkiss.dbeaver.model.access.DBAPermissionRealm;
import org.jkiss.dbeaver.model.rm.RMConstants;
/**
* General constants
*/
public interface DBWConstants {
String PERMISSION_ADMIN = DBAPermissionRealm.PERMISSION_ADMIN;
String PERMISSION_CONFIGURATION_MANAGER = RMConstants.PERMISSION_CONFIGURATION_MANAGER;
String PERMISSION_PRIVATE_PROJECT_ACCESS = "private-project-access";
String PERMISSION_SECRET_MANAGER = "secret-manager";
String PERMISSION_SQL_RESULT_UPDATE = "sql-result-update";
String PERMISSION_SQL_EXECUTE_QUERY = "sql-execute-query";
String GLOBAL_PERMISSION_SCRIPT_EXECUTE = "permission.sql.script.execution";
String GLOBAL_PERMISSION_DATA_EDITOR_IMPORT = "permission.data-editor.import";
String GLOBAL_PERMISSION_DATA_EDITOR_EDITING = "permission.data-editor.editing";
String PERMISSION_EDIT_STRUCTURE = "edit-meta";
String PERMISSION_EDIT_DATA = "edit-data";
String STATE_ATTR_SIGN_IN_STATE = "state.signin";
String WORK_DATA_FOLDER_NAME = ".work-data";
enum SignInState {
GLOBAL,
EMBEDDED
}
String TASK_STATUS_FINISHED = "Finished";
//public static final String PERMISSION_USER = "user";
}
@@ -1,41 +0,0 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 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;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.DBPImage;
/**
* Web feature
*/
public interface DBWFeatureSet {
@NotNull
String getId();
@NotNull
String getLabel();
String getDescription();
DBPImage getIcon();
boolean isEnabled();
boolean isEnabledByDefault();
}
@@ -1,94 +0,0 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 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;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* User identity provided by auth provider.
*/
public class DBWUserIdentity {
@NotNull
private final String id;
@NotNull
private final String displayName;
private final Map<String, String> metaParameters = new LinkedHashMap<>();
@Nullable
private String providedUserRole;
@Nullable
private String[] providedTeamIds;
public DBWUserIdentity(@NotNull String id, @NotNull String displayName) {
this(id, displayName, Map.of());
}
public DBWUserIdentity(
@NotNull String id,
@NotNull String displayName,
@NotNull Map<String, String> metaParameters
) {
this.id = id;
this.displayName = displayName;
this.metaParameters.putAll(metaParameters);
}
@NotNull
public String getId() {
return id;
}
@NotNull
public String getDisplayName() {
return displayName;
}
@NotNull
public Map<String, String> getMetaParameters() {
return Map.copyOf(metaParameters);
}
public void setMetaParameter(@NotNull String name, @Nullable String value) {
if (value == null) {
metaParameters.remove(name);
} else {
metaParameters.put(name, value);
}
}
@Nullable
public String getProvidedUserRole() {
return providedUserRole;
}
public void setProvidedUserRole(@Nullable String providedUserRole) {
this.providedUserRole = providedUserRole;
}
@Nullable
public String[] getProvidedTeamIds() {
return providedTeamIds;
}
public void setProvidedTeamIds(@Nullable String[] providedTeamIds) {
this.providedTeamIds = providedTeamIds;
}
}
@@ -1,162 +0,0 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 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;
import graphql.ErrorClassification;
import graphql.ErrorType;
import graphql.GraphQLError;
import graphql.language.SourceLocation;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.sql.SQLState;
import org.jkiss.utils.CommonUtils;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* The activator class controls the plug-in life cycle
*/
public class DBWebException extends DBException implements GraphQLError {
public static final String ERROR_CODE_SESSION_EXPIRED = "sessionExpired";
public static final String ERROR_CODE_ACCESS_DENIED = "accessDenied";
public static final String ERROR_CODE_SERVER_NOT_INITIALIZED = "serverNotInitialized";
public static final String ERROR_CODE_LICENSE_DENIED = "licenseRequired";
public static final String ERROR_CODE_IDENT_REQUIRED = "identRequired";
public static final String ERROR_CODE_AUTH_REQUIRED = "authRequired";
public static final String ERROR_CODE_QUOTA_EXCEEDED = "quotaExceeded";
private List<Object> path;
private List<SourceLocation> locations;
private String webErrorCode;
public DBWebException(String message) {
super(message);
}
public DBWebException(String message, String errorCode) {
super(message);
this.webErrorCode = errorCode;
}
public DBWebException(String message, Throwable cause) {
super(makeMessage(message, cause), cause);
}
public DBWebException(String message, String errorCode, Throwable cause) {
this(message, cause);
this.webErrorCode = errorCode;
}
public DBWebException(Throwable cause) {
super(null, cause);
}
public String getWebErrorCode() {
return webErrorCode;
}
@Override
public List<Object> getPath() {
return path;
}
public void setPath(List<Object> path) {
this.path = path;
}
@Override
public List<SourceLocation> getLocations() {
return locations;
}
public void setLocations(List<SourceLocation> locations) {
this.locations = locations;
}
@Override
public ErrorClassification getErrorType() {
return ErrorType.DataFetchingException;
}
@Override
public Map<String, Object> getExtensions() {
StringWriter buf = new StringWriter();
CommonUtils.getRootCause(this).printStackTrace(new PrintWriter(buf, true));
Map<String, Object> extensions = new LinkedHashMap<>();
String stString = buf.toString();
// Cur redundant stacktrace before CB handlers
int divPos = stString.indexOf("WebServiceBindingBase");
if (divPos == -1) {
divPos = stString.indexOf("GraphQLEndpoint");
}
if (divPos != -1) {
for (int i = divPos; i >= 0; i--) {
if (stString.charAt(i) == '\n') {
divPos = i;
break;
}
}
stString = stString.substring(0, divPos);
}
divPos = stString.indexOf(':');
if (divPos != -1) {
String exceptionClass = stString.substring(0, divPos).trim();
extensions.put("exceptionClass", exceptionClass);
//stString = stString.substring(divPos + 1).trim();
}
extensions.put("stackTrace", stString.trim());
int errorCode = SQLState.getCodeFromException(this);
if (errorCode != ERROR_CODE_NONE) {
extensions.put("errorCode", errorCode);
}
if (!CommonUtils.isEmpty(webErrorCode)) {
extensions.put("webErrorCode", webErrorCode);
}
String databaseState = SQLState.getStateFromException(this);
if (databaseState != null) {
extensions.put("databaseState", databaseState);
}
return extensions;
}
private static String makeMessage(String message, Throwable cause) {
if (cause == null) {
if (CommonUtils.isEmpty(message)) {
return "Unknown internal error";
} else {
return message;
}
}
if (CommonUtils.isEmpty(message)) {
if (cause.getMessage() != null) {
return cause.getMessage();
}
return cause.getClass().getName();
}
if (CommonUtils.equalObjects(message, cause.getMessage())) {
return message;
}
return message + ":\n" + cause.getMessage();
}
}

Some files were not shown because too many files have changed in this diff Show More