ipfs-shipyard / ipfs-shipyard/ipfs-deploy

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

Open
#236 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.2k
Forks
117
PR merge metrics
No merged PRs in 30d

Description

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 https://github.com/ipfs-shipyard/ipfs-deploy/issues/148 said.

But it throws
```
HTTPError: Response code 400 (Bad Request)
at Request. (...\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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.