From 4bb98225d83594e5417ae8d5ba5d355bd02dd60f Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Wed, 10 Jan 2024 15:10:21 -0500 Subject: [PATCH] docs: remove Heroku integration --- docs/explanations/nginx.rst | 2 +- docs/integrations/heroku.rst | 122 ----------------------------------- postgrest.dict | 3 - 3 files changed, 1 insertion(+), 126 deletions(-) delete mode 100644 docs/integrations/heroku.rst diff --git a/docs/explanations/nginx.rst b/docs/explanations/nginx.rst index ccbdebc47..7867b8855 100644 --- a/docs/explanations/nginx.rst +++ b/docs/explanations/nginx.rst @@ -42,7 +42,7 @@ The first step is to create an Nginx configuration file that proxies requests to HTTPS ----- -PostgREST aims to do one thing well: add an HTTP interface to a PostgreSQL database. To keep the code small and focused we do not implement HTTPS. Use a reverse proxy such as NGINX to add this, `here's how `_. Note that some Platforms as a Service like Heroku also add SSL automatically in their load balancer. +PostgREST aims to do one thing well: add an HTTP interface to a PostgreSQL database. To keep the code small and focused we do not implement HTTPS. Use a reverse proxy such as NGINX to add this, `here's how `_. Rate Limiting ------------- diff --git a/docs/integrations/heroku.rst b/docs/integrations/heroku.rst deleted file mode 100644 index 614950c1d..000000000 --- a/docs/integrations/heroku.rst +++ /dev/null @@ -1,122 +0,0 @@ -.. _deploy_heroku: - -Heroku -====== - -1. Log into Heroku using the `Heroku CLI `_: - - .. code-block:: bash - - # If you have multiple Heroku accounts, use flag '--interactive' to switch between them - heroku login --interactive - - -2. Create a new Heroku app using the PostgREST buildpack: - - .. code-block:: bash - - mkdir ${YOUR_APP_NAME} - cd ${YOUR_APP_NAME} - git init . - - heroku apps:create ${YOUR_APP_NAME} --buildpack https://github.com/PostgREST/postgrest-heroku.git - heroku git:remote -a ${YOUR_APP_NAME} - -3. Create a new Heroku PostgreSQL add-on attached to the app and keep notes of the assigned add-on name (e.g. :code:`postgresql-curly-58902`) referred later as ${HEROKU_PG_DB_NAME} - - .. code-block:: bash - - heroku addons:create heroku-postgresql:standard-0 -a ${YOUR_APP_NAME} - # wait until the add-on is available - heroku pg:wait -a ${YOUR_APP_NAME} - -4. Create the necessary user roles according to the - `PostgREST documentation `_: - - .. code-block:: bash - - heroku pg:credentials:create --name api_user -a ${YOUR_APP_NAME} - # use the following command to ensure the new credential state is active before attaching it - heroku pg:credentials -a ${YOUR_APP_NAME} - - heroku addons:attach ${HEROKU_PG_DB_NAME} --credential api_user -a ${YOUR_APP_NAME} - -5. Connect to the PostgreSQL database and create some sample data: - - .. code-block:: bash - - heroku psql -a ${YOUR_APP_NAME} - - .. code-block:: postgres - - # from the psql command prompt execute the following commands: - create schema api; - - create table api.todos ( - id serial primary key, - done boolean not null default false, - task text not null, - due timestamptz - ); - - insert into api.todos (task) values - ('finish tutorial 0'), ('pat self on back'); - - grant usage on schema api to api_user; - grant select on api.todos to api_user; - -6. Create the :code:`Procfile`: - - .. code-block:: bash - - web: PGRST_SERVER_HOST=0.0.0.0 PGRST_SERVER_PORT=${PORT} PGRST_DB_URI=${PGRST_DB_URI:-${DATABASE_URL}} ./postgrest-${POSTGREST_VER} - .. - - Set the following environment variables on Heroku: - - .. code-block:: bash - - heroku config:set POSTGREST_VER=10.0.0 - heroku config:set PGRST_DB_SCHEMA=api - heroku config:set PGRST_DB_ANON_ROLE=api_user - .. - - PGRST_DB_URI can be set if an external database is used or if it's different from the default Heroku DATABASE_URL. This latter is used if nothing is provided. - POSTGREST_VER is mandatory to select and build the required PostgREST release. - - See https://postgrest.org/en/stable/configuration.html#environment-variables for the full list of environment variables. - -7. Build and deploy your app: - - .. code-block:: bash - - git add Procfile - git commit -m "PostgREST on Heroku" - git push heroku master - .. - - Your Heroku app should be live at :code:`${YOUR_APP_NAME}.herokuapp.com` - -8. Test your app - - From a terminal display the application logs: - - .. code-block:: bash - - heroku logs -t - .. - - From a different terminal retrieve with curl the records previously created: - - .. code-block:: bash - - curl https://${YOUR_APP_NAME}.herokuapp.com/todos - .. - - and test that any attempt to modify the table via a read-only user is not allowed: - - .. code-block:: bash - - curl https://${YOUR_APP_NAME}.herokuapp.com/todos -X POST \ - -H "Content-Type: application/json" \ - -d '{"task": "do bad thing"}' diff --git a/postgrest.dict b/postgrest.dict index 5b7ea3f0f..30679bfca 100644 --- a/postgrest.dict +++ b/postgrest.dict @@ -8,9 +8,7 @@ Auth auth authenticator backoff -balancer booleans -buildpack BOM Bytea Cardano @@ -47,7 +45,6 @@ Greenplum gte GUC Haskell -Heroku HMAC htmx Htmx