feat: Introduce Nginx configuration and Vultr DNS record creation scripts for btlabel.app and btlabel subdomains.
This commit is contained in:
10
btlabel.app.oncloud.my.id.conf
Normal file
10
btlabel.app.oncloud.my.id.conf
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
28
create_btlabel_app_record.py
Normal file
28
create_btlabel_app_record.py
Normal 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
28
create_btlabel_record.py
Normal 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}")
|
||||||
Reference in New Issue
Block a user