Skip to content

Commit

Permalink
Merge pull request #271 from nemunaire/f/sync-3.8
Browse files Browse the repository at this point in the history
New route for 3.8 compatibility
  • Loading branch information
nemunaire authored Nov 18, 2023
2 parents ed3c969 + 45aa4c5 commit 15be8b7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ This is a replacement of the cloud, in case you want to sync/backup your files a
## [Docs](https://ddvk.github.io/rmfakecloud/)

## NB
The current release of rmfakecloud support SW <= 3.8.2. Newer releases have not been tested yet.

For Tablet SW > 3.X, rendering of the notebooks is not yet supported.

## Breaking Changes
Expand Down
17 changes: 17 additions & 0 deletions internal/app/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,23 @@ func (app *App) blobStorageRead(c *gin.Context) {
c.DataFromReader(http.StatusOK, size, "application/octet-stream", reader, nil)
}

func (app *App) blobStorageWrite(c *gin.Context) {
uid := c.GetString(userIDKey)
blobID := common.ParamS(fileKey, c)

newgeneration, err := app.blobStorer.StoreBlob(uid, blobID, c.Request.Body, 0)
if err != nil {
log.Error(err)
c.AbortWithStatus(http.StatusInternalServerError)
return
}

c.JSON(http.StatusOK, messages.SyncRootV3{
Generation: newgeneration,
Hash: string(blobID),
})
}

func (app *App) integrationsGetMetadata(c *gin.Context) {
var metadata messages.IntegrationMetadata
metadata.Thumbnail = ""
Expand Down
1 change: 1 addition & 0 deletions internal/app/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,6 @@ func (app *App) registerRoutes(router *gin.Engine) {
authRoutes.GET("/sync/v3/root", app.syncGetRootV3)
authRoutes.PUT("/sync/v3/root", app.syncUpdateRootV3)
authRoutes.GET("/sync/v3/files/:"+fileKey, app.blobStorageRead)
authRoutes.PUT("/sync/v3/files/:"+fileKey, app.blobStorageWrite)
}
}

0 comments on commit 15be8b7

Please sign in to comment.