Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Troubleshooting tips #109

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bonfire.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
run: mix test

test_cooperation_flavour:
name: Test coordination flavour
name: Test cooperation flavour
runs-on: ubuntu-latest
container: elixir:alpine
env:
Expand Down
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,19 @@ endef
pre-config: pre-init ## Initialise env files, and create some required folders, files and softlinks
@echo "You can now edit your config for flavour '$(FLAVOUR)' in config/$(MIX_ENV)/secrets.env, config/$(MIX_ENV)/public.env and ./config/ more generally."

CONFIG_PATH=$(FLAVOUR_PATH)/config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea

pre-init:
@echo "Setting flavour to $(FLAVOUR_PATH)"
@ln -sfn $(FLAVOUR_PATH)/config ./config
@ln -sf $(FLAVOUR_PATH)/config ./config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you explain why the n option was removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The n option doesn't appear to serve any definitive purpose in this context, so I didn't see the need for it. It shouldn't matter if the link is treated like a file or not, the commands worked just as well for me on both operating systems without that flag

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs for -h (alias of -n): If the link_name or link_dirname is a symbolic link, do not follow it. This is most useful with the -f option, to replace a symlink which may point to a directory.
When switching flavours, this means that the link is recreated pointing to the new source dir (flavours/x/config).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright fair enough, thank you for explaining. I'll be sure to switch it back before making my next PR

@mkdir -p data/
@ln -sf ../$(FLAVOUR_PATH) ./data/current_flavour
@mkdir -p config/prod
@mkdir -p config/dev
@touch config/deps.path
@cp -n config/templates/public.env config/dev/ | true
@cp -n config/templates/public.env config/prod/ | true
@cp -n config/templates/not_secret.env config/dev/secrets.env | true
@cp -n config/templates/not_secret.env config/prod/secrets.env | true
@mkdir -p $(CONFIG_PATH)/prod
@mkdir -p $(CONFIG_PATH)/dev
@touch $(CONFIG_PATH)/deps.path
@cp -n $(CONFIG_PATH)/templates/public.env $(CONFIG_PATH)/dev/ | true
@cp -n $(CONFIG_PATH)/templates/public.env $(CONFIG_PATH)/prod/ | true
@cp -n $(CONFIG_PATH)/templates/not_secret.env $(CONFIG_PATH)/dev/secrets.env | true
@cp -n $(CONFIG_PATH)/templates/not_secret.env $(CONFIG_PATH)/prod/secrets.env | true

pre-run:
@mkdir -p forks/
Expand Down
4 changes: 2 additions & 2 deletions docs/DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ $ cd bonfire

2. The first thing to do is choosing what flavour of Bonfire you want to deploy (the default is `classic`), as each flavour has its own Docker image and config.

For example if you want to run the `coordination` flavour (you may want to use direnv or something similar to persist this):
For example if you want to run the `cooperation` flavour (you may want to use direnv or something similar to persist this):

`export FLAVOUR=coordination MIX_ENV=prod`
`export FLAVOUR=cooperation MIX_ENV=prod`

3. Once you've picked a flavour, run this command to initialise some default config (.env files which won't be checked into git):

Expand Down
24 changes: 21 additions & 3 deletions docs/HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ $ cd bonfire

- The first thing to do is choosing what flavour of Bonfire you want to hack on (the default is `classic`), as each flavour has its own config.

For example if you want to run the `coordination` flavour:
For example if you want to run the `cooperation` flavour:

`export FLAVOUR=coordination`
`export FLAVOUR=cooperation`

- Once you've picked a flavour, run this command to initialise some default config (.env files which won't be checked into git):

Expand Down Expand Up @@ -210,7 +210,25 @@ make git.merge~% Draft-merge another branch, eg `make git-mer
make git.conflicts Find any git conflicts in ./forks
```

## What happens when I get this error?
## Troubleshooting

### EACCES Permissions Error

If you get a permissions error when following any of the steps, run the following command and it should be fixed:

```shell
cd ~/bonfire && sudo chown -R yourusername:yourusername .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe saying to run the chown in their bonfire directory, since not everyone would have it at ~/bonfire

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it could be changed to cd bonfire, since that is what the HACKING.md documentation says

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it in the new PR

```

### Unable to access Postgres database

If you are getting any `:nxdomain` errors, check if you have any firewalls that may be blocking the port on your system.

For example, if you are running UFW (a lot of Linux distros do), run the following command to allow access to port 4000:

```shell
sudo ufw allow 4000
```

### (Mix) Package fetch failed

Expand Down
4 changes: 2 additions & 2 deletions nix/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ in
POSTGRES_SOCKET_DIR = lib.mkIf (dbSocketDir != null) dbSocketDir;
HOSTNAME = hostname;
WITH_DOCKER = "no";
FLAVOUR = "coordination";
BONFIRE_FLAVOUR = "flavours/coordination";
FLAVOUR = "cooperation";
BONFIRE_FLAVOUR = "flavours/cooperation";
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion nix/package.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, self, flavour ? "coordination" }:
{ pkgs, self, flavour ? "cooperation" }:
let
beamPackages = with pkgs; beam.packagesWith beam.interpreters.erlang;
in
Expand Down
2 changes: 1 addition & 1 deletion nix/shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, flavour ? "coordination" }:
{ pkgs, flavour ? "cooperation" }:

with pkgs;

Expand Down