feat: Introduce Nginx configuration and Vultr DNS record creation scripts for btlabel.app and btlabel subdomains.

This commit is contained in:
Wartana
2026-02-28 17:17:09 +08:00
parent 0c15ea7b46
commit b508821293
3 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
server {
listen 80;
server_name btlabel.app.oncloud.my.id;
location / {
root /home/wartana/myApp/btlabel;
index index.html;
try_files $uri $uri/ =404;
}
}

View File

@@ -0,0 +1,28 @@
import requests
import json
import os
VULTR_API_KEY = os.environ.get("VULTR_API_KEY")
DOMAIN = "oncloud.my.id"
headers = {
"Authorization": f"Bearer {VULTR_API_KEY}",
"Content-Type": "application/json"
}
print(f"Creating record btlabel.app.{DOMAIN} -> 103.138.63.186")
data = {
"name": "btlabel.app",
"type": "A",
"data": "103.138.63.186",
"ttl": 300
}
response = requests.post(f"https://api.vultr.com/v2/domains/{DOMAIN}/records", headers=headers, json=data)
if response.status_code == 201:
print("Record created successfully!")
print(json.dumps(response.json(), indent=2))
else:
print(f"Error ({response.status_code}): {response.text}")

28
create_btlabel_record.py Normal file
View File

@@ -0,0 +1,28 @@
import requests
import json
import os
VULTR_API_KEY = os.environ.get("VULTR_API_KEY")
DOMAIN = "oncloud.my.id"
headers = {
"Authorization": f"Bearer {VULTR_API_KEY}",
"Content-Type": "application/json"
}
print(f"Creating record btlabel.{DOMAIN} -> 103.138.63.186")
data = {
"name": "btlabel",
"type": "A",
"data": "103.138.63.186",
"ttl": 300
}
response = requests.post(f"https://api.vultr.com/v2/domains/{DOMAIN}/records", headers=headers, json=data)
if response.status_code == 201:
print("Record created successfully!")
print(json.dumps(response.json(), indent=2))
else:
print(f"Error ({response.status_code}): {response.text}")