From f2b12c0a1ff29c0e0398b520108a4a4ac50863dc Mon Sep 17 00:00:00 2001 From: Andres Quan Date: Tue, 15 Oct 2024 10:07:22 -0600 Subject: [PATCH 1/2] Use random pass for neo4j --- beeflow/common/config_driver.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/beeflow/common/config_driver.py b/beeflow/common/config_driver.py index 3b26432a..ee5c7407 100644 --- a/beeflow/common/config_driver.py +++ b/beeflow/common/config_driver.py @@ -3,6 +3,7 @@ from configparser import ConfigParser import getpass import os +import base64 import platform import random import shutil @@ -309,7 +310,12 @@ def validate_chrun_opts(opts): VALIDATOR.section('graphdb', info='Main graph database configuration section.') VALIDATOR.option('graphdb', 'hostname', default='localhost', info='hostname of database') -VALIDATOR.option('graphdb', 'dbpass', default='password', info='password for database') + +# Generate random initial password for neo4j +random_bytes = os.urandom(32) +random_pass = base64.b64encode(random_bytes).decode('utf-8') + +VALIDATOR.option('graphdb', 'dbpass', default=random_pass, info='password for database') VALIDATOR.option('graphdb', 'bolt_port', default=DEFAULT_BOLT_PORT, validator=int, info='port used for the BOLT API') VALIDATOR.option('graphdb', 'http_port', default=DEFAULT_HTTP_PORT, validator=int, From 63489b6517b70a4489515da1d0c488f9769c51db Mon Sep 17 00:00:00 2001 From: Andres Quan Date: Tue, 15 Oct 2024 10:12:58 -0600 Subject: [PATCH 2/2] pyllama lint fixes --- beeflow/common/config_driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beeflow/common/config_driver.py b/beeflow/common/config_driver.py index ee5c7407..ad4a80cc 100644 --- a/beeflow/common/config_driver.py +++ b/beeflow/common/config_driver.py @@ -311,7 +311,7 @@ def validate_chrun_opts(opts): VALIDATOR.option('graphdb', 'hostname', default='localhost', info='hostname of database') -# Generate random initial password for neo4j +# Generate random initial password for neo4j random_bytes = os.urandom(32) random_pass = base64.b64encode(random_bytes).decode('utf-8')