From 32512809696a995c8ff9a0f60a8d095c7b53ee72 Mon Sep 17 00:00:00 2001 From: Daniel Strano Date: Tue, 23 Apr 2024 10:06:08 -0400 Subject: [PATCH] Env. vars. in README --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 832db6f..0e2822e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ First, clone the repositories and initialize the submodules: $ git submodule update ``` -Install PostgreSQL and Node.js. (The Ubuntu system packages are fine, or you can install directly from the maintainer's site.) +Install PostgreSQL and Node.js. (The Ubuntu system packages are fine, or you can install directly from the maintainers' sites.) ```sh $ sudo apt install postgresql postgresql-contrib nodejs npm @@ -34,13 +34,19 @@ Restore the QA database in `metriq-postgres` as your Metriq development environm postgres$ psql ``` -In `psql`, enter the following SQL commands, to create the Metriq database and user: +In `psql`, enter the following SQL commands, to create the Metriq database and user. (Pick a strong, private password, instead of 'ExamplePassword'): ```sql CREATE USER metriq WITH PASSWORD 'ExamplePassword'; CREATE DATABASE metriq WITH OWNER metriq; quit ``` +You'll need to export this password as an environment variable, so that `metriq-api` can access the PostgreSQL database. See the configuration files in the code, but you can create a shell script `metriq_env_vars.sh` that runs `export` on configuration settings, then add it your shell startup with the line +```sh +. ~/metriq_env_vars.sh +``` +in your (hidden) `.bashrc` profile file. + After quiting `psql`, you can restore the backup: ```sh postgres$ psql -d metriq -a -f metriq_qa.sql