Skip to content

Commit 3cce0e2

Browse files
committed
claude session completed
1 parent 23b102d commit 3cce0e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2023
-695
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,50 @@ on:
66
pull_request:
77
branches: [main]
88

9+
env:
10+
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
11+
912
jobs:
1013
check:
14+
name: Checks
1115
runs-on: ubuntu-latest
16+
timeout-minutes: 10
1217
steps:
13-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v6
1419
- uses: oven-sh/setup-bun@v2
20+
with:
21+
bun-version: latest
1522
- run: bun install --frozen-lockfile
1623
- run: bun check
24+
25+
build:
26+
name: Build
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 10
29+
steps:
30+
- uses: actions/checkout@v6
31+
- uses: oven-sh/setup-bun@v2
32+
with:
33+
bun-version: latest
34+
- run: bun install --frozen-lockfile
1735
- run: bun run build
36+
37+
e2e:
38+
name: E2E Tests
39+
runs-on: ubuntu-latest
40+
timeout-minutes: 15
41+
steps:
42+
- uses: actions/checkout@v6
43+
44+
- uses: oven-sh/setup-bun@v2
45+
with:
46+
bun-version: latest
47+
48+
- name: Install dependencies
49+
run: bun install --frozen-lockfile
50+
51+
- name: Install Playwright browsers
52+
run: bunx playwright install chromium --with-deps
53+
54+
- name: Run E2E tests
55+
run: bun run test:e2e

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ Thumbs.db
2222
.devenv*
2323
devenv.local*
2424
.direnv
25+
26+
# Test Results
27+
/playwright-report/
28+
/test-results/
29+
/playwright/.cache/

.lefthook/pre-push/docker-build.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
# Build up to builder stage to verify dependencies and build process
3+
# Note: This uses secrets.dev.yaml for local verification
4+
# Production builds will use secrets.prod.yaml with actual SOPS_AGE_KEY
5+
6+
set -e
7+
8+
if [ ! -f secrets.dev.yaml ]; then
9+
echo "❌ secrets.dev.yaml not found. Cannot verify Docker build."
10+
exit 1
11+
fi
12+
13+
# Check if SOPS_AGE_KEY is available
14+
if [ -z "$SOPS_AGE_KEY" ]; then
15+
echo "⚠️ SOPS_AGE_KEY not set. Skipping Docker build verification."
16+
echo "💡 To enable Docker build checks, export SOPS_AGE_KEY in your shell."
17+
exit 0
18+
fi
19+
20+
echo "🐳 Verifying Docker build..."
21+
docker build --target builder \
22+
--build-arg SOPS_AGE_KEY="${SOPS_AGE_KEY}" \
23+
--build-arg SECRETS_FILE=secrets.dev.yaml \
24+
-t cms-utcode-build-check .
25+
26+
echo "✅ Docker build verification passed!"

README.md

Lines changed: 17 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ utcode.net の CMS 駆動版フォーク (フォークではない) です。そ
44

55
## Development
66

7-
環境構築
7+
### 環境構築
88

99
- [devenv](https://devenv.sh/) パッケージをインストールします
1010
- `.sops-age-key.txt` を配置します(チームメンバーから取得)
@@ -13,34 +13,20 @@ utcode.net の CMS 駆動版フォーク (フォークではない) です。そ
1313
direnv allow
1414
```
1515

16-
サーバーその他全部起動
16+
### コマンド
1717

18-
```sh
19-
bun up
20-
```
21-
22-
停止
2318

2419
```sh
25-
bun down
26-
```
27-
28-
リロード
20+
bun up # (devenv) サーバーその他全部起動
21+
bun down # (devenv) 停止
22+
bun reload # (devenv) リロード
23+
bun tail # (devenv) ログ
24+
bun attach # (devenv) process compose に接続 (F10 + enter で退出)
2925

30-
```sh
31-
bun reload
32-
```
33-
34-
ログ
35-
36-
```sh
37-
bun logs
38-
```
39-
40-
process compose に接続 (F10 + enter で退出)
41-
42-
```sh
43-
bun attach
26+
bun check # 全てのチェックを実行
27+
bun fix # 自動修正 (フォーマットなど)
28+
bun tidy # 全てのチェックを実行し、自動修正できるものは修正
29+
bun test:e2e # playwright で E2E テストを実行
4430
```
4531

4632
## Secrets
@@ -51,32 +37,19 @@ bun attach
5137
# 編集
5238
sops secrets.dev.yaml
5339
sops secrets.prod.yaml
40+
# 実行
41+
sops exec-env secrets.dev.yaml 'bun run build'
5442
```
5543

56-
### 鍵のローテーション
57-
58-
```sh
59-
# 1. 新しい鍵を生成
60-
age-keygen
61-
62-
# 2. .sops.yaml に新しい公開鍵を追加(古い鍵も残す)
63-
64-
# 3. .sops-age-key.txt に新しい秘密鍵を追加(古い鍵も残す)
65-
66-
# 4. 再暗号化(古い鍵で復号→新しい鍵で暗号化)
67-
sops updatekeys -y secrets.dev.yaml
68-
sops updatekeys -y secrets.prod.yaml
69-
70-
# 5. 古い鍵を .sops.yaml と .sops-age-key.txt から削除
71-
```
44+
## コーディングルール
7245

73-
## Data Access Layer
46+
### Data Access Layer
7447

7548
データ操作は DAL `$lib/server/data/*` から import します。直接 db を触りません。
7649

7750
```ts
78-
import { listMembers, createMember } from "$lib/server/data/members";
79-
import { listPublishedArticles } from "$lib/server/data/articles";
51+
import { createMember } from "$lib/server/data/private/members";
52+
import { listPublishedArticles } from "$lib/server/data/public/articles";
8053
```
8154

8255
## その他

bun.lock

Lines changed: 33 additions & 55 deletions
Large diffs are not rendered by default.

docs/knowledges/security.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
- Members must belong to the `ut-code` GitHub organization
1616
- Membership is cached for 24 hours (`CACHE_TTL_MS`)
1717
- `UNSAFE_DISABLE_AUTH=true` bypasses all auth checks (dev only, throws error in production)
18+
- Mock user ID: `"mock"`, mock member ID: `"mock-member"`
19+
- Mock data returned from `getMemberByUserId`, `getUserPreference`, `setDefaultAuthor`
1820

1921
## Ownership Model
2022

drizzle/0005_boring_rockslide.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE "article" DROP COLUMN "excerpt";

0 commit comments

Comments
 (0)