My exact aim is to accomplish a transfer between 2 s3-like systems, using a custom ca certificate. Going through the above links, I did not fully grasp how I could accomplish the same with golang. Could you help me with the same by pointing to the right way to use the library ?
Without ca-crt, i can accomplish the transfer by implementing the 'Storage' interface.
Sounds like you are relatively new to rclone, so I suggest we first try doing a simple move using the rclone command line interface. It is a lot easier to understand and explain, and once we have a working example it is a lot easier to do the same using the (golang) API.
Are you able to configure both your remotes using this S3 guide and then list the content of a bucket something like this:
rclone lsl yourS3:yourBucket
If successful, then try a simple move something like this:
However I need
I am able to do the same with a ca certificate
So I am using rclone sync sg://bucket1 sg://bucket2 --ca-cert ca.crt
Which is working fine.
The env i need to use, doesn't really allow for command line access. I am trying to trigger the sync internally via golang.
Currently I am using `sync.Sync(ctx, dstFs, srcFs, false), which triggers Sync method in sync package. Wondering if the sync method can be triggered with a custom ca cert.
Thanks. I was able to use the fs.AddConfig function to achieve the same. I had misunderstood the utility of the function earlier.
I was wondering if instead of using ca crt file, if it is possible to have the certificate used as is/as a string/as a byte array. I couldn't figure the same out from the code.
For the file, the method I am using is :
os.CreateTemp to create a certificate file
Use with sync.Sync
defer os.Remove(file.Name())
Would you recommend any other approach? I am not sure if creating a temp file would be possible in all the env's my system is deployed in (containers).
It would be possible to change the certificate reading code to maybe expect the certificate instead of a file name if it started with @inline@ or something like that?
Thanks. Let me check that. Also wanted to confirm that it's not possible to have separate ca certs for source and destination right? It seems like they're using the same ca cert, even if one is defined and the other is not.
I've taken the method name from Remote Control / API and I've tried via the CLI which works well:
rclone version
rclone v1.61.1
Do you know what I'm doing wrong? I can't seem to find examples online to follow, is there a call to Initialize I need? I tried with and without it and it doesn't seem to change the result.
The issue seems to be that the "sync/sync" command isn't loaded into the list of available calls being checked here:
which indicates that this peace of code isn't executed when librclone is initializing:
Not sure exactly what is wrong, my best idea is that librclone should somehow import this (and possible other missing commands) to make them be available in the RPC interface.