Compare commits

...
17 changed files with 37 additions and 27 deletions
+1 -3
View File
@@ -14,12 +14,10 @@ RUN groupadd -g $DBEAVER_GID dbeaver && \
COPY cloudbeaver /opt/cloudbeaver
COPY scripts/launch-product.sh /opt/cloudbeaver/launch-product.sh
RUN chown -R $DBEAVER_UID:$DBEAVER_GID /opt/cloudbeaver
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"]
ENTRYPOINT ["./run-server.sh"]
@@ -92,7 +92,7 @@ public class WebUserOriginInfo implements WebObjectOrigin {
}
try {
SMAuthProvider<?> authProvider = this.authProviderDescriptor.getInstance();
if (authProvider instanceof SMAuthProviderExternal) {
if (authProvider instanceof SMAuthProviderExternal && !authProviderDescriptor.isAuthHidden()) {
// read user's info from credentials, previously we tried to read data from external service using
// SMAuthProviderExternal#getUserDetails
var creds = loadCredentials();
@@ -187,15 +187,18 @@ public class CBEmbeddedSecurityController<T extends WebAuthApplication>
protected void importUsers(@NotNull Connection connection, @NotNull SMUserImportList userImportList)
throws DBException, SQLException {
outer:
for (SMUserProvisioning user : userImportList.getUsers()) {
String authRole = user.getAuthRole() == null ? userImportList.getAuthRole() : user.getAuthRole();
if (isSubjectExists(user.getUserId())) {
log.info("User already exist : " + user.getUserId());
setUserAuthRole(connection, user.getUserId(), authRole);
enableUser(connection, user.getUserId(), true);
continue;
for (String possibleUserId : List.of(user.getUserId(), user.getUserId().toLowerCase())) {
if (isSubjectExists(possibleUserId)) {
log.info("User already exist : " + possibleUserId);
setUserAuthRole(connection, possibleUserId, authRole);
enableUser(connection, possibleUserId, true);
continue outer;
}
}
createUser(connection, user.getUserId(), user.getMetaParameters(), true, authRole);
createUser(connection, user.getUserId().toLowerCase(), user.getMetaParameters(), true, authRole);
}
}
@@ -9,12 +9,4 @@ export const GITHUB_LINKS = {
CLOUDBEAVER_REPO: 'https://github.com/dbeaver/cloudbeaver',
EE_DEPLOY_UPDATE: 'https://github.com/dbeaver/cloudbeaver-deploy?tab=readme-ov-file#updating-the-cluster',
TE_DEPLOY_UPDATE: 'https://github.com/dbeaver/team-edition-deploy?tab=readme-ov-file#server-version-update',
getDeployUpdateLink(distributed: boolean) {
if (distributed) {
return GITHUB_LINKS.TE_DEPLOY_UPDATE;
}
return GITHUB_LINKS.EE_DEPLOY_UPDATE;
},
};
@@ -11,6 +11,7 @@ export const WEBSITE_LINKS = {
SQL_EDITOR_DOCUMENTATION_PAGE: 'https://dbeaver.com/docs/cloudbeaver/SQL-Editor/',
SERVER_CONFIGURATION_RESOURCE_QUOTAS_PAGE: 'https://dbeaver.com/docs/cloudbeaver/Server-configuration/#resource-quotas',
DATABASE_NAVIGATOR_DOCUMENTATION_PAGE: 'https://dbeaver.com/docs/cloudbeaver/Database-Navigator/',
AWS_DEPLOY_UPDATE_PAGE: 'https://dbeaver.com/docs/cloudbeaver/Managing-CloudBeaver-server-on-AWS/#version-update-procedure',
ENTERPRISE_BUY_PRODUCT_PAGE: 'https://dbeaver.com/products/cloudbeaver-enterprise/',
TEAM_EDITION_BUY_PRODUCT_PAGE: 'https://dbeaver.com/products/team-edition/',
@@ -114,7 +114,7 @@ export default [
['ui_close_others', 'Close others'],
['ui_close_all_to_the_right', 'Close all to the Right'],
['ui_close_all_to_the_left', 'Close all to the Left'],
['ui_or', 'Or'],
['ui_or', 'or'],
['ui_download', 'Download'],
['ui_download_file', 'Download file'],
['ui_upload', 'Upload'],
@@ -108,7 +108,7 @@ export default [
['ui_close_others', 'Fermer les autres'],
['ui_close_all_to_the_right', 'Fermer tout à droite'],
['ui_close_all_to_the_left', 'Fermer tout à gauche'],
['ui_or', 'Ou'],
['ui_or', 'ou'],
['ui_download', 'Télécharger'],
['ui_download_file', 'Télécharger le fichier'],
['ui_upload', 'Importer'],
@@ -104,7 +104,7 @@ export default [
['ui_close_others', 'Close others'],
['ui_close_all_to_the_right', 'Close all to the Right'],
['ui_close_all_to_the_left', 'Close all to the Left'],
['ui_or', 'Or'],
['ui_or', 'or'],
['ui_download', 'Download'],
['ui_download_file', 'Download file'],
['ui_upload', 'Upload'],
@@ -110,7 +110,7 @@ export default [
['ui_close_others', 'Закрыть другие'],
['ui_close_all_to_the_right', 'Закрыть все справа'],
['ui_close_all_to_the_left', 'Закрыть все слева'],
['ui_or', 'Или'],
['ui_or', 'или'],
['ui_download', 'Cкачать'],
['ui_download_file', 'Скачать файл'],
['ui_upload', 'Загрузить'],
@@ -5,13 +5,17 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { Link, useTranslate } from '@cloudbeaver/core-blocks';
import { Link, Text, useTranslate } from '@cloudbeaver/core-blocks';
import type { InstructionComponent } from './VersionUpdateService.js';
export const BaseUpdateInstruction: InstructionComponent = function UpdateInstruction({ version, containerId, link, className }) {
const translate = useTranslate();
if (!link) {
return <Text className={className}>{translate('version_update_instruction_link_not_provided')}</Text>;
}
return (
<div className={className}>
{translate('version_update_instruction')}{' '}
@@ -5,14 +5,14 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { computed, makeObservable } from 'mobx';
import { computed, makeObservable, observable } from 'mobx';
import { injectable } from '@cloudbeaver/core-di';
import { type IVersion, VersionResource, VersionService } from '@cloudbeaver/core-version';
interface IInstructionProps {
version: IVersion;
link: string;
link: string | null;
containerId?: string;
className?: string;
}
@@ -23,6 +23,7 @@ export type InstructionComponent = React.FunctionComponent<IInstructionProps>;
export class VersionUpdateService {
generalInstructionsGetter: (() => React.FC) | null = null;
versionInstructionGetter: (() => InstructionComponent) | null;
instructionLink: string | null;
get newVersionAvailable() {
if (!this.versionService.current || !this.versionResource.latest) {
@@ -37,12 +38,18 @@ export class VersionUpdateService {
private readonly versionResource: VersionResource,
) {
this.versionInstructionGetter = null;
this.instructionLink = null;
makeObservable(this, {
newVersionAvailable: computed,
instructionLink: observable.ref,
});
}
registerInstructionLink(link: string): void {
this.instructionLink = link;
}
registerVersionInstruction(componentGetter: () => InstructionComponent): void {
this.versionInstructionGetter = componentGetter;
}
@@ -16,4 +16,5 @@ export default [
['version_update_info', 'Info'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
['version_update_instruction_link_not_provided', 'Instructions link is not provided. Please contact support.'],
];
@@ -16,4 +16,5 @@ export default [
['version_update_info', 'Info'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
['version_update_instruction_link_not_provided', 'Instructions link is not provided. Please contact support.'],
];
@@ -16,4 +16,5 @@ export default [
['version_update_info', 'Info'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
['version_update_instruction_link_not_provided', 'Instructions link is not provided. Please contact support.'],
];
@@ -16,4 +16,5 @@ export default [
['version_update_info', 'Информация'],
['version_update_instruction', 'Чтобы обновить версию, следуйте'],
['version_update_instruction_link', 'инструкциям'],
['version_update_instruction_link_not_provided', 'Ссылка на инструкции не предоставлена. Обратитесь в службу поддержки.'],
];
@@ -16,4 +16,5 @@ export default [
['version_update_info', '信息'],
['version_update_instruction', 'To update version, please follow'],
['version_update_instruction_link', 'the instructions'],
['version_update_instruction_link_not_provided', 'Instructions link is not provided. Please contact support.'],
];
@@ -10,7 +10,6 @@ import { useEffect, useState } from 'react';
import { Combobox, Container, Group, GroupItem, GroupTitle, s, useS, useTranslate } from '@cloudbeaver/core-blocks';
import { useService } from '@cloudbeaver/core-di';
import { GITHUB_LINKS } from '@cloudbeaver/core-links';
import { ServerConfigResource } from '@cloudbeaver/core-root';
import { type IVersion, VersionResource } from '@cloudbeaver/core-version';
import { VersionUpdateService } from '@cloudbeaver/core-version-update';
@@ -39,6 +38,7 @@ export const VersionSelector = observer<Props>(function VersionSelector({ versio
const version = versions.find(v => v.number === selected);
const Instruction = versionUpdateService.versionInstructionGetter?.();
const instructionLink = versionUpdateService.instructionLink;
return (
<Container gap>
@@ -56,7 +56,7 @@ export const VersionSelector = observer<Props>(function VersionSelector({ versio
{version && Instruction && (
<GroupItem>
<Instruction
link={GITHUB_LINKS.getDeployUpdateLink(!!serverConfigResource.data?.distributed)}
link={instructionLink}
className={s(style, { instruction: true })}
version={version}
containerId={serverConfigResource.data?.containerId}