mirror of
https://github.com/Ysurac/openmptcprouter-vps-admin.git
synced 2025-02-12 10:31:52 +00:00
Fix Shadowsocks-go new API add/remove user
This commit is contained in:
parent
371ce38ec2
commit
bec293d6b7
2 changed files with 20 additions and 6 deletions
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -1,3 +1,9 @@
|
|||
omr-vps-admin (0.13+20241025) unstable; urgency=medium
|
||||
|
||||
* Fix Shadowsocks-go new API support on add/remove user
|
||||
|
||||
-- OpenMPTCProuter <contact@openmptcprouter.com> Fri, 25 Oct 2024 10:09:14 +0200
|
||||
|
||||
omr-vps-admin (0.13+20241016) unstable; urgency=medium
|
||||
|
||||
* Add Shadowsocks-go new API support
|
||||
|
|
20
omr-admin.py
20
omr-admin.py
|
@ -391,22 +391,30 @@ 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", json= {'username': user,'uPSK': key})
|
||||
#r = requests.post(url="http://127.0.0.1:65279/api/ssm/v1/servers/ss-2022/users", json= {'username': user,'uPSK': key})
|
||||
r = requests.post(url="http://127.0.0.1:65279/api/ssm/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:
|
||||
LOG.debug("Shadowsocks go add error (" + str(err) + ")")
|
||||
try:
|
||||
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:
|
||||
LOG.debug("Shadowsocks go add error (" + str(err) + ")")
|
||||
return key
|
||||
|
||||
def remove_ss_go_user(user):
|
||||
try:
|
||||
r = requests.delete(url="http://127.0.0.1:65279/v1/servers/ss-2022/users/" + user)
|
||||
#r = requests.delete(url="http://127.0.0.1:65279/api/ssm/v1/servers/ss-2022/users/" + user)
|
||||
r = requests.delete(url="http://127.0.0.1:65279/api/ssm/v1/servers/ss-2022/users/" + user)
|
||||
except requests.exceptions.Timeout:
|
||||
LOG.debug("Shadowsocks go remove timeout")
|
||||
except requests.exceptions.RequestException as err:
|
||||
LOG.debug("Shadowsocks go remove error (" + str(err) + ")")
|
||||
try:
|
||||
r = requests.delete(url="http://127.0.0.1:65279/v1/servers/ss-2022/users/" + user)
|
||||
except requests.exceptions.Timeout:
|
||||
LOG.debug("Shadowsocks go remove timeout")
|
||||
except requests.exceptions.RequestException as err:
|
||||
LOG.debug("Shadowsocks go remove error (" + str(err) + ")")
|
||||
|
||||
def v2ray_add_user(user, v2rayuuid='', restart=1):
|
||||
if v2rayuuid == '':
|
||||
|
|
Loading…
Reference in a new issue