diff --git a/Dockerfile b/Dockerfile index d5ad1cd..1ee0f7a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM golang:1.16-alpine as build +FROM golang:1.22-alpine as build ARG GOARCH= ARG GO_BUILD_ARGS= diff --git a/README.md b/README.md index 24b43e5..7c8f9de 100644 --- a/README.md +++ b/README.md @@ -187,13 +187,20 @@ Revokes an existing API token. In order to set up 💥PoW! Bot Deterrent on your page, you just need to load/include `pow-bot-deterrent.js` and one or more html elements with all 3 of the following properties: -#### `data-pow-bot-deterrent-url` +#### `data-pow-bot-deterrent-static-assets-cross-origin-url` -This is the base url from which `pow-bot-deterrent.js` will attempt to load additional resources `pow-bot-deterrent.css` and `proofOfWorker.js`. +*OPTIONAL* This is the base url from which `pow-bot-deterrent.js` will attempt to load additional resources `pow-bot-deterrent.css` and `proofOfWorker_CrossOrigin.js`. -> 💬 *INFO* In our examples, we passed the Bot Deterrent server URL down to the HTML page and used it as the value for this property. -However, that's not required. The HTML page doesn't need to talk to the Bot Deterrent server at all, it just needs to know where it can -download the `pow-bot-deterrent.css` and `proofOfWorker.js` files. There is nothing stopping you from simply hosting those files on your own server or CDN and placing the corresponding URL into the `data-pow-bot-deterrent-url` property. +Example value: `https://bot-deterrent.example.com/static/` + +> 💬 *INFO* The HTML page doesn't need to talk to the Bot Deterrent server at all, it just needs to know where it can +download the `pow-bot-deterrent.css` and `proofOfWorker_CrossOrigin.js` files. Doing this cross-origin is simpler and easier, but it can cause issues with website's [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP). So if you care about that, try using `data-pow-bot-deterrent-static-assets-path` instead. + +#### `data-pow-bot-deterrent-static-assets-path` + +A path (on the same origin as your site) where the `pow-bot-deterrent.css`, `proofOfWorker.js`, and `scrypt.wasm` files can be found. + +*OPTIONAL*, default value is `/pow-bot-deterrent-static/` #### `data-pow-bot-deterrent-challenge` @@ -470,7 +477,7 @@ There are two main important parts, the form and the javascript at the bottom: