Repository navigation
Expand file tree
/
Copy pathconfig.yaml
More file actions
78 lines (69 loc) · 3.3 KB
/
Copy pathconfig.yaml
File metadata and controls
78 lines (69 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# HomepageX 后端配置
server:
port: "8090"
mode: debug # debug 或 release
# auths 认证配置
# 规则格式: user:pass@path1:perm,path2:perm2
# - 路径写法: /a 子树匹配(/a 及 /a/**);/a* 前缀匹配(也会命中 /ab);* 或 /* 匹配全部
# - 权限后缀: rw 读写 / ro 只读(省略时默认 ro) / no 拒绝
# - 用户名留空(@...)即匿名规则,构成「匿名基线」,也就是未登录用户能做什么
# - !path 表示「认证墙」:匿名不可访问,登录后按各自权限访问(对已登录用户不生效)
# - 已登录用户 = 自身规则优先,未命中则回退匿名基线,所以不必给每个用户补 /*:ro 兜底
# - 写操作必须已登录且具备 rw
auths:
- admin:admin123@*:rw # admin:全站读写
- user1:user123@/tools:rw # user1:额外获得 /tools 的读写,其余读权限来自下面的匿名基线
- "@*,!/inner*" # 匿名基线:全站只读,但 /inner* 需要登录后才能访问
# deny 硬拒绝:任何人都不能访问(admin 也不例外),用于临时下线页面等
# 例: deny: ["/secret", "/inner-tools"]
deny: []
# 图标缓存配置
# 页面使用: icons-local/{cdn-key}/{type:png|webp|svg}/{icon-name} 格式访问图标
# eg: icons-local/dashboard-icons/png/gitlab.png
#
# 图标缓存目录(相对本配置文件所在目录;内嵌的前端资源只读,缓存必须落在可写目录)
icons_dir: "./icons-cache"
# 是否允许从 CDN 下载缺失图标:false 时完全不访问外网(离线/内网部署),未缓存直接 404
# 下载失败的图标会记入 10 分钟失败缓存,期间不再重试
icons_remote: true
icons_cdn:
# 图标 CDN 配置:key 为本地使用前缀,value 为远程 CDN 基础路径
# 本地:icons-local/{cdn-key}/png/gitlab.png
# 远程:{IconsCDN[cdn-key]} + "png/gitlab.png"
#
# dashboard-icons 示例(来自 https://dashboardicons.com/)
# 本地:icons-local/dashboard-icons/png/gitlab.png
# 远程:https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/gitlab.png
dashboard-icons: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/"
# selfhst-icons 示例(来自 https://selfh.st/icons/)
# 本地:icons-local/selfhst-icons/webp/openobserve.webp
# 远程:https://cdn.jsdelivr.net/gh/selfhst/icons/webp/openobserve.webp
selfhst-icons: "https://cdn.jsdelivr.net/gh/selfhst/icons/"
# 页面配置文件存放目录
pages_dir: "./pages"
# 前端目录:存在 index.html 时优先使用;不存在/没有 index.html 时用二进制内嵌的前端资源
# (单文件部署无需该目录;源码运行请先 `pnpm --dir frontend run build`)
frontend_dir: "./frontend/build"
# 补充 HTML/JSON 等静态文件,无需改源码或替换内嵌前端;相对配置文件所在目录
static_dir: "./static"
# 全局备注/公告:非空时在骨架菜单上方显示,长文本可用 YAML 的 | 写多行
announcement: ""
#
# 页面默认配置
# 所有页面都继承这些配置,可在页面配置文件中覆盖
page_defaults:
theme: "ocean-depths"
# 默认导航配置
page_navs:
- name: "Home"
icon: "fas fa-home"
url: "/"
- name: "Tools"
icon: "fas fa-tools"
url: "/tools"
- name: "InnerTools"
icon: "fas fa-tools"
url: "/inner-tools"
- name: "Another"
icon: "fas fa-star"
url: "/another"