From 09d7bca3fec9b249200a9ea0ae873a7eab894686 Mon Sep 17 00:00:00 2001 From: liuxiaohua Date: Tue, 7 Jan 2025 14:33:24 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20[2025-01-07]=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20Linkwarden=E3=80=81=E9=9B=86=E7=AE=80=E4=BA=91=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E3=80=81Yearning=E9=83=A8=E7=BD=B2=E6=8C=87=E5=8D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 教程/20250107-Yearning安装及SSO接入指南.md | 86 +++++++++++----------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/教程/20250107-Yearning安装及SSO接入指南.md b/教程/20250107-Yearning安装及SSO接入指南.md index 82f5c9f..f401bcf 100644 --- a/教程/20250107-Yearning安装及SSO接入指南.md +++ b/教程/20250107-Yearning安装及SSO接入指南.md @@ -71,32 +71,32 @@ services: #### `conf.toml` 文件 -```java +```toml [Mysql] -Db ="Yearning" -Host ="127.0.0.1" -Port ="3306" -Password ="" -User ="root" +Db = "Yearning" +Host = "127.0.0.1" +Port = "3306" +Password = "" +User = "root" - [General] -SecretKey ="dbcjqheupqjsuwsm" -Hours =4 -Lang="zh_CN" +[General] +SecretKey = "dbcjqheupqjsuwsm" +Hours = 4 +Lang = "zh_CN" - [Oidc] -Enable =false -ClientId ="${keycloak的客户端ID}" -ClientSecret ="${keycloak的客户端Secret}" -Scope ="openid profile" -AuthUrl ="${issuer链接}/protocol/openid-connect/auth" -TokenUrl ="${issuer链接}/protocol/openid-connect/token" -UserUrl ="${issuer链接}/protocol/openid-connect/userinfo" -RedirectUrL ="${yearning的地址}/oidc/_token-login" -UserNameKey ="preferred_username" -RealNameKey ="name" -EmailKey ="email" -SessionKey ="session_state" +[Oidc] +Enable = false +ClientId = "${keycloak的客户端ID}" +ClientSecret = "${keycloak的客户端Secret}" +Scope = "openid profile" +AuthUrl = "${issuer链接}/protocol/openid-connect/auth" +TokenUrl = "${issuer链接}/protocol/openid-connect/token" +UserUrl = "${issuer链接}/protocol/openid-connect/userinfo" +RedirectUrL = "${yearning的地址}/oidc/_token-login" +UserNameKey = "preferred_username" +RealNameKey = "name" +EmailKey = "email" +SessionKey = "session_state" ``` ### Yearning OIDC 配置 @@ -105,20 +105,20 @@ SessionKey ="session_state" #### 修改 `conf.toml`(Keycloak示例) -```java +```toml [Oidc] -Enable =true -ClientId ="${keycloak的客户端ID}" -ClientSecret ="${keycloak的客户端Secret}" -Scope ="openid profile" -AuthUrl ="${issuer链接}/protocol/openid-connect/auth" -TokenUrl ="${issuer链接}/protocol/openid-connect/token" -UserUrl ="${issuer链接}/protocol/openid-connect/userinfo" -RedirectUrL ="${yearning的地址}/oidc/_token-login" -UserNameKey ="preferred_username" -RealNameKey ="name" -EmailKey ="email" -SessionKey ="session_state" +Enable = true +ClientId = "${keycloak的客户端ID}" +ClientSecret = "${keycloak的客户端Secret}" +Scope = "openid profile" +AuthUrl = "${issuer链接}/protocol/openid-connect/auth" +TokenUrl = "${issuer链接}/protocol/openid-connect/token" +UserUrl = "${issuer链接}/protocol/openid-connect/userinfo" +RedirectUrL = "${yearning的地址}/oidc/_token-login" +UserNameKey = "preferred_username" +RealNameKey = "name" +EmailKey = "email" +SessionKey = "session_state" ``` - ${keycloak的客户端ID}:例如 `yearning` @@ -206,7 +206,7 @@ npm -v ### Yearning 源码安装 -- 工作目录: `/usr/local/workspace` +- 工作目录 `/usr/local/workspace` #### 获取 Yearning @@ -243,18 +243,18 @@ go mod tidy cp conf.toml.template conf.toml -# 修改 配置文件 +#- 修改 配置文件 vi conf.toml -# 初始化(第一次需要) -# go run main.go install +#- 初始化(第一次需要) +#- go run main.go install -# 启动 +#- 启动 go run main.go run ``` -- 启动报错,chat/* xxx - - `vi src/service/yearning.go` +- 启动报错 `chat/* xxx` + - 编辑文件 `vi src/service/yearning.go` - 删除报错提示的行相关的代码 ## 参考