Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use random pass for neo4j #948

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion beeflow/common/config_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from configparser import ConfigParser
import getpass
import os
import base64
import platform
import random
import shutil
Expand Down Expand Up @@ -305,7 +306,14 @@ 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', 'gdb_image_mntdir', default=join_path('/tmp', USER),
info='graph database image mount directory', validator=validation.make_dir)
VALIDATOR.option('graphdb', 'sleep_time', validator=int, default=1,
Expand Down