├── README.md
├── styles.css
├── index.html
└── script.lua
/README.md:
--------------------------------------------------------------------------------
1 | This folder holds the source code for buss://register.it
2 |
--------------------------------------------------------------------------------
/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #242424;
3 | padding: 10px;
4 | border-radius: 12px;
5 | }
6 |
7 | introduction {
8 | direction: column;
9 | align-items: center;
10 |
11 | gap: 10;
12 | margin-bottom: 40px;
13 | }
14 |
15 | header {
16 | font-size: 48px;
17 | font-weight: ultralight;
18 | font-style: italic;
19 | }
20 |
21 | result {
22 | margin-top: 20px;
23 |
24 | font-size: 24px;
25 | }
26 |
27 | list {
28 | align-items: center;
29 |
30 | direction: row;
31 | gap: 60;
32 | margin-top: 20px;
33 | margin-bottom: 20px;
34 | }
35 |
36 | list2 {
37 | align-items: center;
38 |
39 | direction: column;
40 | }
41 |
42 | item {
43 | direction: column;
44 | gap:10;
45 | }
46 |
47 | item-title {
48 | font-size: 24px;
49 | font-weight: bold;
50 | }
51 |
52 | input {
53 | padding: 5px;
54 | border-color: #616161;
55 | border-width: 1px;
56 | border-style: solid;
57 | border-radius: 12px;
58 |
59 | width: 400px;
60 | }
61 |
62 | spacing {
63 | margin-bottom: 10px;
64 | }
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Bussin Registrar
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
What do you wish to do?
18 | Currently broken on pre-built Windows executables, images won't work.
19 |
20 |
21 |
22 |
23 |
24 |
32 |
33 |
34 |
Update
35 |
36 |
37 |
38 |
39 |
40 |
41 |
Delete
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
Loading...
51 |
52 |
Result will appear here after you press Done.
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/script.lua:
--------------------------------------------------------------------------------
1 | local publish_domain = get("publish-input-domain")
2 | local publish_tld = get("publish-input-tld")
3 | local publish_ip = get("publish-input-ip")
4 | local publish_done = get("done-1")
5 |
6 | local update_key = get("update-input-key")
7 | local update_ip = get("update-input-ip")
8 | local update_done = get("done-2")
9 |
10 | local delete_key = get("delete-input-key")
11 | local delete_done = get("done-3")
12 |
13 | local result = get("result")
14 |
15 | coroutine.wrap(function()
16 | local res = fetch({
17 | url = "https://api.buss.lol/tlds",
18 | method = "GET",
19 | headers = { ["Content-Type"] = "application/json" },
20 | })
21 |
22 | local tld_list = table.concat(res, ", ")
23 | get("tlds").set_content("Available TLDs: " .. tld_list)
24 | end)()
25 |
26 | function fetch_dns()
27 | local body = "{"
28 | .. '"tld": "'
29 | .. publish_tld.get_content()
30 | .. '", '
31 | .. '"name": "'
32 | .. publish_domain.get_content()
33 | .. '", '
34 | .. '"ip": "'
35 | .. publish_ip.get_content()
36 | .. '" }'
37 |
38 | print(body)
39 | local res = fetch({
40 | url = "https://api.buss.lol/domain",
41 | method = "POST",
42 | headers = { ["Content-Type"] = "application/json" },
43 | body = body,
44 | })
45 |
46 | return res
47 | end
48 |
49 | publish_done.on_click(function()
50 | local res = fetch_dns()
51 |
52 | if res["secret_key"] then
53 | result.set_content("Congrats! Your key: " .. res["secret_key"] .. "\nPLEASE SAVE IT.")
54 | else
55 | result.set_content(res.msg .. " | " .. res.error)
56 | end
57 | end)
58 |
59 | update_done.on_click(function()
60 | local body = "{"
61 | .. '"ip": "'
62 | .. update_ip.get_content()
63 | .. '"'
64 | .. "}"
65 |
66 | local res = fetch({
67 | url = "https://api.buss.lol/domain/" .. update_key.get_content(),
68 | method = "PUT",
69 | headers = { ["Content-Type"] = "application/json" },
70 | body = body,
71 | })
72 |
73 | print(res)
74 |
75 | if res and res.status then
76 | if res.status == 429 then
77 | result.set_content("Failed due to ratelimit.")
78 | elseif res.status == 404 then
79 | result.set_content("Failed due to: domain not found.")
80 | elseif res.status == 400 then
81 | result.set_content("Failed due to: invalid body.\nMake sure all fields are completed")
82 | elseif res.status == 200 then
83 | result.set_content("Success!")
84 | else
85 | result.set_content("Failed due to error: " .. res.status)
86 | end
87 | elseif res and res.ip then
88 | result.set_content("Success!")
89 | else
90 | result.set_content("Failed due to unknown error.")
91 | end
92 | end)
93 |
94 | delete_done.on_click(function()
95 | local res = fetch({
96 | url = "https://api.buss.lol/domain/" .. delete_key.get_content(),
97 | method = "DELETE",
98 | headers = { ["Content-Type"] = "application/json" },
99 | })
100 |
101 | print(res)
102 |
103 | if res and res.status then
104 | if res.status == 429 then
105 | result.set_content("Failed due to ratelimit.")
106 | elseif res.status == 404 then
107 | result.set_content("Failed due to: domain not found.")
108 | elseif res.status == 200 then
109 | result.set_content("Success!")
110 | else
111 | result.set_content("Failed due to error: " .. res.status)
112 | end
113 | elseif res and res.secret_key then
114 | result.set_content("Success!")
115 | else
116 | result.set_content("Failed due to unknown error.")
117 | end
118 | end)
119 |
--------------------------------------------------------------------------------