diff --git a/common/profile.go b/common/profile.go index 09a4d86e..f171308a 100644 --- a/common/profile.go +++ b/common/profile.go @@ -9,7 +9,7 @@ import ( ) type Profile struct { - // Mode can be "release" or "dev" + // Mode can be "prod" or "dev" Mode string `json:"mode"` // Port is the binding port for server. Port int `json:"port"` @@ -41,7 +41,7 @@ func checkDSN(dataDir string) (string, error) { // GetDevProfile will return a profile for dev. func GetProfile() Profile { mode := os.Getenv("mode") - if mode != "dev" && mode != "release" { + if mode != "dev" && mode != "prod" { mode = "dev" } @@ -51,7 +51,7 @@ func GetProfile() Profile { } data := "" - if mode == "release" { + if mode == "prod" { data = "/var/opt/memos" } diff --git a/server/server.go b/server/server.go index ccc020db..1d917c20 100644 --- a/server/server.go +++ b/server/server.go @@ -49,7 +49,7 @@ func NewServer(profile *common.Profile) *Server { // In dev mode, set the const secret key to make login session persistence. secret := []byte("justmemos") - if profile.Mode == "release" { + if profile.Mode == "prod" { secret = securecookie.GenerateRandomKey(16) } e.Use(session.Middleware(sessions.NewCookieStore(secret))) diff --git a/store/sqlite.go b/store/sqlite.go index 6e8e37dd..28ad935b 100644 --- a/store/sqlite.go +++ b/store/sqlite.go @@ -23,7 +23,7 @@ type DB struct { Db *sql.DB // datasource name DSN string - // mode should be release or dev + // mode should be prod or dev mode string }