mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-04-25 05:36:14 +03:00
[GH-ISSUE #826] Cant define CB_ADMIN_NAME and CB_ADMIN_PASSWORD correctly with a predefine .cloudbeaver.runtime.conf #207
Labels
No labels
AS
can't reproduce
can't reproduce
deployment
development
documentation
duplicate
duplicate
ee
enhancement
external
new driver
performance
pull-request
third party issue
wait for response
wait for review
wontfix
x:Oracle
x:cassandra
x:clickhouse
x:db2
x:duckdb
x:greenplum
x:h2
x:h2gis
x:hana
x:hive
x:intersystems
x:kyuubi
x:maria
x:mongo
x:mysql
x:postgresql
x:presto
x:sql server
x:sqlite
x:teradata
x:trino
xf:accessibility
xf:administration
xf:ai
xf:authentication
xf:aws
xf:commit-mode
xf:connection
xf:dark theme
xf:data editor
xf:datatransfer
xf:dba
xf:driver management
xf:erd
xf:filters
xf:i18n
xf:i18n
xf:installer
xf:json
xf:kerberos
xf:ldap
xf:local config
xf:log viewer
xf:metadata
xf:metadata editor
xf:navigator
xf:okta
xf:query manager
xf:resource manager
xf:scripts
xf:sql editor
xf:tasks
xf:ui/uix
xo: Firefox
xo:eclipse
xo:internet explorer
xo:macos
xp:major
xrn:internal
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cloudbeaver#207
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @crkcni on GitHub (May 12, 2022).
Original GitHub issue: https://github.com/dbeaver/cloudbeaver/issues/826
Describe the bug
Into a container, with
dbeaver/cloudbeaver:prodimage, when I try to defineCB_ADMIN_NAMEandCB_ADMIN_PASSWORDas environment variable, and also mount/opt/cloudbeaver/workspace/.data/.cloudbeaver.runtime.confas a read-only volume : I can't connect. When I take a look,CB_ADMIN_NAMEexist butCB_ADMIN_PASSWORDdoesn't seem to be the same because I can't connect with my defined password.My user/password seems to be defined in database.
To Reproduce
Steps to reproduce the behavior:
CB_ADMIN_NAMEandCB_ADMIN_PASSWORDas a environment variable.cloudbeaver.runtime.conffile as a volume into your container with the following content (or any content, as long as you defineserver.databasevaluesAdditional context
Environment : Kubernetes, using image
dbeaver/cloudbeaver:prod@kseniiaguzeeva commented on GitHub (May 18, 2022):
Could you please try to:
"serverName": "CloudBeaver Server"from.cloudbeaver.runtime.confThen run your Cloudbeaver instance.
@riccardomessineo commented on GitHub (May 23, 2022):
I'm struggling with this bug too.
There is currently no way of skipping the initial setup and I've tried everything... documented and undocumented features.
The only success I had was loading the .cloudbeaver.runtime.conf, but... without defining any user, so I can't login...
And if I start to play with "CB_ADMIN_XXX" (env variables in docker, .cloudbeaver.auto.conf) it starts again with the setup phase. Before you ask: yes I drop "serverName" in runtime config...
Please, help us!
@kseniiaguzeeva commented on GitHub (May 23, 2022):
Thank you for the description of the problem. Server name has to be explicitely set in run command (you can skip only Server base URL). Could you try to use following comand to skip the Easy Config of a new CloudBeaver instance:
docker run --name {some_name} --rm -ti -p {some_local_port}:8978 -e CB_SERVER_NAME=test -e CB_ADMIN_NAME=test -e CB_ADMIN_PASSWORD=test -v {way_to_empty_local_storage}:/opt/cloudbeaver/workspace dbeaver/cloudbeaver:22.0.4@riccardomessineo commented on GitHub (May 23, 2022):
Hi @kseniiaguzeeva ,
using only the environment variables (as you suggested) it works as expected: it skips the setup phase and it's possible to login with the user declared in the variables.
But... the problem arises when I try to mount a runtime config and setup the admin user via env.
I need to disable some drivers and set "simple view" as default, to give you an exact example of my use case.
Is there a way to define the admin user in the runtime config?
Is there a way to define runtime settings in the env variables?
How can I achieve my goal?
@kseniiaguzeeva commented on GitHub (May 25, 2022):
We will investigate a better way to define admin via variable and implement it.
Regarding the second question: you already can set variables in the runtime config. If you've already tried without success, could you please give me a config example?
@riccardomessineo commented on GitHub (May 25, 2022):
I'm sorry... I didn't understand the question, maybe because I wasn't clear in the first place!
The main problem I have is using both env variables and the runtime config.
So I was wondering if there is there a way to define runtime settings (such as "authProvider", "anonymousAccessEnabled", ...) via env variables such as CB_SERVER_NAME.
I do not think it's possible.
@kseniiaguzeeva commented on GitHub (May 25, 2022):
We will discuss what can be done.
@Wroud commented on GitHub (Jun 18, 2022):
How i can see, problem is: you want to skip easy-config, but some settings from
.cloudbeaver.runtime.confis overridden and you want to find the way to configure server without easy-config?@riccardomessineo commented on GitHub (Jun 21, 2022):
@Wroud I would like to skip initial setup and set custom options.
My use case is: I need to disable some drivers and set "simple view" as default AND setup the admin user, skipping the initial config phase
@jonpalle commented on GitHub (Sep 6, 2022):
I have also been struggling with something similar. I want to run Cloudbeaver on Kubernetes (Openshift) with some preconfigured settings such as a database connection. But when I map a configmap into one of the folders under
/opt/cloudbeaver/workspaceit becomes read-only and Cloudbeaver fails to start up.Based on the documentation I started out with mapping to
/opt/cloudbeaver/workspace/.data/.cloudbeaver.runtime.confas described in https://cloudbeaver.io/docs/Server-configuration/ also with the result that the server could not start up so I changed to mapping into/opt/cloudbeaver/conf/cloudbeaver.confand then it worked! Except that Cloudbeaver now seemed to ignore the environment variables such asCB_ADMIN_NAMEso I couldn't log in. So then I put the admin username and password(!) in a configmap and mapped that to/opt/cloudbeaver/conf/initial-data.confand it worked again. Until I added the mapping to/opt/cloudbeaver/workspace/GlobalConfiguration/.dbeaver/data-sources.json.In the following example I have mounted configmaps as files in
/opt/cloudbeaver/conf/cloudbeaver.confand/opt/cloudbeaver/conf/initial-data.confto overwrite the default settings. I have also mounted/opt/cloudbeaver/workspace/GlobalConfiguration/.dbeaver/data-sources.jsonin an attempt to create a predefined connection as described in https://cloudbeaver.io/docs/Configuring-server-datasources/ but alas then the server won't start up:The server logs include this when it fails to start up:
Maybe I'm reading the documentation wrong or maybe this was just not meant for k8s where configmap volumes are read-only?
What is the best way to configure predefined settings on k8s? Please also consider that it would be best to have passwords stored as secrets.
UPDATE: The server does actually start up fine when mapping to
/opt/cloudbeaver/workspace/GlobalConfiguration/.dbeaver/data-sources.jsonin spite of the error message.@kseniaguzeeva commented on GitHub (Sep 7, 2022):
@riccardomessineo we will make possible to set admin via the configuration file.
@jonpalle Thank you for the report. It looks like another issue. Could you please create a separate ticket? We will give an answer or fix the bug after its investigation.
@kseniaguzeeva commented on GitHub (Oct 24, 2022):
The request is implemented.
I. Variables can be set in
.cloudbeaver.runtime.conf.II. In order to set a Navigator view, available drivers, anonymous access and admin credentials do following:
e.g.
docker run --name cloudbeaver --rm -ti -p 8978:8978 -e CB_SERVER_NAME=test -e CB_ADMIN_NAME=test -e CB_ADMIN_PASSWORD=test -v C:\var\cloudbeaver\workspace:/opt/cloudbeaver/workspace dbeaver/cloudbeaver:22.2.3