Pcloud configuration not working

Discussion about CloudSync.
Locked
User avatar
xdevill89
Posts: 2
Joined: 01 Apr 2023, 10:15

Pcloud configuration not working

Post by xdevill89 »

Good morning,

I was able to check why your software is not working properly in synchronizing the nas on European servers.
Reverse engineering of your software shows that the CloudSync software essentially resides in
/usr/local/CloudSync -> /Volume1/@apps/CloudSync .

Here are two folders of interest:
1 /usr/local/CloudSync/config/Pcloud
Which contains the following cloud.conf file and a temporary .response_code file

the cloud.conf file contains :
link="https://my.pcloud.com/oauth2/authorize? ... _type=code"
init="/scripts/Pcloud/Pcloud-interactive"

2 /scripts/Pcloud
Which essentially contains a script that is used to create the configurato to link with the cloud service > Pcloud-interactive :

Code: Select all

#!/usr/bin/expect
set NAME [lindex $argv 0]
set response_code "$env(CLOUD_PATH)/config/Pcloud/.response_code"
set CLIENT_ID "XXXXXXX"
set CLIENT_SECRET "XXXXXX"

spawn $env(CLOUD_PATH)/bin/cloudsync config --config $env(CLOUD_PATH)/etc/cloudsync.conf
expect "*e/n/d/r/c/s/q>"
send "n\r"
expect "*name>"
send "$NAME\r"
expect "*Storage>"
send "35\r"
expect "*client_id>"
send "$CLIENT_ID\r"
expect "*client_secret>"
send "$CLIENT_SECRET\r"
expect "*y/n>"
send "n\r"
expect "y/n>"
send "y\r"
expect "*Enter verification code>"

while {[file exists $response_code] == 0} {
        exec sleep 0.01
}

set fid [open $response_code r]
gets $fid line
close $fid
exec rm $response_code
send "$line\r"
expect "*y/e/d>"
send "y\r"
expect "*e/n/d/r/c/s/q>"
send "q\r"
~
From the reported code it is evident the functioning of the system in part:
1 from the cloudsync gui a new connection is created
2 the following Pcloud-interactive script is called which prepares the /etc/cloudsync.conf file
Sample Content >

Code: Select all

 
       [Pcloud_1]
       type = pcloud
       client_id = XXXXXX
       client_secret = XXXXXX
       

3 the internet address screen opens: https://my.pcloud.com/oauth2/authorize?
access_type=offline&client_id=XXXXXXXXX&redirect_uri=https%3A%2F%2Foauth.terra-
master.com%2Fcloudsync%2Fdb.php&response_type=code

4 upon confirmation of point 2, the following actions occur:
4.a url invoked > https://e.pcloud.com/oauth2/authorize_submit?
client_id=XXXXXXX&response_type=code&redirect_uri=https://oauth.terra-
master.com/cloudsync/db.php&sign=XXXXXXXX&auth=XXXXXXX so a code and a subsequent redirect are generated

4.b https://oauth.terra-master.com/cloudsync/db.php?
code=XXXXX&locationid=2&hostname=eapi.pcloud.com

5 if the process is successful then this line will be executed '' spawn $env(CLOUD_PATH)/bin/cloudsync config --config
$env(CLOUD_PATH)/etc/cloudsync.conf
''
.

The problem of the non-functioning lies in point 4.b, as reported by the pcloud documentation in two points :
1 ''https://docs.pcloud.com/''
pCloud has two data centers. One in United States and one in Europe.
As a consequence API calls have to be made to the correct API host name depending were the user has been registered – api.pcloud.com for United States and eapi.pcloud.com for Europe.

2 ''https://docs.pcloud.com/methods/oauth_2 ... orize.html''
locationid=2&hostname=eapi.pcloud.com
locationid The ID for the location of the data center where the user is located. 1 - US, 2 - Europe
hostname The host name of the API server. Consequent API calls have to be made to that host name.
Your software does not manage location 2 Europe.
I was able to verify this by opening another account with location US without changing the rest of my system configurations.
User avatar
TMzethar
TerraMaster Team
Posts: 1128
Joined: 27 Oct 2020, 16:43

Re: Pcloud configuration not working

Post by TMzethar »

Hi, we have referred your feedback to the relevant project team and will verify the issue and get back to you.
To contact our team, please send email to following addresses, remember to replace (at) with @:
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement, RMA service)
User avatar
xdevill89
Posts: 2
Joined: 01 Apr 2023, 10:15

Re: Pcloud configuration not working

Post by xdevill89 »

Thanks!
User avatar
mandrael
Posts: 7
Joined: 07 Apr 2023, 04:02

Re: Pcloud configuration not working

Post by mandrael »

Same problem here +1 for a fix ;-) I'm using pCloud in Europe.
Locked