The minimalistic document archiving platform.
feat(docs): update dark theme colors and refined docs (#157)
Corentin Thomasset6f5ea9f9de65
diff --git a/apps/docs/src/assets/app.css b/apps/docs/src/assets/app.cssindex 53fc4099..09c72597 100644--- a/apps/docs/src/assets/app.css+++ b/apps/docs/src/assets/app.css@@ -1,10 +1,16 @@:root[data-theme='dark'] {- --sl-color-text-accent: #d9fe7a;- --sl-color-accent-high: #d9fe7a!important;+ --background-color: #050505!important;+ --accent-color: #fff!important;+ --foreground-color: #f6f6f6!important;- --sl-color-bg: #141414!important;- --sl-rapide-ui-header-bg-color: #141414!important;- --sl-color-bg-sidebar: #141414!important;+ --sl-color-text: var(--foreground-color)!important;++ --sl-color-text-accent: var(--accent-color)!important;+ --sl-color-accent-high: var(--accent-color)!important;++ --sl-color-bg: var(--background-color)!important;+ --sl-rapide-ui-header-bg-color: var(--background-color)!important;+ --sl-color-bg-sidebar: var(--background-color)!important;}.site-title {@@ -12,6 +18,11 @@gap: 0.5rem !important;}+:root[data-theme='dark'] .site-title {+ color:#fff !important;+}++.site-title img {width: 1.8rem !important;}\ No newline at end of filediff --git a/apps/docs/src/assets/logo-dark.svg b/apps/docs/src/assets/logo-dark.svgindex e4a1d323..ed58d053 100644--- a/apps/docs/src/assets/logo-dark.svg+++ b/apps/docs/src/assets/logo-dark.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><g fill="none" stroke="#d9fe7a" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2zM9 9h1m-1 4h6m-6 4h6"/></g></svg>\ No newline at end of file+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><g fill="none" stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M14 3v4a1 1 0 0 0 1 1h4"/><path d="M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2zM9 9h1m-1 4h6m-6 4h6"/></g></svg>\ No newline at end of filediff --git a/apps/docs/src/assets/owlrelay-api-keys.png b/apps/docs/src/assets/owlrelay-api-keys.pngnew file mode 100644index 00000000..6655e81dBinary files /dev/null and b/apps/docs/src/assets/owlrelay-api-keys.png differdiff --git a/apps/docs/src/assets/owlrelay-intake-email.png b/apps/docs/src/assets/owlrelay-intake-email.pngnew file mode 100644index 00000000..11bdd4f9Binary files /dev/null and b/apps/docs/src/assets/owlrelay-intake-email.png differdiff --git a/apps/docs/src/content/docs/02-self-hosting/01-using-docker.md b/apps/docs/src/content/docs/02-self-hosting/01-using-docker.mdindex cc18a0ae..ce03620f 100644--- a/apps/docs/src/content/docs/02-self-hosting/01-using-docker.md+++ b/apps/docs/src/content/docs/02-self-hosting/01-using-docker.md@@ -6,9 +6,20 @@ slug: self-hosting/using-dockerPapra can be easily installed and run using Docker. This method is recommended for users who want a quick and straightforward way to deploy their own instance of Papra with minimal setup.+- Single lightweight image+- Only one container to manage+- Available for all platforms (arm64, arm/v7, x86_64)+- Root and Rootless image variants+## Prerequisites-Before you begin, ensure that you have Docker installed on your system. You can download and install Docker from the official Docker website.+Before you begin, ensure that you have Docker installed on your system. You can download and install Docker from the official [Docker website](https://www.docker.com/get-started).++Verify your installation:++```bash frame="none"+docker --version+```## Root and Rootless installationdiff --git a/apps/docs/src/content/docs/02-self-hosting/02-using-docker-compose.md b/apps/docs/src/content/docs/02-self-hosting/02-using-docker-compose.mddeleted file mode 100644index dd87a11c..00000000--- a/apps/docs/src/content/docs/02-self-hosting/02-using-docker-compose.md+++ /dev/null@@ -1,6 +0,0 @@-----title: Using Docker Compose-slug: self-hosting/using-docker-compose------Coming soon.diff --git a/apps/docs/src/content/docs/02-self-hosting/02-using-docker-compose.mdx b/apps/docs/src/content/docs/02-self-hosting/02-using-docker-compose.mdxnew file mode 100644index 00000000..bf3662ca--- /dev/null+++ b/apps/docs/src/content/docs/02-self-hosting/02-using-docker-compose.mdx@@ -0,0 +1,88 @@+---+title: Using Docker Compose+slug: self-hosting/using-docker-compose+---++import { Steps } from '@astrojs/starlight/components';++Docker Compose makes it easy to deploy Papra on your server or local machine. Follow these simple steps to get your instance up and running quickly.++<Steps>++1. Prepare your environment++ Make sure you have [Docker](https://www.docker.com/get-started) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your system.++ Verify your installation:++ ```bash frame="none"+ docker --version+ ```++2. Create Docker Compose file++ Create a file named `docker-compose.yml` with the following content:++ ```yaml+ services:+ papra:+ image: corentinth/papra:latest-rootless+ ports:+ - '1221:1221'+ volumes:+ - papra-data:/app/app-data+ restart: unless-stopped++ volumes:+ papra-data:+ driver: local+ ```++3. Start Papra++ From the directory containing your `docker-compose.yml` file, run:++ ```bash+ docker compose up -d+ ```++ This command downloads the latest Papra image, sets up the container, and starts the Papra service.++4. Access Papra++ Once your container is running, access Papra via your browser at:++ ```+ http://localhost:1221+ ```++ Your Papra instance is now ready for use!++5. To go further++ Check the [configuration](/self-hosting/configuration) page for more information on how to configure your Papra instance.++</Steps>++## Maintenance++Check logs++```bash+docker compose logs -f+```++Stop the service++```bash+docker compose down+```++Update Papra++```bash+docker compose pull+docker compose up -d+```++You're all set! Enjoy managing your documents with Papra.diff --git a/apps/docs/src/content/docs/03-guides/01-intake-emails-with-owlrelay.mdx b/apps/docs/src/content/docs/03-guides/01-intake-emails-with-owlrelay.mdxnew file mode 100644index 00000000..df17e582--- /dev/null+++ b/apps/docs/src/content/docs/03-guides/01-intake-emails-with-owlrelay.mdx@@ -0,0 +1,76 @@+---+title: Setup Intake Emails with OwlRelay+description: Step-by-step guide to setup OwlRelay to receive emails in your Papra instance.+slug: guides/intake-emails-with-owlrelay+---++import { Aside } from '@astrojs/starlight/components';+import { Steps } from '@astrojs/starlight/components';++This guide will show you how to setup Papra to receive emails using [OwlRelay](https://owlrelay.email).++[OwlRelay](https://owlrelay.email) is an open-source agnostic email-to-http service developed by the Papra team. It's a free service that allows you to receive emails and forward them to your self-hosted Papra instance.+++## Prerequisites++In order to follow this guide, your Papra instance needs to be running and accessible from the internet.++## How it works++By integrating Papra with OwlRelay, your instance will generate email addresses on OwlRelay through it's API (specifying a webhook on your Papra instance). And OwlRelay will forward the emails to your Papra instance through a webhook.++++++## Setup+<Steps>++1. **Create an account on OwlRelay**++ Go to [owlrelay.email](https://owlrelay.email) and create an account.++2. **Create an OwlRelay API key**++ Once you have created your account, you can create an API key by going to the [API keys page](https://app.owlrelay.email/api-keys).++ ++3. **Configure your Papra instance**++ Once you have created your API key, you can configure your Papra instance to receive emails by setting the `OWLRELAY_API_KEY` and `OWLRELAY_WEBHOOK_SECRET` environment variables.++ ```bash+ # Enable intake emails+ INTAKE_EMAILS_IS_ENABLED=true++ # Tell your Papra instance to use OwlRelay+ INTAKE_EMAILS_DRIVER=owlrelay++ # This is your OwlRelay API key+ OWLRELAY_API_KEY=owrl_*****++ # Set a random key that will be transmitted to OwlRelay to sign the requests,+ # this is to authenticate that the emails are coming from OwlRelay+ INTAKE_EMAILS_WEBHOOK_SECRET=a-random-key++ # Optional: This is the URL that OwlRelay will send the emails to,+ # if not provided, the webhook will be inferred from the server URL.+ # Can be relevant if you have multiple urls pointing to your Papra instance+ # or when using tunnel services+ OWLRELAY_WEBHOOK_URL=https://your-instance.com/api/intake-emails/owlrelay+ ```++4. **That's it!**++ You can now generate intake emails in your Papra instance and send emails with attachments to the email address generated.++</Steps>++## Troubleshooting++If you encounter any issues, you can:+- Check the logs of your Papra instance to see if there are any errors.+- Connect to your OwlRelay account to see if the emails address are generated and emails are received.+diff --git a/apps/docs/src/content/docs/03-guides/01-intake-emails.mdx b/apps/docs/src/content/docs/03-guides/02-intake-emails-with-cf-email-worker.mdxsimilarity index 77%rename from apps/docs/src/content/docs/03-guides/01-intake-emails.mdxrename to apps/docs/src/content/docs/03-guides/02-intake-emails-with-cf-email-worker.mdxindex 7051dad3..2427d0ff 100644--- a/apps/docs/src/content/docs/03-guides/01-intake-emails.mdx+++ b/apps/docs/src/content/docs/03-guides/02-intake-emails-with-cf-email-worker.mdx@@ -1,5 +1,5 @@----title: Setup Papra to receive emails+title: Setup Intake Emails with CF Email Workersdescription: Step-by-step guide to setup a Cloudflare Email worker to receive emails in your Papra instance.slug: guides/intake-emails-with-cloudflare-email-workers---@@ -10,12 +10,20 @@ import { Steps } from '@astrojs/starlight/components';This guide will show you how to setup a Cloudflare Email worker to receive emails in your Papra instance.<Aside type="note">- Currently, only [Cloudflare Email Workers](https://developers.cloudflare.com/email-routing/email-workers/) are officially supported to handle email-to-http. More solutions may be added in the future.+ Setting up a Papra Intake Emails with a Cloudflare Email worker requires bit of knowledge about how to setup a CF Email worker and how to configure your Papra instance to receive emails.++ For a simpler solution, you can use the official [OwlRelay integration](/docs/guides/intake-emails-with-papra-email-intake) guide.</Aside>## Prerequisites-In order to follow this guide, you need to have a Cloudflare account with a domain and a publicly accessible Papra instance.+In order to follow this guide, you need:+- a [Cloudflare](https://www.cloudflare.com/) account+- a custom domain name available on Cloudflare+- a publicly accessible Papra instance+- basic development skills (git and node.js to setup the Email Worker)++If you prefer a simpler solution, you can use the official [OwlRelay integration](/docs/guides/intake-emails-with-papra-email-intake) guide.## How it works@@ -72,9 +80,23 @@ The code for the Email Worker proxy is available in the [papra-hq/email-proxy](h3. **Configure your Papra instance**In your Papra instance, add the following environment variables:- - `INTAKE_EMAILS_IS_ENABLED`: Set to `true` to enable the email intake feature.- - `INTAKE_EMAILS_EMAIL_GENERATION_DOMAIN`: The domain from which the intake email will be generated (eg. `domain.com`).- - `INTAKE_EMAILS_WEBHOOK_SECRET`: The secret key to authenticate the webhook requests, set the same as the `WEBHOOK_SECRET` environment variable in the Email Worker.++ ```bash+ # Enable intake emails+ INTAKE_EMAILS_IS_ENABLED=true++ # Tell your Papra instance that it can generate any email address from the+ # domain you setup in the Email Worker as it's a wildcard redirection+ INTAKE_EMAILS_DRIVER=random-username++ # This is the domain from which the intake email will be generated+ # eg. `domain.com`+ INTAKE_EMAILS_EMAIL_GENERATION_DOMAIN=papra.email++ # This is the secret key to authenticate the webhook requests+ # set the same as the `WEBHOOK_SECRET` variable in the Email Worker+ INTAKE_EMAILS_WEBHOOK_SECRET=a-random-key+ ```4. **Configure the Email Routing**diff --git a/apps/docs/src/content/docs/index.md b/apps/docs/src/content/docs/index.mddeleted file mode 100644index dda1e3b3..00000000--- a/apps/docs/src/content/docs/index.md+++ /dev/null@@ -1,8 +0,0 @@-----title: Papra docs-description: Papra documentation.------**WIP**: This is still a work in progress. The documentation is not yet complete.--Papra is a minimalistic document management and archiving platform. It is designed to be simple to use and accessible to everyone. Papra is a plateform for long-term document storage and management, like a digital archive for your documents.diff --git a/apps/docs/src/content/docs/index.mdx b/apps/docs/src/content/docs/index.mdxnew file mode 100644index 00000000..d7f3c8ca--- /dev/null+++ b/apps/docs/src/content/docs/index.mdx@@ -0,0 +1,60 @@+---+title: Papra documentation+description: Papra documentation.+---++import { LinkCard } from '@astrojs/starlight/components';+++Welcome to the official documentation of Papra, an intuitive open-source document management and archiving platform. It is designed to be simple to use and accessible to everyone. Papra is a plateform for long-term document storage and management, like a digital archive for your documents.++Papra can be used in two different ways:++- As a **self-hosted solution**, using the fully packaged lightweight [Docker image](/self-hosting/using-docker).+- As a **fully managed solution**, using our cloud service available on [papra.app](https://papra.app).++<div style="margin-top: 40px">+<LinkCard+title="Get started"+description="Learn how to self-host Papra using Docker."+href="/self-hosting/using-docker"+/>+</div>++## Why Papra?++In today's digital world, managing countless important documents efficiently and securely has become crucial. Papra helps you effortlessly keep track of everything from personal files to critical business records, providing peace of mind and enhancing productivity through a robust yet user-friendly system.++## Features++- **Document management**: Upload, store, and manage your documents in one place.+- **Organizations**: Create organizations to manage documents with family, friends, or colleagues.+- **Search**: Quickly search for documents with full-text search.+- **Authentication**: User accounts and authentication.+- **Dark Mode**: A dark theme for those late-night document management sessions.+- **Responsive Design**: Works on all devices, from desktops to mobile phones.+- **Open Source**: The project is open-source and free to use.+- **Self-hosting**: Host your own instance of Papra using Docker or other methods.+- **Tags**: Organize your documents with tags.+- **Email ingestion**: Send/forward emails to a generated address to automatically import documents.+- **Content extraction**: Automatically extract text from images or scanned documents for search.+- **i18n**: Support for multiple languages.+- *Coming soon:* **Tagging Rules**: Automatically tag documents based on custom rules.+- *Coming soon:* **Folder ingestion**: Automatically import documents from a folder.+- *Coming soon:* **SDK and API**: Build your own applications on top of Papra.+- *Coming soon:* **CLI**: Manage your documents from the command line.+- *Coming soon:* **Document sharing**: Share documents with others.++## Community & Open Source++Papra is proudly open-source under the [AGPL3](https://github.com/papra-hq/papra/blob/main/LICENSE) license. You can contribute to the project by reporting issues, suggesting features, or even contributing code.++++<div style="margin-top: 40px">+<LinkCard+title="Get started"+description="Learn how to self-host Papra using Docker."+href="/self-hosting/using-docker"+/>+</div>diff --git a/apps/docs/src/content/navigation.ts b/apps/docs/src/content/navigation.tsindex 8408e75b..a583037a 100644--- a/apps/docs/src/content/navigation.ts+++ b/apps/docs/src/content/navigation.ts@@ -19,7 +19,11 @@ export const sidebar: StarlightUserConfig['sidebar'] = [label: 'Guides',items: [{- label: 'Setup intake emails',+ label: 'Setup intake emails with OwlRelay',+ slug: 'guides/intake-emails-with-owlrelay',+ },+ {+ label: 'Setup intake emails with CF Email Workers',slug: 'guides/intake-emails-with-cloudflare-email-workers',},],diff --git a/apps/papra-server/src/modules/intake-emails/drivers/owlrelay/owlrelay.intake-email-driver.config.ts b/apps/papra-server/src/modules/intake-emails/drivers/owlrelay/owlrelay.intake-email-driver.config.tsindex 970c5d5c..60157cf8 100644--- a/apps/papra-server/src/modules/intake-emails/drivers/owlrelay/owlrelay.intake-email-driver.config.ts+++ b/apps/papra-server/src/modules/intake-emails/drivers/owlrelay/owlrelay.intake-email-driver.config.ts@@ -15,10 +15,4 @@ export const owlrelayIntakeEmailDriverConfig = {default: undefined,env: 'OWLRELAY_WEBHOOK_URL',},- webhookSecret: {- doc: 'The secret used to verify the webhook from OwlRelay',- schema: z.string(),- default: 'change-me',- env: 'OWLRELAY_WEBHOOK_SECRET',- },} as const satisfies ConfigDefinition;diff --git a/apps/papra-server/src/modules/intake-emails/drivers/owlrelay/owlrelay.intake-email-driver.ts b/apps/papra-server/src/modules/intake-emails/drivers/owlrelay/owlrelay.intake-email-driver.tsindex f686507c..f10c0759 100644--- a/apps/papra-server/src/modules/intake-emails/drivers/owlrelay/owlrelay.intake-email-driver.ts+++ b/apps/papra-server/src/modules/intake-emails/drivers/owlrelay/owlrelay.intake-email-driver.ts@@ -8,6 +8,7 @@ export const OWLRELAY_INTAKE_EMAIL_DRIVER_NAME = 'owlrelay';export const owlrelayIntakeEmailDriverFactory = defineIntakeEmailDriver(({ config }) => {const { baseUrl } = config.server;+ const { webhookSecret } = config.intakeEmails;const { owlrelayApiKey, webhookUrl: configuredWebhookUrl } = config.intakeEmails.drivers.owlrelay;const client = createClient({@@ -22,6 +23,7 @@ export const owlrelayIntakeEmailDriverFactory = defineIntakeEmailDriver(({ conficonst { domain, username } = await client.createEmail({username: generateHumanReadableId(),webhookUrl,+ webhookSecret,});const emailAddress = buildEmailAddress({ username, domain });diff --git a/apps/papra-server/src/modules/intake-emails/drivers/random-username/random-username.intake-email-driver.config.ts b/apps/papra-server/src/modules/intake-emails/drivers/random-username/random-username.intake-email-driver.config.tsindex 2b63bf66..877d61eb 100644--- a/apps/papra-server/src/modules/intake-emails/drivers/random-username/random-username.intake-email-driver.config.ts+++ b/apps/papra-server/src/modules/intake-emails/drivers/random-username/random-username.intake-email-driver.config.ts@@ -3,8 +3,9 @@ import { z } from 'zod';export const randomUsernameIntakeEmailDriverConfig = {domain: {- doc: 'The domain to use when generating email addresses for intake emails',+ doc: 'The domain to use when generating email addresses for intake emails when using the random username driver',schema: z.string(),default: 'papra.email',+ env: 'INTAKE_EMAILS_EMAIL_GENERATION_DOMAIN',},} as const satisfies ConfigDefinition;diff --git a/apps/papra-server/src/modules/intake-emails/intake-emails.config.ts b/apps/papra-server/src/modules/intake-emails/intake-emails.config.tsindex a2c7cf3f..9d8646ac 100644--- a/apps/papra-server/src/modules/intake-emails/intake-emails.config.ts+++ b/apps/papra-server/src/modules/intake-emails/intake-emails.config.ts@@ -17,14 +17,8 @@ export const intakeEmailsConfig = {default: 'false',env: 'INTAKE_EMAILS_IS_ENABLED',},- emailGenerationDomain: {- doc: 'The domain to use when generating email addresses for intake emails',- schema: z.string(),- default: 'papra.email',- env: 'INTAKE_EMAILS_EMAIL_GENERATION_DOMAIN',- },driver: {- doc: 'The driver to use when generating email addresses for intake emails',+ doc: `The driver to use when generating email addresses for intake emails, value can be one of: ${Object.keys(intakeEmailDrivers).map(x => `\`${x}\``).join(', ')}`,schema: z.enum(Object.keys(intakeEmailDrivers) as [string, ...string[]]),default: RANDOM_USERNAME_INTAKE_EMAIL_DRIVER_NAME,env: 'INTAKE_EMAILS_DRIVER',