mirror of
https://github.com/Ysurac/openmptcprouter-vps-admin.git
synced 2025-02-14 19:41:52 +00:00
Simplify v2ray key change code
This commit is contained in:
parent
4501378b9e
commit
9f49b3c70a
1 changed files with 1 additions and 4 deletions
|
@ -1661,10 +1661,7 @@ def v2ray(*, params: V2rayconfig, current_user: User = Depends(get_current_user)
|
|||
inbounds['settings']['clients'][0]['id'] = v2ruserid
|
||||
with open('/etc/v2ray/v2ray-server.json', 'w') as outfile:
|
||||
json.dump(v2ray_config, outfile, indent=4)
|
||||
userid = current_user.userid
|
||||
if userid is None:
|
||||
userid = 0
|
||||
username = get_username_from_userid(userid)
|
||||
username = current_user.username
|
||||
final_md5 = hashlib.md5(file_as_bytes(open('/etc/v2ray/v2ray-server.json', 'rb'))).hexdigest()
|
||||
v2ray_key = os.popen('jq -r .inbounds[0].settings.clients[0].id /etc/v2ray/v2ray-server.json').read().rstrip()
|
||||
v2ray_port = os.popen('jq -r .inbounds[0].port /etc/v2ray/v2ray-server.json').read().rstrip()
|
||||
|
|
Loading…
Reference in a new issue