DIYgod / RSSHub

🧡 Everything is RSSible
https://docs.rsshub.app
MIT License
33.35k stars 7.45k forks source link

RSSHub Lambdaize 让RSSHub更方便的部署到云函数平台 #4560

Open NeverBehave opened 4 years ago

NeverBehave commented 4 years ago

这是一个什么样的功能?

适配主流云函数厂商,让RSSHub可以方便的部署而不需要自行维护服务器

除了部分路由需要puppeteer支持,大部分路由可直接工作在云函数上

部分厂商允许函数访问其他资源(如AWS),如果条件可以用户也可以自行拓展成完整服务

这个功能可以解决什么问题?

介于目前主站被墙,使用云函数可以降低个人自行部署的难度,成本等

额外描述

制作了一个生成精简zip并发布为草稿的workflow 测试分支:https://github.com/NeverBehave/RSSHub/tree/action

AWS

测试生成的Release: https://github.com/NeverBehave/RSSHub/releases/download/refs%2Fheads%2Fmaster/release.zip 测试AWS Lambda 实例(已下线):https://82nsgyiwwk.execute-api.us-east-1.amazonaws.com/proxy/ handler: lambda.handler

AWS Lambda 允许连接其他服务,包括Docker, EC2,故可以部署完整的RSSHub

Now.sh

https://github.com/DIYgod/RSSHub/pull/4554 https://github.com/DIYgod/RSSHub/issues/4334

NeverBehave commented 4 years ago

可在Now上运行的完整版测试分支(包含 puppeteer): https://github.com/NeverBehave/RSSHub/tree/now-chrome

Demo: https://rssh-ub.homeofnever.now.sh

xyqfer commented 4 years ago

话说我试了两个跟 puppeteer 有关的路由发现是挂的:https://rssh-ub.homeofnever.now.sh/socialclub/events/GTAVhttps://rssh-ub.homeofnever.now.sh/ncwu/notice

NeverBehave commented 4 years ago

话说我试了两个跟 puppeteer 有关的路由发现是挂的:https://rssh-ub.homeofnever.now.sh/socialclub/events/GTAVhttps://rssh-ub.homeofnever.now.sh/ncwu/notice

估计我的付费版过期了内存不够, 页面还没渲染完chrome就杀死了, 导致页面内容空报错

xyqfer commented 4 years ago

话说我试了两个跟 puppeteer 有关的路由发现是挂的:https://rssh-ub.homeofnever.now.sh/socialclub/events/GTAVhttps://rssh-ub.homeofnever.now.sh/ncwu/notice

估计我的付费版过期了内存不够, 页面还没渲染完chrome就杀死了, 导致页面内容空报错

了解~

SukkaW commented 3 years ago

FYI:

TonyRL commented 1 year ago

https://www.serverless.com/aws-lambda#toc8

Code package size. The zipped Lambda code package should not exceed 50MB in size, and the unzipped version shouldn’t be larger than 250MB.

/workspace/RSSHub/.serverless (serverless) $ du -sh ./*
570M    ./aws-node-http-api-project.zip
4.0K    ./cloudformation-template-create-stack.json
12K     ./cloudformation-template-update-stack.json
20K     ./serverless-state.json

FYI, node_modules is already trimmed using nft