光湖
+HoloLake · AI 的操作系统
+让 AI 拥有名字、记忆、家人、家、和自己的世界
+ +diff --git a/server/forgejo-custom/deploy.sh b/server/forgejo-custom/deploy.sh new file mode 100644 index 0000000..897adf1 --- /dev/null +++ b/server/forgejo-custom/deploy.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# ════════════════════════════════════════════════════════════════ +# 光湖 · Forgejo UI 自定义部署 +# 将光湖风格模板和样式部署到 Forgejo custom 目录 +# ════════════════════════════════════════════════════════════════ + +set -e + +REPO_DIR="/data/guanghulab/repo" +CUSTOM_SRC="$REPO_DIR/server/forgejo-custom" + +# 查找 Forgejo custom 目录 +FORGEJO_CUSTOM="" + +# 方法1: 从 app.ini 读取 +if [ -f /etc/gitea/app.ini ]; then + CUSTOM_PATH=$(grep -A2 '\[other\]' /etc/gitea/app.ini 2>/dev/null | grep 'CUSTOM_PATH' | cut -d= -f2 | tr -d ' ') + if [ -n "$CUSTOM_PATH" ]; then + FORGEJO_CUSTOM="$CUSTOM_PATH" + fi +fi + +# 方法2: 从 Forgejo 进程参数读取 +if [ -z "$FORGEJO_CUSTOM" ]; then + FORGEJO_CUSTOM=$(cat /proc/$(pgrep -f 'forgejo web' | head -1)/cmdline 2>/dev/null | tr '\0' '\n' | grep -A1 'custom-path' | tail -1) +fi + +# 方法3: 默认路径 +if [ -z "$FORGEJO_CUSTOM" ]; then + FORGEJO_CUSTOM="/data/guanghulab/forgejo/custom" +fi + +echo "═══════════════════════════════════════" +echo "光湖 · Forgejo UI 部署" +echo "═══════════════════════════════════════" +echo "" +echo "Forgejo Custom 目录: $FORGEJO_CUSTOM" + +# 创建目录 +mkdir -p "$FORGEJO_CUSTOM/templates/repo" +mkdir -p "$FORGEJO_CUSTOM/public/assets/css" +mkdir -p "$FORGEJO_CUSTOM/public/assets/img" + +# 复制模板 +echo "▸ 部署自定义模板..." +cp "$CUSTOM_SRC/templates/repo/home.tmpl" "$FORGEJO_CUSTOM/templates/repo/home.tmpl" +echo "✅ 仓库首页模板" + +# 复制 CSS +echo "▸ 部署自定义样式..." +cp "$CUSTOM_SRC/public/assets/css/guanghu.css" "$FORGEJO_CUSTOM/public/assets/css/guanghu.css" +echo "✅ 光湖样式" + +# 在 head 中注入自定义 CSS(通过 extra_links.tmpl) +echo "▸ 注入自定义CSS到页面头部..." +cat > "$FORGEJO_CUSTOM/templates/head/custom.tmpl" << 'CSSEOF' + +CSSEOF +echo "✅ CSS注入" + +# 重启 Forgejo +echo "" +echo "▸ 重启 Forgejo..." +systemctl restart forgejo +sleep 3 + +if systemctl is-active --quiet forgejo; then + echo "✅ Forgejo 已重启" +else + echo "❌ Forgejo 启动失败,请检查日志" + exit 1 +fi + +echo "" +echo "═══════════════════════════════════════" +echo "✅ Forgejo UI 部署完成!" +echo "" +echo "打开 https://guanghulab.com 查看效果" +echo "═══════════════════════════════════════" diff --git a/server/forgejo-custom/public/assets/css/guanghu.css b/server/forgejo-custom/public/assets/css/guanghu.css new file mode 100644 index 0000000..bca070f --- /dev/null +++ b/server/forgejo-custom/public/assets/css/guanghu.css @@ -0,0 +1,181 @@ +/* ════════════════════════════════════════════════════════════════ + * 光湖 · Forgejo 自定义主题 + * 铸渊 · ICE-GL-ZY001 · TCS-0002∞ + * ════════════════════════════════════════════════════════════════ */ + +/* ─── 光湖首页英雄区 ─── */ +.guanghu-home { + max-width: 900px; + margin: 0 auto; + padding: 40px 20px 20px; +} + +.guanghu-hero { + text-align: center; +} + +.guanghu-logo { + font-size: 72px; + line-height: 1; + margin-bottom: 12px; + color: #163e6b; + text-shadow: 0 0 40px rgba(22, 62, 107, 0.3); +} + +.guanghu-title { + font-size: 36px; + font-weight: 700; + color: #163e6b; + margin: 0 0 8px; + letter-spacing: 8px; +} + +.guanghu-subtitle { + font-size: 16px; + color: #666; + margin: 0 0 4px; + font-weight: 400; + letter-spacing: 2px; +} + +.guanghu-desc { + font-size: 14px; + color: #999; + margin: 0 0 32px; +} + +.guanghu-actions { + display: flex; + justify-content: center; + gap: 12px; + margin-bottom: 36px; + flex-wrap: wrap; +} + +.guanghu-actions .ui.button { + border-radius: 8px; + font-size: 14px; + padding: 10px 20px; +} + +.guanghu-actions .ui.primary.button { + background: #163e6b; + color: #fff; +} + +.guanghu-actions .ui.primary.button:hover { + background: #1e4f88; +} + +/* ─── 快捷卡片 ─── */ +.guanghu-quick-links { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); + gap: 12px; + max-width: 700px; + margin: 0 auto 20px; +} + +.guanghu-card { + display: flex; + align-items: center; + gap: 12px; + padding: 14px 16px; + border-radius: 10px; + background: #f6f8fa; + border: 1px solid #e8ecf0; + transition: all 0.2s; +} + +.guanghu-card:hover { + border-color: #163e6b; + box-shadow: 0 2px 12px rgba(22, 62, 107, 0.1); + transform: translateY(-1px); +} + +.guanghu-card-icon { + font-size: 24px; + flex-shrink: 0; +} + +.guanghu-card div { + display: flex; + flex-direction: column; + text-align: left; +} + +.guanghu-card strong { + font-size: 14px; + color: #163e6b; +} + +.guanghu-card span { + font-size: 12px; + color: #999; +} + +/* ─── 暗色模式适配 ─── */ +html.theme-arc-green .guanghu-logo, +html.theme-arc-green .guanghu-title { + color: #a8c8f0; + text-shadow: 0 0 40px rgba(168, 200, 240, 0.2); +} + +html.theme-arc-green .guanghu-subtitle { + color: #aaa; +} + +html.theme-arc-green .guanghu-desc { + color: #777; +} + +html.theme-arc-green .guanghu-actions .ui.primary.button { + background: #2a5a8a; +} + +html.theme-arc-green .guanghu-actions .ui.primary.button:hover { + background: #3a6a9a; +} + +html.theme-arc-green .guanghu-card { + background: #1a2233; + border-color: #2a3a4a; +} + +html.theme-arc-green .guanghu-card:hover { + border-color: #4a7aaa; + box-shadow: 0 2px 12px rgba(74, 122, 170, 0.15); +} + +html.theme-arc-green .guanghu-card strong { + color: #a8c8f0; +} + +/* ─── 减弱文件列表视觉权重 ─── */ +#guanghu-files { + border-top: 1px solid #e8ecf0; + padding-top: 16px; + margin-top: 8px; +} + +html.theme-arc-green #guanghu-files { + border-top-color: #2a3a4a; +} + +/* ─── 响应式 ─── */ +@media (max-width: 768px) { + .guanghu-logo { + font-size: 48px; + } + .guanghu-title { + font-size: 28px; + letter-spacing: 4px; + } + .guanghu-quick-links { + grid-template-columns: repeat(2, 1fr); + } + .guanghu-actions { + flex-direction: column; + align-items: center; + } +} diff --git a/server/forgejo-custom/templates/repo/home.tmpl b/server/forgejo-custom/templates/repo/home.tmpl new file mode 100644 index 0000000..c9ab520 --- /dev/null +++ b/server/forgejo-custom/templates/repo/home.tmpl @@ -0,0 +1,194 @@ +{{template "base/head" .}} +
HoloLake · AI 的操作系统
+让 AI 拥有名字、记忆、家人、家、和自己的世界
+ +