-
Notifications
You must be signed in to change notification settings - Fork 130
feat: add opt-in rclone cache population #1290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 18 commits
39f0273
869df91
4e1973c
8f4a49d
7435d97
c9c783a
eefcb6a
93ec80d
4b8a109
d5de170
832b03a
3cb1e75
4871b73
494aeb5
18338ef
cd06591
ae888af
f92f1c5
74e7838
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| "@opennextjs/cloudflare": minor | ||
| --- | ||
|
|
||
| feature: add opt-in batch upload via `rclone` for fast R2 cache population. | ||
|
|
||
| **Key Changes:** | ||
|
|
||
| 1. **Optional `rclone` Upload**: Install the optional `rclone.js` peer dependency and pass `--rclone` to opt in to `rclone` based batch uploads. | ||
|
|
||
| - `R2_ACCESS_KEY_ID` | ||
| - `R2_SECRET_ACCESS_KEY` | ||
| - `CF_ACCOUNT_ID` | ||
|
|
||
| 2. **Explicit Opt-in**: The existing worker-based population path remains the default. `rclone` is only loaded when `--rclone` is used for a remote cache. | ||
|
|
||
| 3. **Clear Errors**: The CLI reports missing credentials or a missing `rclone.js` installation when the option is used. | ||
|
|
||
| **Usage:** | ||
|
|
||
| Install `rclone.js`, then add the secrets in a `.env`/`.dev.vars` file in your project root: | ||
|
|
||
| ```bash | ||
| pnpm install rclone.js | ||
| pnpm approve-builds # select rclone.js | ||
| pnpm rebuild rclone.js | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this also a valid pnpm command?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting! The docs don't mention a positional param. |
||
| R2_ACCESS_KEY_ID=your_key | ||
| R2_SECRET_ACCESS_KEY=your_secret | ||
| CF_ACCOUNT_ID=your_account | ||
|
|
||
| opennextjs-cloudflare deploy --rclone | ||
| ``` | ||
|
|
||
| You can also set the environment variables for CI builds. | ||
|
|
||
| **Notes:** | ||
|
|
||
| - You can follow documentation <https://developers.cloudflare.com/r2/api/tokens/> for creating API tokens with appropriate permissions for R2 access. | ||
| - `rclone` may not be supported on all platforms. | ||

Uh oh!
There was an error while loading. Please reload this page.