<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Serverless on Gmero</title><link>https://www.gmero.com/tags/serverless/</link><description>Recent content in Serverless on Gmero</description><generator>Hugo</generator><language>zh-CN</language><copyright>© 2025 Gmero. All rights reserved.</copyright><lastBuildDate>Fri, 09 Oct 2026 10:55:03 +0800</lastBuildDate><atom:link href="https://www.gmero.com/tags/serverless/index.xml" rel="self" type="application/rss+xml"/><item><title>把 onedrive 部署到 serverless，作为你的图床、共享网盘</title><link>https://www.gmero.com/posts/2026/1009-serve-your-onedrive-on-serverless/</link><pubDate>Fri, 09 Oct 2026 10:55:03 +0800</pubDate><guid>https://www.gmero.com/posts/2026/1009-serve-your-onedrive-on-serverless/</guid><description>&lt;p&gt;项目地址：&lt;a&#13;&#10; href="https://codeberg.org/gmero/edge-onedrive"&#13;&#10; target="_blank"&#13;&#10; &gt;edge-onedrive&lt;/a&gt;, 本博客大部分文章里的图片都是使用该项目进行托管的，目前代码托管在 codeberg，因为我的 github 账号因为在一个 issue 里口嗨被 hidden 了，已经在申诉了，如果申诉成功会迁移回 github&lt;/p&gt;&#10;&lt;p&gt;因为深受国内网盘其害，我在大学的时候就将主力网盘切换到了 OneDrive，在淘宝上买的家庭共享只要30/年就有1TB的存储空间，感觉比很多国内网盘要划算，而且没有限速，利用多线程下载器，轻松能实现满速下载。而且 OneDrive 还提供了 api，从而使其作为图床以及直链文件分享成为了可能。于是我便开发了 edge-onedrive 项目，目标时将 OneDrive 的 api 功能封装部署到边缘函数上，目前已经在 Vercel、Cloudflare、EdgeOne 上得到了验证&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&lt;a&#13;&#10; href="https://demo-edge-onedrive.sxl.cc"&#13;&#10; target="_blank"&#13;&#10; &gt;https://demo-edge-onedrive.sxl.cc&lt;/a&gt; (Cloudflare Worker)&lt;/p&gt;&#10;&lt;p&gt;&lt;a&#13;&#10; href="https://demo-edge-onedrive.vercel.app"&#13;&#10; target="_blank"&#13;&#10; &gt;https://demo-edge-onedrive.vercel.app&lt;/a&gt; (Vercel)&lt;/p&gt;&#10;&lt;p&gt;&lt;a&#13;&#10; href="https://demo-edge-onedrive.gmero.com"&#13;&#10; target="_blank"&#13;&#10; &gt;https://demo-edge-onedrive.gmero.com&lt;/a&gt; (EdgeOne)&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;h2 id="功能说明"&gt;功能说明&lt;/h2&gt;&#10;&lt;p&gt;edge-onedrive 目前支持以下功能:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;图床功能：将一个文件夹作为图床目录，上传的图片可以自动重命名带上宽高信息，方便博客使用，提供一个 npm cli 包来方便接入 typora 等软件&lt;/li&gt;&#10;&lt;li&gt;列目录，展示文件详情，显示缩略图(如果能获取到)，下载文件&lt;/li&gt;&#10;&lt;li&gt;直链下载，支持自定义过期时间(全局)&lt;/li&gt;&#10;&lt;li&gt;访客模式，可将文件夹设置为访客模式，访客无需登录即可访问该文件夹下的内容&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="部署教程"&gt;部署教程&lt;/h2&gt;&#10;&lt;p&gt;可在项目仓库的 examples 目录下找到各个平台的部署示例，其中 EdgeOne 平台代码会多一些，因为进行了优化，同时利用了它的两套运行时，从而降低直链以及图床的延迟&lt;/p&gt;&#10;&lt;h3 id="1-fork-或下载仓库源码"&gt;1. fork 或下载仓库源码&lt;/h3&gt;&#10;&lt;p&gt;目前仓库托管在 codeberg, 在 .forgejo 下能仓库所跑的 ci 自动部署流程，从而实现多平台部署，不过这属于进阶一点的操作了，感兴趣的可以看一下也很简单&lt;/p&gt;&#10;&lt;h3 id="2-注册微软应用"&gt;2. 注册微软应用&lt;/h3&gt;&#10;&lt;p&gt;进入 &lt;a&#13;&#10; href="https://entra.microsoft.com/"&#13;&#10; target="_blank"&#13;&#10; &gt;https://entra.microsoft.com/&lt;/a&gt;，选择应用注册 → 新注册，然后按图片填入信息&lt;/p&gt;&#10;&lt;p&gt;&lt;span class="img"&gt;&#13;&#10;&lt;img&#13;&#10; class="lazy-img"&#13;&#10; alt="应用注册1"&#13;&#10; title=""&#13;&#10; data-src="https://as.gmero.com/pic/2026/1791534525755_625x529.png"&gt;&#13;&#10;&lt;/span&gt;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;&lt;/p&gt;</description></item></channel></rss>