Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

400 when updating Cloudflare dns-link if web3 gateway is enabled #236

Open
AnthonyTsang opened this issue Jun 15, 2022 · 2 comments
Open

Comments

@AnthonyTsang
Copy link

Cloudflare is having a new way to handle dns-link.

Instead of using PUT zones/:zone_identifier/dns_records/:identifier like it is an ordinary DNS record, there is a new endpoint PATCH zones/:zone_identifier/web3/hostnames/:identifier

My original issue is that, I was trying to run
ipd -p infura -d cloudflare .
with IPFS_DEPLOY_CLOUDFLARE__ZONE, IPFS_DEPLOY_CLOUDFLARE__RECORD and IPFS_DEPLOY_CLOUDFLARE__API_TOKEN are set.

The Cloudflare API token has
Account : Account Settings : Read
Zone : Zone Settings : Edit
Zone : Zone : Edit
Zone : DNS : Edit

just like #148 said.

But it throws

HTTPError: Response code 400 (Bad Request)
 at Request.<anonymous> (...\node_modules\ipfs-deploy\node_modules\got\dist\source\as-promise\index.js:118:42)

So I dig into the mentioned line and add
console.log(response.body)
It prints out

{
  result: null,
  success: false,
  errors: [
    {
      code: 1049,
      message: 'Unable to edit this record. It was generated by Cloudflare and can be modified in your Web3 Gateway configuration.'
    }
  ],
  messages: []
}

It seems that it has to use the new endpoint to do the job.

@banciur
Copy link
Contributor

banciur commented Jul 8, 2022

You can take a look at my forks of ipfs-deploy and dnslink-cloudflare. I updated them but as project seems dead (previous PR I did with unpin feature hangs since April) I'm now not caring about backward compatibiliy or tests.

I didn't implement all cases as you could still use "old way" to host ipfs files without using Cloudflare web3 features.

@emilianobonassi
Copy link

@AnthonyTsang #255

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants