Glance:支持RSS的自托管仪表板

在这里插入图片描述

本文软件由网友 P家单推人 推荐

什么是 Glance ?

Glance 是一个自托管仪表板,可以显示实时 RSS 订阅、Reddit 子版块帖子、天气、书签、特定频道的最新 YouTube 视频、日历、股票信息、iframetwitch 频道和热门游戏、GitHub 发布和网站监控等。

因为是基于 Go 语言开发的,所以除了 Docker 外,还支持 LinuxWindows 平台,而且不仅支持 X86,也支持 ARM 平台

下载地址:https://github.com/glanceapp/glance/releases

准备

Glance 的配置是通过单个 YAML 文件完成的,需要重新启动服务器才能使任何更改生效。尝试使用无效的配置文件启动服务器,将导致错误。

所以老苏建议你

  1. 先用官方的 glance.yml 跑起来之后,再慢慢根据需要进行修改;
  2. Visual Studio Code 来编辑 YAML 文件。在安装了 YAML 插件后,比较容易发现 YAML 中因为缩进导致的错误;
pages:
  - name: Home
    columns:
      - size: small
        widgets:
          - type: calendar

          - type: rss
            limit: 10
            collapse-after: 3
            cache: 3h
            feeds:
              - url: https://ciechanow.ski/atom.xml
              - url: https://www.joshwcomeau.com/rss.xml
                title: Josh Comeau
              - url: https://samwho.dev/rss.xml
              - url: https://awesomekling.github.io/feed.xml
              - url: https://ishadeed.com/feed.xml
                title: Ahmad Shadeed

          - type: twitch-channels
            channels:
              - theprimeagen
              - cohhcarnage
              - christitustech
              - blurbs
              - asmongold
              - jembawls

      - size: full
        widgets:
          - type: hacker-news

          - type: videos
            channels:
              - UCR-DXc1voovS8nhAvccRZhg # Jeff Geerling
              - UCv6J_jJa8GJqFwQNgNrMuww # ServeTheHome
              - UCOk-gHyjcWZNj3Br4oxwh0A # Techno Tim

          - type: reddit
            subreddit: selfhosted

      - size: small
        widgets:
          - type: weather
            location: London, United Kingdom

          - type: stocks
            stocks:
              - symbol: SPY
                name: S&P 500
              - symbol: BTC-USD
                name: Bitcoin
              - symbol: NVDA
                name: NVIDIA
              - symbol: AAPL
                name: Apple
              - symbol: MSFT
                name: Microsoft
              - symbol: GOOGL
                name: Google
              - symbol: AMD
                name: AMD
              - symbol: RDDT
                name: Reddit

保存的时候建议用 UTF-8 格式,避免出现错误

glance.yml 中各参数的设置请参考官方文档: https://github.com/glanceapp/glance/blob/main/docs/configuration.md

虽然是英文的,但是搭配 Kimi Copilot 或者 Kimi 阅读助手,还是可以理解个七七八八的

安装

在群晖上以 Docker 方式安装。

在注册表中搜索 glanceapp ,选择第一个 glanceapp/glance,版本选择 latest

本文写作时, latest 版本对应为 v0.4.0

但因为要挂载时区和时间,所以采用命令行方式安装

docker cli 安装

如果你熟悉命令行,可能用 docker cli 更快捷

# 新建文件夹 glance 及子目录
mkdir -p /volume1/docker/glance/assets

# 进入 glance 目录
cd /volume1/docker/glance

# 将 glance.yml 放入当前目录

# 运行容器
docker run -d \
   --restart unless-stopped \
   --name glance \
   -p 3340:8080 \
   -v $(pwd)/glance.yml:/app/glance.yml \
   -v $(pwd)/assets:/app/assets \
   -v /etc/TZ:/etc/timezone:ro \
   -v /etc/localtime:/etc/localtime:ro \
   glanceapp/glance

下面是一个简单的参数说明

参数 说明
-p 3340:8080 端口映射
-v /app/glance.yml 挂载配置文件
-v /app/assets 挂载资源目录
-v /etc/timezone 本机所属的时区
-v /etc/localtime 本机时间

docker-compose 安装

也可以用 docker-compose 安装,将下面的内容保存为 docker-compose.yml 文件

version: '3'

services:
  glance:
    image: glanceapp/glance
    container_name: glance
    restart: unless-stopped
    ports:
      - 3340:8080
    volumes:
      - ./glance.yml:/app/glance.yml
      - ./assets:/app/assets
      - /etc/TZ:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro

然后执行下面的命令

# 新建文件夹 glance 及子目录
mkdir -p /volume1/docker/glance/assets

# 进入 glance 目录
cd /volume1/docker/glance

# 将 glance.yml 和 docker-compose.yml 放入当前目录

# 一键启动
docker-compose up -d

运行

在浏览器中输入 http://群晖IP:3340 ,如果你的网络科学的话,应该会看到这样的界面

但这显然不是老苏想要的,先易后难,第一版只保留了 日历RSS天气

pages:
  - name: Home
    columns:
      - size: small
        widgets:
          - type: calendar

      - size: full
        widgets:
          - type: rss
            limit: 10
            collapse-after: 10
            cache: 3h
            feeds:
              - url: https://laosu.tech/atom.xml
                title: 各种折腾

      - size: small
        widgets:
          - type: weather
            location: Shanghai, China

原本加了 style: horizontal-cards,但是图片出不来,所以还是去掉了

最后的版本加了站点监控

server:
  port: 8080
  assets-path: /app/assets

pages:
  - name: Home
    columns:
      - size: small
        widgets:
          - type: calendar
          
          - type: monitor
            cache: 1m
            title: Services
            sites:
              - title: Jellyfin
                url: http://192.168.0.197:8096
                icon: /assets/jellyfin-logo.png
              - title: Vaultwarden
                url: http://192.168.0.199:8880
                icon: /assets/bitwarden_new_256.png
              - title: Alist(xiaoya)
                url: http://192.168.0.199:8765
                icon: /assets/alist.svg 

      - size: full
        widgets:
          - type: rss
            limit: 10
            collapse-after: 10
            cache: 3h
            feeds:
              - url: https://laosu.tech/atom.xml
                title: 各种折腾

      - size: small
        widgets:
          - type: weather
            location: Shanghai, China

PC 上不觉得怎么样,但是手机上的效果老苏觉得还不错

站点监控用到的图片,需要自己上传到 assets 目录

参考文档

glanceapp/glance: A selfhosted dashboard that puts all your feeds in one place
地址:https://github.com/glanceapp/glance

相关推荐

  1. glances安装方式

    2024-06-07 12:14:01       31 阅读
  2. 4-安装并配置Grafana并导入特定仪表模板

    2024-06-07 12:14:01       45 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-07 12:14:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-07 12:14:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-06-07 12:14:01       87 阅读
  4. Python语言-面向对象

    2024-06-07 12:14:01       96 阅读

热门阅读

  1. C#软件搬家功能的实现

    2024-06-07 12:14:01       30 阅读
  2. HTML5 视频 Vedio 标签详解

    2024-06-07 12:14:01       29 阅读
  3. 【第二篇】SpringSecurity源码详解

    2024-06-07 12:14:01       32 阅读
  4. npm上传提示:413 Request Entity Too Large

    2024-06-07 12:14:01       35 阅读
  5. 【二叉树算法题记录】669. 修剪二叉搜索树

    2024-06-07 12:14:01       30 阅读
  6. 游戏心理学Day06

    2024-06-07 12:14:01       32 阅读
  7. 在CentOS 7上查看和管理内存使用情况

    2024-06-07 12:14:01       26 阅读
  8. 【回溯算法 1】全排列(medium)(每日一题)

    2024-06-07 12:14:01       34 阅读