Skip to content

Commit

Permalink
Fix adding users in Shadowsocks-go and removing in XRay/V2Ray
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Feb 13, 2024
1 parent 8ddcfd4 commit 0780292
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
omr-vps-admin (0.8+20240213) unstable; urgency=medium

* Fix Shadowsocks-go add user and XRay/V2Ray remove user

-- OpenMPTCProuter <[email protected]> Tue, 13 Feb 2024 15:02:13 +0200

omr-vps-admin (0.8+20240210) unstable; urgency=medium

* Fix typo
Expand Down
6 changes: 3 additions & 3 deletions omr-admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def remove_ss_user(port):

def add_ss_go_user(user, key=''):
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:
LOG.debug("Shadowsocks go add timeout")
except requests.exceptions.RequestException as err:
Expand Down Expand Up @@ -3168,9 +3168,9 @@ def remove_user(*, params: RemoveUser, current_user: User = Depends(get_current_
if os.path.isfile('/etc/shadowsocks-go/server.json'):
remove_ss_go_user(params.username)
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'):
xray_remove_user(params.username)
xray_del_user(params.username)
if content:
backup_config()
with open('/etc/openmptcprouter-vps-admin/omr-admin-config.json', 'w') as f:
Expand Down

0 comments on commit 0780292

Please sign in to comment.