chore: update system setting default value (#1665)

This commit is contained in:
boojack 2023-05-15 22:59:26 +08:00 committed by GitHub
parent 041be46732
commit 1a8310f027
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 15 deletions

View file

@ -137,7 +137,7 @@ func (s *Server) registerResourceRoutes(g *echo.Group) {
if err != nil && common.ErrorCode(err) != common.NotFound {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find local storage path setting").SetInternal(err)
}
localStoragePath := ""
localStoragePath := "assets/{timestamp}_{filename}"
if systemSettingLocalStoragePath != nil {
err = json.Unmarshal([]byte(systemSettingLocalStoragePath.Value), &localStoragePath)
if err != nil {

View file

@ -44,7 +44,7 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
AllowSignUp: false,
IgnoreUpgrade: false,
DisablePublicMemos: false,
MaxUploadSizeMiB: 32, // this is the frontend default value
MaxUploadSizeMiB: 32,
AdditionalStyle: "",
AdditionalScript: "",
CustomizedProfile: api.CustomizedProfile{
@ -56,7 +56,7 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
ExternalURL: "",
},
StorageServiceID: api.DatabaseStorage,
LocalStoragePath: "",
LocalStoragePath: "assets/{timestamp}_{filename}",
}
systemSettingList, err := s.Store.FindSystemSettingList(ctx, &api.SystemSettingFind{})

View file

@ -1,7 +0,0 @@
INSERT
OR IGNORE INTO system_setting(name, value)
VALUES
(
'local-storage-path',
'"assets/{timestamp}_{filename}"'
);

View file

@ -1,5 +0,0 @@
INSERT INTO
system_setting (`name`, `value`, `description`)
VALUES
('allow-signup', 'true', ''),
('max-upload-size-mib', '32', '');