From ea096aa32aadbccecc7585740a594ebc716e9902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Gr=C3=BCneberg?= Date: Tue, 11 Feb 2025 16:06:34 +0800 Subject: [PATCH] formatting --- .../content/guides/platform/cost-control.mdx | 13 +++- .../platform/get-set-up-for-billing.mdx | 5 +- .../guides/platform/manage-your-usage.mdx | 9 --- .../content/guides/self-hosting/docker.mdx | 63 ++++++++++--------- 4 files changed, 47 insertions(+), 43 deletions(-) diff --git a/apps/docs/content/guides/platform/cost-control.mdx b/apps/docs/content/guides/platform/cost-control.mdx index 10a1a26bb66..7ccc3a9498f 100644 --- a/apps/docs/content/guides/platform/cost-control.mdx +++ b/apps/docs/content/guides/platform/cost-control.mdx @@ -4,11 +4,13 @@ title: 'Control your costs' --- ## Spend Cap + The Spend Cap determines whether your organization can exceed your subscription plan's quota for any usage item. Scenarios that could lead to high usage—and thus high costs—include system attacks or bugs in your software. The Spend Cap can protect you from these unexpected costs for certain usage items. This feature is available only with the Pro Plan. However, you will not be charged while using the Free Plan. ### What happens when the Spend Cap is on? + After exceeding the quota for a usage item, further usage of that item is disallowed until the next billing cycle. You don't get charged for over-usage but your services will be restricted according to our [Fair Use Policy](/docs/guides/platform/billing-faq#fair-use-policy) if you consistently exceed the quota. @@ -16,13 +18,16 @@ After exceeding the quota for a usage item, further usage of that item is disall ### What happens when the Spend Cap is off? + Your projects will continue to operate after exceeding the quota for a usage item. Any additional usage will be charged based on the item's cost per unit, as outlined on the [pricing page](https://supabase.com/pricing). - When the Spend Cap is off, we recommend monitoring your usage and costs on the [organization's usage page](https://supabase.com/dashboard/org/_/usage). + When the Spend Cap is off, we recommend monitoring your usage and costs on the [organization's + usage page](https://supabase.com/dashboard/org/_/usage). ### Usage items covered by the Spend Cap + - [Disk Size](/docs/guides/platform/manage-your-usage/disk-size) - [Egress](/docs/guides/platform/manage-your-usage/egress) - [Edge Function Invocations](/docs/guides/platform/manage-your-usage/edge-function-invocations) @@ -35,6 +40,7 @@ Your projects will continue to operate after exceeding the quota for a usage ite - [Storage Size](/docs/guides/platform/manage-your-usage/storage-size) ### Usage items not covered by the Spend Cap + Usage items that are predictable and explicitly opted into by the user are excluded. - [Compute](/docs/guides/platform/manage-your-usage/compute) @@ -50,10 +56,13 @@ Usage items that are predictable and explicitly opted into by the user are exclu - [Point-in-Time-Recovery](/docs/guides/platform/manage-your-usage/point-in-time-recovery) ### What the Spend Cap is not + The Spend Cap doesn't allow for fine-grained cost control, such as setting budgets for specific usage item or receiving notifications when certain costs are reached. We plan to make cost control more flexible in the future. ### Configure the Spend Cap + You can configure the Spend Cap when creating an organization on the Pro Plan or at any time in the Cost Control section of the [organization's billing page](https://supabase.com/dashboard/org/_/billing). ## Keep track of your usage and costs -You can monitor your usage on the [organization's usage page](https://supabase.com/dashboard/org/_/usage). The Billing Breakdown section of the [organization's billing page](https://supabase.com/dashboard/org/_/billing) shows your current spending and provides an estimate of your total costs for the billing cycle based on your usage. \ No newline at end of file + +You can monitor your usage on the [organization's usage page](https://supabase.com/dashboard/org/_/usage). The Billing Breakdown section of the [organization's billing page](https://supabase.com/dashboard/org/_/billing) shows your current spending and provides an estimate of your total costs for the billing cycle based on your usage. diff --git a/apps/docs/content/guides/platform/get-set-up-for-billing.mdx b/apps/docs/content/guides/platform/get-set-up-for-billing.mdx index 827107eef6c..368d757f723 100644 --- a/apps/docs/content/guides/platform/get-set-up-for-billing.mdx +++ b/apps/docs/content/guides/platform/get-set-up-for-billing.mdx @@ -8,6 +8,7 @@ Correct billing settings are essential for ensuring successful payment processin ## Payments ### Ensuring valid credit card details + Paid plans require a credit card to be on file. Ensure the correct credit card is set as active and - has not expired @@ -17,6 +18,7 @@ Paid plans require a credit card to be on file. Ensure the correct credit card i For more information on managing payment methods, see [Manage your payment methods](/docs/guides/platform/manage-your-subscription#manage-your-payment-methods). ### Alternatives to monthly charges + Instead of having your credit card charged every month, you can make an upfront payment by topping up your credit balance. You may want to consider this option to avoid issues with recurring payments, gain more control over how often your credit card is charged, and potentially make things easier for your accounting department. @@ -24,8 +26,7 @@ You may want to consider this option to avoid issues with recurring payments, ga For more information on credits and credit top-ups, see the [Credits page](/docs/guides/platform/credits). ## Billing details + Billing details cannot be changed once an invoice is issued, so it's crucial to configure them correctly from the start. You can update your billing email address, billing address and tax ID on the [organization's billing page](https://supabase.com/dashboard/org/_/billing). - - diff --git a/apps/docs/content/guides/platform/manage-your-usage.mdx b/apps/docs/content/guides/platform/manage-your-usage.mdx index f8fef9e5167..dbf24c12944 100644 --- a/apps/docs/content/guides/platform/manage-your-usage.mdx +++ b/apps/docs/content/guides/platform/manage-your-usage.mdx @@ -24,12 +24,3 @@ Each subpage breaks down a specific usage item and details what you're charged f - [MFA Phone](/docs/guides/platform/manage-your-usage/advanced-mfa-phone) - [Read Replicas](/docs/guides/platform/manage-your-usage/read-replicas) - [Branching](/docs/guides/platform/manage-your-usage/branching) - - - - - - - - - diff --git a/apps/docs/content/guides/self-hosting/docker.mdx b/apps/docs/content/guides/self-hosting/docker.mdx index 02fdc8487e9..42dd4eb8a03 100644 --- a/apps/docs/content/guides/self-hosting/docker.mdx +++ b/apps/docs/content/guides/self-hosting/docker.mdx @@ -1,13 +1,14 @@ --- -title: "Self-Hosting with Docker" -description: "Learn how to configure and deploy Supabase with Docker." -subtitle: "Learn how to configure and deploy Supabase with Docker." -tocVideo: "FqiQKRKsfZE" +title: 'Self-Hosting with Docker' +description: 'Learn how to configure and deploy Supabase with Docker.' +subtitle: 'Learn how to configure and deploy Supabase with Docker.' +tocVideo: 'FqiQKRKsfZE' --- Docker is the easiest way to get started with self-hosted Supabase. It should only take you a few minutes to get up and running. This guide assumes you are running the command from the machine you intend to host from. ## Contents + 1. [Before you begin](#before-you-begin) 2. [Installing and running Supabase](#installing-and-running-supabase) 3. [Accessing your services](#accessing-supabase-studio) @@ -142,12 +143,14 @@ The default tenant ID is `your-tenant-id`, and the default password is `your-sup By default, the database is not accessible from outside the local machine but the pooler is. You can [change this](#exposing-your-postgres-database) by updating the `docker-compose.yml` file. ## Updating your services + For security reasons, we "pin" the versions of each service in the docker-compose file (these versions are updated ~monthly). If you want to update any services immediately, you can do so by updating the version number in the docker compose file and then running `docker compose pull`. You can find all the latest docker images in the [Supabase Docker Hub](https://hub.docker.com/u/supabase). You should update your services frequently to get the latest features and bug fixes and security patches. Note that you will need to restart the services to pick up the changes, which will result in some downtime for your services. **Example** You'll want to update the Studio(Dashboard) frequently to get the latest features and bug fixes. To update the Dashboard: + 1. Visit the [supabase/studio](https://hub.docker.com/r/supabase/studio/tags) image in the [Supabase Docker Hub](https://hub.docker.com/u/supabase) 2. Find the latest version (tag) number. It will look something like `20241029-46e1e40` 3. Update the `image` field in the `docker-compose.yml` file to the new version. It should look like this: `image: supabase/studio:20241028-a265374` @@ -158,6 +161,7 @@ You'll want to update the Studio(Dashboard) frequently to get the latest feature While we provided you with some example secrets for getting started, you should NEVER deploy your Supabase setup using the defaults we have provided. Please follow all of the steps in this section to ensure you have a secure setup, and then [restart all services](#restarting-all-services) to pick up the changes. ### Generate API keys + We need to generate secure keys for accessing your services. We'll use the `JWT Secret` to generate `anon` and `service` API keys using the form below. 1. **Obtain a Secret**: Use the 40-character secret provided, or create your own. If creating, ensure it's a strong, random string of 40 characters. @@ -170,8 +174,8 @@ We need to generate secure keys for accessing your services. We'll use the `JWT Run this form twice to generate new `anon` and `service` API keys. Replace the values in the `./docker/.env` file: - - `ANON_KEY` - replace with an `anon` key - - `SERVICE_ROLE_KEY` - replace with a `service` key +- `ANON_KEY` - replace with an `anon` key +- `SERVICE_ROLE_KEY` - replace with a `service` key You will need to [restart](#restarting-all-services) the services for the changes to take effect. @@ -191,19 +195,20 @@ You will need to [restart](#restarting-all-services) the services for the change The Dashboard is protected with basic authentication. The default user and password MUST be updated before using Supabase in production. Update the following values in the `./docker/.env` file: - - `DASHBOARD_USERNAME`: The default username for the Dashboard - - `DASHBOARD_PASSWORD`: The default password for the Dashboard + +- `DASHBOARD_USERNAME`: The default username for the Dashboard +- `DASHBOARD_PASSWORD`: The default password for the Dashboard You can also add more credentials for multiple users in `./docker/volumes/api/kong.yml`. For example: ```yaml docker/volumes/api/kong.yml basicauth_credentials: -- consumer: DASHBOARD - username: user_one - password: password_one -- consumer: DASHBOARD - username: user_two - password: password_two + - consumer: DASHBOARD + username: user_one + password: password_one + - consumer: DASHBOARD + username: user_two + password: password_two ``` You will need to [restart](#restarting-all-services) the services for the changes to take effect. @@ -297,23 +302,22 @@ Each system has a number of configuration options which can be found in the rele - [Kong](https://docs.konghq.com/gateway/latest/install/docker/) - [Supavisor](https://supabase.github.io/supavisor/development/docs/) - These configuration items are generally added to the `env` section of each service, inside the `docker-compose.yml` section. If these configuration items are sensitive, they should be stored in a [secret manager](/docs/guides/self-hosting#managing-your-secrets) or using an `.env` file and then referenced using the `${}` syntax. - +These configuration items are generally added to the `env` section of each service, inside the `docker-compose.yml` section. If these configuration items are sensitive, they should be stored in a [secret manager](/docs/guides/self-hosting#managing-your-secrets) or using an `.env` file and then referenced using the `${}` syntax. - ```yml docker-compose.yml +```yml docker-compose.yml services: rest: image: postgrest/postgrest environment: PGRST_JWT_SECRET: ${JWT_SECRET} - ``` +``` - ```bash .env - ## Never check your secrets into version control +```bash .env +## Never check your secrets into version control `${JWT_SECRET}` - ``` +``` @@ -341,11 +345,10 @@ We recommend using [AWS SES](https://aws.amazon.com/ses/). It's extremely cheap By default all files are stored locally on the server. You can configure the Storage service to use S3 by updating the following environment variables: ```yaml docker-compose.yml - storage: - environment: - STORAGE_BACKEND=s3 - GLOBAL_S3_BUCKET=name-of-your-s3-bucket - REGION=region-of-your-s3-bucket +storage: + environment: STORAGE_BACKEND=s3 + GLOBAL_S3_BUCKET=name-of-your-s3-bucket + REGION=region-of-your-s3-bucket ``` You can find all the available options in the [storage repository](https://github.com/supabase/storage-api/blob/master/.env.sample). Restart the `storage` service to pick up the changes: `docker compose restart storage --no-deps` @@ -390,9 +393,9 @@ If you need direct access to the Postgres database without going through Supavis # supavisor: # ports: # ... - db: - ports: - - ${POSTGRES_PORT}:${POSTGRES_PORT} +db: + ports: + - ${POSTGRES_PORT}:${POSTGRES_PORT} ``` This is less-secure, so please make sure you are running a firewall in front of your server. @@ -415,7 +418,6 @@ All data in analytics will be deleted when you run the commands below. - ```sh ### Destroy analytics to transition to postgres self hosted solution without other data loss @@ -443,6 +445,7 @@ A minimal setup working on Ubuntu, hosted on DigitalOcean. ### Demo using DigitalOcean + 1. A DigitalOcean Droplet with 1 GB memory and 25 GB solid-state drive (SSD) is sufficient to start 2. To access the Dashboard, use the ipv4 IP address of your Droplet. 3. If you're unable to access Dashboard, run `docker compose ps` to see if the Studio service is running and healthy.