From fb5915d6ace15b98b1f087d155518348c881855b Mon Sep 17 00:00:00 2001 From: Gabriel Massadas <5445926+G4brym@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:19:24 +0000 Subject: [PATCH] Update docs (#76) --- .gitignore | 2 + README.md | 2 +- .../guides/continue-using-legacy-dashboard.md | 18 --------- docs/requirements.txt | 6 --- {docs => packages/docs}/_redirects | 0 {docs => packages/docs}/mkdocs.yml | 4 +- .../docs}/pages/assets/cloudflare-access.png | Bin .../docs}/pages/assets/custom-domain.png | Bin .../assets/github-action/add-cf-token.png | Bin .../assets/github-action/add-variables.png | Bin .../assets/github-action/enable-actions.png | Bin .../docs}/pages/assets/github-action/fork.png | Bin .../pages/assets/github-action/new-secret.png | Bin .../assets/github-action/trigger-update.png | Bin .../assets/github-action/update-available.png | Bin {docs => packages/docs}/pages/assets/logo.svg | 0 .../docs}/pages/assets/r2-explorer-logo.png | Bin .../pages/assets/setup-email-routing-2.png | Bin .../pages/assets/setup-email-routing-3.png | Bin .../pages/assets/setup-email-routing-4.png | Bin .../pages/assets/setup-email-routing.png | Bin .../docs}/pages/assets/update-available.png | Bin .../pages/getting-started/add-r2-buckets.md | 0 .../pages/getting-started/configuration.md | 18 ++++----- .../getting-started/creating-a-new-project.md | 14 +++---- .../docs}/pages/getting-started/deploying.md | 0 .../docs}/pages/getting-started/security.md | 4 +- .../getting-started/updating-your-project.md | 8 ++-- .../docs}/pages/guides/migrating-to-1.0.md | 0 .../docs}/pages/guides/migrating-to-1.1.md | 0 .../pages/guides/setup-email-explorer.md | 12 +++--- {docs => packages/docs}/pages/index.md | 35 ++++++++++-------- packages/docs/requirements.txt | 1 + 33 files changed, 55 insertions(+), 69 deletions(-) delete mode 100644 docs/pages/guides/continue-using-legacy-dashboard.md delete mode 100644 docs/requirements.txt rename {docs => packages/docs}/_redirects (100%) rename {docs => packages/docs}/mkdocs.yml (97%) rename {docs => packages/docs}/pages/assets/cloudflare-access.png (100%) rename {docs => packages/docs}/pages/assets/custom-domain.png (100%) rename {docs => packages/docs}/pages/assets/github-action/add-cf-token.png (100%) rename {docs => packages/docs}/pages/assets/github-action/add-variables.png (100%) rename {docs => packages/docs}/pages/assets/github-action/enable-actions.png (100%) rename {docs => packages/docs}/pages/assets/github-action/fork.png (100%) rename {docs => packages/docs}/pages/assets/github-action/new-secret.png (100%) rename {docs => packages/docs}/pages/assets/github-action/trigger-update.png (100%) rename {docs => packages/docs}/pages/assets/github-action/update-available.png (100%) rename {docs => packages/docs}/pages/assets/logo.svg (100%) rename {docs => packages/docs}/pages/assets/r2-explorer-logo.png (100%) rename {docs => packages/docs}/pages/assets/setup-email-routing-2.png (100%) rename {docs => packages/docs}/pages/assets/setup-email-routing-3.png (100%) rename {docs => packages/docs}/pages/assets/setup-email-routing-4.png (100%) rename {docs => packages/docs}/pages/assets/setup-email-routing.png (100%) rename {docs => packages/docs}/pages/assets/update-available.png (100%) rename {docs => packages/docs}/pages/getting-started/add-r2-buckets.md (100%) rename {docs => packages/docs}/pages/getting-started/configuration.md (69%) rename {docs => packages/docs}/pages/getting-started/creating-a-new-project.md (86%) rename {docs => packages/docs}/pages/getting-started/deploying.md (100%) rename {docs => packages/docs}/pages/getting-started/security.md (94%) rename {docs => packages/docs}/pages/getting-started/updating-your-project.md (82%) rename {docs => packages/docs}/pages/guides/migrating-to-1.0.md (100%) rename {docs => packages/docs}/pages/guides/migrating-to-1.1.md (100%) rename {docs => packages/docs}/pages/guides/setup-email-explorer.md (80%) rename {docs => packages/docs}/pages/index.md (79%) create mode 100644 packages/docs/requirements.txt diff --git a/.gitignore b/.gitignore index 9c53cd9..3060d41 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,5 @@ packages/dashboard/.quasar template/package-lock.json template/node_modules/ + +packages/docs/site diff --git a/README.md b/README.md index 9d565f8..d35303c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
diff --git a/docs/pages/guides/continue-using-legacy-dashboard.md b/docs/pages/guides/continue-using-legacy-dashboard.md deleted file mode 100644 index d265331..0000000 --- a/docs/pages/guides/continue-using-legacy-dashboard.md +++ /dev/null @@ -1,18 +0,0 @@ -The new dashboard v2 is now stable, and we are no longer providing update to the legacy (dashboard v1) version. - -But if you want, you can keep using the legacy version, by defining `dashboardUrl` in your `index.js` file, like this: - -```js title="src/index.js" -import { R2Explorer } from 'r2-explorer'; - -const explorer = R2Explorer({ - // ... other settings, you may have - dashboardUrl: "https://dashboard-v1.r2-explorer-dashboard.pages.dev/", -}) - -export default { - async fetch(request, env, context) { - return explorer(request, env, context) - } -}; -``` diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index f6ecd90..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -mkdocs==1.5.2 -mkdocs-material==9.1.21 -termynal==0.10.1 -mdx-include==1.4.2 -mkdocs-markdownextradata-plugin==0.2.5 -pyyaml==6.0.1 diff --git a/docs/_redirects b/packages/docs/_redirects similarity index 100% rename from docs/_redirects rename to packages/docs/_redirects diff --git a/docs/mkdocs.yml b/packages/docs/mkdocs.yml similarity index 97% rename from docs/mkdocs.yml rename to packages/docs/mkdocs.yml index 26fe1d1..1f2f255 100644 --- a/docs/mkdocs.yml +++ b/packages/docs/mkdocs.yml @@ -60,10 +60,12 @@ nav: - guides/setup-email-explorer.md - guides/migrating-to-1.0.md - guides/migrating-to-1.1.md - - guides/continue-using-legacy-dashboard.md - Email explorer: https://r2explorer.dev/guides/setup-email-explorer/ - Live demo: https://demo.r2explorer.dev/ markdown_extensions: + - def_list + - pymdownx.tasklist: + custom_checkbox: true - attr_list - toc: permalink: true diff --git a/docs/pages/assets/cloudflare-access.png b/packages/docs/pages/assets/cloudflare-access.png similarity index 100% rename from docs/pages/assets/cloudflare-access.png rename to packages/docs/pages/assets/cloudflare-access.png diff --git a/docs/pages/assets/custom-domain.png b/packages/docs/pages/assets/custom-domain.png similarity index 100% rename from docs/pages/assets/custom-domain.png rename to packages/docs/pages/assets/custom-domain.png diff --git a/docs/pages/assets/github-action/add-cf-token.png b/packages/docs/pages/assets/github-action/add-cf-token.png similarity index 100% rename from docs/pages/assets/github-action/add-cf-token.png rename to packages/docs/pages/assets/github-action/add-cf-token.png diff --git a/docs/pages/assets/github-action/add-variables.png b/packages/docs/pages/assets/github-action/add-variables.png similarity index 100% rename from docs/pages/assets/github-action/add-variables.png rename to packages/docs/pages/assets/github-action/add-variables.png diff --git a/docs/pages/assets/github-action/enable-actions.png b/packages/docs/pages/assets/github-action/enable-actions.png similarity index 100% rename from docs/pages/assets/github-action/enable-actions.png rename to packages/docs/pages/assets/github-action/enable-actions.png diff --git a/docs/pages/assets/github-action/fork.png b/packages/docs/pages/assets/github-action/fork.png similarity index 100% rename from docs/pages/assets/github-action/fork.png rename to packages/docs/pages/assets/github-action/fork.png diff --git a/docs/pages/assets/github-action/new-secret.png b/packages/docs/pages/assets/github-action/new-secret.png similarity index 100% rename from docs/pages/assets/github-action/new-secret.png rename to packages/docs/pages/assets/github-action/new-secret.png diff --git a/docs/pages/assets/github-action/trigger-update.png b/packages/docs/pages/assets/github-action/trigger-update.png similarity index 100% rename from docs/pages/assets/github-action/trigger-update.png rename to packages/docs/pages/assets/github-action/trigger-update.png diff --git a/docs/pages/assets/github-action/update-available.png b/packages/docs/pages/assets/github-action/update-available.png similarity index 100% rename from docs/pages/assets/github-action/update-available.png rename to packages/docs/pages/assets/github-action/update-available.png diff --git a/docs/pages/assets/logo.svg b/packages/docs/pages/assets/logo.svg similarity index 100% rename from docs/pages/assets/logo.svg rename to packages/docs/pages/assets/logo.svg diff --git a/docs/pages/assets/r2-explorer-logo.png b/packages/docs/pages/assets/r2-explorer-logo.png similarity index 100% rename from docs/pages/assets/r2-explorer-logo.png rename to packages/docs/pages/assets/r2-explorer-logo.png diff --git a/docs/pages/assets/setup-email-routing-2.png b/packages/docs/pages/assets/setup-email-routing-2.png similarity index 100% rename from docs/pages/assets/setup-email-routing-2.png rename to packages/docs/pages/assets/setup-email-routing-2.png diff --git a/docs/pages/assets/setup-email-routing-3.png b/packages/docs/pages/assets/setup-email-routing-3.png similarity index 100% rename from docs/pages/assets/setup-email-routing-3.png rename to packages/docs/pages/assets/setup-email-routing-3.png diff --git a/docs/pages/assets/setup-email-routing-4.png b/packages/docs/pages/assets/setup-email-routing-4.png similarity index 100% rename from docs/pages/assets/setup-email-routing-4.png rename to packages/docs/pages/assets/setup-email-routing-4.png diff --git a/docs/pages/assets/setup-email-routing.png b/packages/docs/pages/assets/setup-email-routing.png similarity index 100% rename from docs/pages/assets/setup-email-routing.png rename to packages/docs/pages/assets/setup-email-routing.png diff --git a/docs/pages/assets/update-available.png b/packages/docs/pages/assets/update-available.png similarity index 100% rename from docs/pages/assets/update-available.png rename to packages/docs/pages/assets/update-available.png diff --git a/docs/pages/getting-started/add-r2-buckets.md b/packages/docs/pages/getting-started/add-r2-buckets.md similarity index 100% rename from docs/pages/getting-started/add-r2-buckets.md rename to packages/docs/pages/getting-started/add-r2-buckets.md diff --git a/docs/pages/getting-started/configuration.md b/packages/docs/pages/getting-started/configuration.md similarity index 69% rename from docs/pages/getting-started/configuration.md rename to packages/docs/pages/getting-started/configuration.md index 8afa30c..be54c82 100644 --- a/docs/pages/getting-started/configuration.md +++ b/packages/docs/pages/getting-started/configuration.md @@ -2,14 +2,14 @@ All customizations are applied in the `src/index.ts` file. Here is all the available options: -| Name | Type(s) | Description | Examples | -|--------------------|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------| -| `readonly` | `boolean` or `undefined` | Controls the write access globally, default: `true` | `true` | -| `cors` | `boolean` or `undefined` | Enables or disables CORS access to the internal API, default: `false` | `true` | -| `cfAccessTeamName` | `string` or `undefined` | When set enforces Cloudflare Access in all requests | `radar` (taken from https://radar.cloudflareaccess.com/) | -| `dashboardUrl` | `string` or `undefined` | Allows you to serve a custom dashboard, read more [here](/guides/migrating-to-1.0/#why-is-the-dashboard-no-longer-bundled-in-the-worker) | `https://demo.r2explorer.dev` | -| `emailRouting` | `object` or `undefined` | Customize Email Explorer, read more [here](/guides/setup-email-explorer) | `https://demo.r2explorer.dev` | -| `cacheAssets` | `boolean` or `undefined` | Cache dashboard assets by 5 minutes, default: `true` | `https://demo.r2explorer.dev` | +| Name | Type(s) | Description | Examples | +|--------------------|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------| +| `readonly` | `boolean` or `undefined` | Controls the write access globally, default: `true` | `true` | +| `cors` | `boolean` or `undefined` | Enables or disables CORS access to the internal API, default: `false` | `true` | +| `cfAccessTeamName` | `string` or `undefined` | When set enforces Cloudflare Access in all requests | `radar` (taken from https://radar.cloudflareaccess.com/) | +| `dashboardUrl` | `string` or `undefined` | Allows you to serve a custom dashboard, read more [here](../guides/migrating-to-1.0.md/#why-is-the-dashboard-no-longer-bundled-in-the-worker) | `https://demo.r2explorer.dev` | +| `emailRouting` | `object` or `undefined` | Customize Email Explorer, read more [here](../guides/setup-email-explorer.md) | `https://demo.r2explorer.dev` | +| `cacheAssets` | `boolean` or `undefined` | Cache dashboard assets by 5 minutes, default: `true` | `https://demo.r2explorer.dev` | `emailRouting` options: @@ -45,7 +45,7 @@ wrangler deploy To setup a custom domain, just open the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/workers/services/view/:worker/production/settings#domains) and go to Workers & Pages -> your worker -> Triggers. And click "Add Custom Domain". -![Cloudflare Workers Dashboard](/assets/custom-domain.png) +![Cloudflare Workers Dashboard](../assets/custom-domain.png) ## Configuring Email Explorer target bucket diff --git a/docs/pages/getting-started/creating-a-new-project.md b/packages/docs/pages/getting-started/creating-a-new-project.md similarity index 86% rename from docs/pages/getting-started/creating-a-new-project.md rename to packages/docs/pages/getting-started/creating-a-new-project.md index 6de7d0b..5e0f801 100644 --- a/docs/pages/getting-started/creating-a-new-project.md +++ b/packages/docs/pages/getting-started/creating-a-new-project.md @@ -2,17 +2,17 @@ Start by creating a new fork of the [github repository here](https://github.com/G4brym/R2-Explorer/fork). -![Fork](/assets/github-action/fork.png) +![Fork](../assets/github-action/fork.png) Create a new API Token as described in the [official Cloudflare Docs](https://developers.cloudflare.com/workers/wrangler/migration/v1-to-v2/wrangler-legacy/authentication/#api-token). Then, in your new repository go to Settings -> Secret and variables -> Actions -> New repository secret. -![new secret](/assets/github-action/new-secret.png) +![new secret](../assets/github-action/new-secret.png) Create a new secret with the name `CF_API_TOKEN` and the value as the newly created token. -![add cf token](/assets/github-action/add-cf-token.png) +![add cf token](../assets/github-action/add-cf-token.png) Now switch to the variables tab and create the following variables: @@ -30,12 +30,12 @@ Example variables: - `R2EXPLORER_DOMAIN => my-domain.com` -![add variables](/assets/github-action/add-variables.png) +![add variables](../assets/github-action/add-variables.png) Now go to the github repository and click Actions -> I understand my workflows, go ahead and enable them. -![enable actions](/assets/github-action/enable-actions.png) +![enable actions](../assets/github-action/enable-actions.png) After enabling actions, go ahead and trigger a new deploy, you can use this flow at any time to re-deploy @@ -43,7 +43,7 @@ your application. Click Actions -> Deploy -> Run workflow -> Run workflow. -![trigger update](/assets/github-action/trigger-update.png) +![trigger update](../assets/github-action/trigger-update.png) ## 2nd Method (create-cloudflare) @@ -65,5 +65,5 @@ This command with automatically create the project files locally and install all ## 3rd Method (manual template) -If you prefer to do the things yourself, there is a project template available on +If you prefer to do the things yourself, there is a project template available on [github here](https://github.com/G4brym/R2-Explorer/tree/main/template), that you can use. diff --git a/docs/pages/getting-started/deploying.md b/packages/docs/pages/getting-started/deploying.md similarity index 100% rename from docs/pages/getting-started/deploying.md rename to packages/docs/pages/getting-started/deploying.md diff --git a/docs/pages/getting-started/security.md b/packages/docs/pages/getting-started/security.md similarity index 94% rename from docs/pages/getting-started/security.md rename to packages/docs/pages/getting-started/security.md index eacadb6..3859760 100644 --- a/docs/pages/getting-started/security.md +++ b/packages/docs/pages/getting-started/security.md @@ -13,7 +13,7 @@ export default R2Explorer({ readonly: false, basicAuth: [{ },{ username: 'anotherUser', password: '123567' - }] + }] }); ``` @@ -46,7 +46,7 @@ You can find the team name, in the Zero trust dashboard -> Settings -> Custom Pa In my account the team name is `r2explorer`. -![Cloudflare Zero Trust Dashboard](/assets/cloudflare-access.png) +![Cloudflare Zero Trust Dashboard](../assets/cloudflare-access.png) --- diff --git a/docs/pages/getting-started/updating-your-project.md b/packages/docs/pages/getting-started/updating-your-project.md similarity index 82% rename from docs/pages/getting-started/updating-your-project.md rename to packages/docs/pages/getting-started/updating-your-project.md index bc6eb8c..1468b6d 100644 --- a/docs/pages/getting-started/updating-your-project.md +++ b/packages/docs/pages/getting-started/updating-your-project.md @@ -1,7 +1,7 @@ R2 Explorer receives updates regularly, you will be prompted to update your application inside your instance, in the bottom left connor, like this: -![Update available](/assets/update-available.png) +![Update available](../assets/update-available.png) ## Manual update @@ -18,10 +18,10 @@ wrangler deploy ## Update using github actions -You can check if your workers needs to update in fork github repository, by looking into the commits behind +You can check if your workers needs to update in fork github repository, by looking into the commits behind section. -To start the update, just click sync fork and then click update branch. +To start the update, just click sync fork and then click update branch. This will update your fork and trigger an automatic deploy to update your Cloudflare worker. @@ -30,5 +30,5 @@ This will update your fork and trigger an automatic deploy to update your Cloudf Update using github actions, **requires** you to setup your instance following this [tutorial here](./creating-a-new-project.md). -![update](/assets/github-action/update-available.png) +![update](../assets/github-action/update-available.png) diff --git a/docs/pages/guides/migrating-to-1.0.md b/packages/docs/pages/guides/migrating-to-1.0.md similarity index 100% rename from docs/pages/guides/migrating-to-1.0.md rename to packages/docs/pages/guides/migrating-to-1.0.md diff --git a/docs/pages/guides/migrating-to-1.1.md b/packages/docs/pages/guides/migrating-to-1.1.md similarity index 100% rename from docs/pages/guides/migrating-to-1.1.md rename to packages/docs/pages/guides/migrating-to-1.1.md diff --git a/docs/pages/guides/setup-email-explorer.md b/packages/docs/pages/guides/setup-email-explorer.md similarity index 80% rename from docs/pages/guides/setup-email-explorer.md rename to packages/docs/pages/guides/setup-email-explorer.md index 18d883d..3dcb102 100644 --- a/docs/pages/guides/setup-email-explorer.md +++ b/packages/docs/pages/guides/setup-email-explorer.md @@ -3,7 +3,7 @@ Email Explorer is a feature, that allows you and your team to see and open email received using [Cloudflare Email routing](https://www.cloudflare.com/developer-platform/email-routing/). -![Email routing screenshot](/assets/setup-email-routing-4.png) +![Email routing screenshot](../assets/setup-email-routing-4.png) It works by catching the emails you configure to send to your R2 Explorer instance, saving theses in a R2 bucket and then exposing a UI built around the R2 API. @@ -34,11 +34,11 @@ the domain you want to setup. Open the Email -> Email Routing -![open email routing tab](/assets/setup-email-routing-3.png) +![open email routing tab](../assets/setup-email-routing-3.png) Then click Routes and in the bottom select Edit in the Catch-all address. -![edit routing](/assets/setup-email-routing.png) +![edit routing](../assets/setup-email-routing.png) !!! note @@ -47,12 +47,12 @@ Then click Routes and in the bottom select Edit in the Catch-all address. Finally click Send to a Worker, pick your R2 Explorer instance and click save. -![edit routing](/assets/setup-email-routing-2.png) +![edit routing](../assets/setup-email-routing-2.png) Congratulations! you will now be able to see all the emails you receive inside your R2 Explorer instance. -By default your emails will end up in the 1º bucket you have, but you can overwrite it, read more -[here](/getting-started/configuration/#configuring-email-explorer-target-bucket). +By default your emails will end up in the 1º bucket you have, but you can overwrite it, read more +[here](../getting-started/configuration.md#configuring-email-explorer-target-bucket). diff --git a/docs/pages/index.md b/packages/docs/pages/index.md similarity index 79% rename from docs/pages/index.md rename to packages/docs/pages/index.md index 0d7d684..55f528f 100644 --- a/docs/pages/index.md +++ b/packages/docs/pages/index.md @@ -4,9 +4,11 @@ hide: # - toc --- +# R2 Explorer + @@ -44,20 +46,23 @@ Read this in other languages: [Español](https://r2explorer-dev.translate.goog/? - Self-hosted/Deployed on your own Cloudflare Account - [Receive and read emails](https://r2explorer.dev/guides/setup-email-explorer/) (via Cloudflare Email Routing) -- Security: - - [Basic Auth](https://r2explorer.dev/getting-started/security/#basic-auth) - - [Cloudflare Access](https://r2explorer.dev/getting-started/security/#authenticating-with-cloudflare-access) -- Managing files: - - In-browser File preview (pdf, image, txt, markdown, csv, logpush...) - - In-browser File editing - - Drag-and-Drop upload - - Upload files or folders with files - - Multipart upload for big files - - HTTP/Custom metadata edit -- Organization: - - Create folders - - Upload/Rename/Download/Delete files - - Right click in file for extra options + +##### Security: +- [Basic Auth](https://r2explorer.dev/getting-started/security/#basic-auth) +- [Cloudflare Access](https://r2explorer.dev/getting-started/security/#authenticating-with-cloudflare-access) + +##### Managing files: +- In-browser File preview (pdf, image, txt, markdown, csv, logpush...) +- In-browser File editing +- Drag-and-Drop upload +- Upload files or folders with files +- Multipart upload for big files +- HTTP/Custom metadata edit + +##### Organization: +- Create folders +- Upload/Rename/Download/Delete files +- Right click in file for extra options ## Installation diff --git a/packages/docs/requirements.txt b/packages/docs/requirements.txt new file mode 100644 index 0000000..68bf498 --- /dev/null +++ b/packages/docs/requirements.txt @@ -0,0 +1 @@ +mkdocs-material==9.5.49