GithubHelp home page GithubHelp logo

fengkx / noderssbot Goto Github PK

View Code? Open in Web Editor NEW
342.0 6.0 95.0 7.23 MB

Another Telegram RSS bot but in Node.js Telegram RSS 机器人

Home Page: https://t.me/NodeRSS_bot

License: MIT License

JavaScript 2.24% Dockerfile 0.59% Shell 0.74% TypeScript 96.08% EJS 0.35% Procfile 0.02%
rss telegram rssbot telegram-rssbot opml-import hacktoberfest bot

noderssbot's Introduction

NodeRSSBot

Node CI Publish Docker Docker pulls Docker image size FOSSA Status

Deploy

Another telegram RSSBot in Node.js

Highlights

  1. HTTP Caching
  2. Import and export an opml file
  3. Various configuration
  4. Pagination on command that list feeds
  5. Automatically extract feed from page (from link tag with type such as type="application/atom+xml")
  6. I18N

Document

Visit rssbot.vercel.app to see full documentation.

NodeRSSBot

又是一个 telegram RSS Bot 不过这次用的是 Node.js

Highlights

  1. HTTP Caching
  2. OPML 文件导入导出
  3. 丰富的可配置项
  4. 命令支持按键翻页
  5. 自动从网页中读取 feed url (从 type 类似这样的 link 标签中读取 type="application/atom+xml")
  6. I18N

文档

完整文档请访问 rssbot.vercel.app

License

FOSSA Status

noderssbot's People

Contributors

arcticlampyrid avatar avtojaja avatar dependabot-preview[bot] avatar dependabot[bot] avatar depfu[bot] avatar dubaid avatar dukkee avatar fengkx avatar fortifying avatar fossabot avatar mariajose13 avatar mhmda-83 avatar npueyo avatar partment avatar settingdust avatar theglander avatar vherasme avatar vittoboa avatar wait-what avatar yanshibin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

noderssbot's Issues

Use an alternative to got

Why

We are fetching feed using got, But in new lts docker which use Node 16, got@11 has some bug. When I upgrade to got@12 beta using got-cjs package, because we can't upgrade to esm module for some reason, got start to throw unhandledrejection on its beforeError function.

https://sentry.io/share/issue/fc3100c57306493ca2809a91397b808f/
https://sentry.io/share/issue/7f246477131040e687fe8ef2f968d693/
https://sentry.io/share/issue/6ef2f4a57d55423681aa136cf16ceec9/

and we don't need much function got provided, so we can move to an alternative. Currently I want to switch to undici

Some function we need and provided by got.

  1. agent to support http proxy
  2. retry on some error
  3. encoding convert with got-iconv

Feeds of .opml import with channel ID shown in bot's private chat

I created multiple .opml files ready for import. Their filenames had my private channels IDs (with -100 at the beginning).

The import went flawless but when I got the first RSS-Feeds they appeared in my bot's private chat and not in my channels.

With /sub <channel_ID> <RSS_URL> I don't have that problem.

No reposponse bug

After using this bot for few weeks this just stopped working 😟

photo_2020-07-31_17-46-26

运行错误

npm start

[email protected] start /root/NodeRSSBot
node index

/root/NodeRSSBot/index.js:24
(async () => {
^

SyntaxError: Unexpected token (
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)

npm ERR! Linux 4.20.0-1.el7.elrepo.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v6.16.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node index
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node index'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the noderssbot package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node index
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs noderssbot
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls noderssbot
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /root/NodeRSSBot/npm-debug.log

Thank you - not an issue

Just wanted to thank you for this bot, I works perfectly with my ttrss selfhosted instance.
Tried other bots with no luck.
Also thank you for translating to english!

rssbot 更新提醒重复

作者大大,您好。一直用您的bot来提醒rss更新。
但是有时候会出bug:RSS会重复提醒内容。一般复现在删除内容的时候,会推送删除的项目之前的内容。
不知道是不是订阅源新旧内容的比较算法的问题,只要有不同就会推送更新,但其实是因为订阅源中删除了内容,导致了旧的内容会重复推送了。
希望您能抽空看看,谢谢

winston throw error

TypeError: self.log is not a function
    at process.DerivedLogger.<computed> (/home/fengkx/project/NodeRSSBot/node_modules/winston/lib/winston/create-logger.js:97:19)
    at process.emit (node:events:390:28)
    at process._fatalException (node:internal/process/execution:170:25)
    at processPromiseRejections (node:internal/process/promises:246:11)
    at processTicksAndRejections (node:internal/process/task_queues:97:32)

winston throw error because this binding to process, But I can't find why this happen, so I just fix it with proxy 86a74b3

Related upstream issue: winstonjs/winston#1648

Single User Mode

Could you please offer a switch to enable single user mode when providing Telegram User ID? My Telegram Bot is only geared to the needs for myself. The Rust version Telegram RSSBOT has archieved this awesome feature, I hope you wil follow it up. Thanks!

求助,部署在fly.io上,数据无法保存,重启项目订阅源就都没了

heroku收费了,于是想找个替代的,找到了fly.io。

fly.io能通过docker部署本项目,telegram bot也能正常运行,但是有两个问题:
(1)重启或者更新部署,数据就丢失了,之前的订阅源都没了。部署的时候,分配了1个G的硬盘空间,项目也能在指定位置创建database,但只要项目重启或者更新,数据就没了。
(2)通过fly.io定义的Secret Variables环境变量无法生效

大佬有空的话,帮忙看看。谢谢

Heroku error

2021-03-24T17:59:45.151675+00:00 app[worker.1]:

2021-03-24T17:59:45.151705+00:00 app[worker.1]: > [email protected] start

2021-03-24T17:59:45.151706+00:00 app[worker.1]: > cross-env NODE_PRODUTION=true node dist/source/index.js

2021-03-24T17:59:45.151707+00:00 app[worker.1]:

2021-03-24T17:59:46.028302+00:00 app[worker.1]: {"message":"Database is located in postgres://udpterdvhpcriv:5555606f74703e55b4db5c63a82101d25a036c197d7e88164224946ea0f56ad7@ec2-54-158-222-248.compute-1.amazonaws.com:5432/d2ai8ubefs4pab","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-03-24T17:59:46.023Z"}

2021-03-24T17:59:46.029710+00:00 app[worker.1]: {"message":"Using Default language is en","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-03-24T17:59:46.029Z"}

2021-03-24T17:59:46.030296+00:00 app[worker.1]: {"message":"send the latest 5 items for each feed","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-03-24T17:59:46.029Z"}

2021-03-24T17:59:46.031107+00:00 app[worker.1]: {"message":"NodeRSSBot is ready","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-03-24T17:59:46.030Z"}

2021-03-24T17:59:46.159262+00:00 app[worker.1]: /app/node_modules/pg-protocol/dist/parser.js:278

2021-03-24T17:59:46.159270+00:00 app[worker.1]: : new messages_1.DatabaseError(messageValue, length, name);

2021-03-24T17:59:46.159271+00:00 app[worker.1]: ^

2021-03-24T17:59:46.159272+00:00 app[worker.1]:

2021-03-24T17:59:46.159272+00:00 app[worker.1]: error: no pg_hba.conf entry for host "34.229.41.212", user "udpterdvhpcriv", database "d2ai8ubefs4pab", SSL off

2021-03-24T17:59:46.159274+00:00 app[worker.1]: at Parser.parseErrorMessage (/app/node_modules/pg-protocol/dist/parser.js:278:15)

2021-03-24T17:59:46.159274+00:00 app[worker.1]: at Parser.handlePacket (/app/node_modules/pg-protocol/dist/parser.js:126:29)

2021-03-24T17:59:46.159275+00:00 app[worker.1]: at Parser.parse (/app/node_modules/pg-protocol/dist/parser.js:39:38)

2021-03-24T17:59:46.159275+00:00 app[worker.1]: at Socket. (/app/node_modules/pg-protocol/dist/index.js:10:42)

2021-03-24T17:59:46.159276+00:00 app[worker.1]: at Socket.emit (node:events:369:20)

2021-03-24T17:59:46.159277+00:00 app[worker.1]: at addChunk (node:internal/streams/readable:313:12)

2021-03-24T17:59:46.159277+00:00 app[worker.1]: at readableAddChunk (node:internal/streams/readable:288:9)

2021-03-24T17:59:46.159277+00:00 app[worker.1]: at Socket.Readable.push (node:internal/streams/readable:227:10)

2021-03-24T17:59:46.159278+00:00 app[worker.1]: at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {

2021-03-24T17:59:46.159278+00:00 app[worker.1]: length: 167,

2021-03-24T17:59:46.159279+00:00 app[worker.1]: severity: 'FATAL',

2021-03-24T17:59:46.159280+00:00 app[worker.1]: code: '28000',

2021-03-24T17:59:46.159280+00:00 app[worker.1]: detail: undefined,

2021-03-24T17:59:46.159280+00:00 app[worker.1]: hint: undefined,

2021-03-24T17:59:46.159281+00:00 app[worker.1]: position: undefined,

2021-03-24T17:59:46.159281+00:00 app[worker.1]: internalPosition: undefined,

2021-03-24T17:59:46.159282+00:00 app[worker.1]: internalQuery: undefined,

2021-03-24T17:59:46.159282+00:00 app[worker.1]: where: undefined,

2021-03-24T17:59:46.159282+00:00 app[worker.1]: schema: undefined,

2021-03-24T17:59:46.159283+00:00 app[worker.1]: table: undefined,

2021-03-24T17:59:46.159283+00:00 app[worker.1]: column: undefined,

2021-03-24T17:59:46.159283+00:00 app[worker.1]: dataType: undefined,

2021-03-24T17:59:46.159284+00:00 app[worker.1]: constraint: undefined,

2021-03-24T17:59:46.159284+00:00 app[worker.1]: file: 'auth.c',

2021-03-24T17:59:46.159284+00:00 app[worker.1]: line: '502',

2021-03-24T17:59:46.159285+00:00 app[worker.1]: routine: 'ClientAuthentication'

2021-03-24T17:59:46.159285+00:00 app[worker.1]: }

2021-03-24T17:59:46.223571+00:00 app[worker.1]: npm ERR! code 1

2021-03-24T17:59:46.224207+00:00 app[worker.1]: npm ERR! path /app

2021-03-24T17:59:46.231335+00:00 app[worker.1]: npm ERR! command failed

2021-03-24T17:59:46.231660+00:00 app[worker.1]: npm ERR! command sh -c cross-env NODE_PRODUTION=true node dist/source/index.js

2021-03-24T17:59:46.245942+00:00 app[worker.1]:

2021-03-24T17:59:46.246129+00:00 app[worker.1]: npm ERR! A complete log of this run can be found in:

2021-03-24T17:59:46.246284+00:00 app[worker.1]: npm ERR! /app/.npm/_logs/2021-03-24T17_59_46_232Z-debug.log

2021-03-24T17:59:46.294236+00:00 heroku[worker.1]: Process exited with status 1

2021-03-24T17:59:46.357703+00:00 heroku[worker.1]: State changed from up to crashed

URLencode is not idempotent operation

This feed does not validate.

    line 25, column 124: Invalid character in a URI: https://www.apkmirror.com/apk/huawei/huawei-fm-radio/variant-{"minapi_slug":"minapi-28"}/feed/ [help]

        ... ariant-{"minapi_slug":"minapi-28"}/feed/</link>

https://validator.w3.org/feed/check.cgi show url should be encoded in link tag of item. So we can output the url of item directly without encode it.

But I store unencoded URL in database. Because urldecode is an idempotent operation. We should encode the url before we send it in html href attribute.

Originally posted by @fengkx in #186 (comment)

It is not an idempotent operation.

%2525 is an example

See https://stackoverflow.com/questions/17564837/how-to-know-if-a-url-is-decoded-encoded?rq=1#:~:text=There%20is%20a%20simple%20way,different%20then%20it%20is%20encoded.

regex: /%[\da-f]{2}/i

特性请求

  • 发送链接订阅,正则
  • 换行分割多链接订阅

新加订阅出错

如图,新添加订阅一直显示正在处理中请稍后。发送其他指令无响应。重启机器人依旧会出现“正在处理中请稍后”
image

rss不正常更新

今天git pull之后发现无法正常收到rss更新,多次回滚到
748e6b4
才正常--
系统archlinux,node版本v11.15.0

i18n: Add and Imporve translation

2020 Hacktoberfest update

There are some words updated in zh-cn.yaml, zh-tw.yaml and en.yaml but no other languages.


The bot supports switching language using /lang command.
For now, It supports languages listed in README.

We can add more translation by adding a yaml file named by a lower case language code in the i18n directory. For example: #52

The translation should be based on zh-cn.yaml or en.yaml which is maintained by repository owner(get updates with latest strings)
PR welcome.

请教一个小问题

首先感谢做出这样的 Telegram Bot,请问一键部署到 Heroku 的 bot 这里能不能修改(见图)?新手第一次部署到 Heroku,想要自定义一些信息在 bot 的开始页。

1

Docker image error: standard_init_linux.go:211

The docker logs says:
standard_init_linux.go:211: exec user process caused "exec format error"

I'm running it on a RaspberryPi with raspbian stretch

My container I created:
$ docker run --name rssbot --restart unless-stopped -d -v /ho
me/pi/telepot/noderssbot/data:/app/data/ -e RSSBOT_TOKEN=(my token) -e RSSBOT_LANG=en fengkx/node_rssbot

That's basically it, I hope there is a solution for me.
The noderssbot is my first docker "project" I dealed with so I might not see any obvious problems/solutions.

一些 RSS 源内容无法抓取

简单来说就是通过 RSSHub 抓取的 twitter 内容,在 NodeRSSBot 中无法正常推送,其余的网站 RSS 源不存在这样的问题

Regexp improve

/^((https?:)(\/\/\/?)([\w]*(?::[\w]*)?@)?([\d\w\.-]+)(?::(\d+))?)?([\/\\\w\.()-]*)?(?:([?][^#]*)?(#.*)?)*/gm

Dockerfile for Raspberry Pi

Hey it's me again,

I haven't done an update since v0.3.1 and I'd like to update.
Since you wrote me last time to use a different Dockerfile which worked back then I'd like you to ask you what Dockerfile I should use for v0.6.1

My Dockerfile from v0.3.1 was:

FROM arm32v7/node:12.12-alpine`
WORKDIR /app`
RUN apk add --no-cache --update build-base python2`
COPY . /app`
ENV NODE_PRODUTION true
RUN npm install --production 
ENTRYPOINT npm run start

It seems that it doesn't work after updating to v0.6.1, I also tried it with FROM arm32v7/node:current-alpine.

Another Dockerfile I tried was that one:

FROM arm32v7/node:current-alpine as ts-builder
WORKDIR /app
COPY . /app
RUN npm install --ignore-scripts && npm run build

FROM arm32v7/node:current-alpine as dep-builder
WORKDIR /app
COPY package.json clean-nm.sh /app/
RUN apk add --no-cache --update build-base python2
RUN npm install --production && sh /app/clean-nm.sh

FROM arm32v7/node:current-alpine as app
WORKDIR /app
ENV NODE_PRODUTION true
COPY data /app/data
COPY logs /app/logs
COPY package.json /app/package.json
COPY --from=ts-builder /app/dist /app/dist
COPY --from=dep-builder /app/node_modules /app/node_modules
CMD npm run start-withsnapshot

Without any success...

My system didn't change, I'm still using raspbian stretch.

Thanks :)

Change feed output format

Is it possible to change the output format for the RSS feeds? At the moment it always combines 10 feed items into one message. I would like to get an individual message for each item and maybe display the body text too instead of only showing the headline as a link.

Thanks for the amazing bot btw!

[Feature]支持heroku部署

为什么在heroku部署,一会好一会又不能用了?应该不是半小时休眠问题,一般用个几分钟就坏了

使用pm2,运行错误

错误报告如下
│ ││ node_rssbot > > [email protected] start /root │
│ ││ node_rssbot > > cross-env NODE_PRODUTION=true node dist/source/index.js
│ ││ node_rssbot > sh: 1: cross-env: not found │
│ ││ node_rssbot > npm ERR! code ELIFECYCLE │
│ ││ node_rssbot > npm ERR! syscall spawn │
│ ││ node_rssbot > npm ERR! file sh │
│ ││ node_rssbot > npm ERR! errno ENOENT │
│ ││ node_rssbot > npm ERR! [email protected] start: `cross-env NODE_PRODUTION=tr │
│ ││ node_rssbot > npm ERR! spawn ENOENT │
│ ││ node_rssbot > npm ERR! │
│ ││ node_rssbot > npm ERR! Failed at the [email protected] start script. │
│ ││ node_rssbot > npm ERR! This is probably not a problem with npm. There is │
│ ││ node_rssbot > npm WARN Local package.json exists, but node_modules missing, │
│ ││ node_rssbot > npm ERR! A complete log of this run can be found in: │
│ ││ node_rssbot > npm ERR! /root/.npm/_logs/2022-03-22T16_48_04_113Z-debug.l │

麻烦大佬帮忙看看

Some feed url contain `{`, `"` which can not fit in JavaScript template string and HTML

example https://www.apkmirror.com/apk/huawei/huawei-fm-radio/variant-%7B%22minapi_slug%22%3A%22minapi-28%22%7D/feed/

https://www.apkmirror.com/apk/huawei/huawei-fm-radio/variant-{"minapi_slug"%3A"minapi-28"}/feed/
error: Error: 400: Bad Request: can't parse entities: Expected equal sign in declaration of an attribute of the tag "a" at byte offset 3647
    at /root/NodeRSSBot/node_modules/telegraf/core/network/client.js:281:17
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
    at async /root/NodeRSSBot/dist/source/utils/two-key-reply.js:10:9
    at async viewAll (/root/NodeRSSBot/dist/source/controlers/rss.js:148:5)
    at async /root/NodeRSSBot/dist/source/index.js:141:5
    at async exports.default (/root/NodeRSSBot/dist/source/middlewares/only-private-chat.js:13:5)
    at async exports.default (/root/NodeRSSBot/dist/source/middlewares/send-error.js:36:9)
    at async Promise.all (index 0) {"timestamp":"2020-05-01T15:10:55.703Z"}

RSS url to someone's Diigo bookmark collection according to a certain tag can not be detected properly

Demo or Self hosted

  • Demo
  • Self hosted

Describe the bug
Can not distinguish RSS links below:
https://www.diigo.com/rss/profile/melissaadkins?query=#myfav
https://www.diigo.com/rss/profile/melissaadkins?query=%23myfav
One can click these two links to see the difference. Not sure it's your issue or Diigo's though. Perhaps related to URL encode.

To Reproduce
Steps to reproduce the behavior:
\sub https://www.diigo.com/rss/profile/melissaadkins?query=#myfav
\sub https://www.diigo.com/rss/profile/melissaadkins?query=%23myfav
The same feed items will be fetched and shown because they are treated as the same RSS url.

Expected behavior
Someone's full Diigo bookmark collection is not I want. Its collection filtered by a certain tag is what I'm interested in. Hope the NodeRSSbot can successfully fetch items from the RSS url to someone's Diigo bookmark collection according to a certain tag.

Screenshots / Logs
6T6Bss.png
6T6sZq.png

Repeated messages for new posts

Demo or Self hosted

  • Demo
  • Self hosted

Describe the bug
I'm getting duplicate messages for new posts.

To Reproduce
Subscribe to new feed and wait.

Expected behavior
No duplicate messages.

Screenshots / Logs
Screenshot_20240120-231124

Bot changes feed urls to wrong ones on its own

Demo or Self hosted

  • Demo
  • Self hosted

Describe the bug
Some connection error happens at the bot and then it decides to change the feed URL to something else which is wrong. This has happened with several feeds today. Also the error messages are in Chinese in a Telegram channel even though the bot is set to English.

To Reproduce
Steps to reproduce the behavior: Subscribe to a feed, wait for a error.

Expected behavior
Error message should be shown in English, but feed URL should not be changed.

Screenshots / Logs
DNA Oyj - uusimmat tiedotteet: https://www.sttinfo.fi/pressroom/latest?publisherId=1881 多次抓取失败,建议取消订阅 Timeout awaiting 'lookup' for 3000ms

DNA Oyj - uusimmat tiedotteet:  多次抓取失败,建议取消订阅
找到的订阅地址:
https://www.sttinfo.fi/rss/releases/latest
https://www.sttinfo.fi/rss/announcements/latest?lang=fi
订阅源地址变为 https://www.sttinfo.fi/rss/releases/latest

建议 - 可以添加网页预览吗?

image

如图所示。在推送消息时,不仅仅提供新增文章的标题,同时提供网页预览(page preview)。
这样,很多文章不用跳转到浏览器也能一窥究竟了。
Telegram Bot API 提供了相关参数,只需打开就可以了。

最新版本heroku部署报错

一键Heroku部署后报错

log

2022-05-11T10:39:07.782724+00:00 app[worker.1]: at Object.fetch (node:internal/deps/undici/undici:6372:20)
2022-05-11T10:39:07.782725+00:00 app[worker.1]: at fetch (node:internal/bootstrap/pre_execution:199:25)
2022-05-11T10:39:07.782725+00:00 app[worker.1]: at /app/node_modules/camaro/dist/camaro.js:22:251
2022-05-11T10:39:07.782725+00:00 app[worker.1]: at f.asm (/app/node_modules/camaro/dist/camaro.js:22:465)
2022-05-11T10:39:07.782725+00:00 app[worker.1]: at /app/node_modules/camaro/dist/camaro.js:92:220 {
2022-05-11T10:39:07.782725+00:00 app[worker.1]: input: '/app/node_modules/camaro/dist/camaro.wasm',
2022-05-11T10:39:07.782726+00:00 app[worker.1]: code: 'ERR_INVALID_URL'
2022-05-11T10:39:07.782726+00:00 app[worker.1]: }
2022-05-11T10:39:07.782727+00:00 app[worker.1]: }
2022-05-11T10:39:14.053572+00:00 app[worker.1]: {"level":"\u001b[32minfo\u001b[39m","message":"heapUsedBefore:
16766784 heapUsedAfter: 15879880 rssBefore: 123301888 rssAfater: 123301888 costed 25821137","timestamp":"2022-05-11T10:39:14.052Z"}

机器人提示抓取错误

critical error in docker (any image newer than 092ebb)

Any image newer than 50f7ce

Demo or Self hosted

  • Demo
  • Self hosted

Describe the bug
Got a critical error (cross-env not found) that make the bot completely fail to start when running in docker, using any image newer than 50f7ce (50f7ced, included):

> [email protected] start-withsnapshot
> cross-env NODE_PRODUTION=true node --heapsnapshot-signal=SIGUSR2 dist/source/index.js

sh: cross-env: not found

To Reproduce
Steps to reproduce the behavior:

docker run --name rssbot -d -v /var/data:/app/data/ -e RSSBOT_TOKEN=123456:abcdef123456-U fengkx/rssbot

Expected behavior
Dep cross-env should exist and not lead to a critical error.

Screenshots / Logs
See above.

Any image newer than 092ebb but older than 50f7ce

Demo or Self hosted

  • Demo
  • Self hosted

Describe the bug
Got a critical error (Cannot find module 'fastq') that make the bot fail to initialize when running in docker, using any image newer than 092ebb (092ebb0, included) but older than 50f7ce (50f7ced, not included):

{"message":"Migrate schema to latest version","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-10-13T17:22:54.351Z"}
internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module 'fastq'
Require stack:
- /app/dist/source/utils/fetch.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/app/dist/source/utils/fetch.js:28:33)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/app/dist/source/utils/fetch.js' ]
}
{"message":"child process exit","code":1,"signal":null,"level":"\u001b[31merror\u001b[39m","timestamp":"2021-10-13T17:22:54.642Z"}

To Reproduce
Steps to reproduce the behavior:

docker run --name rssbot -d -v /var/data:/app/data/ -e RSSBOT_TOKEN=123456:abcdef123456-U fengkx/rssbot:092ebb

Expected behavior
Dep fastq should exist and not lead to a critical error.

Screenshots / Logs

> [email protected] start-withsnapshot /app
> cross-env NODE_PRODUTION=true node --heapsnapshot-signal=SIGUSR2 dist/source/index.js

{"message":"sqlite does not support inserting default values. Set the `useNullAsDefault` flag to hide this warning. (see docs http://knexjs.org/#Builder-insert).","level":"\u001b[33mwarn\u001b[39m","timestamp":"2021-10-13T17:22:54.075Z"}
{"message":"Database is located in /app/data/database.db","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-10-13T17:22:54.245Z"}
{"message":"Using Default language is zh-cn","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-10-13T17:22:54.246Z"}
{"message":"send the latest 10 items for each feed","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-10-13T17:22:54.249Z"}
{"message":"NodeRSSBot is ready","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-10-13T17:22:54.249Z"}
{"message":"Migrate schema to latest version","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-10-13T17:22:54.351Z"}
internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module 'fastq'
Require stack:
- /app/dist/source/utils/fetch.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/app/dist/source/utils/fetch.js:28:33)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/app/dist/source/utils/fetch.js' ]
}
{"message":"child process exit","code":1,"signal":null,"level":"\u001b[31merror\u001b[39m","timestamp":"2021-10-13T17:22:54.642Z"}
{"message":"Migrate schema to latest version","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-10-13T17:22:54.647Z"}
internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module 'fastq'
Require stack:
- /app/dist/source/utils/fetch.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/app/dist/source/utils/fetch.js:28:33)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/app/dist/source/utils/fetch.js' ]
}
{"message":"child process exit","code":1,"signal":null,"level":"\u001b[31merror\u001b[39m","timestamp":"2021-10-13T17:22:54.896Z"}
{"message":"Migrate schema to latest version","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-10-13T17:22:54.900Z"}
internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module 'fastq'
Require stack:
- /app/dist/source/utils/fetch.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/app/dist/source/utils/fetch.js:28:33)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/app/dist/source/utils/fetch.js' ]
}
{"message":"child process exit","code":1,"signal":null,"level":"\u001b[31merror\u001b[39m","timestamp":"2021-10-13T17:22:55.159Z"}
{"message":"Migrate schema to latest version","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-10-13T17:22:55.163Z"}
internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module 'fastq'
Require stack:
- /app/dist/source/utils/fetch.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/app/dist/source/utils/fetch.js:28:33)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/app/dist/source/utils/fetch.js' ]
}
{"message":"child process exit","code":1,"signal":null,"level":"\u001b[31merror\u001b[39m","timestamp":"2021-10-13T17:22:55.405Z"}
{"message":"Migrate schema to latest version","level":"\u001b[32minfo\u001b[39m","timestamp":"2021-10-13T17:22:55.411Z"}
{"message":"fetch process exit too much(3) times","level":"\u001b[31merror\u001b[39m","timestamp":"2021-10-13T17:22:55.473Z"}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start-withsnapshot: `cross-env NODE_PRODUTION=true node --heapsnapshot-signal=SIGUSR2 dist/source/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start-withsnapshot script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-10-13T17_22_56_062Z-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.