lambdaclass / elephant_in_the_room

Simple wordpress replacement coded in Elixir + Phoenix + Ecto + PostgreSQL + Docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Elephant In The Room

Elephant In The Room is an opensource multi-site news page project.

Run the elephant!

First, the dependencies

In order to run this project you need to have already installed:

How to run the server locally

Run the website with the following commands:

  • Install project dependencies:
make deps
  • Start the database server:
make ops

The following commands need to be executed in a separate shell:

  • Create elephant's database, run migrations, and seed data:
make create_db
  • Start the web server:
make dev

Populating with dummy data

You can populate the database with dummy data using make populate_db or make clean_populate_db to reset the DB and populate. Both of this will create 4 default sites, one uses localhost as domain, but the others use custom domains (site-2.com, site-3.com, site-4.com) so you will need to add them to your /etc/hosts file to be able to access them. Append the following:

127.0.0.1       site-2.com
127.0.0.1       site-3.com
127.0.0.1       site-4.com

Backup

The backup can be generated sending a POST request /admin/backup/do_backup or in the admin panel /admin/backup pressing the botton backup now. After the backup is generated it can be downloaded to pressing the download latest backup that will appear when the backup generation process ends.

The restoration of the database is manual, it can be done this way:

export PGPASSWORD=<db_password> && \
psql -h <db_host>  -U <db_user> -c "drop database <database_name>; create database <database_name>;" && \
psql -h <db_host>  -U <db_user> -v ON_ERROR_STOP=1 <database_name> < \
  <location_of_backup>.sql

WARNING: This will first destroy the database and all its data before it recovers the backup.

About

Simple wordpress replacement coded in Elixir + Phoenix + Ecto + PostgreSQL + Docker


Languages

Language:CSS 46.6%Language:Elixir 36.4%Language:HTML 15.3%Language:JavaScript 1.2%Language:Shell 0.2%Language:Makefile 0.2%