Is it possible to implement custom backup providers?
-
Hi
I see many requests on the forum regarding the support for "this" and "that" backup storage solution..
Why not letting a power user (developer) implement their own backup provider, and then register it with cloudron CLI/API?For me this is a major show-stopper, because I don't want to be limited to what cloudron gives me today. I use several providers, like simple FTP(S) storage, SFTP, Backblaze B2 and others, and I'm ok with writing providers for these (and potentially sharing with the community).
Bye
P. -
@nexbit It's possible to implement (probably takes a bit of time). https://git.cloudron.io/cloudron/box/tree/master/src/storage is the backend code for backups. See interface.js on what needs to be implemented for each backup backend. I think SFTP is probably not too hard to do - it has just not been requested enough. For B2, last I checked, there was no node module for this. https://github.com/cebollia/node-b2 has not seen updates in a while. I would in fact suggest that if you are interested in B2, simply start a new nodejs project that support file manipulation for the B2 API. We can then work together to implement the Cloudron backend (We can do the the Cloudron backend part).
-
I just found https://github.com/yakovkhalinsky/backblaze-b2 which seems active
-
@girish said in Is it possible to implement custom backup providers?:
I just found https://github.com/yakovkhalinsky/backblaze-b2 which seems active
Yeah it seems fairly active and supported.. So it should be fairly simple to implement a B2 provider, taking the S3 one and adapting for B2, right?
Regarding the box repo, is it possible to maintain a customized clone and use that on a server instead of the official one? I know that such setup can't be officially supported, and can be potentially dangerous, but it can be useful for some advanced customizations or testing of new functionality.Thx for your support,
P. -
@girish @nexbit Any update on Backblaze B2 backup target? If there's a branch with progress I could put some time towards finishing it. I'm also a developer and am eager to have native Backblaze B2 support. The b2 node library and existing backup target interface linked above looks helpfully straight forward.
-
@fourspace For Hetzner storage box, just mount it via SMB - https://cloudron.io/documentation/backups/#sambacifs
@adrw We haven't worked on the B2 backend. If you want to hack on it, first step is to just create a separate project that implements our storage interface -https://git.cloudron.io/cloudron/box/blob/master/src/storage/interface.js . You can see the other backend providers as to how it's implemented (same directory). I am afraid there are no more docs that the code itself. If we have a standalone project that implements the interface (roughly), it's easier for us to integrate it into cloudron.
-
-
We put in SSHFS/CIFS in 5.3. B2 support is in 5.4
-
Currently the main advantage is, that it checks if the filesystem is mounted prior starting the backup. This prevents situations where for some reason the mountpoint got unmounted (ie. network errors) and the regular filesystem backup provider would then use that mountpoint, which is now just a regular folder on the / disk, and put the backups there.
Also backup permissions are dealt with a bit differently, since the uid/gid are set with the mount options.