1.简介

Dashy 是一款既美观又实用的书签管理工具

2.环境准备

  • Linux CentOS 7.6
  • docker

3.部署docker

[root@learn-1 ~]# yum install docker -y
[root@learn-1 ~]# systemctl start docker && systemctl enable docker

4.编辑配置文件

在本地编辑配置文件,用于挂载至容器中

[root@learn-1 ~]# mkdir -p /data/dashy
[root@learn-1 ~]# vim /data/dashy/my-conf.yml

---
# Page meta info, like heading, footer text and nav links
pageInfo:
  title: Dashy
  description: Welcome to your new dashboard!
  navLinks:
  - title: GitHub
    path: https://github.com/Lissy93/dashy
  - title: Documentation
    path: https://dashy.to/docs

# Optional app settings and configuration
appConfig:
  # 设置默认主题 
  theme: colorful
  # 开启网站健康检查
  statusCheck: true
  # 开启简单登陆认证
  auth:
    users:
    - user: admin
      # 123456,采用SHA-256加密,工具地址:https://crypot.51strive.com/sha256.html
      hash: 8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92
      type: admin
    - user: view
      # 123456,采用SHA-256加密,工具地址:https://crypot.51strive.com/sha256.html
      hash: 8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92
      type: normal

# Main content - An array of sections, each containing an array of items
sections:
- name: Getting Started
  icon: fas fa-rocket
  items:
  - title: Dashy Live
    description: Development a project management links for Dashy
    icon: https://i.ibb.co/qWWpD0v/astro-dab-128.png
    url: https://live.dashy.to/
    target: newtab
  - title: GitHub
    description: Source Code, Issues and Pull Requests
    url: https://github.com/lissy93/dashy
    icon: favicon
  - title: Docs
    description: Configuring & Usage Documentation
    provider: Dashy.to
    icon: far fa-book
    url: https://dashy.to/docs
  - title: Showcase
    description: See how others are using Dashy
    url: https://github.com/Lissy93/dashy/blob/master/docs/showcase.md
    icon: far fa-grin-hearts
  - title: Config Guide
    description: See full list of configuration options
    url: https://github.com/Lissy93/dashy/blob/master/docs/configuring.md
    icon: fas fa-wrench
  - title: Support
    description: Get help with Dashy, raise a bug, or get in contact
    url: https://github.com/Lissy93/dashy/blob/master/.github/SUPPORT.md
    icon: far fa-hands-helping
- name: test1
  #statusCheck: true
  icon: fas fa-rocket
  items:
  - title: baidu
    url: http://www.baidu.com
    target: newtab
    icon: fa fa-sign-in
- name: test2
  #statusCheck: true
  icon: fas fa-rocket
  items:
  - title: google
    url: https://www.google.com
    target: newtab
    icon: fa fa-sign-in

5.启动容器

docker run -d -p 7777:80 -v /data/dashy/my-conf.yml:/app/public/conf.yml --name my-dashboard --restart=always lissy93/dashy:latest

请添加图片描述

登陆后为上图显示页面,点击对应板块就会新打开一个浏览器窗口访问对应网址

6.开启访客模式

appConfig:
...
  auth:
    # 开启访客模式
    enableGuestAccess: true
...

7.简单细粒度认证

  • hideForUsers:所有用户可见,指定客户隐藏
  • showForUsers:所有用户隐藏,指定客户可见
  • hideForGuests:对登陆用户可见,指定访客不可见

生效级别细分为section与item,以下默认的Getting Started部分分别举例:

  • section级别

    • Getting Started部分对test1可见,对test2隐藏,对访客不可见
sections:
- name: Getting Started
  icon: fas fa-rocket
  # 细粒度控制
  displayData:
    hideForUsers: [test2]
    showForUsers: [test1]
    hideForGuests: true
  • item级别

    • Getting Started部分中,Dashy Live与GitHub对test1可见(即对其余所有用户隐藏),Docs与Showcase对test2隐藏(其余所有用户可见),Config Guide与Support对游客隐藏
sections:
- name: Getting Started
  icon: fas fa-rocket

  items:
  - title: Dashy Live
    # 仅 test1 可见,其余用户隐藏
    displayData:
      showForUsers: [test1]
    description: Development a project management links for Dashy
    icon: https://i.ibb.co/qWWpD0v/astro-dab-128.png
    url: https://live.dashy.to/
    target: newtab
  - title: GitHub
    # 仅 test1 可见,其余用户隐藏
    displayData:
      showForUsers: [test1]
    description: Source Code, Issues and Pull Requests
    url: https://github.com/lissy93/dashy
    icon: favicon
  - title: Docs
    # 仅 test2 隐藏,其余用户可见
    displayData:
      hideForUsers: [test2]
    description: Configuring & Usage Documentation
    provider: Dashy.to
    icon: far fa-book
    url: https://dashy.to/docs
  - title: Showcase
    # 仅 test2 隐藏,其余用户可见
    displayData:
      hideForUsers: [test2]
    description: See how others are using Dashy
    url: https://github.com/Lissy93/dashy/blob/master/docs/showcase.md
    icon: far fa-grin-hearts
  - title: Config Guide
    # 仅游客隐藏,登陆用户可见
    displayData:
      hideForGuests: true
    description: See full list of configuration options
    url: https://github.com/Lissy93/dashy/blob/master/docs/configuring.md
    icon: fas fa-wrench
  - title: Support
    # 仅游客隐藏,登陆用户可见
    displayData:
      hideForGuests: true
    description: Get help with Dashy, raise a bug, or get in contact
    url: https://github.com/Lissy93/dashy/blob/master/.github/SUPPORT.md
    icon: far fa-hands-helping

8.关于更改配置的权限

- 开启登陆认证的前提下,仅 ‘appConfig.auth.users.type: admin’ 的用户可以在UI界面将更改写入磁盘,其余类型(normal)用户只可将更改保存在浏览器本地

- 禁止所有用户将更改写入磁盘

appConfig:
  theme: colorful
  statusCheck: true
  # 禁止所有用户将更改写入磁盘
  preventWriteToDisk: true

- 禁止所有用户将更改保存在本地浏览器

appConfig:
  theme: colorful
  statusCheck: true
  # 禁止将更改保存至浏览器本地
  preventLocalSave: true

- 禁止所有用户UI配置选项

appConfig:
  theme: colorful
  statusCheck: true
  # 禁止UI配置
  disableConfiguration: true

``yaml
appConfig:
theme: colorful
statusCheck: true

禁止将更改保存至浏览器本地

preventLocalSave: true


\- 禁止所有用户UI配置选项

```yaml
appConfig:
  theme: colorful
  statusCheck: true
  # 禁止UI配置
  disableConfiguration: true
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐