Closed flashlab closed 3 months ago
The image uploading feature seems not working. I recieved
KN.writeFileSync is not a function
error in the log. So maybe local file system is not supported in cf worker.
I updated the README.md
file to mention it in the "Known limitations" section
The IM notification function also has problem. Here is the log when I properly setup telegram options.
For this part, I'm not sure. I think it's likely that pushoo is not compatible with Cloudflare workers. Could you let me know how did you set up the config so that I can reproduce the error to see if it's a bug or limitation?
Could you let me know how did you set up the config so that I can reproduce the error to see if it's a bug or limitation?
Firstly, I displaced SendGrid patch to aliyun DirectMail becuase the former one is not registrable in China. https://github.com/flashlab/twikoo-cloudflare/commit/3548f6de0da777d0ab4655593c2eed4d64691bca Then I setup twikoo in front ui, modified fields includes SITE_NAME, SITE_URL, BLOGGER_NICK, BLOGGER_EMAIL, COMMENT_PLACEHOLDER, HIDE_ADMIN_CRYPT, SHOW_IMAGE, IMAGE_CDN, IMAGE_CDN_TOKEN, PUSHOO_CHANNEL[telegram], PUSHOO_TOKEN[nnn:xxxx#nnn], SENDER_EMAIL, SENDER_NAME, SMTP_SERVICE, SMTP_USER, SMTP_PASS
Then, I posted under one of the article with email other than admin's, no notification were happened and recieved error log above in cf web panel. And I'm sure my telegram token is working.
I displaced SendGrid patch to aliyun DirectMail
Does the Aliyun DirectMail integration work?
I don't have a telegram account thus I can't test telegram integration on my end. I dug the source code a little bit, and found the error was from this line:
https://github.com/imaegoo/pushoo/blob/a0b3c86eed125846ff3c22369909ff5deffde3fa/src/index.ts#L530
You can patch the code there to get more information such as stack trace.
Also the code deployed to Cloudflare is minified thus the error message might not be that readable. You might consider to reproduce the problem locally via npx wrangler dev
.
I think it's likely that pushoo is not compatible with Cloudflare workers.
Yes, Pushoo.js
depends on axio
that needs NodeJS runtime.
See Runtime APIs for more details.
Thanks @ChaiByte for the information!
I updated the "Known limitations" section of README
to mention the limitation.
I test with wecom api, and recived this error log:
{
"message": [
"获取企业微信 access token 失败,请检查 token",
"TypeError: r is not a function"
],
"level": "error",
"timestamp": 1718344724049
},
{
"message": [
"[PUSHOO] Send to <wecom> result:",
{}
],
"level": "debug",
"timestamp": 1718344724049
}
So @ChaiByte explained the issue, If I want to enable IM on cf worker, maybe another patch is needed. If pushoo can use fetch instead of axio, maybe the problem will gone.
Does the Aliyun DirectMail integration work?
@Tao-VanJS original mail service donot have aliyun DirectMail, I patched it from scratch.
If I want to enable IM on cf worker, maybe another patch is needed.
Yes, you can replace all axios API with Cloudflare Workers' Fetch API and test whether it works or not. A project named like pushoo-cf-worker
to make pushoo.js
totally work with Cloudflare workers is possible.
Here are two limitations not mentioned in the document:
KN.writeFileSync is not a function
error in the log. So maybe local file system is not supported in cf worker.I'm not sure if it's a bug or another limitation. If possible, i'd like IM notification works in cf, Thank you guys.