Killshot
Killshot
WWasp
Created by Killshot on 2/12/2025 in #đŸ™‹questions
Getting 404 error from Plausible self hosted instance.
aah that's nice, i keep migrating from 0.14 so might have missed it
15 replies
WWasp
Created by Killshot on 2/12/2025 in #đŸ™‹questions
Getting 404 error from Plausible self hosted instance.
definitely
15 replies
WWasp
Created by Killshot on 2/12/2025 in #đŸ™‹questions
Getting 404 error from Plausible self hosted instance.
This should be there in .env.server as a comment for future reasons that someone faces same issue....
15 replies
WWasp
Created by Killshot on 2/12/2025 in #đŸ™‹questions
Getting 404 error from Plausible self hosted instance.
@genyus this worked like a charm, thanks
15 replies
WWasp
Created by Killshot on 2/12/2025 in #đŸ™‹questions
Getting 404 error from Plausible self hosted instance.
So it will analytics.mysite.com/api ?
15 replies
WWasp
Created by Killshot on 2/12/2025 in #đŸ™‹questions
Getting 404 error from Plausible self hosted instance.
No
15 replies
WWasp
Created by Killshot on 2/12/2025 in #đŸ™‹questions
Getting 404 error from Plausible self hosted instance.
i got api key from my self hosted instance.
15 replies
WWasp
Created by Killshot on 2/12/2025 in #đŸ™‹questions
Getting 404 error from Plausible self hosted instance.
No description
15 replies
WWasp
Created by Sean on 2/10/2025 in #đŸ™‹questions
APIs keep returning 404 error
i think your api middleware configuration might need changes...
30 replies
WWasp
Created by Sean on 2/10/2025 in #đŸ™‹questions
APIs keep returning 404 error
hey 404 usually means the page you're reaching is not there.... (server error)
30 replies
WWasp
Created by Killshot on 3/6/2024 in #đŸ™‹questions
Need Recommendations
This is really good. Will definitely use this in future.
26 replies
WWasp
Created by Killshot on 12/9/2024 in #đŸ™‹questions
LemonSqueezy webhooks not working after deployment (VPS)
Exactly... !! Anyways i truly appreciate the support and patience you folks showed, Now going back to building. Until then..... May the Force be with you :salute_right:.
81 replies
WWasp
Created by Killshot on 12/9/2024 in #đŸ™‹questions
LemonSqueezy webhooks not working after deployment (VPS)
That worked miho, The issue was resolved by completely cleaning up the Docker environment: Removing the existing container and image: docker rm appName && docker rmi appName Cleaning up unused Docker resources: docker image prune -a Rebuilding the application from scratch: wasp build Creating a fresh Docker image: docker build . -t appName For now everything is working fine. Can't believe i didn't think of this before, but now the doubt is when will i need to do this again, would have loved a warning somewhere saying i might need to clear my docker environment. The webhook error ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH persisted because: The old Docker image contained cached versions of the code Simply running wasp clean and wasp build wasn't enough because the Docker container was still using the cached image layers.
81 replies
WWasp
Created by Killshot on 12/9/2024 in #đŸ™‹questions
LemonSqueezy webhooks not working after deployment (VPS)
We know vinny tested the same code in Fly.io and it also works fine in my localhost. the only thing different is my VPS is Caddy and Cloudflare.
81 replies
WWasp
Created by Killshot on 12/9/2024 in #đŸ™‹questions
LemonSqueezy webhooks not working after deployment (VPS)
Yes i am on the latest code and i didn't make any changes to the webhook.ts file inside the lemonsqueezy folder.
81 replies
WWasp
Created by Killshot on 12/9/2024 in #đŸ™‹questions
LemonSqueezy webhooks not working after deployment (VPS)
i used docker logs appname -f so i could see live logs. also put up a few logging in Caddy Configuration to see if i catch something, nothing unusual there too. Do we know someone who has a live project deployed on a VPS with Cloudflare, Caddy and Lemonsqueezy as server and payments?
81 replies
WWasp
Created by Killshot on 12/9/2024 in #đŸ™‹questions
LemonSqueezy webhooks not working after deployment (VPS)
const rawBody = request.body.toString('utf8');
const signature = request.get('X-Signature');

console.log('Raw Body:', rawBody);
console.log('Signature:', signature);

if (!signature) {
throw new HttpError(400, 'Lemon Squeezy Webhook Signature Not Provided');
}

const secret = requireNodeEnvVar('LEMONSQUEEZY_WEBHOOK_SECRET');


console.log('Secret Length:', secret.length); // Avoid logging actual secret

const hmac = crypto.createHmac('sha256', secret);
const digest = Buffer.from(hmac.update(rawBody).digest('hex'), 'utf8');

console.log('Computed HMAC:', hmac.digest('hex')); // Log the HMAC value

// Additional logging for debugging
console.log('Computed Digest:', digest.toString());
console.log('Received Signature:', signature);
console.log('Signature Comparison:', crypto.timingSafeEqual(Buffer.from(signature, 'utf8'), digest));

if (!crypto.timingSafeEqual(Buffer.from(signature, 'utf8'), digest)) {
throw new HttpError(400, 'Invalid signature');
}
const rawBody = request.body.toString('utf8');
const signature = request.get('X-Signature');

console.log('Raw Body:', rawBody);
console.log('Signature:', signature);

if (!signature) {
throw new HttpError(400, 'Lemon Squeezy Webhook Signature Not Provided');
}

const secret = requireNodeEnvVar('LEMONSQUEEZY_WEBHOOK_SECRET');


console.log('Secret Length:', secret.length); // Avoid logging actual secret

const hmac = crypto.createHmac('sha256', secret);
const digest = Buffer.from(hmac.update(rawBody).digest('hex'), 'utf8');

console.log('Computed HMAC:', hmac.digest('hex')); // Log the HMAC value

// Additional logging for debugging
console.log('Computed Digest:', digest.toString());
console.log('Received Signature:', signature);
console.log('Signature Comparison:', crypto.timingSafeEqual(Buffer.from(signature, 'utf8'), digest));

if (!crypto.timingSafeEqual(Buffer.from(signature, 'utf8'), digest)) {
throw new HttpError(400, 'Invalid signature');
}
81 replies
WWasp
Created by Killshot on 12/9/2024 in #đŸ™‹questions
LemonSqueezy webhooks not working after deployment (VPS)
you're gonna think i am crazy but even after adding extensive logging, i don't see any logs, just the same error in the Docker logs. :sadboi:
81 replies
WWasp
Created by Killshot on 12/9/2024 in #đŸ™‹questions
LemonSqueezy webhooks not working after deployment (VPS)
@miho Would love any insights you can offer here.
81 replies
WWasp
Created by Killshot on 12/9/2024 in #đŸ™‹questions
LemonSqueezy webhooks not working after deployment (VPS)
but as mentioned before, i get this error when my Webhooks are fired- https://discord.com/channels/686873244791210014/1315633636384571422/1315634500155215872
81 replies