Skip to content

ep4sh/autopsy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autopsy: web app for postmortems

Autopsy

Autopsy Autopsy is free, Flask-based Postmortem web app.

Autopsy spreads postmortems culture, involves people to learn on the failures.

Demo

A small demo running on raspberry pi in k8s cluster:
http://autopsy.ep4sh.ru

Concepts

  • Users can add, update postmortems
  • You can update only your postmortem
  • User with id == 1 is a service's admininstrator

Screenshots

Register

register

Login

login

Reset Password

forgot_password

Dashboard

dashboard

Postmortems

list_postmortems

View a postmortem

view

New postmortem

new

Search in postmortems

[search

Update profile

profile

Admin page

admin

Create a support ticket

support

Features

  • Dashboard shows latest and random postmortems
  • Postmortems provides lists postmortems with CRU(D) capabilities
  • Search performs search operation in Postmortems' names
  • Admin manages all the service's data in Flask-admin way
  • Users can register, login, update the profile, create support tickets (attaching screenshot), logout and restore their password via email.

Roadmap

Trello

Requirements

  • python3
  • PostgreSQL
  • SMTP server (for password reset)

Installation

Clone the project

git clone https://github.com/ep4sh/autopsy.git
cd autopsy

Python venv

I'd recommend to use python virtual environment to install all dependencies:

python3 -m venv path/to/new/virtual/environment
source path/to/new/virtual/environment

Dotenv files

Autopsy reads the key-value pairs from .env files and adds them to environment variable

cp .env.example .env

Dotenv file settings description

Variable Value(default) Required for update Description
FLASK_APP main.py No Name of the main module
FLASK_ENV development depends Flask mode
FLASK_SECRET abcdef Yes Flask Secret
MAIL_SERVER smtp.example.com Yes SMTP server URL
MAIL_PORT 465 Yes SMTP server port
MAIL_USE_SSL True depends SMTP server SSL
MAIL_USERNAME [email protected] Yes Username for no-reply@ account
MAIL_PASSWORD <account_password> Yes Password for no-reply account
DATABASE_HOST <database_host> Yes Database host
DATABASE_USER docker Yes Database Username
DATABASE_PASSWORD docker Yes Database Password
DATABASE_PORT 5432 depends Database Port
DATABASE_NAME docker Yes Database Name
SQLALCHEMY_TRACK_MODIFICATIONS True No Track DB modification

Install dependencies

pip3 install -r requirements.txt

Init database

Run flask shell commands

It will create database schema and load init resources like roles

flask shell <<< "from autopsy_app.model import db; db.create_all();"

OR

Apply DB migrations

flask db stamp head
flask db migrate
flask db upgrade

Run app

uswgi app.ini

Go to

http://localhost:5000/

PostgreSQL development instance

There is a way to spin-up development PostgreSQL database in container via docker-compose. DB credentials are via environment vars - please checl docker-compose.yml file.

cd docker_misc/db
sudo chmod 777 pgdata
docker-compose up -d

Running code-style checks

pylint --load-plugins pylint_flask,pylint_flask_sqlalchemy *.py

Icon authors:

DinosoftLabs

FreePik

Books

I'm in love with books. If you want to thank me, just help me to buy books from the list

buy-me-a-book