feat: secure pickup flow and add deployment
Release / deploy (push) Successful in 4m1s

This commit is contained in:
loveuer
2026-09-10 02:44:35 -07:00
parent fa4357a3f2
commit 8ca8341d7c
8 changed files with 276 additions and 34 deletions
+13 -12
View File
@@ -23,18 +23,19 @@ type Session struct {
}
type SharedFile struct {
ID uint `gorm:"primaryKey" json:"id"`
Hash string `gorm:"uniqueIndex;size:8;not null" json:"hash"`
OriginalName string `gorm:"not null" json:"name"`
MimeType string `gorm:"not null" json:"mimeType"`
Size int64 `json:"size"`
OwnerID uint `gorm:"index;not null" json:"ownerId"`
ExpiresAt *time.Time `gorm:"index" json:"expiresAt"`
MaxDownloads *int `json:"maxDownloads"`
DownloadCount int `gorm:"not null;default:0" json:"downloadCount"`
PickupCodeHash string `json:"-"`
Ready bool `gorm:"index;not null;default:false" json:"-"`
CreatedAt time.Time `json:"createdAt"`
ID uint `gorm:"primaryKey" json:"id"`
Hash string `gorm:"uniqueIndex;size:8;not null" json:"hash"`
OriginalName string `gorm:"not null" json:"name"`
MimeType string `gorm:"not null" json:"mimeType"`
Size int64 `json:"size"`
OwnerID uint `gorm:"index;not null" json:"ownerId"`
ExpiresAt *time.Time `gorm:"index" json:"expiresAt"`
MaxDownloads *int `json:"maxDownloads"`
DownloadCount int `gorm:"not null;default:0" json:"downloadCount"`
PickupCodeHash string `json:"-"`
FailedCodeAttempts int `gorm:"not null;default:0" json:"-"`
Ready bool `gorm:"index;not null;default:false" json:"-"`
CreatedAt time.Time `json:"createdAt"`
}
func (f SharedFile) HasPickupCode() bool { return f.PickupCodeHash != "" }