보안: - Zip Bomb 방어 (io.LimitReader 100MB) - Redis Del 에러 로깅 (auth, idempotency) - 로그인 실패 로그에서 username 제거 - os.Remove 에러 로깅 모니터링: - Prometheus 메트릭 미들웨어 + /metrics 엔드포인트 - http_requests_total, http_request_duration_seconds 등 4개 메트릭 테스트: - download (11), chain (10), bossraid (20) = 41개 단위 테스트 기타: - DB 모델 GORM 인덱스 태그 추가 - launcherHash 필드 + hashFileToHex() 추가 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
27 lines
1.1 KiB
Go
27 lines
1.1 KiB
Go
package download
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Info struct {
|
|
ID uint `json:"id" gorm:"primaryKey"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
|
URL string `json:"url" gorm:"not null"`
|
|
Version string `json:"version" gorm:"not null"`
|
|
FileName string `json:"fileName" gorm:"not null"`
|
|
// FileSize is a human-readable string (e.g., "1.5 GB") for display purposes.
|
|
// Programmatic size tracking uses os.Stat on the actual file.
|
|
FileSize string `json:"fileSize" gorm:"not null"`
|
|
FileHash string `json:"fileHash" gorm:"not null;default:''"`
|
|
LauncherURL string `json:"launcherUrl" gorm:"not null;default:''"`
|
|
// LauncherSize is a human-readable string (e.g., "25.3 MB") for display purposes.
|
|
// Programmatic size tracking uses os.Stat on the actual file.
|
|
LauncherSize string `json:"launcherSize" gorm:"not null;default:''"`
|
|
LauncherHash string `json:"launcherHash" gorm:"not null;default:''"`
|
|
}
|