Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 0.4.2 changelog #885

Merged
merged 4 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security


## [0.4.2]

### Added

- [App] Increase the display of progress during the installation process
- [App] Label whether the current app supports x86 or Pi devices
- [App] Support single app version upgrade
- [File] Support mounting of Google Drive and Dropbox cloud drives
- [System] Support Mint Linux

### Changed

- [File] Optimize the download speed of a single file

### Fixed

- [Share] Fix the samba permission issue
- [Disk] Fix the problem of disk mount point plus 1 after upgrade ([#770](https://github.com/IceWhaleTech/CasaOS/issues/770))
- [File] Fix the problem of file permission change caused by modifying files in casaos ([#829](https://github.com/IceWhaleTech/CasaOS/issues/829))
- [Share] Fix the problem of files being deleted due to samba uninstallation failure ([#843](https://github.com/IceWhaleTech/CasaOS/issues/843))



## [0.4.1] - 2023-1-19


Expand Down
5 changes: 5 additions & 0 deletions pkg/utils/httper/drive.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ type MountList struct {
MountPoint string `json:"MountPoint"`
Fs string `json:"Fs"`
Icon string `json:"Icon"`
Name string `json:"Name"`
} `json:"mountPoints"`
}
type MountPoint struct {
MountPoint string `json:"mount_point"`
Fs string `json:"fs"`
Icon string `json:"icon"`
Name string `json:"name"`
}
type MountResult struct {
Error string `json:"error"`
Expand Down Expand Up @@ -77,6 +79,7 @@ func Mount(mountPoint string, fs string) error {
res, err := NewRestyClient().R().SetFormData(map[string]string{
"mountPoint": mountPoint,
"fs": fs,
"mountOpt": `{"AllowOther": true}`,
}).Post("/mount/mount")
if err != nil {
return err
Expand All @@ -92,9 +95,11 @@ func Unmount(mountPoint string) error {
"mountPoint": mountPoint,
}).Post("/mount/unmount")
if err != nil {
logger.Error("when unmount", zap.Error(err))
return err
}
if res.StatusCode() != 200 {
logger.Error("then unmount failed", zap.Any("res", res.Body()))
return fmt.Errorf("unmount failed")
}
logger.Info("unmount then", zap.Any("res", res.Body()))
Expand Down
1 change: 1 addition & 0 deletions route/v1/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ func DirPath(c *gin.Context) {
t.IsDir = info[i].IsDir
t.Name = info[i].Name
t.Modified = info[i].Date
t.Date = info[i].Date
t.Size = info[i].Size
t.Path = info[i].Path
t.Extensions = info[i].Extensions
Expand Down
1 change: 1 addition & 0 deletions route/v1/file_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type ObjResp struct {
Thumb string `json:"thumb"`
Type int `json:"type"`
Path string `json:"path"`
Date time.Time `json:"date"`
Extensions map[string]interface{} `json:"extensions"`
}
type FsListResp struct {
Expand Down
19 changes: 5 additions & 14 deletions route/v1/recover.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package v1

import (
"strconv"
"strings"
"time"

"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
"github.com/IceWhaleTech/CasaOS/drivers/dropbox"
"github.com/IceWhaleTech/CasaOS/drivers/google_drive"
fileutil "github.com/IceWhaleTech/CasaOS/pkg/utils/file"
"github.com/IceWhaleTech/CasaOS/service"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
Expand Down Expand Up @@ -82,13 +82,10 @@ func GetRecoverStorage(c *gin.Context) {
a := strings.Split(username, "@")
username = a[0]
}
username = fileutil.NameAccumulation(username, "/mnt")

dataMap, _ := service.MyService.Storage().GetConfigByName(username)
if len(dataMap) > 0 {
service.MyService.Storage().UnmountStorage("/mnt/" + username)
service.MyService.Storage().DeleteConfigByName(username)
}
//username = fileutil.NameAccumulation(username, "/mnt")
username += "_google_drive_" + strconv.FormatInt(time.Now().Unix(), 10)

dmap["client_id"] = add.ClientID
dmap["client_secret"] = add.ClientSecret
dmap["scope"] = "drive"
Expand Down Expand Up @@ -161,13 +158,7 @@ func GetRecoverStorage(c *gin.Context) {
a := strings.Split(username, "@")
username = a[0]
}
username = fileutil.NameAccumulation(username, "/mnt")
dataMap, _ := service.MyService.Storage().GetConfigByName(username)
if len(dataMap) > 0 {

service.MyService.Storage().UnmountStorage("/mnt/" + username)
service.MyService.Storage().DeleteConfigByName(username)
}
username += "_dropbox_" + strconv.FormatInt(time.Now().Unix(), 10)

dmap["client_id"] = add.AppKey
dmap["client_secret"] = add.AppSecret
Expand Down
6 changes: 4 additions & 2 deletions route/v1/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func ListStorages(c *gin.Context) {
if dataMap["type"] == "dropbox" {
r.MountPoints[i].Icon = dropbox.ICONURL
}
r.MountPoints[i].Name = dataMap["username"]
}
list := []httper.MountPoint{}

Expand All @@ -60,6 +61,7 @@ func ListStorages(c *gin.Context) {
Fs: v.Fs,
Icon: v.Icon,
MountPoint: v.MountPoint,
Name: v.Name,
})
}

Expand All @@ -84,12 +86,12 @@ func DeleteStorage(c *gin.Context) {
c.ShouldBind(&json)
mountPoint := json["mount_point"]
if mountPoint == "" {
c.JSON(common_err.SUCCESS, model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.CLIENT_ERROR), Data: "mount_point is empty"})
c.JSON(common_err.CLIENT_ERROR, model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.CLIENT_ERROR), Data: "mount_point is empty"})
return
}
err := service.MyService.Storage().UnmountStorage(mountPoint)
if err != nil {
c.JSON(common_err.SUCCESS, model.Result{Success: common_err.SERVICE_ERROR, Message: common_err.GetMsg(common_err.SERVICE_ERROR), Data: err.Error()})
c.JSON(common_err.SERVICE_ERROR, model.Result{Success: common_err.SERVICE_ERROR, Message: common_err.GetMsg(common_err.SERVICE_ERROR), Data: err.Error()})
return
}
service.MyService.Storage().DeleteConfigByName(strings.ReplaceAll(mountPoint, "/mnt/", ""))
Expand Down
1 change: 1 addition & 0 deletions service/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func (s *storageStruct) CheckAndMountAll() error {
}
return nil
}

func (s *storageStruct) GetConfigByName(name string) (map[string]string, error) {
return httper.GetConfigByName(name)
}
Expand Down