[Cloudtools APKG HOW-TO] Dropbox

Moderator: Lillian.W@AST

Post Reply
User avatar
father.mande
Posts: 1817
youtube meble na wymiar Warszawa
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

[Cloudtools APKG HOW-TO] Dropbox

Post by father.mande »

Hi,

This is a series of messages to explain usage for each cloud target using cloudtools command line or mount tools
Please for support use the "PRODUCT" forum and help
... the source code of the program have not been changed in any manner (except if difference is listed here ... in fact only for Bash interface)

[Dropbox]
Prerequisite :
need a Dropbox account
dropbox_uploader, dropShell BASH client interface require : Entware-ng APKG for full bash + complete realink command ; install it from App. Central
dropbox.py official dropbox command line client require : Python 2.7 APKG ; install it from App. Central

[dropbox_uploader, dropShell]
I only explain dropbox_uploader ... dropShell use dropbox_uploader but present interface as a private shell and not as command line ...)
dropbox_uploader is a pure BASH shell script ...
... only change from "original" is Path for bash and Path for temp file
IT'S not a synchronization tool ... so no image locale of the data ...

When you start the first time ... you will have to follow the requested actions (using a browser) ... then nothing more
a .dropbox_uploader file is created in the HOME folder
like this

Code: Select all

root@AS5002TaPhil:/volume1/.@root # cat /usr/local/AppCentral/cloudtools/.dropbox_uploader.sample
APPKEY=xxx_from_dropbox_app
APPSECRET=xxx_from_dropbox_app
ACCESS_LEVEL=dropbox_or_folder_response_in_first_use
OAUTH_ACCESS_TOKEN=return_by_first_run_after_accept
OAUTH_ACCESS_TOKEN_SECRET=return_by_first_run_after_accept
root@AS5002TaPhil:/volume1/.@root 
here a trace of first run :

Code: Select all

root@AS5002TaPhil:/volume1/.@root # dropbox_uploader.sh

 This is the first time you run this script.

 1) Open the following URL in your Browser, and log in using your account: https://www.dropbox.com/developers/apps
 2) Click on "Create App", then select "Dropbox API app"
 3) Now go on with the configuration, choosing the app permissions and access restrictions to your DropBox folder
 4) Enter the "App Name" that you prefer (e.g. MyUploader22261407623126)

 Now, click on the "Create App" button.

 When your new App is successfully created, please type the
 App Key, App Secret and the Permission type shown in the confirmation page:

 # App key: lz8xxxxxxiafml
 # App secret: fm0xxxxxxa2s05

Permission type:
 App folder [a]: If you choose that the app only needs access to files it creates
 Full Dropbox [f]: If you choose that the app needs access to files already on Dropbox

 # Permission type [a/f]: f

 > App key is lz8xxxxxxxiafml, App secret is fm0xxxxxxxxa2s05 and Access level is Full Dropbox. Looks ok? [y/n]: y

 > Token request... OK

 Please open the following URL in your browser, and allow Dropbox Uploader
 to access your DropBox folder:

 --> https://www.dropbox.com/1/oauth/authorize?oauth_token=K3xxxxxxxs30i1oy

Press enter when done...

 > Access Token request... OK

 Setup completed!
root@AS5002TaPhil:/volume1/.@root #
so all is clear and easy ...

After you can use it to manipulate your data :

Code: Select all

root@AS5002TaPhil:/volume1/.@root # dropbox_uploader.sh
Dropbox Uploader v0.16
Andrea Fabrizi - andrea.fabrizi@gmail.com

Usage: /usr/local/bin/dropbox_uploader.sh [PARAMETERS] COMMAND...

Commands:
         upload   <LOCAL_FILE/DIR ...>  <REMOTE_FILE/DIR>
         download <REMOTE_FILE/DIR> [LOCAL_FILE/DIR]
         delete   <REMOTE_FILE/DIR>
         move     <REMOTE_FILE/DIR> <REMOTE_FILE/DIR>
         copy     <REMOTE_FILE/DIR> <REMOTE_FILE/DIR>
         mkdir    <REMOTE_DIR>
         list     [REMOTE_DIR]
         share    <REMOTE_FILE>
         saveurl  <URL> <REMOTE_DIR>
         info
         unlink

Optional parameters:
        -f <FILENAME> Load the configuration file from a specific file
        -s            Skip already existing files when download/upload. Default: Overwrite
        -d            Enable DEBUG mode
        -q            Quiet mode. Don't show messages
        -h            Show file sizes in human readable format
        -p            Show cURL progress meter
        -k            Doesn't check for SSL certificates (insecure)

For more info and examples, please see the README file.

root@AS5002TaPhil:/volume1/.@root #
It's all ...

[dropbox.py]
Python script provide by dropbox ... require python 2.7 APKG
dropbox.py is a server (in fact download and generate server) and a client
This server is a syncjronization tool ... so a folder in HOME user is created to clone the dropbox data
... $HOME/Dropbox this folder CAN'T BE CHANGED (due to indexing) ... so moving it require some manipulation explain later ...
ATTENTION READ THIS CAREFULLY
The installation is in multiple phases :
phase 1 first call of dropbox.py (dropbox start -i ) i to install the server
... the python script create a folder .dropbox-dist in HOME user folder
... download in it the server program (x86_64 or x32)
... start it
... the server create a folder name .dropbox ... where the server and the client communicate ...
BUT BUT BUT the server is started in background ... and nothing seem to work as well
phase 2 kill the server
phase 3
restart the server $HOME/.dropbox-dist/dropboxd in the shell in foreground ...
... the server loop on a request URL to validate the access ... use the URL to validate the access ... using a Web browser
It's finish
Now you can use dropbox.py as client ...
following ... start with -i to install the server ...
BE ATTENTION to the break (^C) when message "This computer is now linked to Dropbox. Welcome " indicate that registered is done

Code: Select all

root@AS5002TaPhil:/volume1/.@root # dropbox.py start -i
Starting Dropbox...
Dropbox is the easiest way to share and store your files online. Want to learn more? Head to https://www.dropbox.com/

In order to use Dropbox, you must download the proprietary daemon.
Note: python-gpgme is not installed, we will not be able to verify binary signatures. [y/n] y
Downloading Dropbox... 100%
Unpacking Dropbox... 100%
Dropbox isn't running!
Done!
root@AS5002TaPhil:/volume1/.@root # ps -eaf | grep dropbo
root     20474     1 26 13:22 ?        00:00:03 /volume1/.@root/.dropbox-dist/dropbox-lnx.x86_64-3.20.1/dropbox
root     20745 24860  0 13:22 pts/1    00:00:00 grep dropbo
root@AS5002TaPhil:/volume1/.@root # dropbox.py status
Starting...
root@AS5002TaPhil:/volume1/.@root # kill -9 20474
root@AS5002TaPhil:/volume1/.@root # cd .dropbox-dist/
root@AS5002TaPhil:/volume1/.@root/.dropbox-dist # ./dropboxd
This computer isn't linked to any Dropbox account...
Please visit https://www.dropbox.com/cli_link_nonce?nonce=67708939c379dxxxxxx546ef07157140 to link this device.
This computer isn't linked to any Dropbox account...
Please visit https://www.dropbox.com/cli_link_nonce?nonce=67708939c379dxxxxxx546ef07157140 to link this device.
This computer isn't linked to any Dropbox account...
Please visit https://www.dropbox.com/cli_link_nonce?nonce=67708939c379dxxxxxx546ef07157140 to link this device.
This computer isn't linked to any Dropbox account...
Please visit https://www.dropbox.com/cli_link_nonce?nonce=67708939c379dxxxxxx546ef07157140 to link this device.
This computer isn't linked to any Dropbox account...
Please visit https://www.dropbox.com/cli_link_nonce?nonce=67708939c379dxxxxxx546ef07157140 to link this device.
This computer isn't linked to any Dropbox account...
Please visit https://www.dropbox.com/cli_link_nonce?nonce=67708939c379dxxxxxx546ef07157140 to link this device.
This computer is now linked to Dropbox. Welcome Philippe
^C
root@AS5002TaPhil:/volume1/.@root/.dropbox-dist # ps -eaf | grep drop
root     11823 24860  0 13:43 pts/1    00:00:00 grep drop
root@AS5002TaPhil:/volume1/.@root/.dropbox-dist # dropbox.py status
Dropbox isn't running!
root@AS5002TaPhil:/volume1/.@root/.dropbox-dist # dropbox.py start
Starting Dropbox...Done!
root@AS5002TaPhil:/volume1/.@root/.dropbox-dist # dropbox.py status
Downloading file list...
root@AS5002TaPhil:/volume1/.@root/.dropbox-dist # dropbox.py status
Up to date
root@AS5002TaPhil:/volume1/.@root/.dropbox-dist 
Clone of Dropbox is in $HOME/Dropbox

Code: Select all

root@AS5002TaPhil:/volume1/.@root # ll Dropbox/
total 276
drwx------    6 root     root        4.0K May 22 13:44 ./
drwx------   15 root     root        4.0K May 22 13:22 ../
-rwxr-xr-x    1 root     root          35 May 20 18:20 .dropbox*
drwxr-xr-x    3 root     root        4.0K May 22 13:44 .dropbox.cache/
drwxr-xr-x    3 root     root        4.0K May 20 18:21 Photos/
-rw-r--r--    1 root     root      229.1K Jun 13  2012 Premiers_pas.pdf
drwxr-xr-x    2 root     root        4.0K May 20 18:21 Public/
drwxr-xr-x    2 root     root        4.0K Feb 26  2014 Taiwan_2012/
root@AS5002TaPhil:/volume1/.@root #
BUT I want to change the folder place ???
Just follow this :
1 stop server ( dropbox.py stop )
2 move folder to a new place
ex. : mv /root/Dropbox /share/cloudtools/
3 create a link (so index stay available)
ln -s /share/cloudtools/Dropbox /root/
4 restart server
dropbox.py start

Have fun.
Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
damien599901
Posts: 575
Joined: Mon Dec 30, 2013 2:53 am

Re: [Cloudtools APKG HOW-TO] Dropbox

Post by damien599901 »

"Dropbox isn't running!
Done!der to use Dropbox, you must download the proprietary daemon."
Storage: AS7004T & AS5002T
Network: FREEBOX REVOLUTION V6
Laptop: Apple MACBOOK Pro OS X El Capitan & Windows 10
Media Player: ASUSTOR NAS with Kodi 16 Beta & HD_Engine 1 (thanks Fathe_Mande)
Portable: iPhone 6S Plus, iPad Mini 2 & iPad Air
User avatar
father.mande
Posts: 1817
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: [Cloudtools APKG HOW-TO] Dropbox

Post by father.mande »

hi,
damien599901 wrote:"Dropbox isn't running!
Done!der to use Dropbox, you must download the proprietary daemon."
if it's dropbox.py ... do you use the -i for install the first time you run it : dropbox.py start -i

this -i download then install the server ... BUT read carefully the topic on ... because you must follow the VERY specific procedure ... due to Drpobox validation and the fact you are on a NAS;

Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
Post Reply

Return to “Cloodtools”