Skip to main content

Populate the database and log in to Device Manager

Run this command to populate the database

$ docker compose exec edgehog-backend bin/edgehog eval Edgehog.Release.seed

This will create the tenant acme-inc and add a sample device to it.

"I had the wrong variables set, and now I can't run the seed again. What now?" If this happens, the easiest solution is to just recreate the edgehog volumes:

$ docker compose down -v && docker compose up -d

Nice! Now we have our tenant but we can't access to it yet, we need a token. Luckily Device Manager includes a scripts to generate one!

First you'll need to make sure to have Elixir installed in your system. If you're using the asdf version manager, you can install Elixir by running:

$ asdf install

Now you can generate the login token with

$ ./tools/gen-edgehog-jwt -t tenant -k ./acme_private.pem

If in the previous section you had decided not to use a custom key, use this command instead

$ ./tools/gen-edgehog-jwt -t tenant -k ./backend/priv/repo/seeds/keys/tenant_private.pem

You can finally navigate to http://edgehog.localhost in your browser and login to the acme-inc tenant using your newly generated token.