|
| 1 | +# Dropbox Adapter Plugin |
| 2 | + |
| 3 | +The **Dropbox Adapter Plugin** provides Dropbox v2 API integration with Winter CMS as a custom filesystem disk driver. |
| 4 | +This allows limited usage of Dropbox with Laravel's Storage facade—primarily for custom logic and backup tools such as |
| 5 | +[`NumenCode.SyncOps`](https://github.com/numencode/wn-syncops-plugin). |
| 6 | + |
| 7 | +[](https://github.com/numencode/wn-dropboxadapter-plugin/releases) |
| 8 | +[](https://packagist.org/packages/numencode/wn-dropboxadapter-plugin) |
| 9 | +[](https://github.com/numencode/wn-dropboxadapter-plugin/actions) |
| 10 | +[](https://github.com/numencode/wn-dropboxadapter-plugin/actions) |
| 11 | +[](https://github.com/numencode/wn-dropboxadapter-plugin/blob/main/LICENSE.md) |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Target Audience |
| 16 | + |
| 17 | +This plugin is designed for developers who want to interact with Dropbox from within Winter CMS using |
| 18 | +Laravel’s filesystem abstraction, especially for automation, remote syncing, and backup scenarios. |
| 19 | + |
| 20 | +> **Note:** Due to framework limitations, Winter CMS (as of version 1.2) does not support using Dropbox as a |
| 21 | +> filesystem for core `media` or `uploads` disks. This plugin is not intended for direct media asset management, |
| 22 | +> but rather for use cases like backup transport, cloud storage sync, or custom plugin integration (e.g. [`NumenCode.SyncOps`](https://github.com/numencode/wn-syncops-plugin)). |
| 23 | +
|
| 24 | +## Installation |
| 25 | + |
| 26 | +This plugin is available for installation via [Composer](http://getcomposer.org/). |
| 27 | + |
| 28 | +```bash |
| 29 | +composer require numencode/wn-dropboxadapter-plugin |
| 30 | +``` |
| 31 | + |
| 32 | +Once the plugin is installed, ensure all migrations are executed: |
| 33 | + |
| 34 | +```bash |
| 35 | +php artisan winter:up |
| 36 | +``` |
| 37 | + |
| 38 | +## Requirements |
| 39 | + |
| 40 | +* [Winter CMS](https://wintercms.com/) version 1.2.7 or newer |
| 41 | +* PHP 8.0 or later |
| 42 | +* A Dropbox API access token |
| 43 | + |
| 44 | +## Configuration |
| 45 | + |
| 46 | +1. Create a Dropbox App in the [Dropbox App Console](https://www.dropbox.com/developers/apps) and generate an access token. |
| 47 | +2. Define a new filesystem disk in your `config/filesystems.php` file: |
| 48 | + ```php |
| 49 | + 'dropbox' => [ |
| 50 | + 'driver' => 'dropbox', |
| 51 | + 'authorization_token' => env('DROPBOX_AUTH_TOKEN'), |
| 52 | + ], |
| 53 | + ``` |
| 54 | +3. Add the token to your `.env` file: |
| 55 | + ```dotenv |
| 56 | + DROPBOX_AUTH_TOKEN=your_generated_token |
| 57 | + ``` |
| 58 | + You can now interact with Dropbox programmatically using the Storage facade in Laravel: |
| 59 | + ```php |
| 60 | + Storage::disk('dropbox')->put('backups/site.zip', $contents); |
| 61 | + ``` |
| 62 | + This is especially useful for custom automation (e.g., deployment scripts or remote backup workflows). |
| 63 | + |
| 64 | +## Limitations |
| 65 | +- **Not compatible with Winter CMS native `media` or `uploads` disks.** |
| 66 | +- **Not suitable for asset serving or file uploading through the CMS backend UI.** |
| 67 | + |
| 68 | +Use Dropbox through this plugin **only for custom filesystem operations** that are manually invoked or triggered |
| 69 | +via automation (e.g., within the [`NumenCode.SyncOps`](https://github.com/numencode/wn-syncops-plugin) plugin or similar). |
| 70 | + |
| 71 | +## Example Use Case |
| 72 | +This plugin was created to support [`NumenCode.SyncOps`](https://github.com/numencode/wn-syncops-plugin), |
| 73 | +a Winter CMS plugin for managing deployments, backups, and environment synchronization. Dropbox serves as a |
| 74 | +remote storage destination for sync packages or archive backups. |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +## Changelog |
| 79 | + |
| 80 | +All notable changes are documented in the [CHANGELOG](CHANGELOG.md). |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +## Contributing |
| 85 | + |
| 86 | +Please refer to the [CONTRIBUTING](CONTRIBUTING.md) guide for details on contributing to this project. |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +## Security |
| 91 | + |
| 92 | +If you identify any security issues, email info@numencode.com rather than using the issue tracker. |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +## Author |
| 97 | + |
| 98 | +The **NumenCode.DropboxAdapter** plugin is created and maintained by [Blaz Orazem](https://orazem.si/). |
| 99 | + |
| 100 | +For inquiries, contact: info@numencode.com |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +## License |
| 105 | + |
| 106 | +This project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). |
| 107 | + |
| 108 | +[](https://github.com/numencode/wn-dropboxadapter-plugin/blob/main/LICENSE.md) |
0 commit comments