mirror of
https://github.com/navidrome/navidrome.git
synced 2024-09-11 20:12:54 +02:00
95 lines
2.6 KiB
Go
95 lines
2.6 KiB
Go
package consts
|
|
|
|
import (
|
|
"crypto/md5"
|
|
"fmt"
|
|
"strings"
|
|
"time"
|
|
)
|
|
|
|
const (
|
|
AppName = "navidrome"
|
|
|
|
DefaultDbPath = "navidrome.db?cache=shared&_busy_timeout=15000&_journal_mode=WAL&_foreign_keys=on"
|
|
InitialSetupFlagKey = "InitialSetup"
|
|
|
|
UIAuthorizationHeader = "X-ND-Authorization"
|
|
UIClientUniqueIDHeader = "X-ND-Client-Unique-Id"
|
|
JWTSecretKey = "JWTSecret"
|
|
JWTIssuer = "ND"
|
|
DefaultSessionTimeout = 24 * time.Hour
|
|
CookieExpiry = 365 * 24 * 3600 // One year
|
|
|
|
// DefaultEncryptionKey This is the encryption key used if none is specified in the `PasswordEncryptionKey` option
|
|
// Never ever change this! Or it will break all Navidrome installations that don't set the config option
|
|
DefaultEncryptionKey = "just for obfuscation"
|
|
PasswordsEncryptedKey = "PasswordsEncryptedKey"
|
|
|
|
DevInitialUserName = "admin"
|
|
DevInitialName = "Dev Admin"
|
|
|
|
URLPathUI = "/app"
|
|
URLPathNativeAPI = "/api"
|
|
URLPathSubsonicAPI = "/rest"
|
|
|
|
// Login backgrounds from https://unsplash.com/collections/20072696/navidrome
|
|
DefaultUILoginBackgroundURL = "https://source.unsplash.com/collection/20072696/1600x900"
|
|
|
|
RequestThrottleBacklogLimit = 100
|
|
RequestThrottleBacklogTimeout = time.Minute
|
|
|
|
ArtistInfoTimeToLive = 3 * 24 * time.Hour
|
|
|
|
I18nFolder = "i18n"
|
|
SkipScanFile = ".ndignore"
|
|
|
|
PlaceholderAlbumArt = "navidrome-600x600.png"
|
|
PlaceholderAvatar = "logo-192x192.png"
|
|
|
|
DefaultHttpClientTimeOut = 10 * time.Second
|
|
)
|
|
|
|
// Cache options
|
|
const (
|
|
TranscodingCacheDir = "cache/transcoding"
|
|
DefaultTranscodingCacheMaxItems = 0 // Unlimited
|
|
|
|
ImageCacheDir = "cache/images"
|
|
DefaultImageCacheMaxItems = 0 // Unlimited
|
|
|
|
DefaultCacheSize = 100 * 1024 * 1024 // 100MB
|
|
DefaultCacheCleanUpInterval = 10 * time.Minute
|
|
)
|
|
|
|
// Shared secrets (only add here "secrets" that can be public)
|
|
const (
|
|
LastFMAPIKey = "9b94a5515ea66b2da3ec03c12300327e"
|
|
LastFMAPISecret = "74cb6557cec7171d921af5d7d887c587" // nolint:gosec
|
|
)
|
|
|
|
var (
|
|
DefaultTranscodings = []map[string]interface{}{
|
|
{
|
|
"name": "mp3 audio",
|
|
"targetFormat": "mp3",
|
|
"defaultBitRate": 192,
|
|
"command": "ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -",
|
|
},
|
|
{
|
|
"name": "opus audio",
|
|
"targetFormat": "opus",
|
|
"defaultBitRate": 128,
|
|
"command": "ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -c:a libopus -f opus -",
|
|
},
|
|
}
|
|
)
|
|
|
|
var (
|
|
VariousArtists = "Various Artists"
|
|
VariousArtistsID = fmt.Sprintf("%x", md5.Sum([]byte(strings.ToLower(VariousArtists))))
|
|
UnknownArtist = "[Unknown Artist]"
|
|
VariousArtistsMbzId = "89ad4ac3-39f7-470e-963a-56509c546377"
|
|
|
|
ServerStart = time.Now()
|
|
)
|