Please read the introduction blog post.
lorito is a web app written in Elixir that uses a postgres database to store its information.
There's a .devcontainer setup to run Lorito for development purposes, which includes both an app container and a PostgreSQL container.
If you load this repository in VSCode, it will detect the devcontainer setup and prompt you to open the project inside a Docker container.
Once inside the container, run mix add_user
to create a user.
Then, execute mix phx.server
to run lorito at http://localhost:4000
and its dashboard is available at http://localhost:4000/_lorito
.
To create a production-ready package,
a Dockerfile
is used to build an Elixir release.
There are two prerequisites to run lorito:
- The postgres database must support SSL
- lorito must run over HTTPS because of the Clipboard API
lorito needs two secrets (environment variables) to work:
DATABASE_URL
: postgres connection URI of your databaseSECRET_KEY_BASE
: the secret key to sign cryptographic material such as session tokens
You can use docker-compose to run lorito
using the provided docker-compose.yml
file.
To configure secrets,
create a .env file to declare:
DATABASE_URL
:postgresql://
connection URISECRET_KEY_BASE
: you can generate one withhead -c 66 /dev/urandom | base64 -w 0
PHX_HOST
:localhost
by default, then you can modify it with a custom domain.
docker-compose up
will run lorito at http://localhost:4000
and its dashboard at http://localhost:4000/_lorito
.
To add a user, follow this steps:
- Enter into the container with
docker-compose exec elixir /bin/bash
- Run the database migrations with
./bin/migrate
- Then, enter IEX with
./bin/lorito remote
- Add your user with
Lorito.Release.add_user("email@domain.tld")
If you want to take a look at lorito, you can use this setup. Beware that it uses default distro SSL keys to set up SSL and containers aren't recommended for production databases.
You can execute docker-compose -f docker-compose.with-db.yml up
and update .env
with DATABASE_URL=postgresql://postgres:postgres@db:5432/app
.
Then, follow the same instructions to add a user as outlined in the previous section.
My suggestion is to go with fly.io. It takes care of secrets, SSL certificates, custom domains, monitoring, etc.
There's a little guide here.
The issue is that you're accessing lorito dashboard
from an IP/host different than PHX_HOST
from .env
file.
They must match and the issue should be resolved.