mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-12-23 21:14:41 +00:00
Compare commits
5 Commits
v0.4.2-alp
...
v0.4.2-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46e146e633 | ||
|
|
1a2f917b30 | ||
|
|
86adfbaef8 | ||
|
|
143af78745 | ||
|
|
7b07f22685 |
2
.github/workflows/demo.yml
vendored
2
.github/workflows/demo.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get old instance and snapshot name, create new instance name
|
- name: Get old instance and snapshot name, create new instance name
|
||||||
run: |
|
run: |
|
||||||
echo "OLD_INSTANCE_SNAPSHOT_NAME=$(aws lightsail get-instance-snapshots | grep '"name": "casaos-0.3.6-1666150291' | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/name://g')" >> $GITHUB_ENV
|
echo "OLD_INSTANCE_SNAPSHOT_NAME=$(aws lightsail get-instance-snapshots | grep '"name": "updateto_to_0.4.1-1676285322' | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/name://g')" >> $GITHUB_ENV
|
||||||
echo "OLD_INSTANCE_NAME=$(aws lightsail get-instances | grep '"name": "CasaOS-Demo-[0-9]' | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/name://g')" >> $GITHUB_ENV
|
echo "OLD_INSTANCE_NAME=$(aws lightsail get-instances | grep '"name": "CasaOS-Demo-[0-9]' | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/name://g')" >> $GITHUB_ENV
|
||||||
echo "NEW_INSTANCE_NAME=CasaOS-Demo-$(date +%s)" >> $GITHUB_ENV
|
echo "NEW_INSTANCE_NAME=CasaOS-Demo-$(date +%s)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
|||||||
23
CHANGELOG.md
23
CHANGELOG.md
@@ -17,6 +17,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Security
|
### 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
|
## [0.4.1] - 2023-1-19
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,12 +17,14 @@ type MountList struct {
|
|||||||
MountPoint string `json:"MountPoint"`
|
MountPoint string `json:"MountPoint"`
|
||||||
Fs string `json:"Fs"`
|
Fs string `json:"Fs"`
|
||||||
Icon string `json:"Icon"`
|
Icon string `json:"Icon"`
|
||||||
|
Name string `json:"Name"`
|
||||||
} `json:"mountPoints"`
|
} `json:"mountPoints"`
|
||||||
}
|
}
|
||||||
type MountPoint struct {
|
type MountPoint struct {
|
||||||
MountPoint string `json:"mount_point"`
|
MountPoint string `json:"mount_point"`
|
||||||
Fs string `json:"fs"`
|
Fs string `json:"fs"`
|
||||||
Icon string `json:"icon"`
|
Icon string `json:"icon"`
|
||||||
|
Name string `json:"name"`
|
||||||
}
|
}
|
||||||
type MountResult struct {
|
type MountResult struct {
|
||||||
Error string `json:"error"`
|
Error string `json:"error"`
|
||||||
@@ -77,6 +79,7 @@ func Mount(mountPoint string, fs string) error {
|
|||||||
res, err := NewRestyClient().R().SetFormData(map[string]string{
|
res, err := NewRestyClient().R().SetFormData(map[string]string{
|
||||||
"mountPoint": mountPoint,
|
"mountPoint": mountPoint,
|
||||||
"fs": fs,
|
"fs": fs,
|
||||||
|
"mountOpt": `{"AllowOther": true}`,
|
||||||
}).Post("/mount/mount")
|
}).Post("/mount/mount")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -323,6 +323,7 @@ func DirPath(c *gin.Context) {
|
|||||||
t.IsDir = info[i].IsDir
|
t.IsDir = info[i].IsDir
|
||||||
t.Name = info[i].Name
|
t.Name = info[i].Name
|
||||||
t.Modified = info[i].Date
|
t.Modified = info[i].Date
|
||||||
|
t.Date = info[i].Date
|
||||||
t.Size = info[i].Size
|
t.Size = info[i].Size
|
||||||
t.Path = info[i].Path
|
t.Path = info[i].Path
|
||||||
t.Extensions = info[i].Extensions
|
t.Extensions = info[i].Extensions
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ type ObjResp struct {
|
|||||||
Thumb string `json:"thumb"`
|
Thumb string `json:"thumb"`
|
||||||
Type int `json:"type"`
|
Type int `json:"type"`
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
|
Date time.Time `json:"date"`
|
||||||
Extensions map[string]interface{} `json:"extensions"`
|
Extensions map[string]interface{} `json:"extensions"`
|
||||||
}
|
}
|
||||||
type FsListResp struct {
|
type FsListResp struct {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
|
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
|
||||||
"github.com/IceWhaleTech/CasaOS/drivers/dropbox"
|
"github.com/IceWhaleTech/CasaOS/drivers/dropbox"
|
||||||
"github.com/IceWhaleTech/CasaOS/drivers/google_drive"
|
"github.com/IceWhaleTech/CasaOS/drivers/google_drive"
|
||||||
fileutil "github.com/IceWhaleTech/CasaOS/pkg/utils/file"
|
|
||||||
"github.com/IceWhaleTech/CasaOS/service"
|
"github.com/IceWhaleTech/CasaOS/service"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
@@ -71,7 +71,10 @@ func GetRecoverStorage(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
if cf["type"] == "drive" && cf["username"] == dmap["username"] {
|
if cf["type"] == "drive" && cf["username"] == dmap["username"] {
|
||||||
c.String(200, `<p>The same configuration has been added</p><script>window.close()</script>`)
|
c.String(200, `<p>The same configuration has been added</p><script>window.close()</script>`)
|
||||||
service.MyService.Storage().CheckAndMountByName(cf["username"])
|
err := service.MyService.Storage().CheckAndMountByName(v)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("check and mount by name error: ", zap.Error(err), zap.Any("name", cf["username"]))
|
||||||
|
}
|
||||||
notify["status"] = "warn"
|
notify["status"] = "warn"
|
||||||
notify["message"] = "The same configuration has been added"
|
notify["message"] = "The same configuration has been added"
|
||||||
service.MyService.Notify().SendNotify("casaos:file:recover", notify)
|
service.MyService.Notify().SendNotify("casaos:file:recover", notify)
|
||||||
@@ -82,13 +85,10 @@ func GetRecoverStorage(c *gin.Context) {
|
|||||||
a := strings.Split(username, "@")
|
a := strings.Split(username, "@")
|
||||||
username = a[0]
|
username = a[0]
|
||||||
}
|
}
|
||||||
username = fileutil.NameAccumulation(username, "/mnt")
|
|
||||||
|
|
||||||
dataMap, _ := service.MyService.Storage().GetConfigByName(username)
|
//username = fileutil.NameAccumulation(username, "/mnt")
|
||||||
if len(dataMap) > 0 {
|
username += "_google_drive_" + strconv.FormatInt(time.Now().Unix(), 10)
|
||||||
service.MyService.Storage().UnmountStorage("/mnt/" + username)
|
|
||||||
service.MyService.Storage().DeleteConfigByName(username)
|
|
||||||
}
|
|
||||||
dmap["client_id"] = add.ClientID
|
dmap["client_id"] = add.ClientID
|
||||||
dmap["client_secret"] = add.ClientSecret
|
dmap["client_secret"] = add.ClientSecret
|
||||||
dmap["scope"] = "drive"
|
dmap["scope"] = "drive"
|
||||||
@@ -150,7 +150,11 @@ func GetRecoverStorage(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
if cf["type"] == "dropbox" && cf["username"] == dmap["username"] {
|
if cf["type"] == "dropbox" && cf["username"] == dmap["username"] {
|
||||||
c.String(200, `<p>The same configuration has been added</p><script>window.close()</script>`)
|
c.String(200, `<p>The same configuration has been added</p><script>window.close()</script>`)
|
||||||
service.MyService.Storage().CheckAndMountByName(cf["username"])
|
err := service.MyService.Storage().CheckAndMountByName(v)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("check and mount by name error: ", zap.Error(err), zap.Any("name", cf["username"]))
|
||||||
|
}
|
||||||
|
|
||||||
notify["status"] = "warn"
|
notify["status"] = "warn"
|
||||||
notify["message"] = "The same configuration has been added"
|
notify["message"] = "The same configuration has been added"
|
||||||
service.MyService.Notify().SendNotify("casaos:file:recover", notify)
|
service.MyService.Notify().SendNotify("casaos:file:recover", notify)
|
||||||
@@ -161,13 +165,7 @@ func GetRecoverStorage(c *gin.Context) {
|
|||||||
a := strings.Split(username, "@")
|
a := strings.Split(username, "@")
|
||||||
username = a[0]
|
username = a[0]
|
||||||
}
|
}
|
||||||
username = fileutil.NameAccumulation(username, "/mnt")
|
username += "_dropbox_" + strconv.FormatInt(time.Now().Unix(), 10)
|
||||||
dataMap, _ := service.MyService.Storage().GetConfigByName(username)
|
|
||||||
if len(dataMap) > 0 {
|
|
||||||
|
|
||||||
service.MyService.Storage().UnmountStorage("/mnt/" + username)
|
|
||||||
service.MyService.Storage().DeleteConfigByName(username)
|
|
||||||
}
|
|
||||||
|
|
||||||
dmap["client_id"] = add.AppKey
|
dmap["client_id"] = add.AppKey
|
||||||
dmap["client_secret"] = add.AppSecret
|
dmap["client_secret"] = add.AppSecret
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ func ListStorages(c *gin.Context) {
|
|||||||
if dataMap["type"] == "dropbox" {
|
if dataMap["type"] == "dropbox" {
|
||||||
r.MountPoints[i].Icon = dropbox.ICONURL
|
r.MountPoints[i].Icon = dropbox.ICONURL
|
||||||
}
|
}
|
||||||
|
r.MountPoints[i].Name = dataMap["username"]
|
||||||
}
|
}
|
||||||
list := []httper.MountPoint{}
|
list := []httper.MountPoint{}
|
||||||
|
|
||||||
@@ -60,6 +61,7 @@ func ListStorages(c *gin.Context) {
|
|||||||
Fs: v.Fs,
|
Fs: v.Fs,
|
||||||
Icon: v.Icon,
|
Icon: v.Icon,
|
||||||
MountPoint: v.MountPoint,
|
MountPoint: v.MountPoint,
|
||||||
|
Name: v.Name,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -138,8 +139,10 @@ func InitV2DocRouter(docHTML string, docYAML string) http.Handler {
|
|||||||
}
|
}
|
||||||
func InitFile() http.Handler {
|
func InitFile() http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
path := r.URL.Query().Get("path")
|
filePath := r.URL.Query().Get("path")
|
||||||
http.ServeFile(w, r, path)
|
fileName := path.Base(filePath)
|
||||||
|
w.Header().Add("Content-Disposition", "attachment; filename*=utf-8''"+url.PathEscape(fileName))
|
||||||
|
http.ServeFile(w, r, filePath)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ func (s *storageStruct) CheckAndMountAll() error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *storageStruct) GetConfigByName(name string) (map[string]string, error) {
|
func (s *storageStruct) GetConfigByName(name string) (map[string]string, error) {
|
||||||
return httper.GetConfigByName(name)
|
return httper.GetConfigByName(name)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user