Files
supabase/web/docs/realtime/server/digitalocean.md
T
Copple a788003648 Documentation for the new DX (#253)
## What kind of change does this PR introduce?

Updates the docs with the new developer experience: https://deploy-preview-253--supabase.netlify.app/docs

- Documents the new Auth using `gotrue-js`
- Fixes #179 
- Fixes OAuth links https://github.com/supabase/supabase/issues/241#issuecomment-705632335 
- [x] Add docs on Policies

## Additional context

Related PR on `supabase-js` https://github.com/supabase/supabase-js/pull/50

* Updates the docs for the new Auth DX.

* docs: adds docs for subscribing to rows

* Updates all the reads

* Updates all the docs with the new format

* docs: Replaces all { error, data} with data first, because I subjectively think it looks better

* Adds some of the breaking changes to a blog post

* Adds headings

* removes the blog post since it is now in notion

* Adds the Oauth changes

* removes recharts because we no longer use it

* Adds basic structure for GoTrue ref

* Adds styles for the api reference docs

* Adds more generated docs

* Downloads the files to work locally

* Adds a supabase generator

* Moves some of the guides into the "tools" folder

* Re-shuffles some of the pages around

* Generated everythign related to the Supabase Client

* Refactors and categorieses the pages

* Changes the names to be more readable

* Migrates almost all of the filters into the API reference

* Moves most of the stored procedure filters

* Adds realtime-js to the mix

* More desciptive titles

* Moves all the generated docs to the docs folder

* Moves over some of the data manipulators

* Extracts most of the client functionality to the API ref

* Adds more detail to the guides

* Removes the reference to the emulator

* Adds the supabase 1.0 blog post

* Adds a redirects for netlify

* chore: Updates packages

* Updates broken links

* Adding docs for the server

* Adds comments to gotrue and pgapi

* Adds a twitter icon to our navbar

* Updates the auth with the new user and session return values

* Updates the sponsors

* Styles for cards

* Adds a default value to all of the Tabs
2020-11-02 11:08:02 +08:00

2.1 KiB

id, title, description
id title description
digitalocean DigitalOcean Host your own Realtime server

Quick Install

You can use our droplet which is registered in the DigitalOcean Marketplace under the name Supabase Realtime.

Before we start, this droplet enables UFW that allows port 22 for SSH, port 5432 for PostgreSQL, and port 4000 for serving Supabase Realtime subscriptions. If you want to use different ports for your PostgreSQL database or Realtime, you have to configure UFW to allow those ports. Otherwise, read on!

Once the droplet is up and running, you first need to point Realtime to listen to your PostgreSQL database. First, SSH to the droplet instance, and edit /etc/realtime/realtime.env:

nano /etc/realtime/realtime.env

You'll see some environment variables you will need to set. If you are using our Supabase Postgres droplet, you simply need to set DB_HOST to the Postgres droplet's public IP, DB_PASSWORD to the password you set with \password postgres, and SECRET_KEY_BASE to a randomly generated secret which you can get by running the command below:

openssl rand -base64 48

Now you need the Realtime service to use the newly set environment variables:

systemctl daemon-reload && systemctl restart realtime

You can now disconnect from SSH. Now you should be able to visit your Realtime endpoint at http://your_realtime_droplet_ip:4000 and receive the greeting page, which means you're ready to subscribe to changes to your database with Realtime!

Build from Scratch

Make sure you have Packer installed.

Set DO_API_TOKEN to a personal access token (you can create one by following these steps):

export DO_API_TOKEN=youraccesstoken

Run Packer on do.json:

packer build do.json

Launch an instance from the image created by Packer, and follow the steps in Quick Install.