File: LOCAL_DEV.md

package info (click to toggle)
node-postgres 8.16.3%2B~cs35.24.27-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,788 kB
  • sloc: javascript: 15,879; python: 79; makefile: 57
file content (43 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Local development

Steps to install and configure Postgres on Mac for developing against locally

1. Install homebrew
2. Install postgres
   ```sh
   brew install postgresql
   ```
3. Create a database
   ```sh
   createdb test
   ```
4. Create SSL certificates
   ```sh
   cd /opt/homebrew/var/postgresql@14
   openssl genrsa -aes128 2048 > server.key
   openssl rsa -in server.key -out server.key
   chmod 400 server.key
   openssl req -new -key server.key -days 365 -out server.crt -x509
   cp server.crt root.crt
   ```
5. Update config in `/opt/homebrew/var/postgresql@14/postgresql.conf`

   ```conf
   listen_addresses = '*'

   password_encryption = md5

   ssl = on
   ssl_ca_file = 'root.crt'
   ssl_cert_file = 'server.crt'
   ssl_crl_file = ''
   ssl_crl_dir = ''
   ssl_key_file = 'server.key'
   ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
   ssl_prefer_server_ciphers = on
   ```

6. Start Postgres server
   ```sh
   /opt/homebrew/opt/postgresql@14/bin/postgres -D /opt/homebrew/var/postgresql@14
   ```