this is the second post about bonfire, the first one bonfire – part one – ubuntu focused on setting up and configuring the bare metal instance with required packages
for all of these instructions you will be logged into your host as user: bonfire
set up bonfire
clone and create environment
git clone --depth 1 https://github.com/bonfire-networks/bonfire-app.git bonfire && cd bonfire
git checkout v1.0.0
export FLAVOUR=social MIX_ENV=prod WITH_DOCKER=no
echo 'eval "$(mise activate bash)"' >> ~/.bashrc && echo "FLAVOUR=social">> ~/.bashrc && echo "MIX_ENV=prod" >> ~/.bashrc && echo "WITH_DOCKER=no" >> ~/.bashrc && source ~/.bashrc
remove alpine from .tool_versions and install mise tools
vi .tool_versions
#alpine 3.22.2
mise install
create base configuration
just config
just dep-clone-local bonfire_ui_common https://github.com/bonfire-networks/bonfire_ui_common
generate secrets
just secrets
Note: in the part one you used two of the secrets that are generated, (postgres, meilisearch) you can go back and replace them if you want. note your .env file must agree on these values with each of the application configurations. So if you keep your originals be sure to use them in the next step.
edit the .env file
HOSTNAME=host.example.com
PUBLIC_PORT=443
POSTGRES_USER=bonfire_dbuser
WITH_DOCKER=no
SECRET_KEY_BASE=<from just secrets>
SIGNING_SALT=<from just secrets>
ENCRYPTION_SALT=<from just secrets>
ERLANG_COOKIE=<from just secrets>
POSTGRES_PASSWORD=<password set in part 1>
MEILI_MASTER_KEY=<password set in part 1>
set up mail, i used SMTP
MAIL_BACKEND=smtp
MAIL_SERVER=example.com
MAIL_PORT=465
MAIL_USER=admin@example.com
MAIL_PASSWORD=
MAIL_FROM=admin@example.com
MAIL_SSL=true
build the binaries
just setup-prod # (4 prompts enter N)
just rei-build
rm _build/prod/rel/bonfire/bin/bonfire
just update (ctl-o , enter ctl-x for to accept)
just rel-build
test the app
test install
just cmd _build/prod/rel/bonfire/bin/bonfire start
If the system starts there will be a flurry of output to the console but it should settle down to a bunch of ‘oban’ entries like this:
19:00:05.589 [info] [source: "oban", duration: 2084, event: "plugin:stop", plugin: "Oban.Plugins.Lifeline", discarded_jobs: [], rescued_jobs: []]
19:00:05.629 [info] [source: "oban", duration: 1622, event: "plugin:stop", plugin: "Oban.Plugins.Pruner", pruned_count: 0]
If you get a bunch of repeating red database errors it means the migrations didn’t get run and you should try re-building.
initial signup
you will want to connect to https://host.example.com/signup and set up the first user. This user will be admin for the site.
Leave a Reply