8000 GitHub - csalazar/lorito
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

csalazar/lorito

Repository files navigation

<º\\ lorito - HTTP security suite

GitHub Release

What's this about?

Please read the introduction blog post.

Architecture

lorito is a web app written in Elixir that uses a postgres database to store its information.

Running lorito

Development

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.

Production

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 database
  • SECRET_KEY_BASE: the secret key to sign cryptographic material such as session tokens

Using docker-compose

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 URI
  • SECRET_KEY_BASE: you can generate one with head -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:

  1. Enter into the container with docker-compose exec elixir /bin/bash
  2. Run the database migrations with ./bin/migrate
  3. Then, enter IEX with ./bin/lorito remote
  4. Add your user with Lorito.Release.add_user("email@domain.tld")

Using docker-compose with a postgres container

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.

Deployment

fly.io

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.

Troubleshooting

We can't find the internet error & loading bar not finishing

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0