Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcloud: allow configuration of root folder ID #3957

Closed
hfornazier opened this issue Feb 11, 2020 · 4 comments
Closed

pcloud: allow configuration of root folder ID #3957

hfornazier opened this issue Feb 11, 2020 · 4 comments

Comments

@hfornazier
Copy link

What is your current rclone version (output from rclone version)?

v1.51.0

What problem are you are trying to solve?

To define a variable in rclone.config to indicate which folder should be accessed.

How do you think rclone should be changed to solve that?

Rclone already has access to the PCloud Root.

There is already a constant "rootID" in the code, however, I believe that currently it always accesses Pcloud folder 0 (zero).

PCloud works on its API with a number of folders.

If the user can enter the "rootID" the folder number would be very interesting to preserve the entire file structure in the cloud.

This way, even if the rclone.config file is exposed on a PC, the user would only have access to that folder.

This would be excellent already, and in the future we could even use a "rootFolder = / Tests" so that the user could put the name of the Home folder.

@hfornazier
Copy link
Author

pcloud_sugest2

@ncw ncw added this to the Help Wanted milestone Feb 12, 2020
@ncw
Copy link
Member

ncw commented Feb 12, 2020

This would make a nice issue for someone wanting to get into rclone development. There is a free tier for pcloud accounts.

To implement this a new parameter root_folder_id needs to be added to the backend (named like that for consistency with the other backends). For example like this one in the drive backend, but with the default "d0". This needs docs on how to find the root_folder_id.

}, {
Name: "root_folder_id",
Help: `ID of the root folder
Leave blank normally.
Fill in to access "Computers" folders (see docs), or for rclone to use
a non root folder as its starting point.
Note that if this is blank, the first time rclone runs it will fill it
in with the ID of the root folder.
`,
}, {

This needs to be defined in the Options struct as RootFolderID string config:"root_folder_id"`

type Options struct {
Enc encoder.MultiEncoder `config:"encoding"`
}

Then all uses of rootID, need to be replaced with f.opt.RootFolderID

rootID = "d0" // ID of root folder is always this

@ncw ncw changed the title Possibility to configure the "rootID" variable in Rclone.config pcloud: allow configuration of root folder ID Feb 12, 2020
@Sunil-P
Copy link
Contributor

Sunil-P commented Apr 20, 2020

I'll start getting this done, I imagine this is similar to #3422

Sunil-P added a commit to Sunil-P/rclone that referenced this issue Apr 20, 2020
Added support for interchangable root folder for pCloud backend - rclone#3957
Sunil-P added a commit to Sunil-P/rclone that referenced this issue Apr 20, 2020
Sunil-P added a commit to Sunil-P/rclone that referenced this issue Apr 20, 2020
@ncw
Copy link
Member

ncw commented Apr 23, 2020

I've merged @Sunil-P 's fix for this to master now which means it will be in the latest beta in 15-30 mins and released in v1.52

Thank you @Sunil-P

@ncw ncw closed this as completed Apr 23, 2020
dbramwell pushed a commit to dbramwell/rclone that referenced this issue May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants