Commit Graph

32 Commits

Author SHA1 Message Date
1d08955b07 Fix rag-server module path (#752)
* Fix rag-server module path

* Align rag-server module imports
2025-12-06 10:27:24 +08:00
Haitao Pan
9e35a09acf fix(makefile): add idempotent go mod init for account and rag-server 2025-12-06 10:09:06 +08:00
Haitao Pan
5b2bf946f6 fix(go-modules): correct module paths for account and rag-server
Split repositories into two standalone Go modules and fixed their
respective Makefile init targets. Updated:

- account: module → `account`
- rag-server: module → `rag-server`
2025-12-06 10:00:34 +08:00
Haitao Pan
3031a59d6b chore(docker): bump Go base image to 1.25 for account and rag-server 2025-12-05 00:41:45 +08:00
Haitao Pan
42ae5f245f feat: add go modules for account & rag-server services 2025-12-05 00:38:33 +08:00
Haitao Pan
cffa35b481 fix(rag-server): correct Dockerfile WORKDIR so go.mod is detected during build 2025-12-04 23:44:55 +08:00
Haitao Pan
bfcbc1f735 fix(rag-server): correct Dockerfile WORKDIR so go.mod is detected during build 2025-12-04 23:37:22 +08:00
Haitao Pan
8bb2d3b3ab fix(docker): install curl in builder image for init-go 2025-12-04 23:25:09 +08:00
Haitao Pan
1cc683eaee build: ensure Go init runs before binary compilation 2025-12-04 23:20:47 +08:00
Haitao Pan
d0a5a613af fix(docker): expose GO_VERSION arg in builder stages
Builder images install Go SDK and must receive GO_VERSION explicitly.
Adds missing ARG to account and rag-server Dockerfiles.
2025-12-04 23:15:00 +08:00
Haitao Pan
59cfd6c397 build: drop ARG gymnastics; embed Go install in builder stages 2025-12-04 23:11:20 +08:00
Haitao Pan
a6ee35499f ci(docker): simplify Go builder pipeline and trim runtime images 2025-12-04 22:57:12 +08:00
Haitao Pan
f6d3b82153 fix(docker): add default go-runtime image arg for account and rag-server builds 2025-12-04 22:42:40 +08:00
Haitao Pan
dc7251804c feat(docker): enhance go-runtime with optional Go SDK and unify rag-server multi-stage build 2025-12-04 22:09:05 +08:00
Haitao Pan
99fe1f33b3 chore(docker): install make in builder stage and clean runtime env vars 2025-12-04 21:44:46 +08:00
Haitao Pan
9aef9281fe refactor(build): enable standalone next.js build and fix rag-server Dockerfile paths 2025-12-04 21:40:58 +08:00
Haitao Pan
5264ffc9eb refactor(docker): replace GO_BASE_IMAGE with GO_RUNTIME_IMAGE across Dockerfiles 2025-12-04 21:04:31 +08:00
Haitao Pan
060a089f55 chore: workflow tweaks + go-runtime rename + Dockerfile fixes 2025-12-04 15:07:23 +08:00
56ad78e5b8 Add production Dockerfiles for services (#725) 2025-12-02 15:31:02 +08:00
Haitao Pan
0a55d3c4a1 refactor: move Sidebar to hero section with two-column layout
### Layout Changes:
1. **Homepage Layout Restructure** (`src/modules/homepage/page.tsx`)
   - Changed hero section to two-column grid: `lg:grid-cols-[minmax(0,1fr)_360px]`
   - Moved Sidebar component to right side of hero section (360px width)
   - Hero content now spans left column with full-width appearance
   - Sidebar is sticky on large screens: `lg:sticky lg:top-0`
   - Maintains consistent width between upper and lower sections

2. **Template System Updates**
   - Removed Sidebar from `HomePageTemplateSlots` type (`src/modules/templates/types.ts`)
   - Updated `defaultHomeLayoutConfig` to remove Sidebar from content slots
   - Updated default template to remove Sidebar registration
   - Updated `app/page.tsx` to pass only ProductMatrix and CommunityFeed slots

3. **Sidebar Component Conversion** (`src/components/home/Sidebar.tsx`)
   - Converted from Server Component to Client Component
   - Added 'use client' directive to enable useLanguage hook
   - Replaced dynamic CMS content with static bilingual content
   - Hardcoded sections: 社区热议, 推荐资源, 热门标签
   - Maintains same visual structure and styling

4. **Homepage Module Cleanup** (`src/modules/homepage/page.tsx`)
   - Removed unused `getHomepagePosts` import (was causing fs error in client)
   - Kept useLanguage hook for internationalization support
   - Sidebar now works as client component alongside homepage

### Technical Details:
- Grid layout: Two columns on large screens (hero + sidebar)
- Sidebar width: Fixed 360px, sticky positioning
- Hero content: Flexible width with max-w-6xl constraint
- Visual consistency: Upper and lower sections maintain same max-width
- Component architecture: All client components, no server-client mixing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 13:06:49 +08:00
Haitao Pan
19582527c1 cleanup(auth): remove test/docs files from internal/auth
- Deleted non-essential files from rag-server/account internal/auth:
  - Removed: test files, docs (README, IMPLEMENTATION), cache/client modules
  - Kept: core JWT auth middleware and token_service only
- Simplified to JWT service-to-service authentication
- Claims retain UserID/Email/Roles business info
2025-11-05 22:58:39 +08:00
Haitao Pan
e95f5fffa1 feat(auth): implement rag-server remote auth middleware
Implement complete authentication middleware for rag-server:
- Remote token verification via accounts-service
- 60s TTL cache with background GC
- Gin middleware integration
- Role-based access control
- Zero-trust architecture (no private keys)
- Health check endpoint

Files:
- internal/auth/client.go (350 lines)
- internal/auth/middleware_verify.go (280 lines)
- internal/auth/cache.go (180 lines)
- internal/auth/example_test.go (150 lines)
- internal/auth/README.md (550 lines)
- cmd/xcontrol-server/main.go (updated)
- config/config.go (added AuthCfg)
- config/server.yaml (removed secrets)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-11-05 21:01:20 +08:00
Haitao Pan
f83fd47c4f feat(auth): implement dual-layer token authentication with config support
- Add auth.enable configuration field (default: true)
- Add TokenService initialization in account service
- Implement token exchange endpoint (/api/auth/token/exchange)
- Implement token refresh endpoint (/api/auth/token/refresh)
- Protect routes with JWT authentication middleware
- Update configuration structures for all services
- Support accessSecret with configurable expiry times
- Update token management script to handle all token types
- Validate auth configuration consistency across services
2025-11-05 20:11:23 +08:00
Haitao Pan
b3bdbc1a80 feat(auth): implement token authentication system across services
- Add token service and MFA service to account service
- Implement auth middleware for request validation
- Add token-based auth to dashboard and RAG server
- Update configuration files for auth settings
2025-11-05 19:28:23 +08:00
shenlan
e53da0b623 Update default API domains (#604) 2025-10-30 18:24:08 +08:00
Haitao Pan
9690783eba refactor(postgresql): replace zhparser+scws with pg_jieba; update Makefile and setup scripts 2025-10-30 15:16:32 +08:00
shenlan
b811b90608 feat: point account service to dedicated domain (#598) 2025-10-28 17:07:02 +08:00
shenlan
41ba7c3cc0 Increase server timeouts for LLM requests (#594) 2025-10-27 16:11:16 +08:00
shenlan
8360e1e474 Update rag-server default base URL to 8090 (#528) 2025-10-15 15:25:06 +08:00
root
1dfb347a30 update rag-server/Makefile 2025-10-15 14:36:37 +08:00
shenlan
dc4aab3a9f Move RAG module under rag-server (#526) 2025-10-15 13:27:37 +08:00
shenlan
601fe872ce Refactor server layout to rag-server (#525) 2025-10-15 13:04:58 +08:00