From c88cbca5ea88bfa0150f84e27315650ef8eba8b2 Mon Sep 17 00:00:00 2001 From: Matt Fletcher Date: Sun, 14 Jan 2024 08:41:15 -0500 Subject: [PATCH 1/2] Correct the name of the mbbsemu.db file; add message at the end reminding the user to recreate the BBSUSR database. --- scripts/create_user.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/create_user.py b/scripts/create_user.py index 081190c7..4f23405d 100755 --- a/scripts/create_user.py +++ b/scripts/create_user.py @@ -25,7 +25,7 @@ def _make_password_hash(password, salt_bytes): def _main(): args = _create_parser() - conn = sqlite3.connect('mbbs.db') + conn = sqlite3.connect('mbbsemu.db') passwordSaltBytes=os.urandom(32) passwordHashBytes=_make_password_hash(args.password, passwordSaltBytes) @@ -42,5 +42,7 @@ def _main(): cur.execute('INSERT INTO AccountKeys (accountId, accountKey, createDate, updateDate) VALUES (?,?,datetime(\'now\'), datetime(\'now\'))', t) conn.commit() + print("Database updated; now you need to go run MBBSEmu -CLI -DBREBUILD BBSUSR to rebuild the runtime user database.") + if __name__ == '__main__': _main() From 0cc4fdb621de44564b255f37a0c9b2de16e47290 Mon Sep 17 00:00:00 2001 From: Matt Fletcher Date: Sun, 14 Jan 2024 14:49:41 -0500 Subject: [PATCH 2/2] Add dbfile parameter for specifying database file; default to mbbsemu.db --- scripts/create_user.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/create_user.py b/scripts/create_user.py index 4f23405d..2b03f18e 100755 --- a/scripts/create_user.py +++ b/scripts/create_user.py @@ -13,6 +13,7 @@ def _create_parser(): parser.add_argument('--password', help='Password to use', required=True) parser.add_argument('--keys', help='Account keys to add to the new account', action='append', default=['NORMAL','PAYING']) parser.add_argument('--email', help='Email address to use', default='test@test.bbs') + parser.add_argument('--dbfile', help='Database specified by appsettings.json Database.File', default='mbbsemu.db') return parser.parse_args() @@ -25,7 +26,7 @@ def _make_password_hash(password, salt_bytes): def _main(): args = _create_parser() - conn = sqlite3.connect('mbbsemu.db') + conn = sqlite3.connect(args.dbfile) passwordSaltBytes=os.urandom(32) passwordHashBytes=_make_password_hash(args.password, passwordSaltBytes)