I’m currently using GSuite business for unlimited backups to Google Drive. I’m using DriveStream to do the actual transfer, and use a subfolder (g:\encrypted) as the input to a crypt remote.
How can I browse encrypted content on iOS? Since there isn’t an iOS app available, the only solution I can think of is using a VPS to host a rclone serving e.g, ftp / http / webdav. However, this isn’t as efficient as having an app that is able to directly talk to Google Drive and perform the decryption.
Does anyone have any other suggestions as to how to do this?
Are there any technical limitations on iOS that would make writing an app difficult?
I understand why this likely hasn’t been attempted before; iOS doesn’t allow running other binaries from your application, so that precludes using the remote control API unfortunately.
rclone is quite modular with a separation of concerns between the backends the operations and the cli interface. You could build a go program which used rclone’s operations quite easily.
I see the functions for listing a directory in a remote, but couldn’t figure out how it read from configuration files.
If I use the NewFsSrc function, does it automatically load configuration from the default path if not already loaded? I’d need to be able to control at least where the config is auto-read from.
Yes it will read the config from the default place. I htink you can set it by overriding config.ConfigPath. It might be easier to set environment variables RCLONE_CONFIG or pass the --config flag to start with.
I have a prototype app that lets you paste an existing config, which gets saved on the phone. I can also make rclone load the configuration from that file on the phone, and I also see the list of expected remotes in the config.
However, when I try to list a remote’s contents in JSON format (path: “google-drive-iphone:/public”), I get the puzzling log that the remote is not found, even though the app correctly sees that “google-drive-iphone” is a recognized remote:
2018/12/25 16:28:48 NOTICE: Config file "/var/mobile/.rclone.conf" not found - using defaults
2018/12/25 16:28:48 Failed to create file system for "google-drive-iphone:/public": didn't find section in config file
It seems that for some reason, its trying to read the config file again from a default location when I create a new Fs, but can’t figure out why.
This is the relevant code in mobile.go which gets called by the application:
package mobile
import (
"encoding/json"
"sort"
"strings"
"rclone/fs"
"rclone/fs/config"
"rclone/fs/operations"
"github.com/ncw/rclone/cmd"
"github.com/pkg/errors"
)
// LoadConfig loads the config file
func LoadConfig(path string) bool {
config.ConfigPath = path
err := config.LoadConfig() // modified this from the original function to expose errors
return err == nil
}
func ListRemotes() string {
remotes := config.FileSections()
sort.Strings(remotes)
return strings.Join(remotes, "\n") // gomobile doesn't support string[]
}
func ListJson(path string) string {
var opt operations.ListJSONOpt
fsrc := cmd.NewFsSrc([]string{path})
var b strings.Builder
b.WriteString("[")
isFirst := true
err := operations.ListJSON(fsrc, "", &opt, func(item *operations.ListJSONItem) error {
out, err := json.Marshal(item)
if err != nil {
return errors.Wrap(err, "failed to marshal list object")
}
if isFirst {
isFirst = false
} else {
b.WriteString(",\n")
}
b.WriteString(string(out))
return nil
})
if err != nil {
return "[]"
}
b.WriteString("]")
return b.String()
}
I haven't been able to make any more progress on this, but found an app called CryptCloudViewer that says it supports viewing and downloading from encrypted remotes on iOS.