2026/01/nextjs 的 鉴权实践 1
Auth.js
Auth.js
以管理员身份打开PowerShell,然后执行:
# 查看当前执行策略
Get-ExecutionPolicy
# 将执行策略设置为 RemoteSigned(推荐)
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
# 或者设置为 Bypass(临时解决方案)
Set-ExecutionPolicy Bypass -Scope CurrentUser -Force
# 验证更改
Get-ExecutionPolicy -List
在powershell 中
notepad $PROFILE
编辑文件
# Make 命令补全函数
function MakeCompletion {
param($wordToComplete, $commandAst, $cursorPosition)
$makefile = Get-ChildItem -File | Where-Object {
$_.Name -in @('Makefile', 'makefile', 'GNUmakefile')
} | Select-Object -First 1
if ($makefile) {
$targets = Get-Content $makefile.FullName |
Select-String '^\s*([a-zA-Z0-9_-]+):' |
ForEach-Object { $_.Matches.Groups[1].Value } |
Sort-Object -Unique
$targets | Where-Object { $_ -like "$wordToComplete*" } |
ForEach-Object {
[System.Management.Automation.CompletionResult]::new(
$_,
$_,
'ParameterValue',
$_
)
}
}
}
# 注册补全
Register-ArgumentCompleter -CommandName make -ScriptBlock $function:MakeCompletion
现在可以 了
make
输入tab 会自动补全
dockur/windows 是一个容器化的 win 项目
https://github.com/dockur/windows
特点✨ 多语言 ISO 下载器 KVM加速 基于 Web 的查看器
docker pull ghcr.io/dockur/windows:3.13
运行
docker run \
-it --rm \
-p 8006:8006 \
--cap-add NET_ADMIN \
-e VERSION='winxp' \
-e KVM="N" \
-e RAM_SIZE='1G' \
--stop-timeout 120 \
ghcr.io/dockur/windows:3.13
http://127.0.0.1:8006/?resize=scale&autoconnect=true
他这个 本身使用的事 vnc 技术







docker commit b46f8da3f4f4 registry.dafengstudio.cn/windows:xp
docker push registry.dafengstudio.cn/windows:xp
win7
docker commit bce2411bd9a4 registry.dafengstudio.cn/windows:win7
docker push registry.dafengstudio.cn/windows:win7
Bitwarden 是一款开源的密码管理工具,提供跨平台的密码管理解决方案。用户可以安全地存储敏感信息,如密码、信用卡信息和笔记,并通过加密保护这些信息。Bitwarden 支持自动填充密码、生成强密码、共享安全信息等功能,同时提供浏览器插件、移动应用和桌面应用,方便用户在不同设备上访问和管理密码。Bitwarden 的安全性建立在端到端加密和零知识架构之上,确保用户的数据得到最高级别的保护。
注意 最近 docker 被强 自己找加速器 下载后 再推到私有
docker pull hub.uuuadc.top/bitwarden/server
docker image tag hub.uuuadc.top/bitwarden/server:latest registry.dafengstudio.cn/bitwarden/server:
docker push registry.dafengstudio.cn/bitwarden/server:latest
挂载目录
WORKDIR /opt/bitwarden

admin token 生成
https://github.com/dani-garcia/vaultwarden/wiki/Enabling-admin-page#secure-the-admin_token
docker exec -it bitwarden-server /vaultwarden hash
run
docker stop bitwarden-server|true
docker rm bitwarden-server
docker run \
--name bitwarden-server \
-d \
--restart=always \
-e WEBSOCKET_ENABLED=true \
-e SIGNUPS_ALLOWED=false \
-e I_REALLY_WANT_VOLATILE_STORAGE=true \
-e ADMIN_TOKEN='$argon2id$v=19$m=65540,t=3,p=4$UhMyL86++kz+P9BmkHYFB8DmflBNrWnkcrAYRYTCR4c$YGSGH494PLQkXyiRJ9wFfeXbQREPwsZsmJArEQqKtlg' \
-p 3013:80 \
-p 3012:3012 \
-v /volume1/docker/foldspace-apps/bitwarden:/data/ \
registry.dafengstudio.cn/vaultwarden/server:latest


Logseq是一个知识管理和协作平台。它专注于隐私**、持久性和用户控制。Logseq 提供了一系列强大的知识管理**、协作、PDF 注释和任务管理****工具,支持多种文件格式,包括Markdown和Org-mode,以及用于组织和构建笔记的各种功能。
Logseq 的白板功能可让您使用带有形状、绘图、网站嵌入和连接器的空间****画布来组织您的知识和想法。您可以直观地分组和链接您的笔记和外部媒体(例如视频和图像),使视觉思考者能够以新的方式撰写、重新混合、注释和连接来自其知识库和新兴想法的内容。
除了核心功能外,Logseq 还拥有不断壮大的插件和主题生态系统,可实现各种工作流程和自定义选项。还提供移动应用程序,可访问桌面应用程序的大多数功能。无论您是学生、专业人士,还是任何重视以清晰、有条理的方式管理想法和笔记的人,Logseq 都是任何希望提高工作效率和简化工作流程的人的绝佳选择。
https://github.com/logseq/logseq
在 nas 上执行
Status: Downloaded newer image for registry.dafengstudio.cn/logseq/logseq-webapp:latest
registry.dafengstudio.cn/logseq/logseq-webapp:latest
ash-4.3# docker pull registry.dafengstudio.cn/bitwarden/server:latest
latest: Pulling from bitwarden/server
efc2b5ad9eec: Downloading [===========================> ] 16.22MB/29.13MB
66b672aaa3a6: Downloading [=======================> ] 8.65MB/18.71MB
3d7d086377ca: Download complete
030dfb09a3db: Downloading [===============================> ] 20.32MB/32.24MB
75cceec2ae3f: Waiting
2fe3f9fcc07a: Waiting
5005e22762b0: Waiting
注意 最近 docker 被强 自己找加速器 下载后 再推到私有
docker pull hub.uuuadc.top/bitwarden/server
docker image tag hub.uuuadc.top/bitwarden/server:latest registry.dafengstudio.cn/bitwarden/server:
docker push registry.dafengstudio.cn/bitwarden/server:latest
挂载目录
WORKDIR /data
docker run --name tream-logseq \
-it -d \
--restart=always \
-p 3001:80 \
-v /volume1/docker/foldspace-apps/tream-logseq/:/data \
registry.dafengstudio.cn/logseq/logseq-webapp:latest


.well-known/jwks.well-known/jwks 是一个标准的 URI 路径,用于在 Web 服务器上公开 JSON Web Key Set(JWKS),以便其他应用程序可以使用它们来验证令牌的签名。
JSON Web Key Set(JWKS)是一种包含公钥或证书的 JSON 格式文件,用于在 OAuth 2.0 和 OpenID Connect 等身份验证和授权协议中进行令牌签名验证。通过公开 JWKS,应用程序可以获取到用于验证签名的公钥,从而验证来自认证服务器签发的令牌的合法性。
在 OAuth 2.0 和 OpenID Connect 中,认证服务器通常会使用非对称加密算法生成令牌的签名,并将公钥或证书存储在 JWKS 中。其他应用程序可以通过获取 JWKS 中的公钥来验证令牌的签名,确保令牌的真实性和完整性。
因此,当一个应用程序需要验证来自认证服务器签发的令牌时,它可以通过访问 .well-known/jwks 路径来获取 JWKS,并使用其中的公钥来验证令牌的签名。这有助于确保令牌的安全性和有效性。
需要 ngx_http_js_module.so
在开始在研究
感觉纯nginx 比较复杂, 要么需要 nginx plus 要么配置负载
换 https://github.com/zmartzone/lua-resty-openidc 看看
RUN luarocks install lua-resty-openidc
RUN luarocks install lua-resty-http
RUN luarocks install lua-resty-session
RUN luarocks install lua-resty-jwt
安装目录
#15 [11/20] RUN luarocks list
#15 0.208
#15 0.209 Rocks installed for Lua 5.1
#15 0.209 ---------------------------
#15 0.209
#15 0.209 lua-ffi-zlib
#15 0.209 0.6-0 (installed) - /usr/local/openresty/luajit/lib/luarocks/rocks-5.1
#15 0.209
#15 0.209 lua-resty-auto-ssl
#15 0.209 0.13.1-1 (installed) - /usr/local/openresty/luajit/lib/luarocks/rocks-5.1
#15 0.209
#15 0.209 lua-resty-http
#15 0.209 0.17.2-0 (installed) - /usr/local/openresty/luajit/lib/luarocks/rocks-5.1
#15 0.209
#15 0.209 lua-resty-jwt
#15 0.209 0.2.3-0 (installed) - /usr/local/openresty/luajit/lib/luarocks/rocks-5.1
#15 0.209
#15 0.209 lua-resty-openidc
#15 0.209 1.7.6-3 (installed) - /usr/local/openresty/luajit/lib/luarocks/rocks-5.1
#15 0.209
#15 0.209 lua-resty-openssl
#15 0.209 1.5.1-1 (installed) - /usr/local/openresty/luajit/lib/luarocks/rocks-5.1
#15 0.209
#15 0.209 lua-resty-session
#15 0.209 4.0.5-1 (installed) - /usr/local/openresty/luajit/lib/luarocks/rocks-5.1
#15 0.209 3.10-1 (installed) - /usr/local/openresty/luajit/lib/luarocks/rocks-5.1
#15 0.209
#15 0.209 shell-games
#15 0.209 1.1.0-1 (installed) - /usr/local/openresty/luajit/lib/luarocks/rocks-5.1
#15 0.209
#15 DONE 0.2s
https://www.nginx-cn.net/blog/easy-robust-sso-openid-connect-nginx-ingress-controller/
最后发现 js 模块需要