2022-04-15 09:42:07 +02:00
|
|
|
package config
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
2022-04-22 18:06:45 +02:00
|
|
|
// ApiUri is the relative path for handling REST requests.
|
|
|
|
const ApiUri = "/api/v1"
|
|
|
|
|
|
|
|
// StaticUri is the relative path for serving static content.
|
|
|
|
const StaticUri = "/static"
|
|
|
|
|
2022-09-02 21:30:50 +02:00
|
|
|
// CustomStaticUri is the relative path for serving custom static content.
|
|
|
|
const CustomStaticUri = "/c/static"
|
|
|
|
|
2022-04-22 18:06:45 +02:00
|
|
|
// MsgSponsor and MsgSignUp provide sponsorship info messages;
|
|
|
|
// SignUpURL a signup link.
|
2022-04-15 09:42:07 +02:00
|
|
|
const MsgSponsor = "PhotoPrism® needs your support!"
|
2022-05-26 19:33:41 +02:00
|
|
|
const SignUpURL = "https://photoprism.app/membership"
|
2022-04-15 09:42:07 +02:00
|
|
|
const MsgSignUp = "Visit " + SignUpURL + " to learn more."
|
|
|
|
const MsgSponsorCommand = "Since running this command puts additional load on our infrastructure," +
|
|
|
|
" we unfortunately can only offer it to sponsors."
|
|
|
|
|
2022-04-22 18:06:45 +02:00
|
|
|
// DefaultAutoIndexDelay and DefaultAutoImportDelay set the default safety delay duration
|
|
|
|
// before starting to index/import in the background.
|
2022-04-15 09:42:07 +02:00
|
|
|
const DefaultAutoIndexDelay = int(5 * 60) // 5 Minutes
|
|
|
|
const DefaultAutoImportDelay = int(3 * 60) // 3 Minutes
|
|
|
|
|
2022-04-22 18:06:45 +02:00
|
|
|
// MinWakeupInterval and MaxWakeupInterval limit the interval duration
|
|
|
|
// in which the background worker can be invoked.
|
|
|
|
const MinWakeupInterval = time.Minute // 1 Minute
|
|
|
|
const MaxWakeupInterval = time.Hour * 24 // 1 Day
|
2022-04-15 09:42:07 +02:00
|
|
|
const DefaultWakeupIntervalSeconds = int(15 * 60) // 15 Minutes
|
|
|
|
const DefaultWakeupInterval = time.Second * time.Duration(DefaultWakeupIntervalSeconds)
|
|
|
|
|
|
|
|
// Megabyte in bytes.
|
2022-04-22 18:06:45 +02:00
|
|
|
const Megabyte = 1000 * 1000 // 1,000,000 Bytes
|
2022-04-15 09:42:07 +02:00
|
|
|
|
|
|
|
// Gigabyte in bytes.
|
2022-04-22 18:06:45 +02:00
|
|
|
const Gigabyte = Megabyte * 1000 // 1,000,000,000 Bytes
|
2022-04-15 09:42:07 +02:00
|
|
|
|
|
|
|
// MinMem is the minimum amount of system memory required.
|
|
|
|
const MinMem = Gigabyte
|
|
|
|
|
|
|
|
// RecommendedMem is the recommended amount of system memory.
|
2022-04-22 18:06:45 +02:00
|
|
|
const RecommendedMem = 3 * Gigabyte // 3,000,000,000 Bytes
|
2022-04-15 09:42:07 +02:00
|
|
|
|
2022-09-18 14:06:13 +02:00
|
|
|
// DefaultResolutionLimit defines the default resolution limit.
|
|
|
|
const DefaultResolutionLimit = 150 // 150 Megapixels
|
|
|
|
|
2022-04-15 09:42:07 +02:00
|
|
|
// serialName is the name of the unique storage serial.
|
|
|
|
const serialName = "serial"
|
2022-10-03 22:59:29 +02:00
|
|
|
|
|
|
|
// UnixHour is one hour in UnixTime.
|
|
|
|
const UnixHour int64 = 3600
|
|
|
|
|
|
|
|
// UnixDay is one day in UnixTime.
|
|
|
|
const UnixDay = UnixHour * 24
|
|
|
|
|
|
|
|
// UnixWeek is one week in UnixTime.
|
|
|
|
const UnixWeek = UnixDay * 7
|
|
|
|
|
2022-10-25 06:19:56 +02:00
|
|
|
// DefaultSessionMaxAge is the default session expiration time in seconds.
|
|
|
|
const DefaultSessionMaxAge = UnixWeek * 2
|
2022-10-03 22:59:29 +02:00
|
|
|
|
2022-10-25 06:19:56 +02:00
|
|
|
// DefaultSessionTimeout is the default session timeout time in seconds.
|
|
|
|
const DefaultSessionTimeout = UnixWeek
|