Update .env
This commit is contained in:
parent
acf3dbd717
commit
80ada82cb5
@ -7,5 +7,5 @@ CLIENT_NAME = os.getenv("CLIENT_NAME", "default-client-name")
|
|||||||
API_BASE = os.getenv("VRCHAT_API_BASE", "https://api.vrchat.cloud/api/1")
|
API_BASE = os.getenv("VRCHAT_API_BASE", "https://api.vrchat.cloud/api/1")
|
||||||
TOKEN_FILE = Path(os.getenv("TOKEN_FILE", "data/auth/account.json"))
|
TOKEN_FILE = Path(os.getenv("TOKEN_FILE", "data/auth/account.json"))
|
||||||
IS_RENDER = os.getenv("IS_RENDER", "false").lower() in ("true", "1", "t")
|
IS_RENDER = os.getenv("IS_RENDER", "false").lower() in ("true", "1", "t")
|
||||||
ACCOUNT_URL_JSON = os.getenv("ACCOUNT_JSON_URL", "https://example.com/vrcapi_render_download_acc.php")
|
ACCOUNT_JSON_URL = os.getenv("ACCOUNT_JSON_URL", "https://example.com/vrcapi_render_download_acc.php")
|
||||||
ACCOUNT_JSON_TOKEN = os.getenv("ACCOUNT_JSON_TOKEN", "your-token-here")
|
ACCOUNT_JSON_TOKEN = os.getenv("ACCOUNT_JSON_TOKEN", "your-token-here")
|
@ -6,13 +6,13 @@ import sys
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
sys.path.append(str(Path(__file__).resolve().parent.parent))
|
sys.path.append(str(Path(__file__).resolve().parent.parent))
|
||||||
from env import CLIENT_NAME, API_BASE, TOKEN_FILE, IS_RENDER, ACCOUNT_URL_JSON, ACCOUNT_JSON_TOKEN
|
from env import CLIENT_NAME, API_BASE, TOKEN_FILE, IS_RENDER, ACCOUNT_JSON_URL, ACCOUNT_JSON_TOKEN
|
||||||
|
|
||||||
if IS_RENDER:
|
if IS_RENDER:
|
||||||
import requests
|
import requests
|
||||||
print("⚠️ Running in Render environment, downloading account.json with token in URL...")
|
print("⚠️ Running in Render environment, downloading account.json with token in URL...")
|
||||||
|
|
||||||
url = f"{ACCOUNT_URL_JSON}?token={ACCOUNT_JSON_TOKEN}"
|
url = f"{ACCOUNT_JSON_URL}?token={ACCOUNT_JSON_TOKEN}"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = requests.get(url)
|
response = requests.get(url)
|
||||||
@ -21,7 +21,7 @@ if IS_RENDER:
|
|||||||
print(f"❌ Failed to download account.json: {e}")
|
print(f"❌ Failed to download account.json: {e}")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
with open("data/auth/account.json", "wb") as f:
|
with open(TOKEN_FILE, "wb") as f:
|
||||||
f.write(response.content)
|
f.write(response.content)
|
||||||
|
|
||||||
print("✅ account.json downloaded successfully.")
|
print("✅ account.json downloaded successfully.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user