Commit Graph

19 Commits

Author SHA1 Message Date
cc
e5b27a6281 refactor(auth): 去掉登录/入口门的内置兜底,强制走数据库
- db_pool_from_env 强制要求 DATABASE_URL,缺失即 panic 拒启
- UserStore/WallUserStore/DevGate 改为只持连接池的 struct,
  删除全部 seed()/Memory/dev_gate.txt 文件兜底——源码不再留写死账号/hash
- 本地新增 MariaDB(InternetProject 库 + ccuser/dev_gate/wall_users 三表)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 21:09:18 +08:00
cc
6335654904 feat: 上传压缩改按需(>1MB) + 特殊文件夹 6340 兜底用户
- PhotoWallPage: 仅当原文件 >1MB 才 Canvas 压缩,小图原样上传
- auth.rs: seed 兜底表新增 UserTest6340(本地无 DB 时用;线上走 wall_users 表)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 19:42:06 +08:00
cc
3248146c46 @
feat(folder): 特殊文件夹装饰/排版存服务器 + 100条上限

- 后端:WallState 存储模型 + GET/PUT /api/web/folder/{name}/state
- 后端:上传时检查照片+装饰总数 ≤ 100(409 超限拒绝)
- 后端:列表接口返回 max_items 字段
- 前端:特殊文件夹从服务器加载/保存装饰与排版(共享视图)
- 前端:工具栏显示条数计数器,满额变红
- 前端:添加装饰 / 上传图片前客户端检查上限

Co-Authored-By: Claude <noreply@anthropic.com>
@
2026-06-24 23:07:08 +08:00
cc
0e6c774ed6 @
feat(auth): 新增 wall_users 表,照片墙与开发者登录分离

登录先查 ccuser(开发者),再查 wall_users(照片墙用户)。
wall_users 初始用户:cc / UserTest。

Co-Authored-By: Claude <noreply@anthropic.com>
@
2026-06-24 22:42:06 +08:00
cc
8d89cee451 @
feat(photo-wall): 修复4个问题 + 特殊文件夹(共享公共相册)

**照片墙修复:**
- 右键菜单 z-index 40→9999,不再被元素遮挡
- 图片放大后强制重建 DOM(img key 绑定 w/h)
- 右键菜单添加滑条调节旋转步长(1°-90°)和缩放步长(照片 px / 其他 scale)
- Delete 键可删除右键菜单选中的元素(便签也能删)

**特殊文件夹功能(按设计文档实现):**
- 后端:FolderRegistry 解析 special_folders.txt 注册表 + FolderStore 按文件夹存图
- 后端:5 个接口(存在性检查/列表/上传/获取/删除),白名单 + 管理员鉴权
- 前端:App.tsx 按 hash 路由到特殊文件夹,复用 PhotoWallPage
- 前端:文件夹模式无张数上限,localStorage 按文件夹隔离
- 前端:管理员配额警告条(超 1GiB 时显示)
- 前端:403 无权访问时退回起始页

Co-Authored-By: Claude <noreply@anthropic.com>
@
2026-06-24 22:19:29 +08:00
cc
07b0299438 fix(web): scope 16MB body limit to photo routes only
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:15:52 +08:00
cc
e8f3f1674d feat(web): per-user photo endpoints (list/upload/get/delete) behind JWT
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:12:14 +08:00
cc
29cbf524e9 feat(routes): AuthUser extractor validating Bearer JWT
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:08:42 +08:00
cc
9d93a33bae fix(photos): serialize save to enforce quota under concurrency; avoid empty-dir leak
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:07:05 +08:00
cc
3af4893a81 feat(photos): per-user image store with size/count/path-safety guards
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:03:04 +08:00
cc
1186d80475 fix(auth): fail loudly on JWT encode error instead of returning empty token
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:00:21 +08:00
cc
e1820d0ec8 feat(auth): issue/verify username-bearing HS256 JWT
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 20:57:37 +08:00
cc
a3075133d1 feat(monitor): 顶部栏增加磁盘占用,格式与内存一致
采集根分区(/)容量,按 DISK x% · x/x GB · Free x GB 拼入展示文本,
Stats 新增 disk_used_pct / disk_total_bytes / disk_available_bytes 字段。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 15:31:27 +08:00
cc
4c8c4360ad feat(weather): 起始页天气/定位细节完善
- 新增 Client/src/lib/amap.ts:高德 JS 定位封装
- weather.ts / useWeather.ts:带经纬度/城市请求,定位失败不兜底
- Server weather.rs:相应调整
- 文档同步;.gitignore 忽略本地 .codegraph 索引

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 20:45:39 +08:00
cc
58bed0ae44 feat(server): 登录与开发者入口门改走 MySQL
UserStore/DevGate 不再写死,改为从 MySQL 实时查询(每次校验一条索引查询、
不缓存整表,照顾内存):
- 新增 db_pool_from_env(),UserStore 与 DevGate 共用一个 sqlx 懒连接池
- verify() 查 ccuser 表、allows() 查 dev_gate 表,均改为 async
- 未设置 DATABASE_URL 时各自回退到内置/文件兜底,便于本地无库开发

连接串经环境变量 DATABASE_URL 注入(线上写在 weather.env)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 20:43:23 +08:00
cc
a185e56c22 feat: 导航起始页 + 天气/定位 + 天气动态效果
起始页(StartPage)
- 极简玻璃风导航页作未登录首页:时段问候、Bing 默认可切换搜索、10 个快捷位、右下齿轮进登录
- 昼夜背景自动切换(light/dark),按天气图标码 + 本地时间判断
- 天气动态效果(WeatherFx canvas):雨/雪/雷,克制风格,尊重 reduced-motion

天气与定位(前后端)
- 后端 /api/web/weather:高德 IP 定位(城市+坐标) + 和风实时天气
- 和风用 JWT(EdDSA/Ed25519)认证,密钥走环境变量、仅后端持有
- 每日限流(高德 300、和风 900,北京 0 点归零) + 10 分钟按 IP 缓存
- 前端 useWeather + WeatherIcon(7 类极简 SVG)

导航与登录
- 浏览器返回键支持(History API);返回即登出
- 记住我:勾选存 localStorage、不勾存 sessionStorage,默认不勾

其他
- .gitignore 忽略 *.pem/*.env 等密钥
- 新增文档 docs/startpage-weather-location.md 及部署 spec/plan

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 20:13:18 +08:00
cc
06bbf65d71 feat: read PORT from env var, default 8080 2026-06-18 17:08:03 +08:00
cc
58284f3fe0 feat: add login/auth system + blog page with rainbow design
- Client: auth API wrapper (api/auth.ts) + useAuth hook with localStorage persistence

- Client: LoginPage/LoginForm with remember-me and loading states

- Client: BlogPage with hero section, rainbow spotlight cursor effect, post list

- Client: CSS rainbow gradient utilities for text/borders/backgrounds

- Server: POST /api/web/login with username/password verification + token

- Server: CORS extended to POST + Content-Type header

- Server: auth.rs token issuer, serde dependency for JSON

- Chore: gitignore Server/.vite

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-18 00:00:38 +08:00
cc
2205408252 Initial commit: React client + Rust server full-stack project
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-17 20:49:17 +08:00