index.community/backend
2019-07-27 17:58:40 +00:00
..
config quantitative color coding 2019-07-27 17:58:40 +00:00
lib quantitative color coding 2019-07-27 17:58:40 +00:00
priv quantitative color coding 2019-07-27 17:58:40 +00:00
rel/rel refactor/elixir backend 2019-07-14 11:47:06 +00:00
test refactor/elixir backend 2019-07-14 11:47:06 +00:00
.dockerignore refactor/elixir backend 2019-07-14 11:47:06 +00:00
.formatter.exs refactor/elixir backend 2019-07-14 11:47:06 +00:00
.sobelow-conf set up sobelow for backend 2019-07-17 16:16:25 +00:00
Dockerfile set up migrations on deploy 2019-07-17 14:47:47 +03:00
mix.exs add ES to extra_applications 2019-07-27 13:56:00 +03:00
mix.lock Setup appsignal 2019-07-27 10:13:42 +00:00
Procfile add full-text search 2019-07-26 22:30:11 +00:00
README.md feature/administration 2019-07-26 14:34:23 +00:00

fediverse.space backend

Notes

  • This project requires Elixir >= 1.9.
  • Run with SKIP_CRAWL=true to just run the server (useful for working on the API without also crawling)
  • This project is automatically scanned for potential vulnerabilities with Sobelow.

Configuration

There are several environment variables you can set to configure how the crawler behaves.

  • DATABASE_URL (required) . The URL of the Postgres db.
  • POOL_SIZE. The size of the database pool. Default: 10
  • PORT. Default: 4000
  • BACKEND_HOSTNAME (required). The url the backend is running on.
  • SECRET_KEY_BASE (required). Used for signing tokens.
  • TWILIO_ACCOUNT_SID. Used for sending SMS alerts to the admin.
  • TWILIO_AUTH_TOKEN. As above.
  • ADMIN_PHONE. The phone number to receive alerts at.
    • At the moment, the only alert is when there are potential new spam domains.
  • TWILIO_PHONE. The phone number to send alerts from.
  • ADMIN_EMAIL. Used for receiving alerts.
  • FRONTEND_DOMAIN (required). Used to generate login links for instance admins.
    • Don't enter https://, this is added automatically.
  • SENDGRID_API_KEY. Needed to send emails to the admin, or to instance admins who want to opt in/out.

Deployment

Deployment with Docker is handled as per the Distillery docs.

  • To build a new version, run make build in this directory.
  • To migrate a released version, run ./backend eval "Backend.Release.migrate"

Default README

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup
  • Start Phoenix endpoint with mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Learn more