ddvk / rmfakecloud

host your own cloud for the remarkable
GNU Affero General Public License v3.0
788 stars 68 forks source link

Disallow adding/editing localfs integration from ui #340

Closed nemunaire closed 5 days ago

nemunaire commented 5 days ago

To follow up https://github.com/ddvk/rmfakecloud/pull/240#issuecomment-2481664248, this addresses the possibility of adding or editing localfs directly from the UI.

Instead it shows the content to add/edit in .userprofile:

image

To be able to pass error directly from Go code, I added a convention that errors reported as JSON should be passed to the UI as:

c.AbortWithStatusJSON(http.ErrorStatus, gin.H{"error": err.Error()})
ddvk commented 5 days ago

we could add a config variable for allowed root paths for localfs, which would mitigate the issue.