2020-01-20 21:17:43 +01:00
|
|
|
package consts
|
|
|
|
|
2020-03-23 02:38:59 +01:00
|
|
|
import (
|
2020-03-26 14:08:53 +01:00
|
|
|
"crypto/md5"
|
|
|
|
"fmt"
|
|
|
|
"strings"
|
2020-03-23 02:38:59 +01:00
|
|
|
"time"
|
|
|
|
)
|
2020-01-20 21:17:43 +01:00
|
|
|
|
|
|
|
const (
|
2020-01-30 20:43:24 +01:00
|
|
|
AppName = "navidrome"
|
|
|
|
|
2020-06-08 23:29:09 +02:00
|
|
|
DefaultDbPath = "navidrome.db?cache=shared&_busy_timeout=15000&_journal_mode=WAL&_foreign_keys=on"
|
2020-01-21 15:27:38 +01:00
|
|
|
InitialSetupFlagKey = "InitialSetup"
|
2020-01-20 21:17:43 +01:00
|
|
|
|
2021-06-16 00:35:08 +02:00
|
|
|
UIAuthorizationHeader = "X-ND-Authorization"
|
|
|
|
UIClientUniqueIDHeader = "X-ND-Client-Unique-Id"
|
|
|
|
JWTSecretKey = "JWTSecret"
|
|
|
|
JWTIssuer = "ND"
|
|
|
|
DefaultSessionTimeout = 24 * time.Hour
|
|
|
|
CookieExpiry = 365 * 24 * 3600 // One year
|
2020-01-20 21:17:43 +01:00
|
|
|
|
2021-06-19 00:38:38 +02:00
|
|
|
// 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"
|
|
|
|
|
2020-02-08 20:50:33 +01:00
|
|
|
DevInitialUserName = "admin"
|
|
|
|
DevInitialName = "Dev Admin"
|
2020-04-03 23:50:42 +02:00
|
|
|
|
2021-03-31 06:49:12 +02:00
|
|
|
URLPathUI = "/app"
|
2021-06-13 18:46:36 +02:00
|
|
|
URLPathNativeAPI = "/api"
|
2021-03-31 06:49:12 +02:00
|
|
|
URLPathSubsonicAPI = "/rest"
|
|
|
|
|
2021-04-20 21:26:24 +02:00
|
|
|
// Login backgrounds from https://unsplash.com/collections/20072696/navidrome
|
|
|
|
DefaultUILoginBackgroundURL = "https://source.unsplash.com/collection/20072696/1600x900"
|
2020-04-20 17:05:28 +02:00
|
|
|
|
|
|
|
RequestThrottleBacklogLimit = 100
|
|
|
|
RequestThrottleBacklogTimeout = time.Minute
|
2020-05-05 01:54:10 +02:00
|
|
|
|
2021-05-28 02:18:34 +02:00
|
|
|
ArtistInfoTimeToLive = 3 * 24 * time.Hour
|
2020-10-30 21:08:43 +01:00
|
|
|
|
2020-05-18 20:37:01 +02:00
|
|
|
I18nFolder = "i18n"
|
|
|
|
SkipScanFile = ".ndignore"
|
2020-06-03 15:40:37 +02:00
|
|
|
|
|
|
|
PlaceholderAlbumArt = "navidrome-600x600.png"
|
2020-10-24 03:37:53 +02:00
|
|
|
PlaceholderAvatar = "logo-192x192.png"
|
2021-02-08 05:26:05 +01:00
|
|
|
|
2021-06-22 20:00:44 +02:00
|
|
|
DefaultHttpClientTimeOut = 10 * time.Second
|
2020-01-20 21:17:43 +01:00
|
|
|
)
|
2020-03-01 02:01:09 +01:00
|
|
|
|
2020-04-09 19:15:01 +02:00
|
|
|
// Cache options
|
|
|
|
const (
|
|
|
|
TranscodingCacheDir = "cache/transcoding"
|
|
|
|
DefaultTranscodingCacheMaxItems = 0 // Unlimited
|
|
|
|
|
|
|
|
ImageCacheDir = "cache/images"
|
|
|
|
DefaultImageCacheMaxItems = 0 // Unlimited
|
|
|
|
|
|
|
|
DefaultCacheSize = 100 * 1024 * 1024 // 100MB
|
|
|
|
DefaultCacheCleanUpInterval = 10 * time.Minute
|
|
|
|
)
|
|
|
|
|
2021-06-21 23:09:34 +02:00
|
|
|
// Shared secrets (only add here "secrets" that can be public)
|
|
|
|
const (
|
|
|
|
LastFMAPIKey = "9b94a5515ea66b2da3ec03c12300327e"
|
|
|
|
LastFMAPISecret = "74cb6557cec7171d921af5d7d887c587" // nolint:gosec
|
|
|
|
)
|
|
|
|
|
2020-03-01 02:01:09 +01:00
|
|
|
var (
|
|
|
|
DefaultTranscodings = []map[string]interface{}{
|
|
|
|
{
|
|
|
|
"name": "mp3 audio",
|
|
|
|
"targetFormat": "mp3",
|
|
|
|
"defaultBitRate": 192,
|
2020-04-03 06:26:41 +02:00
|
|
|
"command": "ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -",
|
2020-03-01 02:01:09 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "opus audio",
|
2020-09-24 18:27:13 +02:00
|
|
|
"targetFormat": "opus",
|
2020-03-01 02:01:09 +01:00
|
|
|
"defaultBitRate": 128,
|
|
|
|
"command": "ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -c:a libopus -f opus -",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
)
|
2020-03-23 02:38:59 +01:00
|
|
|
|
2020-03-26 14:08:53 +01:00
|
|
|
var (
|
|
|
|
VariousArtists = "Various Artists"
|
|
|
|
VariousArtistsID = fmt.Sprintf("%x", md5.Sum([]byte(strings.ToLower(VariousArtists))))
|
|
|
|
UnknownArtist = "[Unknown Artist]"
|
2020-12-21 17:39:38 +01:00
|
|
|
|
|
|
|
ServerStart = time.Now()
|
2020-03-23 02:38:59 +01:00
|
|
|
)
|