1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps-admin.git synced 2025-02-12 10:31:52 +00:00

Fix adding users in Shadowsocks-go and removing in XRay/V2Ray

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-02-13 15:04:36 +01:00
parent 8ddcfd4d78
commit 0780292d15
2 changed files with 9 additions and 3 deletions

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
omr-vps-admin (0.8+20240213) unstable; urgency=medium
* Fix Shadowsocks-go add user and XRay/V2Ray remove user
-- OpenMPTCProuter <contact@openmptcprouter.com> Tue, 13 Feb 2024 15:02:13 +0200
omr-vps-admin (0.8+20240210) unstable; urgency=medium omr-vps-admin (0.8+20240210) unstable; urgency=medium
* Fix typo * Fix typo

View file

@ -353,7 +353,7 @@ def remove_ss_user(port):
def add_ss_go_user(user, key=''): def add_ss_go_user(user, key=''):
try: try:
r = requests.post(url="http://127.0.0.1:65279/v1/servers/ss-2022/users", data= {'username': user,'uPSK': key}) r = requests.post(url="http://127.0.0.1:65279/v1/servers/ss-2022/users", json= {'username': user,'uPSK': key})
except requests.exceptions.Timeout: except requests.exceptions.Timeout:
LOG.debug("Shadowsocks go add timeout") LOG.debug("Shadowsocks go add timeout")
except requests.exceptions.RequestException as err: except requests.exceptions.RequestException as err:
@ -3168,9 +3168,9 @@ def remove_user(*, params: RemoveUser, current_user: User = Depends(get_current_
if os.path.isfile('/etc/shadowsocks-go/server.json'): if os.path.isfile('/etc/shadowsocks-go/server.json'):
remove_ss_go_user(params.username) remove_ss_go_user(params.username)
if os.path.isfile('/etc/v2ray/v2ray-server.json'): if os.path.isfile('/etc/v2ray/v2ray-server.json'):
v2ray_remove_user(params.username) v2ray_del_user(params.username)
if os.path.isfile('/etc/xray/xray-server.json'): if os.path.isfile('/etc/xray/xray-server.json'):
xray_remove_user(params.username) xray_del_user(params.username)
if content: if content:
backup_config() backup_config()
with open('/etc/openmptcprouter-vps-admin/omr-admin-config.json', 'w') as f: with open('/etc/openmptcprouter-vps-admin/omr-admin-config.json', 'w') as f: