Skip to content

Commit

Permalink
Use random pass for neo4j (#948)
Browse files Browse the repository at this point in the history
* Use random pass for neo4j
  • Loading branch information
aquan9 authored Nov 12, 2024
1 parent 9135e88 commit d0e68fb
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit d0e68fb

Please sign in to comment.