👋 Glance 是什么
Glance 是一个开源自托管仪表盘应用,GitHub 上已收获 35,000+ ⭐,用 Go 编写。能把你日常关注的所有信息源汇聚到一个页面上 —— RSS、Reddit、天气、YouTube、Docker、服务器监控、股票…… 一页全搞定。
最大的优势是 极轻量:二进制不到 20MB,无数据库依赖,加载速度通常在 1 秒以内。
📦 安装部署
方式一:Docker(推荐)
# docker-compose.yml
services:
glance:
image: glanceapp/glance
ports:
- "8080:8080"
volumes:
- ./glance.yml:/app/config/glance.yml
restart: unless-stoppeddocker compose up -d浏览器访问 http://你的IP:8080 即可。
方式二:二进制
curl -sL https://github.com/glanceapp/glance/releases/latest/download/glance-linux-amd64.tar.gz | tar xz./glance --config glance.yml
方式三:反向代理
# Caddy
dash.yourdomain.com {reverse_proxy localhost:8080
}
⚙️ 配置详解
配置写在 glance.yml,支持热重载——改完保存即生效。
最简配置
pages:name: 首页
columns:
size: full
widgets:
type: rss
title: 最新资讯
feeds:
limit: 10
多页多栏布局
pages:name: 首页
columns:
size: small
widgets:
- type: weather
location: 北京
units: metric
size: full
widgets:
type: rss
title: Hacker News
feeds:
limit: 15
name: Homelab
columns:
size: full
widgets:
type: monitor
title: 服务状态
sites:
- title: 我的博客
url: https://seerking.com
icon: si:typecho
- type: docker-containers
title: Docker 容器
🧩 小组件一览
| 类型 | 说明 |
|---|---|
rss | RSS 订阅 |
videos | YouTube 频道 |
reddit | Subreddit |
hacker-news | Hacker News |
weather | 天气 |
markets | 股票/加密 |
monitor | 网站监控 |
docker-containers | Docker 容器 |
server-stats | 服务器资源 |
bookmarks | 书签 |
search | 搜索 |
todo | 待办 |
clock | 时钟 |
twitch | Twitch |
group | 组合容器 |
html | 自定义 HTML |
iframe | 内嵌页面 |
🎨 主题与外观
theme:
background-color: 240 8 9
primary-color: 43 50 70
light: false
presets:gruvbox-dark:
background-color: 0 0 16
primary-color: 43 59 81
图标库:si:github(Simple Icons)、mdi:camera(Material Design)
🔐 访问控制
auth:
secret-key: "用 glance secret:make 生成"
users:
admin:
password: "你的密码"💡 实用技巧
- 热重载:改完保存即生效,无需重启
- 环境变量:支持 ${ENV_VAR} 传敏感信息</li><li><strong>配置拆分</strong>:用 $include 引用独立文件
- 移动端:自带适配,手机打开也漂亮
📝 总结
相比同类产品,Glance 优势:
- ✅ 轻量 — 不到 20MB,几乎不吃资源
- ✅ 速度快 — Go 编译,秒开
- ✅ 配置简单 — YAML 一目了然
- ✅ 组件丰富 — 资讯/监控/天气/书签全覆盖
- ✅ 热重载 — 改配置不用重启