naiba and naiba/CloudCode
59ccc12e58
chore(security): pin JWT algorithm + SameSite and harden OAuth2 state cookie
...
- Set GinJWTMiddleware.SigningAlgorithm to "HS256" explicitly so a future
library default change (or an alg:none confusion attempt) cannot weaken
token validation. This matches the current gin-jwt default, so behaviour
is unchanged.
- Set CookieSameSite to Lax: same as the modern-browser default, but
pinned so server-side intent is clear and CSRF on cross-site POST is
blocked while top-level GET (OAuth callback) still works.
- Move the nz-o2s OAuth2 state cookie into writeOauth2StateCookie and
set HttpOnly=true. The frontend does not read this cookie, so HttpOnly
is strictly an XSS-hardening win with no behaviour change.
JWT Cookie HttpOnly/Secure are intentionally left default for now: the
frontend reads \`!!document.cookie\` to display login state and many
deployments terminate TLS at an upstream proxy — flipping those would
require a coordinated frontend change.
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba >
2026-05-18 15:17:59 +00:00
naiba and naiba/CloudCode
a5d4537a8c
fix: 恢复被误删的 AuthCodeURL 调用,修复编译失败
...
上次提交误删了 url := o2conf.AuthCodeURL(...) 导致编译失败。
同时添加注释说明 Cookie Secure 属性动态设置的原因。
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba >
2026-03-01 04:05:53 +00:00
naiba and naiba/CloudCode
d57d7b73b6
Fix: 设置Cookie Secure属性增强安全性
...
- 根据运行环境动态设置Secure属性
- 开发环境兼容HTTP,生产环境强制HTTPS
- 解决CodeQL扫描发现的安全漏洞
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba >
2026-03-01 03:49:20 +00:00
naiba
cd69af3a0a
fix: oauth2 login
2025-10-09 22:00:08 +08:00
naiba
c3ec52e392
feat: upgrade frontend
2025-03-15 22:31:16 +08:00
UUBulb
5fc1c8d83c
fix: possible redirect url inconsistency ( #1003 )
2025-02-24 20:53:11 +08:00
UUBulb
3216ad43fa
fix: struct tag ( #932 )
...
* fix: struct tag
* fix: struct tag
* fix: strings conversion
* do not write anything after redirection
* fix table
* fix select
2024-12-31 23:09:58 +08:00
UUBulb
553f8e58d4
fix: oauth2 redirect url not consistent ( #930 )
...
* fix: oauth2 redirect url not consistent
* only use one redirect uri
* feat: allow to disable password authentication
* generate translation template
* update error
* redirect
* query
2024-12-31 22:29:29 +08:00
naiba
18020939da
feat: 绑定 oauth2
2024-12-28 23:50:59 +08:00
naiba
9e6bbd3386
🎉 init swaggo
2024-10-19 23:14:53 +08:00
UUBulb
eb6dd2855e
refactor: ddns ( #414 )
...
* refactor ddns
* update webhook
2024-08-24 11:11:06 +08:00
Tao Chen
e1513203b4
添加OIDC支持 ( #387 )
...
* add general OIDC
* use "github.com/coreos/go-oidc/v3/oidc" to simplify oidc config
* fix: check if https by X-Forwarded-Proto
* recovery config.yaml
2024-07-13 12:51:59 +08:00
naiba
f75847d3d7
refactor: imporve code style
2024-06-23 16:15:08 +08:00
Akkia
25e7f8a912
✨ 支持cloudflare access OIDC认证 ( #354 )
2024-05-03 08:47:53 +08:00
naiba
8ae885874b
🔒 ️ more secure token generation
2022-12-16 23:34:14 +08:00
Akkia
ee34615f55
fix: Gitee login error
2022-10-14 01:31:00 +08:00
ysicing
b4a5dd550e
feat(oauth2): add gitea oauth2 support
...
add gitea oauth2 support
Signed-off-by: ysicing <i@ysicing.me >
2022-10-12 19:34:15 +08:00
naiba
9352d3d0e0
✨ batch update server tag
2022-09-17 00:08:27 +08:00
naiba
2ab7a5fdd8
✨ custon dashboard template [no ci]
2022-06-03 09:45:11 +08:00
naiba
e5c507f4e8
✨ dashboard v0.13.20 Login with Gitlab、Jihulab
2022-05-26 20:00:20 +08:00
naiba
c2625240c4
🚸 imporve redirect page
2022-04-30 21:39:25 +08:00
naiba
ade06839b7
🔖 dashboard v0.13.0 Globalization
2022-04-30 00:48:39 +08:00
naiba
130248b9ed
🔖 dashboard v0.12.25 refactor oauth2 login
2022-04-26 09:20:32 +08:00
Akkia
91a1e3fe22
fix some typo
2022-04-10 20:28:22 +08:00
naiba
1e641d1249
theme-mdui by @MikoyChinese
2022-01-09 11:54:14 +08:00
naiba
e24121bdf7
🐛 修复修改服务器导致 Agent 离线
2021-07-25 23:50:08 +08:00
naiba
63bb1570d2
✨ 任意时间区间(月流量)统计,无视重启~
2021-07-14 23:53:37 +08:00
naiba
947a4d5d82
🏷️ 增加对 f2fs 的统计
2021-05-04 10:22:38 +08:00
naiba
fc0aee7c49
🐛 修复修改配置后重置为GitHub登录的问题
2021-05-02 17:21:16 +08:00
naiba
6286e34af0
♻️ 重构部分代码,打印调试信息
2021-04-20 19:30:34 +08:00
naiba
01f99a8c2c
✨ 接入 Gitee 登录,v0.4.11 之前的用户需要更新配置文件
2021-03-02 23:08:40 +08:00
naiba
ec17948fe4
✨ feat: 后台服务器备注 close #72
2021-01-20 19:24:59 +08:00
naiba
d7a3ba607b
🔊 v0.3.0 计划任务(定期备份等场景)
2021-01-19 09:59:04 +08:00
naiba
22935a52de
修复 go mod 不兼容
2020-12-13 00:43:25 +08:00
naiba
7fdf323c05
✨ 一键脚本
2020-11-29 22:17:40 +08:00
naiba
4083a42978
🚚 from p14yground to naiba
2020-11-11 10:07:45 +08:00
奶爸
7143089dcb
多管理员
2020-03-22 22:28:25 +08:00
奶爸
70f0e92343
持久化Token
2019-12-20 23:58:09 +08:00
奶爸
d8c4364653
Web 服务
2019-12-08 16:59:58 +08:00