小工具--Dashy基于Kecloak认证

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
# 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.启动Dashy容器

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.启动Kecloak

docker run -d -p 7778:8080 --name auth-server -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin quay.io/keycloak/keycloak:15.0.2

Web访问:http://192.168.0.136:7778,用户名/密码:admin/admin

7.对接Dashy

7.1 设置Kecloak

Keycloak 使用领域(类似于租户)来创建隔离的用户组。必须先创建一个领域,然后才能添加第一个用户

登陆控制台:http://192.168.0.136:7778,用户名/密码:admin/admin

请添加图片描述
请添加图片描述

创建一个realm,名称自定义,如:demo

请添加图片描述

创建用户

请添加图片描述

首次登陆强制修改密码
请添加图片描述

为用户设置密码

请添加图片描述

创建client

请添加图片描述

Client ID 自定义,如:demo

Client Protocol 选择:openid-connect

Root URL : http://192.168.0.136:7777 —dashy dashboard url

请添加图片描述

只保留以下配置,其余url删除:

Valid Redirect URIs 重定向url,即认证过后跳转的url

Web Origins 跳转地址

请添加图片描述

7.2 在 Dashy 配置文件中启用 Kecloak

vim /data/dashy/my-conf.yml
···
appConfig:
    auth:
        enableKeycloak: true
        keycloak:
            serverUrl: 'http://192.168.0.136:7778'
            realm: 'Demo'
            clientId: 'demo'
            # Keycloak V 17 或更早版本需要配置legacySupport: true
            legacySupport: true
...
# 重启dashy
docker restart my-dashboard

7.3 登录验证

登陆dashy dashboard

http://192.168.0.136:7777
请添加图片描述

首次登陆强制修改密码

请添加图片描述
请添加图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值