Skip to content

Commit

Permalink
Update constants formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
benbusby committed Dec 19, 2024
1 parent 5d8f7b7 commit eb58111
Showing 1 changed file with 31 additions and 36 deletions.
67 changes: 31 additions & 36 deletions shared/constants/constants.go
Original file line number Diff line number Diff line change
@@ -1,44 +1,39 @@
package constants

const VERSION = "1.0.0"

// JSSessionKey determines the hardcoded string that gets replaced in db.ts in
// order to have a semi-random value used in encrypting the user's key pair in
// IndexedDB.
// --- Changes to this value must be reflected in db.ts
const JSSessionKey = "JS_SESSION_KEY"

const CLIUserAgent = "yeetfile-cli"

const AuthSessionStore = "auth"

const Argon2Mem uint32 = 64 // MB
const Argon2Iter uint32 = 2

const LimiterSeconds = 30
const LimiterAttempts = 6

const TotalBandwidthMultiplier = 3 // 3x available storage
const BandwidthMonitorDuration = 7 // 7 day period

const IVSize int = 12
const KeySize int = 32
const ChunkSize int = 10000000 // 10 mb
const TotalOverhead int = 28 // encryption overhead (16) + iv size (12)
const MaxPlaintextLen = 2000
const MaxHintLen = 200
const PlaintextIDPrefix = "text"
const FileIDPrefix = "file"
const VerificationCodeLength = 6
const ChangeIDLength = 9
const MaxTransferThreads = 3
const MaxSendAgeDays = 30 //days
const MaxPassNoteLen = 500
const RecoveryCodeLen = 8

type UpgradeDuration string

const (
VERSION = "1.0.0"

// JSSessionKey determines the hardcoded string that gets replaced in db.ts in
// order to have a semi-random value used in encrypting the user's key pair in
// IndexedDB.
// --- Changes to this value must be reflected in db.ts
JSSessionKey = "JS_SESSION_KEY"

CLIUserAgent = "yeetfile-cli"
AuthSessionStore = "auth"
Argon2Mem uint32 = 64 // MB
Argon2Iter uint32 = 2
LimiterSeconds = 30
LimiterAttempts = 6
TotalBandwidthMultiplier = 3 // 3x available storage
BandwidthMonitorDuration = 7 // 7 day period
IVSize = 12
KeySize = 32
ChunkSize = 10000000 // 10 mb
TotalOverhead = 28 // encryption overhead (16) + iv size (12)
MaxPlaintextLen = 2000
MaxHintLen = 200
PlaintextIDPrefix = "text"
FileIDPrefix = "file"
VerificationCodeLength = 6
ChangeIDLength = 9
MaxTransferThreads = 3
MaxSendAgeDays = 30 //days
MaxPassNoteLen = 500
RecoveryCodeLen = 8

DurationMonth UpgradeDuration = "month"
DurationYear UpgradeDuration = "year"
)

0 comments on commit eb58111

Please sign in to comment.