mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-13 03:30:42 +02:00
rpcauth.py: Combine rpcauth parameter in common
This commit is contained in:
parent
bcc9e07d1e
commit
1a63dfc570
@ -36,13 +36,14 @@ def main():
|
|||||||
# Create 16 byte hex salt
|
# Create 16 byte hex salt
|
||||||
salt = generate_salt(16)
|
salt = generate_salt(16)
|
||||||
password_hmac = password_to_hmac(salt, args.password)
|
password_hmac = password_to_hmac(salt, args.password)
|
||||||
|
rpcauth = f'{args.username}:{salt}${password_hmac}'
|
||||||
|
|
||||||
if args.json:
|
if args.json:
|
||||||
odict={'username':args.username, 'password':args.password, 'rpcauth':f'{args.username}:{salt}${password_hmac}'}
|
odict={'username':args.username, 'password':args.password, 'rpcauth':rpcauth}
|
||||||
print(json.dumps(odict))
|
print(json.dumps(odict))
|
||||||
else:
|
else:
|
||||||
print('String to be appended to bitcoin.conf:')
|
print('String to be appended to bitcoin.conf:')
|
||||||
print(f'rpcauth={args.username}:{salt}${password_hmac}')
|
print(f'rpcauth={rpcauth}')
|
||||||
print(f'Your password:\n{args.password}')
|
print(f'Your password:\n{args.password}')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user