This commit is contained in:
Mayel de Borniol 2023-03-24 12:49:51 +13:00
parent ec3099691d
commit fb573377e7
2 changed files with 28 additions and 19 deletions

View file

@ -28,18 +28,20 @@ $ cd bonfire
Bonfire is a flexible platform that powers a variety of social networks. The first thing you have to choose is which app (or "flavour") you want to hack on:
- `classic` ("Bonfire Social", a toot-based social network that interoperates with the fediverse)
- `cooperation` (for building cooperative communities)
- `reflow` (for community economic activities)
- `haha` (for learning new things)
- `community` (for groups and communities)
- `cooperation` (for building cooperative economic networks)
Note that at the current time, the core team are focusing most of their efforts on the classic flavour and this is where we recommend you start.
You first need to install [just](https://github.com/casey/just#packages) which is a handy tool (a `make` alternative) to run commands defined in `./justfile`.
So for example if you want to run the `classic` flavour, run:
So for example if you want to run the `classic` flavour, with a fully-docker-managed setup (see the other options available below), run:
- `export FLAVOUR=classic` (you may also want to put this in the appropriate place in your system so your choice of flavour is remembered for next time)
- `just config`
- `export FLAVOUR=classic WITH_DOCKER=total`
You may also want to put this in the appropriate place in your system so your choice of flavour is remembered for next time (eg. `~/.bashrc` or `~/.zshrc`)
- Then run `just config` to initialise some config.
### Configure
@ -50,7 +52,7 @@ So for example if you want to run the `classic` flavour, run:
- Dependencies:
- Recent versions of Docker & [docker-compose](https://docs.docker.com/compose/install/)
- Set an environment variable to indicate your choice: `export WITH_DOCKER=total`
- Make sure you've set the environment variable to indicate your choice: `export WITH_DOCKER=total`
- Make sure you've edited your .env file (see above) before getting started and proceed to Hello world!
@ -61,7 +63,7 @@ So for example if you want to run the `classic` flavour, run:
- [yarn](https://yarnpkg.com)
- Recent versions of Docker & [docker-compose](https://docs.docker.com/compose/install/)
- Set an environment variable to indicate your choice: `export WITH_DOCKER=easy`
- Make sure you've set the env to indicate your choice: `export WITH_DOCKER=easy`
- Make sure you've edited your .env file (see above) before getting started and proceed to Hello world!
@ -73,7 +75,7 @@ So for example if you want to run the `classic` flavour, run:
- [yarn](https://yarnpkg.com)
- Recent versions of Docker & [docker-compose](https://docs.docker.com/compose/install/)
- Set an environment variable to indicate your choice: `export WITH_DOCKER=partial`
- Make sure you've set the environment variable to indicate your choice: `export WITH_DOCKER=partial`
- Make sure you've edited your .env file (see above) before getting started and proceed to Hello world!
@ -90,7 +92,7 @@ So for example if you want to run the `classic` flavour, run:
- If you want search capabilities, you'll also need to setup a Meili server and set the relevant env variables as well.
- Set an environment variable to indicate your choice: `export WITH_DOCKER=no` and proceed to Hello world!
- Make sure you've set the environment variable to indicate your choice: `export WITH_DOCKER=no` and proceed to Hello world!
### Option E - the nix one (dev environment with Nix)

View file

@ -83,11 +83,11 @@ config:
@just flavour $FLAVOUR
# Initialise a specific flavour, with its env files, and create some required folders, files and softlinks
flavour select_flavour:
@echo "Switching to flavour '$select_flavour'..."
@flavour select_flavour:
echo "Switching to flavour '$select_flavour'..."
just pre-setup $select_flavour
{{ if MIX_ENV == "prod" { "echo ." } else { "just dev-setup" } }}
@echo "You can now edit your config for flavour '$select_flavour' in /.env and ./config/ more generally."
{{ if MIX_ENV == "prod" { "echo ..." } else { "just dev-setup" } }}
echo "You can now edit your config for flavour '$select_flavour' in /.env and ./config/ more generally."
@pre-init: assets-ln
rm -rf ./priv/repo
@ -722,14 +722,21 @@ db-pre-migrations:
# Generate secrets
@secrets:
{{ if MIX_ENV == "prod" { "echo just rands" } else { "just mix-secrets" } }}
@rands:
just rand
just rand
just rand
@mix-secrets:
just deps-get
cd lib/mix/ && ln -sf ../../extensions/bonfire/lib/mix/tasks || ln -sf ../../deps/bonfire/lib/mix/tasks
cd lib/mix/tasks/secrets/ && mix escript.build && ./secrets 128 3
# just rand
# just rand
# just rand
# @rand: # note: doesn't work in github CI
# echo {{ uuid() }}-{{ uuid() }}-{{ uuid() }}-{{ uuid() }}
@rand:
echo {{ uuid() }}-{{ uuid() }}-{{ uuid() }}-{{ uuid() }}
# note: doesn't work in github CI ^
# Start or stop nix postgres server
@nix-db pg_cmd: