зеркало из https://github.com/mozilla/hubs-ops.git
2
Running PostgREST locally
Brian Peiris редактировал(а) эту страницу 2021-07-08 17:11:40 -04:00
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.