Skip to content

Commit 15be8b7

Browse files
authored
Merge pull request #271 from nemunaire/f/sync-3.8
New route for 3.8 compatibility
2 parents ed3c969 + 45aa4c5 commit 15be8b7

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ This is a replacement of the cloud, in case you want to sync/backup your files a
88
## [Docs](https://ddvk.github.io/rmfakecloud/)
99

1010
## NB
11+
The current release of rmfakecloud support SW <= 3.8.2. Newer releases have not been tested yet.
12+
1113
For Tablet SW > 3.X, rendering of the notebooks is not yet supported.
1214

1315
## Breaking Changes

internal/app/handlers.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,23 @@ func (app *App) blobStorageRead(c *gin.Context) {
787787
c.DataFromReader(http.StatusOK, size, "application/octet-stream", reader, nil)
788788
}
789789

790+
func (app *App) blobStorageWrite(c *gin.Context) {
791+
uid := c.GetString(userIDKey)
792+
blobID := common.ParamS(fileKey, c)
793+
794+
newgeneration, err := app.blobStorer.StoreBlob(uid, blobID, c.Request.Body, 0)
795+
if err != nil {
796+
log.Error(err)
797+
c.AbortWithStatus(http.StatusInternalServerError)
798+
return
799+
}
800+
801+
c.JSON(http.StatusOK, messages.SyncRootV3{
802+
Generation: newgeneration,
803+
Hash: string(blobID),
804+
})
805+
}
806+
790807
func (app *App) integrationsGetMetadata(c *gin.Context) {
791808
var metadata messages.IntegrationMetadata
792809
metadata.Thumbnail = ""

internal/app/routes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,6 @@ func (app *App) registerRoutes(router *gin.Engine) {
131131
authRoutes.GET("/sync/v3/root", app.syncGetRootV3)
132132
authRoutes.PUT("/sync/v3/root", app.syncUpdateRootV3)
133133
authRoutes.GET("/sync/v3/files/:"+fileKey, app.blobStorageRead)
134+
authRoutes.PUT("/sync/v3/files/:"+fileKey, app.blobStorageWrite)
134135
}
135136
}

0 commit comments

Comments
 (0)