Skip to content

Commit

Permalink
Fixes for bare metal documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinetix authored and mayel committed Dec 5, 2024
1 parent 3a304c7 commit d6b9577
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docs/DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Running a custom build without Docker.

- Postgres (or Postgis) version 12 or newer
- [just](https://github.com/casey/just#packages)
- Elixir version 1.15+ with OTP 25+ (see the `Dockerfile` to double check the versions we're currently using). If your distribution only has an old version available, check [Elixir's install page](https://elixir-lang.org/install.html) or use a tool like [mise](https://github.com/jdx/mise) (run `mise install` in this directory) or asdf.
- Elixir version 1.15+ with OTP 25+ (see the `Dockerfile` to double check the versions we're currently using). If your distribution only has an old version available, check [Elixir's install page](https://elixir-lang.org/install.html) or use a tool like [mise](https://github.com/jdx/mise) (run `mise install` in this directory) or asdf. **Note: Source versions of Elixir >1.17 and <1.17.3 have bugs that can freeze compilation when using pathex, which bonfire does.** Many distros have patched around this, but in some, such as Gentoo, they have not, but 1.17.3 fixes this.

2. Clone this repository and change into the directory:

Expand All @@ -150,30 +150,36 @@ You may also want to put this in the appropriate place in your system so your ch

4. Run `just config` to initialise some default config and then edit the config in the `./.env` file (see [prepare the config](#preparing-the-config-in-env) for details about what to edit).

5. Run `just rel-build` to create an elixir release. This will create an executable in your `_build/prod/rel/bonfire` directory. Note that you will need `just` to pass in the `.env` file to the executable, like so: `just cmd _build/prod/rel/bonfire/bin/bonfire <bonfire command>`. Alternatively, this file can be sourced by `source .env` instead. We will be using the `bin/bonfire` executable as called from `just` from here on.
5. Run `just setup` (not setup-dev as suggested by the output of the `just config` step).

6. Running the release
6. Run `just rel-build` to create an elixir release. This will create an executable in your `_build/prod/rel/bonfire` directory. Note that you will need `just` to pass in the `.env` file to the executable, like so: `just cmd _build/prod/rel/bonfire/bin/bonfire <bonfire command>`. Alternatively, this file can be sourced by `source .env` instead. We will be using the `bin/bonfire` executable as called from `just` from here on.

7. Running the release

- Create a database, and a user, fill out the `.env` with your credentials and secrets

- You will need to use `just` in order to pass the `.env` file to the executable. This can be accomplished by running `just cmd _build/prod/rel/bonfire/bin/bonfire <bonfire command>`. Just works from the root directory of the `justfile`, not your current directory.

- If you’re using RDS or some other locked down DB, you may need to run `CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;` on your database with elevated privileges.

- You may also need to enable the `postgis` extension manually by running `CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;` on your database with elevated privileges.

- You can check if your instance is configured correctly and get to the iex console by running `bin/bonfire start`

- The migrations should automatically run on first boot, but if you run into troubles the migration command is: `Bonfire.Common.Repo.migrate()` in the iex console.

- To run the instance as a daemon, use `bin/bonfire start daemon`. [Yay, you're up and running!](#running-the-app)

7. Adding HTTPS
8. Adding HTTPS

The common and convenient way for adding HTTPS is by using a reverse proxy like Nginx or Caddyserver (the latter of which is bundled as part of the docker compose setup).

Caddyserver and other servers can handle generating and setting up HTTPS certificates automatically, but if you need TLS/SSL certificates for nginx, you can look get some for free with [letsencrypt](https://letsencrypt.org/). The simplest way to obtain and install a certificate is to use [Certbot.](https://certbot.eff.org). Depending on your specific setup, certbot may be able to get a certificate and configure your web server automatically.

If you've built from source, you should point the nginx root directory to be `_build/prod/rel/bonfire/lib/bonfire-[current-version]/priv/static`

There is an example nginx configuration provided at `flavours/classic/config/deploy/nginx.conf`

### Nix

This repo contains an experimental Flake and Nix module. These are not ready for production.
Expand Down

0 comments on commit d6b9577

Please sign in to comment.