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

CF_BLOCKLIST_URL Get 403 on Deno #40

Closed
py7hon opened this issue Dec 27, 2021 · 7 comments
Closed

CF_BLOCKLIST_URL Get 403 on Deno #40

py7hon opened this issue Dec 27, 2021 · 7 comments

Comments

@py7hon
Copy link

py7hon commented Dec 27, 2021

Hello
I have a problem with Deno deploy and get 403 on logs.
I have set env with https://cf.rethinkdns.com/blocklists/ but there is space on logs make cant fetch blocklist, i see on blocklistWrapper.js#L163 and blocklistWrapper.js#L165 is fine but on deno there is have a space.

https://cf.rethinkdns.com/blocklists/ /filetag.json Response {
  body: ReadableStream { locked: false },
  bodyUsed: false,
  headers: Headers {
  "content-type": "application/xml",
  date: "Mon, 27 Dec 2021 08:10:51 GMT",
  server: "AmazonS3",
  via: "1.1 03bb2a9a7a53ca49b9a36c5ecd83fbae.cloudfront.net (CloudFront)",
  "x-amz-cf-id": "Q-WNfbUO7fAdAwPBoNRsnq1xlF4IimcTIj9fsNLphK_gLXNEYT9ArQ==",
  "x-amz-cf-pop": "SIN5-C1",
  "x-cache": "Error from cloudfront"
},
  ok: false,
  redirected: false,
  status: 403,
  statusText: "Forbidden",
  url: "https://cf.rethinkdns.com/blocklists/%20/filetag.json"
}
@amithm7
Copy link
Contributor

amithm7 commented Dec 27, 2021

Probably because there is a whitespace in CF_BLOCKLIST_URL's value: "https://cf.rethinkdns.com/blocklists/ "

Try setting CF_BLOCKLIST_URL again?

Edit: Or you may have set CF_LATEST_BLOCKLIST_TIMESTAMP to space: " "?

@py7hon
Copy link
Author

py7hon commented Dec 27, 2021

Same can't fetch because whitespace



{"isException":true,"exceptionStack":"Error: [\"https://cf.rethinkdns.com/blocklists/ /td02.txt\",{},\"response status unsuccessful at fileFetch\"]\n    at fileFetch (file:///src/http.bundle.js:6162:15)\n    at async Promise.all (index 2)\n    at async makeTd (file:///src/http.bundle.js:6187:17)\n    at async Promise.all (index 1)\n    at async downloadBuildBlocklist (file:///src/http.bundle.js:6128:25)\n    at async BlocklistWrapper.initBlocklistConstruction (file:///src/http.bundle.js:6098:22)\n    at async BlocklistWrapper.RethinkModule (file:///src/http.bundle.js:6061:24)\n    at async RethinkPlugin.executePlugin (file:///src/http.bundle.js:7050:25)\n    at async proxyRequest (file:///src/http.bundle.js:7418:9)\n    at async Event.respondWith (deno:ext/http/01_http.js:153:18)","exceptionFrom":"blocklistWrapper.js initBlocklistConstruction","data":{}}
In blocklistFilterCallBack
exec-plugin.wdsdy09xhy: 842ms blocklistFilter got-res
Error: ["https://cf.rethinkdns.com/blocklists/ /td02.txt",{},"response status unsuccessful at fileFetch"]     at fileFetch (file:///src/http.bundle.js:6162:15)     at async Promise.all (index 2)     at async makeTd (file:///src/http.bundle.js:6187:17)     at async Promise.all (index 1)     at async downloadBuildBlocklist (file:///src/http.bundle.js:6128:25)     at async BlocklistWrapper.initBlocklistConstruction (file:///src/http.bundle.js:6098:22)     at async BlocklistWrapper.RethinkModule (file:///src/http.bundle.js:6061:24)     at async RethinkPlugin.executePlugin (file:///src/http.bundle.js:7050:25)     at async proxyRequest (file:///src/http.bundle.js:7418:9)     at async Event.respondWith (deno:ext/http/01_http.js:153:18)
7 | https://cf.rethinkdns.com/blocklists/ /td02.txt Response {   body: ReadableStream { locked: false },   bodyUsed: false,   headers: Headers {   "content-type": "application/xml",   date: "Mon, 27 Dec 2021 08:34:14 GMT",   server: "AmazonS3",   via: "1.1 f8e64d8534487ab105627956713b04b2.cloudfront.net (CloudFront)",   "x-amz-cf-id": "XXjQEYs6fYJxsI78-MA_NUvuq-lhvcV3z0yiWdlnpd4Sre6qQb_rlA==",   "x-amz-cf-pop": "SIN5-C1",   "x-cache": "Error from cloudfront" },   ok: false,   redirected: false,   status: 403,   statusText: "Forbidden",   url: "https://cf.rethinkdns.com/blocklists/%20/td02.txt" }

@amithm7
Copy link
Contributor

amithm7 commented Dec 27, 2021

CF_LATEST_BLOCKLIST_TIMESTAMP is a required variable:

# Required - Time when blocklists were generated.
CF_LATEST_BLOCKLIST_TIMESTAMP=""

Please set it referring to wrangler.toml file.

@py7hon
Copy link
Author

py7hon commented Dec 27, 2021

Fixed
I replaced it with 1638959365361 in CF_LATEST_BLOCKLIST_TIMESTAMP

@py7hon py7hon closed this as completed Dec 27, 2021
amithm7 added a commit that referenced this issue Dec 27, 2021
@ignoramous
Copy link
Contributor

ignoramous commented Dec 29, 2021

CF_LATEST_BLOCKLIST_TIMESTAMP is a required variable:

Perhaps we should add a comment in .env.example to ask folks to refer to Wrangler.toml?

@ignoramous
Copy link
Contributor

@py7hon your homepage is on the Indian government's ban-list, for some reason (:

@amithm7
Copy link
Contributor

amithm7 commented Dec 29, 2021

@ignoramous It's already mentioned in .env.example file at the top:

# Refer to `wrangler.toml` or `fly.toml` file to find values of empty ("").

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