Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
780b7f9287 | |||
6750ee98e9 | |||
3d19ec2850 | |||
a3e033b7e8 | |||
32900d89e3 | |||
0e4379d40d | |||
bf60ba6e0a | |||
88e6b7559d |
@ -1,5 +1,5 @@
|
||||
[tool.bumpversion]
|
||||
current_version = "1.4.15"
|
||||
current_version = "1.4.19"
|
||||
commit = true
|
||||
tag = true
|
||||
tag_name = "{new_version}"
|
||||
|
9
app.py
9
app.py
@ -558,6 +558,7 @@ def _update_npm_config(credentials=None):
|
||||
print("Unauthorized attempt to update NPM config.")
|
||||
return False
|
||||
credentials = session.get("auth_credentials")
|
||||
# If credentials are provided, we skip the session check as the user has already been authenticated
|
||||
|
||||
npm = NginxProxyManager(app.config['NPM_HOST'], app.config['NPM_EMAIL'], app.config['NPM_PASSWORD'])
|
||||
npm.login()
|
||||
@ -579,9 +580,15 @@ def _update_npm_config(credentials=None):
|
||||
return False
|
||||
|
||||
if streams:
|
||||
print("Current Config:")
|
||||
print(current_config)
|
||||
|
||||
new_config = update_config_with_streams(current_config, streams)
|
||||
print("\nNew Config:")
|
||||
print(new_config)
|
||||
|
||||
npm.update_proxy_host_config(9, new_config)
|
||||
print("NPM config updated successfully.")
|
||||
print("\nNPM config updated successfully.")
|
||||
return True
|
||||
else:
|
||||
print("Failed to update NPM config.")
|
||||
|
@ -2,6 +2,7 @@ import requests
|
||||
import json
|
||||
from datetime import datetime
|
||||
from typing import List, Dict, Any, Optional
|
||||
import time
|
||||
|
||||
# Create a session object to reuse TCP connections
|
||||
session = requests.Session()
|
||||
@ -40,13 +41,16 @@ def _make_api_request(
|
||||
|
||||
def get_urls(base_url: str, auth: str) -> List[Dict[str, Any]]:
|
||||
"""Retrieves user account streams from the API."""
|
||||
response = _make_api_request("GET", base_url, auth, "getUserAccounts/streams")
|
||||
endpoint = f"getUserAccounts/streams?_t={int(time.time())}"
|
||||
response = _make_api_request("GET", base_url, auth, endpoint)
|
||||
return response.json() if response else []
|
||||
|
||||
|
||||
def get_user_accounts(base_url: str, auth: str) -> List[Dict[str, Any]]:
|
||||
"""Retrieves user accounts from the API."""
|
||||
response = _make_api_request("GET", base_url, auth, "getUserAccounts")
|
||||
# Add cache-busting parameter to ensure fresh data
|
||||
endpoint = f"getUserAccounts?_t={int(time.time())}"
|
||||
response = _make_api_request("GET", base_url, auth, endpoint)
|
||||
if not response:
|
||||
return []
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user