Compare commits
No commits in common. "19806b7b1bd9afe4d48845a902fe1dffae71aa9c" and "d7c6e1cf70501ad9ac80be1c28a081f15c9e8dd5" have entirely different histories.
19806b7b1b
...
d7c6e1cf70
@ -3,7 +3,6 @@ from dotenv import load_dotenv
|
||||
import discord
|
||||
from discord import app_commands
|
||||
import requests
|
||||
import asyncio
|
||||
|
||||
load_dotenv()
|
||||
TOKEN = os.getenv('DISCORD_TOKEN')
|
||||
@ -70,22 +69,7 @@ async def createsite(ctx, domain: str, licence: str):
|
||||
if r.status_code == 200:
|
||||
json = r.json()
|
||||
if json['success'] == "true":
|
||||
await ctx.response.send_message(f"Site {domain} creating...\nI'll send you a message when it's ready")
|
||||
|
||||
ready = False
|
||||
while ready == False:
|
||||
ready = await check_site_ready(domain)
|
||||
if ready == False:
|
||||
await asyncio.sleep(5)
|
||||
|
||||
r = requests.get(f"http://{Master_IP}:{Master_Port}/site-info?domain={domain}")
|
||||
json = r.json()
|
||||
if json['success'] == "true":
|
||||
await ctx.user.send(f"Site {domain} is ready!\nHere is the site info for {json['domain']}\nA: `{json['ip']}`\nTLSA: `{json['tlsa']}`\nMake sure you put the TLSA in either `_443._tcp.{domain}` or `*.{domain}`")
|
||||
else:
|
||||
await ctx.user.send(f"Error getting site info\n" + json['error'])
|
||||
|
||||
|
||||
await ctx.response.send_message(f"Site {domain} creating...\nPlease wait a few minutes and then send /siteinfo domain:{domain}")
|
||||
else:
|
||||
await ctx.response.send_message(f"Error creating site\n" + json['error'])
|
||||
else:
|
||||
@ -104,17 +88,6 @@ async def siteinfo(ctx, domain: str):
|
||||
else:
|
||||
await ctx.response.send_message(f"Error getting site info\n" + r.text)
|
||||
|
||||
async def check_site_ready(domain):
|
||||
r = requests.get(f"http://{Master_IP}:{Master_Port}/site-info?domain={domain}")
|
||||
if r.status_code == 200:
|
||||
json = r.json()
|
||||
if json['success'] == "true":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
else:
|
||||
return False
|
||||
|
||||
# When the bot is ready
|
||||
@client.event
|
||||
async def on_ready():
|
||||
|
@ -11,7 +11,6 @@ KERNEL_VERSION=$(uname -r)
|
||||
sudo apt-mark hold linux-image-generic linux-headers-generic linux-generic linux-image-$KERNEL_VERSION linux-headers-$KERNEL_VERSION
|
||||
|
||||
# Install Docker
|
||||
sudo apt update
|
||||
sudo apt install apt-transport-https ca-certificates curl software-properties-common python3-pip nginx -y
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
Loading…
Reference in New Issue
Block a user