{"id":34867075,"url":"https://github.com/numencode/wn-dropboxadapter-plugin","last_synced_at":"2025-12-25T22:38:54.871Z","repository":{"id":303668875,"uuid":"1016278097","full_name":"numencode/wn-dropboxadapter-plugin","owner":"numencode","description":"NumenCode Dropbox Adapter plugin for Winter CMS","archived":false,"fork":false,"pushed_at":"2025-07-14T13:55:17.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-24T04:42:55.512Z","etag":null,"topics":["dropbox","laravel","numencode","php","plugin","storage","winter","wintercms","wintercms-plugin"],"latest_commit_sha":null,"homepage":"https://www.numencode.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numencode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-08T18:59:10.000Z","updated_at":"2025-07-20T15:12:24.000Z","dependencies_parsed_at":"2025-07-08T20:39:25.259Z","dependency_job_id":"aad86dbe-264d-4ab0-a079-61d2f140ea57","html_url":"https://github.com/numencode/wn-dropboxadapter-plugin","commit_stats":null,"previous_names":["numencode/wn-dropboxadapter-plugin"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/numencode/wn-dropboxadapter-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numencode%2Fwn-dropboxadapter-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numencode%2Fwn-dropboxadapter-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numencode%2Fwn-dropboxadapter-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numencode%2Fwn-dropboxadapter-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numencode","download_url":"https://codeload.github.com/numencode/wn-dropboxadapter-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numencode%2Fwn-dropboxadapter-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28039254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dropbox","laravel","numencode","php","plugin","storage","winter","wintercms","wintercms-plugin"],"created_at":"2025-12-25T22:38:54.180Z","updated_at":"2025-12-25T22:38:54.856Z","avatar_url":"https://github.com/numencode.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dropbox Adapter Plugin\n\nThe **Dropbox Adapter Plugin** provides Dropbox v2 API integration with Winter CMS as a custom filesystem disk driver.\nThis allows limited usage of Dropbox with Laravel's Storage facade — primarily for custom logic and backup tools such as\n[`NumenCode.SyncOps`](https://github.com/numencode/wn-syncops-plugin).\n\n[![Version](https://img.shields.io/github/v/release/numencode/wn-dropboxadapter-plugin?style=flat-square\u0026color=0099FF)](https://github.com/numencode/wn-dropboxadapter-plugin/releases)\n[![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/numencode/wn-dropboxadapter-plugin?style=flat-square\u0026color=0099FF)](https://packagist.org/packages/numencode/wn-dropboxadapter-plugin)\n[![Checks](https://img.shields.io/github/check-runs/numencode/wn-dropboxadapter-plugin/main?style=flat-square)](https://github.com/numencode/wn-dropboxadapter-plugin/actions)\n[![Tests](https://img.shields.io/github/actions/workflow/status/numencode/wn-dropboxadapter-plugin/tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/numencode/wn-dropboxadapter-plugin/actions)\n[![License](https://img.shields.io/github/license/numencode/wn-dropboxadapter-plugin?label=open%20source\u0026style=flat-square\u0026color=0099FF)](https://github.com/numencode/wn-dropboxadapter-plugin/blob/main/LICENSE.md)\n\n---\n\n## Target Audience\n\nThis plugin is designed for developers who want to interact with Dropbox from within Winter CMS using\nLaravel’s filesystem abstraction, especially for automation, remote syncing, and backup scenarios.\n\n\u003e **Note:** Due to framework limitations, Winter CMS (as of version 1.2) does not support using Dropbox as a\n\u003e filesystem for core `media` or `uploads` disks. This plugin is not intended for direct media asset management,\n\u003e 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)).\n\n---\n\n## Installation\n\nThis plugin is available for installation via [Composer](http://getcomposer.org/).\n\n```bash\ncomposer require numencode/wn-dropboxadapter-plugin\n```\n\nOnce the plugin is installed, ensure all migrations are executed:\n\n```bash\nphp artisan winter:up\n```\n\n## Requirements\n\n- [Winter CMS](https://wintercms.com) version 1.2.7 or newer\n- PHP 8.0 or later\n- A Dropbox App (created in the [Dropbox App Console](https://www.dropbox.com/developers/apps))\n  - For **Refresh Token Flow**: You'll need your `App key` and `App secret`.\n  - For **Temporary Token Flow**: You'll need a manually generated `Access token`.\n\n## Configuration and Authentication\n\nThis plugin offers two methods for authenticating with the Dropbox API: the **Refresh Token Flow** (recommended for\nproduction and long-term use) and the **Temporary Token Flow** (ideal for quick development or testing).\nYou can switch between these modes in your `.env` file.\n\n### 1. Create a Dropbox App\n\nRegardless of the authentication method, you need to [create a Dropbox App](https://www.dropbox.com/developers/apps).\n\nWhen creating your app:\n\n- Choose **\"Scoped access\"** and select the permissions your application needs (e.g.,\n  `files.content.write`, `files.content.read` for read/write access).\n\n### 2. Choose your authentication method\n\nYou specify the authentication method in your `.env` file using the `DROPBOX_AUTH_MODE` variable.\nYou can choose between `refresh_token` and `temp_token` modes.\n\n#### a. Refresh Token Flow (recommended for production)\n\nThis is the **secure and persistent** way to authenticate. It uses a long-lived **refresh token** to automatically\nobtain new, short-lived **access tokens** as needed, eliminating the need for manual intervention when tokens expire.\n\n##### Setup Steps\n\n1. **Add Dropbox App credentials to `.env`**:\n\n   You'll need your Dropbox `App key` and `App secret`.\n    ```dotenv\n    DROPBOX_AUTH_MODE=refresh_token\n    DROPBOX_APP_KEY=\n    DROPBOX_APP_SECRET=\n    DROPBOX_REFRESH_TOKEN=\n    ```\n\n2. **Generate your refresh token**:\n\n   Use the provided console command to go through the OAuth2 authorization process and obtain your refresh token:\n    ```bash\n    php artisan dropboxadapter:setup\n    ```\n\n   Follow the on-screen prompts:\n    - It will ask for your **Dropbox App key**.\n    - It will provide a URL to open in your browser. Authorize your app on Dropbox. After authorization, Dropbox will\n      provide an \"authorization code\" (often in the URL parameters if no redirect URI is set, or directly on the\n      success page). Copy this `code`.\n    - Paste the `authorization code` back into the console.\n    - Enter your **Dropbox App secret**.\n    - The command will then exchange this code for a refresh token and display it.\n\n3. **Update `.env` with refresh token**:\n\n   Copy the generated refresh token and add it to your `.env` file.\n\n#### b. Temporary Token Flow (for development/testing only)\n\nThis method is quick and easy for **temporary testing**, but the token will **expire after 4 hours** and requires\nmanual renewal. **Do not use this in production.**\n\n##### Setup Steps\n\n1. **Generate a temporary access token:**\n\n   - Go to your [Dropbox App Console](https://www.dropbox.com/developers/apps).\n   - Navigate to your app's settings.\n   - Under \"OAuth 2\", find the \"Generated access token\" section and click \"Generate\". Copy this token.\n\n2. **Add temporary token to `.env`:**\n\n    ```dotenv\n    DROPBOX_AUTH_MODE=temp_token\n    DROPBOX_TEMP_TOKEN=\n    ```\n\n    **Important:** If using this mode, the `DROPBOX_APP_KEY`, `DROPBOX_APP_SECRET`,\n    and `DROPBOX_REFRESH_TOKEN` variables are ignored by the plugin.\n\n### 3. Define the dropbox disk\n\nOnce you have configured your chosen authentication method in `.env`,\ndefine a new filesystem disk in your `config/filesystems.php` file:\n\n```php\n'dropbox' =\u003e [\n    'driver' =\u003e 'dropbox',\n],\n```\n\n### 4. Usage with Storage Facade\n\nYou can now interact with Dropbox programmatically using the Storage facade in Laravel:\n\n```php\nStorage::disk('dropbox')-\u003eput('backups/site.zip', $contents);\n```\n\nThis is especially useful for custom automation (e.g., deployment scripts or remote backup workflows).\n\n## Limitations\n\n- **Not compatible with Winter CMS native `media` or `uploads` disks.**\n- **Not suitable for asset serving or file uploading through the CMS backend UI.**\n\nUse Dropbox through this plugin **only for custom filesystem operations** that are manually invoked or triggered\nvia automation (e.g., within the [`NumenCode.SyncOps`](https://github.com/numencode/wn-syncops-plugin) plugin or similar).\n\n## Example Use Case\n\nThis plugin was created to support [`NumenCode.SyncOps`](https://github.com/numencode/wn-syncops-plugin),\na Winter CMS plugin for managing deployments, backups, and environment synchronization. Dropbox serves as a\nremote storage destination for sync packages or archive backups.\n\n---\n\n## Changelog\n\nAll notable changes are documented in the [CHANGELOG](CHANGELOG.md).\n\n---\n\n## Contributing\n\nPlease refer to the [CONTRIBUTING](CONTRIBUTING.md) guide for details on contributing to this project.\n\n---\n\n## Security\n\nIf you identify any security issues, email info@numencode.com rather than using the issue tracker.\n\n---\n\n## Author\n\nThe **NumenCode.DropboxAdapter** plugin is created and maintained by [Blaz Orazem](https://orazem.si/).\n\nFor inquiries, contact: info@numencode.com\n\n---\n\n## License\n\nThis project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n\n[![License](https://img.shields.io/github/license/numencode/wn-dropboxadapter-plugin?style=flat-square\u0026color=0099FF)](https://github.com/numencode/wn-dropboxadapter-plugin/blob/main/LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumencode%2Fwn-dropboxadapter-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumencode%2Fwn-dropboxadapter-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumencode%2Fwn-dropboxadapter-plugin/lists"}