-
Notifications
You must be signed in to change notification settings - Fork 59
Running PostgREST locally
Brian Peiris edited this page Jul 8, 2021
·
2 revisions
Postgrest is required to use some of the features of the Hubs admin console. Use these instructions to setup a local postgrest server against your existing local reticulum server.
- Install PostgREST (https://github.com/PostgREST/postgrest/releases)
- Create a
jwk
in aniex
session on your local reticulum,
jwk = Application.get_env(:ret, Ret.PermsToken)[:perms_key] |> JOSE.JWK.from_pem(); JOSE.JWK.to_file("/path/to/reticulum/reticulum-jwk.json", jwk)
or copy it from the hubs-ops repo:
cp <hubs-ops-repo-path>/ansible/roles/postgrest/files/jwk.json.local <reticulum-repo>/reticulum-jwk.json
- Create a PostgREST config file (
reticulum.conf
):
# reticulum.conf
db-uri = "postgres://postgres:postgres@localhost:5432/ret_dev"
db-schema = "ret0_admin"
db-anon-role = "postgres_anonymous"
jwt-secret = "@reticulum-jwk.json"
jwt-aud = "ret_perms"
role-claim-key = ".postgrest_role"
- Run PostgREST with the config file.
postgrest reticulum.conf
Your local reticulum server should now proxy PostgREST requests from the admin console to this PostgREST server.