feat: add homelab deployment configs, documentation, and automation scripts
This commit is contained in:
13
scripts/test_portainer_auth.py
Normal file
13
scripts/test_portainer_auth.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import requests
|
||||
import json
|
||||
import urllib3
|
||||
urllib3.disable_warnings()
|
||||
|
||||
url = "https://140.44.4.71:9443/api/auth"
|
||||
res = requests.post(url, json={"username": "admin", "password": "Cfxg0GqDfocWcteE"}, verify=False)
|
||||
jwt = res.json().get("jwt")
|
||||
headers = {"Authorization": f"Bearer {jwt}"}
|
||||
|
||||
r_create = requests.post("https://140.44.4.71:9443/api/users/1/tokens", headers=headers, json={"description": "homepage-dashboard", "password": "Cfxg0GqDfocWcteE"}, verify=False)
|
||||
print("Create token status:", r_create.status_code)
|
||||
print("Token response:", r_create.json())
|
||||
Reference in New Issue
Block a user