mirror of
https://github.com/Ysurac/openmptcprouter-vps-admin.git
synced 2025-03-09 15:40:05 +00:00
Add/Remove users via API without script restart
This commit is contained in:
parent
a30f1f3246
commit
7adb6dd108
2 changed files with 16 additions and 2 deletions
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -1,3 +1,9 @@
|
|||
omr-vps-admin (0.9+20240301) unstable; urgency=medium
|
||||
|
||||
* Add/Remove users via API without script restart
|
||||
|
||||
-- OpenMPTCProuter <contact@openmptcprouter.com> Fri, 01 Mar 2024 15:32:17 +0200
|
||||
|
||||
omr-vps-admin (0.9+20240222) unstable; urgency=medium
|
||||
|
||||
* Use fd00 instead of fe80 for 6in4
|
||||
|
|
12
omr-admin.py
12
omr-admin.py
|
@ -3149,7 +3149,11 @@ def add_user(*, params: NewUser, current_user: User = Depends(get_current_user))
|
|||
add_dsvpn(userid)
|
||||
|
||||
set_lastchange(30)
|
||||
os.execv(__file__, sys.argv)
|
||||
#os.execv(__file__, sys.argv)
|
||||
with open('/etc/openmptcprouter-vps-admin/omr-admin-config.json') as f:
|
||||
global fake_users_db
|
||||
omr_config_data = json.load(f)
|
||||
fake_users_db = omr_config_data['users'][0]
|
||||
|
||||
class RemoveUser(BaseModel):
|
||||
username: str
|
||||
|
@ -3188,7 +3192,11 @@ def remove_user(*, params: RemoveUser, current_user: User = Depends(get_current_
|
|||
if os.path.isfile('/etc/dsvpn/dsvpn0'):
|
||||
remove_dsvpn(userid)
|
||||
set_lastchange(30)
|
||||
os.execv(__file__, sys.argv)
|
||||
#os.execv(__file__, sys.argv)
|
||||
with open('/etc/openmptcprouter-vps-admin/omr-admin-config.json') as f:
|
||||
global fake_users_db
|
||||
omr_config_data = json.load(f)
|
||||
fake_users_db = omr_config_data['users'][0]
|
||||
|
||||
class ClienttoClient(BaseModel):
|
||||
enable: bool = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue