mirror of
https://github.com/afoim/fuwari.git
synced 2026-01-31 09:03:18 +08:00
posts: 添加EdgeOne Pages原生部署Umami的教程
This commit is contained in:
BIN
src/content/assets/images/eo-umami-1.png
Normal file
BIN
src/content/assets/images/eo-umami-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
BIN
src/content/assets/images/eo-umami-2.png
Normal file
BIN
src/content/assets/images/eo-umami-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
BIN
src/content/assets/images/eo-umami.png
Normal file
BIN
src/content/assets/images/eo-umami.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
38
src/content/posts/eo-umami.md
Normal file
38
src/content/posts/eo-umami.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
title: WTF?!直接将Umami部署到EdgeOne Pages?扔掉VPS!直接跑在云函数!
|
||||||
|
published: 2025-12-22T10:14:32
|
||||||
|
description: 我们都知道,EdgeOne Pages有个完整的Node.js环境,那Umami是Next.js也基于Node.js,那我们是不是可以...
|
||||||
|
image: ../assets/images/eo-umami-1.png
|
||||||
|
draft: false
|
||||||
|
lang: ""
|
||||||
|
---
|
||||||
|
# 原理探寻
|
||||||
|
由于 **Umami** 使用的是 **SSR** ,我原以为EdgeOne Pages不支持该模式,尝试部署后发现最大的问题在于
|
||||||
|
```
|
||||||
|
Error: SSR functions package size exceeds 128MiB limit (157MiB)
|
||||||
|
```
|
||||||
|
|
||||||
|
也就是说,EdgeOne Page是支持SSR程序的,只是Umami构建后的函数太大了,那么我们的思路就很清晰了,只需要裁切一些代码即可
|
||||||
|
|
||||||
|
那么该项目就应运而生了 [afoim/umami: Umami is a modern, privacy-focused analytics platform. An open-source alternative to Google Analytics, Mixpanel and Amplitude.](https://github.com/afoim/umami)
|
||||||
|
|
||||||
|
我将Umami v3中的无关紧要的东西,如 `像素统计` `链接统计` `团队` `地理位置文件` 删去了,最终可以在EO上部署一个残血版的Umami
|
||||||
|
|
||||||
|
至于数据库,我用的是 https://supabase.com/ 需要注意,连接方式不能用 `Direct Connection`
|
||||||
|

|
||||||
|
|
||||||
|
Demo: [Umami](https://eo-umami.acofork.com/share/rC995W8J6CT4uLDo)
|
||||||
|
|
||||||
|
视频: https://www.bilibili.com/video/BV1JiqSBaEY1/
|
||||||
|
|
||||||
|
唯一的缺陷,无法获取用户地区(原逻辑有个高达60M的本地Geo文件)
|
||||||
|

|
||||||
|
|
||||||
|
# 上手部署
|
||||||
|
|
||||||
|
1. Fork 该仓库 [afoim/umami: Umami is a modern, privacy-focused analytics platform. An open-source alternative to Google Analytics, Mixpanel and Amplitude.](https://github.com/afoim/umami)
|
||||||
|
2. 连接到EdgeOne Pages,但先别点部署
|
||||||
|
3. 填写环境变量 `DATABASE_URL` 从Supbase中拿,类似于 `postgresql://postgres.kupggtyqiaepzvjqbboy:[YOUR-PASSWORD]@aws-1-ap-northeast-1.pooler.supabase.com:5432/postgres`
|
||||||
|
4. 绑定你的域名,访问并登录。用户名: admin | 密码:umami
|
||||||
|
# 疑难解答
|
||||||
|
内部重定向貌似出了问题,如果你想要访问设置更改你的管理员密码请手动前往 `/settings/preferences`
|
||||||
Reference in New Issue
Block a user