Commit 9031f8b6 authored by happyriver's avatar happyriver

Move postgres peer authentication setup out of Procfile-nix.dev

parent 2c16bcc7
Pipeline #104209566 passed with stage
in 6 minutes and 25 seconds
web: env PORT=3000 puma -C config/puma.rb
sidekiq: env PORT=3000 sidekiq
stream: env PORT=4000 DB_HOST=/run/postgresql DB_PORT=5432 yarn run start
stream: env PORT=4000 yarn run start
webpack: ./bin/webpack-dev-server --listen-host 0.0.0.0
......@@ -282,21 +282,31 @@ This problem also affects `foreman` but there is a Go clone of it in
`nixpkgs` called `goreman` which does not have that problem. It is
included in the Nix shell created by `develop.nix`.
## Load the database schema
## Loading the database schema
If you are using an operating system other than NixOS, set up the
development database with:
### On non-NixOS systems
Set up the development database with:
```
[nix-shell:~/soapbox]$ rails db:setup
```
On NixOS or in a NixOS container, since the database was already
created by `configuration.nix` or the container configuration, you
can't use `rails db:setup`. Use these commands instead to load the
database schema and seed the username and password for the
`[email protected]:3000` account (`localhost` in that address will be
replaced by `$LOCAL_DOMAIN` if you have set it).
### On NixOS systems or in NixOS containers
Include these settings in `.env` at the root of the Soapbox source
tree to make local peer authentication work:
```
DB_HOST=/run/postgresql
DB_PORT=5432
```
Since the database was already created by `configuration.nix` or the
container configuration, you can't use `rails db:setup`. Use these
commands instead to load the database schema and seed the username and
password for the `[email protected]:3000` account (`localhost` in that
address will be replaced by `$LOCAL_DOMAIN` if you have set it).
```
[nix-shell:~/soapbox]$ rails db:schema:load
......@@ -306,12 +316,8 @@ replaced by `$LOCAL_DOMAIN` if you have set it).
## Starting the development server
Because of the `bundle exec` bug, Soapbox's `Procfile.dev` won't work
as is, so use `Procfile-nix.dev` instead, which omits `bundle exec`
and sets the PostgreSQL socket name for the streaming server, which
makes the peer authentication in NixOS PostgreSQL configuration given
above work.
From inside your `nix-shell` at the root of the soapbox git repo,
as is, so use `Procfile-nix.dev` instead, which omits `bundle exec`.
From inside your `nix-shell` at the root of the soapbox source tree,
start the development server with:
```
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment