face-hh / webx

An alternative for the World Wide Web - browse websites such as buss://yippie.rizz made in HTML, CSS and Lua. Custom web browser, custom HTML rendering engine, custom search engine, and more.
Apache License 2.0
1.67k stars 155 forks source link

Api Return 403 (Forbidden) #128

Closed goldenboys2011 closed 1 month ago

goldenboys2011 commented 1 month ago

Hello I am trying to make a actve domains/tlds viewer (also ill try to make a registra)

But When I try to get api.buss.lol/domain i get

bussregistra.goldencube.dev/:1 Access to XMLHttpRequest at 'https://api.buss.lol/domains' from origin 'https://bussregistra.goldencube.dev' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. (index):25 Error fetching data: fe (anonymous) @ (index):25 api.buss.lol/domains:1 Failed to load resource: net::ERR_FAILED

Same Think WIth tlds api.buss.lol/tlds

Access to XMLHttpRequest at 'https://api.buss.lol/tlds' from origin 'https://bussregistra.goldencube.dev' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. (index):25 Error fetching data: fe {message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: {…}, request: XMLHttpRequest, …} (anonymous) @ (index):25 Promise.catch (async) getdomains @ (index):23 (anonymous) @ (index):13 xhr.js:188 GET https://api.buss.lol/tlds net::ERR_FAILED 200

Then I Started Chrome Using:

chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security

And Then It Did Work.

So Propably Smth To Do With Your End?

Idk... it would be great if you can fix it :D

Sakura-sx commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

goldenboys2011 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

where do i get?

Sakura-sx commented 1 month ago

Contact me on discord with how you will use it and if Face approves I can make a key for you.

KubaPro010 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

No, the error is a HTTP CORS error, you don't need any API keys unless you want to delete\edit your domain

goldenboys2011 commented 1 month ago

Contact me on discord with how you will use it and if Face approves I can make a key for you.

whats ur discord?

KubaPro010 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key?

Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

Sakura-sx commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

No, the error is a HTTP CORS error, you don't need any API keys unless you want to delete\edit your domain

The API key is needed for creating domains, not for deleting or editing, for those you need the domain key. It is true that it is a CORS error.

inventionpro commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

No, the error is a HTTP CORS error, you don't need any API keys unless you want to delete\edit your domain

The API key is needed for creating domains, not for deleting or editing, for those you need the domain key. It is true that it is a CORS error.

There is infact no api keys

goldenboys2011 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

No, the error is a HTTP CORS error, you don't need any API keys unless you want to delete\edit your domain

The API key is needed for creating domains, not for deleting or editing, for those you need the domain key. It is true that it is a CORS error.

im getting CORS when i try to get the domains....

Sakura-sx commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key?

Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

For registering domains without the Nepture browser you will need an API key.

goldenboys2011 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

No, the error is a HTTP CORS error, you don't need any API keys unless you want to delete\edit your domain

The API key is needed for creating domains, not for deleting or editing, for those you need the domain key. It is true that it is a CORS error.

There is infact no api keys

thats what i thought idk...

KubaPro010 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

No, the error is a HTTP CORS error, you don't need any API keys unless you want to delete\edit your domain

The API key is needed for creating domains, not for deleting or editing, for those you need the domain key. It is true that it is a CORS error.

Don't mislead people, there is a API key only for the edit or delete, and with a cors error you can't send the key anyway

From where did you get a API key idea like this?

Sakura-sx commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

No, the error is a HTTP CORS error, you don't need any API keys unless you want to delete\edit your domain

The API key is needed for creating domains, not for deleting or editing, for those you need the domain key. It is true that it is a CORS error.

There is infact no api keys

There are, it is a new feature to prevent domain spam. Requests with the API key bypass the firewall and the 1 hour ratelimit.

goldenboys2011 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key? Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

For registering domains without the Nepture browser you will need an API key.

i think you mean this PUT /domain/:key, DELETE /domain/:key,

Sakura-sx commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

No, the error is a HTTP CORS error, you don't need any API keys unless you want to delete\edit your domain

The API key is needed for creating domains, not for deleting or editing, for those you need the domain key. It is true that it is a CORS error.

Don't mislead people, there is a API key only for the edit or delete, and with a cors error you can't send the key anyway

I am not missleading anyone.

inventionpro commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

No, the error is a HTTP CORS error, you don't need any API keys unless you want to delete\edit your domain

The API key is needed for creating domains, not for deleting or editing, for those you need the domain key. It is true that it is a CORS error.

im getting CORS when i try to get the domains....

try https://corsproxy.io/?https%3A%2F%2Fapi.buss.lol%2Fdomains

Sakura-sx commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key? Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

For registering domains without the Nepture browser you will need an API key.

i think you mean this PUT /domain/:key, DELETE /domain/:key,

That is a separate thing.

inventionpro commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key? Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

For registering domains without the Nepture browser you will need an API key.

i think you mean this PUT /domain/:key, DELETE /domain/:key,

That is a separate thing.

yeah im trying to help with the issue instead of talking of a "supposed" feature

goldenboys2011 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

No, the error is a HTTP CORS error, you don't need any API keys unless you want to delete\edit your domain

The API key is needed for creating domains, not for deleting or editing, for those you need the domain key. It is true that it is a CORS error.

im getting CORS when i try to get the domains....

try https://corsproxy.io/?https%3A%2F%2Fapi.buss.lol%2Fdomains

tried and its also like closed because it was getting abused

goldenboys2011 commented 1 month ago

https://corsproxy.io/?https%3A%2F%2Fapi.buss.lol%2Fdomains

wait i think i havent tried it leme check

Sakura-sx commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key? Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

For registering domains without the Nepture browser you will need an API key.

i think you mean this PUT /domain/:key, DELETE /domain/:key,

That is a separate thing.

yeah im trying to help with the issue instead of talking of a "supposed" feature

I am also helping him, he expressed that he wanted to make a registrar. I told him that ho would need an API key for that. If you don't believe me, just try to create a domain without the napture browser.

goldenboys2011 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key? Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

For registering domains without the Nepture browser you will need an API key.

i think you mean this PUT /domain/:key, DELETE /domain/:key,

That is a separate thing.

yeah im trying to help with the issue instead of talking of a "supposed" feature

it actualy works thenks

goldenboys2011 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key? Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

For registering domains without the Nepture browser you will need an API key.

i think you mean this PUT /domain/:key, DELETE /domain/:key,

That is a separate thing.

yeah im trying to help with the issue instead of talking of a "supposed" feature

I am also helping him, he expressed that he wanted to make a registrar. I told him that ho would need an API key for that. If you don't believe me, just try to create a domain without the napture browser.

then can you please send me your discord so you explain me how to get one and how to use it please :D

Sakura-sx commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key? Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

For registering domains without the Nepture browser you will need an API key.

i think you mean this PUT /domain/:key, DELETE /domain/:key,

That is a separate thing.

yeah im trying to help with the issue instead of talking of a "supposed" feature

I am also helping him, he expressed that he wanted to make a registrar. I told him that ho would need an API key for that. If you don't believe me, just try to create a domain without the napture browser.

then can you please send me your discord so you explain me how to get one and how to use it please :D

You tried to create a domain and it is not working, right? Join the discord https://discord.gg/nrbkpCcxWq

goldenboys2011 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key? Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

For registering domains without the Nepture browser you will need an API key.

i think you mean this PUT /domain/:key, DELETE /domain/:key,

That is a separate thing.

yeah im trying to help with the issue instead of talking of a "supposed" feature

I am also helping him, he expressed that he wanted to make a registrar. I told him that ho would need an API key for that. If you don't believe me, just try to create a domain without the napture browser.

then can you please send me your discord so you explain me how to get one and how to use it please :D

You tried to create a domain and it is not working, right? Join the discord https://discord.gg/nrbkpCcxWq no i didnt yet! but this is the second think im going to try (after making the availability checks)

Sakura-sx commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key? Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

For registering domains without the Nepture browser you will need an API key.

i think you mean this PUT /domain/:key, DELETE /domain/:key,

That is a separate thing.

yeah im trying to help with the issue instead of talking of a "supposed" feature

I am also helping him, he expressed that he wanted to make a registrar. I told him that ho would need an API key for that. If you don't believe me, just try to create a domain without the napture browser.

then can you please send me your discord so you explain me how to get one and how to use it please :D

You tried to create a domain and it is not working, right? Join the discord https://discord.gg/nrbkpCcxWq no i didnt yet! but this is the second think im going to try (after making the availability checks)

Once you try and get a 403 contact me.

KubaPro010 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key? Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

For registering domains without the Nepture browser you will need an API key.

i think you mean this PUT /domain/:key, DELETE /domain/:key,

That is a separate thing.

yeah im trying to help with the issue instead of talking of a "supposed" feature

I am also helping him, he expressed that he wanted to make a registrar. I told him that ho would need an API key for that. If you don't believe me, just try to create a domain without the napture browser.

I did create flerken.web from https://reqbin.com/, because i can't run napture but i got the domain

Not only that, i've wrote a Python wrapper for the DNS service:

import requests
class WebXDNSClient:
    def __init__(self) -> None:
        self.base_url = "https://api.buss.lol/"
        self.session = requests.Session()
        if not self.session.get(self.base_url).status_code == 200:
            raise Exception("Server is offline")
    def register(self, name: str, tld: str, ip: str):
        req = self.session.post(f"{self.base_url}domain",json={"tld": tld,"ip": ip,"name": name})
        match req.status_code:
            case 409:
                raise Exception("Domain exists")
            case 429:
                raise Exception("Rate limit")
        return req
    def fetch(self,name:str,tld:str):
        req = self.session.get(f"{self.base_url}domain/{name}/{tld}")
        match req.status_code:
            case 200:
                return req.json()
            case 404:
                raise Exception("Not found")
    def update(self, key:str, ip:str):
        req = self.session.put(f"{self.base_url}domain/{key}",json={"ip": ip})
        if req.status_code == 400:
            raise Exception("Invalid key")
        elif req.status_code == 404:
            return Exception("Not Found")
        return req.json()
    def delete(self, key:str):
        req = self.session.delete(f"{self.base_url}domain/{key}")
        if req.status_code == 400:
            raise Exception("Invalid key")
        elif req.status_code == 404:
            return Exception("Not Found")
        return req.json()
    def get_all(self):
        return self.session.get(f"{self.base_url}domains").json()
    def get_tlds(self):
        return self.session.get(f"{self.base_url}tlds").json()
dns = WebXDNSClient()
print(dns.fetch("flerken","web"))
# print(dns.get_tlds())

and it returns {'tld': 'web', 'name': 'flerken', 'ip': 'placeholder'} as it should (placeholder until i could test my website, because i dont have the browser)

EDIT: i changed the ip to hi-sakura from this wrapper, just to prove i have control over this domain

goldenboys2011 commented 1 month ago

For registering domains without the Nepture browser you will need an API key.

Where do I input the key? Screenshot_2024-06-02-20-30-06-12_e4424258c8b8649f6e67d283a50a2cbc.jpg

For registering domains without the Nepture browser you will need an API key.

i think you mean this PUT /domain/:key, DELETE /domain/:key,

That is a separate thing.

yeah im trying to help with the issue instead of talking of a "supposed" feature

I am also helping him, he expressed that he wanted to make a registrar. I told him that ho would need an API key for that. If you don't believe me, just try to create a domain without the napture browser.

then can you please send me your discord so you explain me how to get one and how to use it please :D

You tried to create a domain and it is not working, right? Join the discord https://discord.gg/nrbkpCcxWq no i didnt yet! but this is the second think im going to try (after making the availability checks)

Once you try and get a 403 contact me.

i get Uncaught SyntaxError: Invalid left-hand side in assignment

    <script>      
        document.addEventListener("DOMContentLoaded", function() {
            document.getElementById("newDom").addEventListener("click", function(event) {
                event.preventDefault(); // Prevent form submission
                newdom();
            });

            function newdom() {
                axios.put('https://corsproxy.io/?https%3A%2F%2Fapi.buss.lol%2Fdomain' + json={"tld": "dev","ip": "https://goldencube.dev,"name": goldencube})
                    .then(function(response) {
                        // Handle success
                        console.log(response.data);
                    })
                    .catch(function(error) {
                        // Handle error
                        console.error('Error fetching data:', error);
                    });
            }               
        });
    </script>
            <button id="newDom" type="button">register </button>
Sakura-sx commented 1 month ago

Try doing:

const data = {
                    tld: "dev",
                    ip: "https://goldencube.dev",
                    name: "goldencube"
                };

                axios.put('https://corsproxy.io/?https%3A%2F%2Fapi.buss.lol%2Fdomain', data)
goldenboys2011 commented 1 month ago

Try doing:

const data = {
                    tld: "dev",
                    ip: "https://goldencube.dev",
                    name: "goldencube"
                };

                axios.put('https://corsproxy.io/?https%3A%2F%2Fapi.buss.lol%2Fdomain', data)

well i modified the js

document.addEventListener("DOMContentLoaded", function() {
            document.getElementById("doavCheck").addEventListener("click", function(event) {
                event.preventDefault(); // Prevent form submission
                getdomains();
            });

            function getdomains() {
                axios.get('https://corsproxy.io/?https%3A%2F%2Fapi.buss.lol%2Fdomains')
                    .then(function(response) {
                        // Handle success
                        console.log(response.data);
                        displayData(response.data);
                    })
                    .catch(function(error) {
                        // Handle error
                        console.error('Error fetching data:', error);
                    });
            }

            function displayData(data) {
                var resultDiv = document.getElementById("result");
                resultDiv.innerHTML = ""; // Clear previous results

                // Loop through each domain object and display name and tld
                data.forEach(function(domain) {
                    var domainInfo = document.createElement("p");
                    domainInfo.textContent = "Name: " + domain.name + domain.tld;
                    resultDiv.appendChild(domainInfo);
                });
            }
        });

        document.addEventListener("DOMContentLoaded", function() {
            document.getElementById("newDom").addEventListener("click", function(event) {
                event.preventDefault(); // Prevent form submission
                newdom();
            });

            function newdom() {
                const data = {
                    tld: "dev",
                    ip: "https://goldencube.dev",
                    name: "goldencube"
                };

                axios.put('https://corsproxy.io/?https%3A%2F%2Fapi.buss.lol%2Fdomain', data)
                    .then(function(response) {
                        // Handle success
                        console.log(response.data);
                    })
                    .catch(function(error) {
                        // Handle error
                        console.error('Error fetching data:', error);
                    });
            }

        });

now i get this:

bussregistra.goldencube.dev/:1 Access to XMLHttpRequest at 'https://corsproxy.io/?https%3A%2F%2Fapi.buss.lol%2Fdomain' from origin 'https://bussregistra.goldencube.dev' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. (index):65 Error fetching data: fe {message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: {…}, request: XMLHttpRequest, …} (anonymous) @ (index):65 Promise.catch (async) newdom @ (index):63 (anonymous) @ (index):48 xhr.js:188 PUT https://corsproxy.io/?https%3A%2F%2Fapi.buss.lol%2Fdomain net::ERR_FAILED

EDIT: Ill go eat ill be back

face-hh commented 1 month ago

Due to abuse the POST /domain has been locked. Only the browser and some registrars such as https://kitty.yachts/ are allowed to use it

goldenboys2011 commented 1 month ago

Due to abuse the POST /domain has been locked. Only the browser and some registrars such as https://kitty.yachts/ are allowed to use it

can i pretty please get acces ^V^