electerious / Ackee

Self-hosted, Node.js based analytics tool for those who care about privacy.
https://ackee.electerious.com
MIT License
4.2k stars 350 forks source link

Hosting my website on netlify makes requests from preview builds logged #346

Open orangecoloured opened 1 year ago

orangecoloured commented 1 year ago

๐Ÿž Describe the bug

I have ackee and my website both hosted on netlify.

ACKEE_ALLOW_ORIGIN="https://rckt.cc"
ACKEE_AUTO_ORIGIN="false"

But I see requests logged from the preview builds.

๐Ÿ“š To Reproduce

Probably have the tracked app hosted on netlify and see this happening on deploy?

๐Ÿ’ก Expected behavior

I expected that the whitelisted origins prevent loggin requests from other sources.

๐Ÿ–ผ๏ธ Screenshots

image

โš™๏ธ Environment

orangecoloured commented 1 year ago

Another deploy, another logged vist

image

electerious commented 1 year ago

That's strange. Can you check if Ackee sends the correct CORS headers? Is the visit logged by a browser or by the deployment system? Scripts might ignore the CORS headers.

orangecoloured commented 1 year ago

Looks like it's logged by the deployment system. When I visit the deployed snapshot I get proper response

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ackee.rckt.cc/api. (Reason: CORS header โ€˜Access-Control-Allow-Originโ€™ missing). Status code: 204.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ackee.rckt.cc/api. (Reason: CORS request did not succeed). Status code: (null).
orangecoloured commented 1 year ago

Btw, I have a check for window object for initialisation and tracking. So, weird if it's a request that's happening on the "backend" side.

VincentBrule commented 1 year ago

Hello, I have exactly the same issue, let me know if I can give more details to help for the investigation

axelsegebrecht commented 11 months ago

Same issue here. Give me a shout and I'll post what ever info is helping to debug this :) Thank you for an awesome analytics tool!