Skip to content

Commit

Permalink
Env. vars. in README
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Apr 23, 2024
1 parent 4be8b1a commit 3251280
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3251280

Please sign in to comment.