This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
SquidDev's profile picture

Dropbox

Started by SquidDev, 28 April 2014 - 02:27 PM
SquidDev #1
Posted 28 April 2014 - 04:27 PM
I know there are several Dropbox programs out there but I feel this one is better as it contains more features:

Download: Download single files or entire directories.
Copy and Move: Copy and move files or folders on your Dropbox folder straight from the command line
Delete: Delete files and folders on your Dropbox
Make directories: Create a directory on your Dropbox
List: Print out the contents of any folder on your Dropbox
Share: Share files or folders with all other users.
Use more than one account: Ability to use multiple config files, and so use multiple accounts.

For more information visit https://github.com/SquidDev/ComputerCraft-Dropbox

To use
Run pastebin EA91Mdj6 dropbox
Create an app at https://www.dropbox.com/developers/apps/create
- Select 'Dropbox API App'
- Select 'Files and datastore'
- You can chose whether it has access to your entire Dropbox, or its own folder. I would recomend its own folder as this means others cannot access your whole Dropbox.
- If you selected entire dropbox then select all file types.

- Name your app. Make a note your app key and app secret

- Run dropbox and follow the instructions

Security Info:
This script doesn't store your username but instead uses the Dropbox API (https://www.dropbox.com/developers/core). This means that if someone can get access to your dropbox_config (or other config file) then they can use the same script. As it doesn't store your password or username they can only access what you let your app access.

If you are on a non-whitelist server you SHOULD select 'app folder' when creating an app so people cannot access your entire Dropbox. You may also wish to encrypt the dropbox_config file.

Uploading: The http API seems to have some trouble accessing https://api-content.dropbox.com/ which is required for uploading so I am having trouble with uploading. Any fix welcome.

On a side note:
Dropbox also contains a Datastore API (https://www.dropbox.com/developers/datastore). This allows you to store tables on the internet - maybe a useful substitute for rednet. Or even inter-server rednet?
ardera #2
Posted 01 May 2014 - 07:58 PM
On a side note: Dropbox also contains a Datastore API (https://www.dropbox....opers/datastore). This allows you to store tables on the internet - maybe a useful substitute for rednet. Or even inter-server rednet?

I think it's useful, but the user must have a dropbox account, and you have to let the user authorize the app via Dropbox. Inter-server rednet is not the thing datastore works, datastore lets you store data on the user's dropbox profile. There is not one global server that the app can access to, it's just a dropbox for tables. You could create some fake profiles or use your own profile, but clients are able to delete new messages instantly then, which is not that great. Another thing one could do is use some kind of spreading, but thats too complicated just for making "inter-server" rednet, also sxw did something like this. (ZombieNet, I'll edit the link in here when I find it)

Just read about the Datastore and OAuth system, but I think the Core or Sync API lets you do some centralized stuff.

I'm sure you misunderstood the dropbox App thing. It's meant that one developer creates an app, and not every user that wants to use an app creates one.
Edited on 01 May 2014 - 06:02 PM
SquidDev #3
Posted 05 May 2014 - 08:52 PM
I'm sure you misunderstood the dropbox App thing. It's meant that one developer creates an app, and not every user that wants to use an app creates one.
The main reason I got people to create their own app is it reduces dependency on me and allows them to chose what permissions they have.

think it's useful, but the user must have a dropbox account, and you have to let the user authorize the app via Dropbox. Inter-server rednet is not the thing datastore works, datastore lets you store data on the user's dropbox profile. There is not one global server that the app can access to, it's just a dropbox for tables. You could create some fake profiles or use your own profile, but clients are able to delete new messages instantly then, which is not that great. Another thing one could do is use some kind of spreading, but thats too complicated just for making "inter-server" rednet, also sxw did something like this. (ZombieNet, I'll edit the link in here when I find it)
I guess you are right about the Datastore API. Most of the data I send with rednet is structured data (quarry progress, events etc…) that I collect at one computer. I was thinking that by using the Datastore API you could store this even if I was not online (if on a server) or if the main computer's chunk was unloaded or the computer was out of wireless range. This way data would not be lost as it would be stored on the cloud,
CaptRanger #4
Posted 06 May 2014 - 07:55 PM
Works great for me. Thanks for the great work.
viluon #5
Posted 06 May 2014 - 08:29 PM
Seems cool gonna try it