A PHP based web application to help manage your postmortems

Overview

morgue Build Status Code Climate

a safe place for all your postmortem data

Overview

This is a PHP based web application to help manage your postmortems. It has a pluggable feature system and can pull in related information from IRC and JIRA as well as storing relevant links and graphs. This talk from DevOpsDays NYC 2013 gives an introduction and shows some of its features.

You can also join #morgue on Freenode IRC if you have questions.

Morgue tour

Index page

Morgue index page

Creating a new post mortem

Creating a new Post Mortem

Live edit page

Editing a Post Mortem

Scheduling a Post Mortem

Timeline of events

Remediations items

History tracking

Setup

Requirements

  • PHP 7.0 or higher
  • MySQL 5.5 or higher
  • PHP MySQL driver
  • Apache
  • mod_rewrite

Create a morgue configuration file

In the cloned repo, use the example.json file as a template to create your own configuration file.

cp config/example.json config/development.json

NOTES: You may need to remove references to "custom_feature" from your development.json as those only exist as examples to show you how to add custom features to your Morgue installation.

Composer

Morgue relies on the Slim Framework, a dependency that can be easily managed by Composer. Directions to install composer can be found on here). Once installed, run :

php composer.phar update

Apache

This is a basic example for an Apache vhost. The MORGUE_ENVIRONMENT variable is used to determine which config file to use (see above step).

">
    
   
    
      ServerName   morgue.hostname.com

      DocumentRoot /var/www/morgue/htdocs

      
    
     
        AllowOverride All
      
    

      SetEnv MORGUE_ENVIRONMENT development

      php_value include_path "/var/www/morgue:/var/www/morgue/features"
    
   

NOTE: If you maintain a custom Morgue features outside the document root, be sure to include that directory in the php_value include_path directive.

Restart apache and hit the servername you defined above.

MySQL

Create a database named morgue and give access to the morgue user with the morgue password defined in the config file you created at step 1

CREATE DATABASE morgue;
CREATE USER 'morgue'@'localhost' IDENTIFIED BY 'morgue';
GRANT ALL ON morgue.* TO 'morgue'@'localhost';
SET PASSWORD FOR 'morgue'@'localhost' = PASSWORD('morgue_password');

Then add the schema to the database:

mysql -p -u morgue -h localhost morgue < schemas/postmortems.sql

Note : add any additional schemas you may use:

mysql -p -u morgue -h localhost morgue < schemas/images.sql
mysql -p -u morgue -h localhost morgue < schemas/jira.sql
mysql -p -u morgue -h localhost morgue < schemas/links.sql
mysql -p -u morgue -h localhost morgue < schemas/irc.sql

Start a development server

Using PHP built-in webserver it is possible to start quickly viewing what morgue does with the following command run from the document root.

NOTE: You may need to do some PHP setup before doing this. Follow the installation instructions here to install composer, then from your morgue base directory run php composer.phar update to install and update the necessary PHP packages.

cd htdocs
MORGUE_ENVIRONMENT=development php -d include_path=".:$(dirname `pwd`):$(dirname `pwd`)/features" -S localhost:8000

Open http://localhost:8000 to view Morgue

Configuration

Features

The configuration of individual features is maintained in an array of objects -- the 'feature' key on the configuration array.
Minimally a feature is the name of the feature and if it is "on" or not.

"features": [
    {   "name": "my_awesome_feature",
        "enabled": "on"
    }

You can add keys and values as needed for your feature. For example:

    {   "name": "my_awesome_feature",
        "enabled": "on",
        "extra_awesome_value": 11,
        "lost_numbers": [4,8,15,16,23,42]
    }

You can then access these nearly anywhere in the app.


$feature_options = Configuration::get_configuration('my_awesome_feature');
$lost_numbers = $feature_options['lost_numbers'];

A few conventions exist for features to do certain things:

  • "navbar": "on|off" Adds a link to the feature in the main navbar.
  • "custom_js_assets": ["my.js", "other.js", "http://cdn.com/external.js"] Try to load javascripts
  • "custom_css_assets": ["my.css", "other.css", "http://cdn.com/external.css"] Try to load stylesheets

Edit Page Features

If your feature involves the edit page, you'll need to list it in the edit_page_features array. The ordering of this array influences the ordering of the edit page features from first (top) to last (bottom).

   "edit_page_features": [
        "status_time", "contact", "calendar", "summary", "images"
   ]

JIRA feature

baseurl the base URL to your jira installation (use https if you are using a secured JIRA installation) username username for a user with viewing credentials password password for a user with viewing credentials additional_fields mapping of fields to display in morgue (other than key, summary, assignee, status)

    {   "name": "jira",
        "enabled": "on",
        "baseurl": "https://jira.foo.com",
        "username": "jira_morgue",
        "password": "jira_morgue",
        "additional_fields": {
            "Due Date": "duedate",
            "Some Custom Field": "customfield_1234"
        }
    },

IRC Feature

When enabled, the irc features allow the reporting of the IRC channels discussions were happening during the event. The postmortem tools tries to retrieve the list of channels in 2 ways:

  • calling the 'morgue_get_irc_channels_list' if it exits (this function is expected to return an array of strings)
  • retrieving the "channels" array from the 'irc' feature config stanza

IRC Log feature

When the IRC feature is enabled, the channels listed for a given postmortem will be clickable buttons that attempt to retrieve the IRC log history. In order to view that history in Morgue, you need to implement the irclogs endpoint. You can do so by:

  1. Create a new feature: (see below for more detail on creating a new feature)
make feature NAME=irclogs
  1. Add the new feature to your config file (in the features array)
    {   "name": "irclogs",
        "enabled": "on",
        "endpoint": "https://path.to.irseach.endpoint"
    }
  1. Implement the irclogs route

The irclogs route receives parameters in a get request. Morgue will query the irclogs endpoint with an increasing offset of 20 until it receives no data. Regardless of how you implement that endpoint, you need to return an empty response when you no longer have data to feed.

The expected response from the irclogs endpoint is a JSON array with the 3 elements: nick, time and message.

[
  {'nick':'foo','time':'10:30:03 PM', 'message':'I see foo'},
  {'nick':'bar','time':'10:35:00 PM', 'message':'Oh, I see bar'},
  {'nick':'foo','time':'10:37:34 PM', 'message':'turned out it was baz'}
]

A dummy implementation could look like (content of features/irclogs/routes.php)

request->get('start_date'); $start_time = $app->request->get('start_time'); $end_date = $app->request->get('end_date'); $end_time = $app->request->get('end_time'); $timezone = $app->request->get('timezone'); $channel = $app->request->get('channel'); $offset = $app->request->get('offset'); if ($offset == 0) { $results = array( array('nick' => 'foo','time' => '10:55 PM', 'message' => 'bar'), ); } else { $results = array(); } echo json_encode($results); });">


/** irclog endpoint - return IRC logs paginated by 20 entries */
$app->get('/irclogs', function () use ($app) {
    header("Content-Type: application/json");
    $start_date = $app->request->get('start_date');
    $start_time = $app->request->get('start_time');
    $end_date = $app->request->get('end_date');
    $end_time = $app->request->get('end_time');
    $timezone = $app->request->get('timezone');
    $channel = $app->request->get('channel');
    $offset = $app->request->get('offset');

    if ($offset == 0) {
        $results = array(
            array('nick' => 'foo','time' => '10:55 PM', 'message' => 'bar'),
        );
    } else {
        $results = array();
    }
    echo json_encode($results);
});

Creating your own Features

Use make feature to generate a skeleton structure for your new feature.

% make feature NAME=my_new_feature
making new feature  my_new_feature
Feature directory for my_new_feature created.
Remember to add an entry to your feature config.
% tree features/my_new_feature
features/my_new_feature
├── lib.php
├── routes.php
└── views
    └── my_new_feature.php

Add it to and enable it in your config.json.

Tests

You can run the unit test suite with:

make unittests

Contribute

  1. Fork the repository
  2. Hack away
  3. Add tests so we don't accidentally break something in the future
  4. Push the branch up to GitHub (bonus points for topic branches)
  5. Send a pull request to the etsy/morgue project.

FAQ

When I visit a detail event page, I just see a "loooool"

You may have created your schemas before some features that required schema changes were added. Simply run the migration(s) commands to update your schemas:

    alter table postmortems change etsystatustime statustime int(11) UNSIGNED NOT NULL;
    alter table postmortems add column why_surprised text NOT NULL;

Or simply :

    mysql -p -u morgue -h localhost morgue < schemas/migrations/rename_statustime_column.sql
    mysql -p -u morgue -h localhost morgue < schemas/migrations/add_why_surprised_field.sql
    mysql -p -u morgue -h localhost morgue < schemas/migrations/change_text_to_longtext.sql
    mysql -p -u morgue -h localhost morgue < schemas/migrations/add_event_facilitators.sql
    mysql -p -u morgue -h localhost morgue < schemas/migrations/add_edit_locking.sql

Comments
  • JIRA integration doesnt seem to work

    JIRA integration doesnt seem to work

    I am unable to get the JIRA integration to work... I have confirmed the URL is able to curl the rest api w/ the credentials provided. Unfortunately the apps logging doesnt give me much to go on... Pretty much the only error I see is a 404 in the browsers console logs

    POST /events/1/tickets HTTP/1.1
    Host: morgue.int.XXXXXXX.com
    Connection: keep-alive
    Content-Length: 15
    Cache-Control: no-cache
    Pragma: no-cache
    Origin: http://morgue.int.XXXXXXX.com
    X-Requested-With: XMLHttpRequest
    Content-Type: application/x-www-form-urlencoded; charset=UTF-8
    Accept: */*
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36
    Referer: http://morgue.int.XXXXXXX.com/events/1
    Accept-Encoding: gzip,deflate,sdch
    Accept-Language: en-US,en;q=0.8
    Cookie: __qca=P0-xxxx-1378857176282; __utma=159549816.108514511.XXXX.1380727382.1382567378.18; __utmc=159549816; __utmz=159549816.1378329283.7.4.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); postmortem=X%XXXXXX%XXXXX
    
    
    HTTP/1.1 404 Not Found
    Server: nginx/1.4.3
    Date: Thu, 31 Oct 2013 18:45:36 GMT
    Content-Type: text/html; charset=UTF-8
    Content-Length: 4
    Connection: keep-alive
    X-Powered-By: PHP/5.4.19
    Set-Cookie: postmortem=1383248736%xxxxxxxxxxx%7C926cc281871ed7ea5100ff96434446504a701232; path=/; expires=Thu, 31-Oct-2013 19:45:36 UTC
    
    
    

    Is there something more the jira integration that I am maybe missing ?

    opened by johntdyer 13
  • Any environment requirements?

    Any environment requirements?

    Are there PHP version requirements? MySQL requirements? The MySQL that ships with RHEL6 doesnt have support for that.

    I moved to an ubuntu 12.04 machine and tried to run it and I'm running into -

    PHP Parse error: syntax error, unexpected '[' in /web/morgue/phplib/Postmortem.php on line 48

    (which i imagine is a php version thing, but not sure?)

    opened by patcable 10
  • Etsy-isms still present

    Etsy-isms still present

    Still some etsyisms present:

    • Etsystatus time
    • When you enter a username for "contact" the link for the user goes to https://atlas.etsycorp.com/staff/username
    • Maybe not an etsy-ism, but definitely Interface/code disconnect: feature 'links' is referenced as 'fourms' in the postmortem page.
    opened by patcable 7
  • Updating dates often doesn't take

    Updating dates often doesn't take

    In an existing postmortem, I'm trying to update the dates (start, end, detect). More often than not, the update doesn't "take", and refreshing the screen shows the old values. If I keep trying -- I've seen it happen after just trying one more time, and trying maybe 8 more times -- it'll eventually work. But there's no pattern to it.

    I see no errors in the Chrome console or the apache error_log file

    bug question 
    opened by marcesher 6
  • JavaScript errors on page load

    JavaScript errors on page load

    I see these errors in the JavaScript console when I load a morgue screen:

    Uncaught TypeError: Cannot read property 'createPlugin' of undefined jquery.timeentry.min.js:6 Uncaught TypeError: undefined is not a function edit.js:27

    This is on Chrome.

    Morgue running behind apache, per the README

    question 
    opened by marcesher 6
  • "What happened?" field does not appear when editing

    After creating a new postmortem and then clicking to edit, the "What happened?" field does not appear for me. I don't see any obvious reason for this in Chrome Dev Tools. Images of screen and Dev Tools HTML are attached.

    Thanks for any advice.

    screen shot 2015-07-23 at 8 19 20 am screen shot 2015-07-23 at 8 17 27 am
    opened by marcesher 5
  • Teach morgue how to load views from features outside its core.

    Teach morgue how to load views from features outside its core.

    • There may be cases where a developer would prefer not to release morgue features with the core project.

    • This update allows the inclusion of morgue features from a distinct directory, to complement core features.

    • It can even be used to override core features.

    • To configure this support, the 'custom_features' and 'custom_feature_path' values need to be defined in the JSON config, as in 'example.json'.

    • Finally, the web server needs to be configured with an appropriate alias to this location in case it's outside of morgue's document root.

    • This has been tested with Apache using the following additional directives in a vhost configuration:

      ... Alias /morgue_custom_features /usr/local/morgue_features php_value include_path '.:/usr/share/pear:./features:/usr/local/morgue_features' ...

    opened by RyanFrantz 5
  • rename the morgue schema file to postmortems

    rename the morgue schema file to postmortems

    Renaming this file to reflect the tables that are created is more in line with the other schema files, as well as allows for using the filename to determine if the schema should be executed or not.

    opened by miketheman 4
  • Remove etsy auth

    Remove etsy auth

    This isn't the greatest pr, but essentially we want to ensure users can specify their own authentication protocol at a different layer.

    It would be nice to optionally include the EtsyInternalAuth, but I think a better solution to that would be to proxy authentication to this app from your server's sso solution. Also, no one but etsy would have that library, so including that hack would be less useful.

    opened by josegonzalez 4
  • Latest morgue will not run; issues PHP error

    Latest morgue will not run; issues PHP error

    Pulling the latest morgue code, I get this when running within apache:

    PHP Parse error: syntax error, unexpected '[' in /var/www/morgue/htdocs/index.php on line 301

    This is with PHP 5.3.3 and Apache 2.2.15

    opened by marcesher 3
  • Remove WHERE clause when selecting all tags

    Remove WHERE clause when selecting all tags

    The tags table doesn't have a deleted column (schema).

    As mentioned in #8, when trying to fetch all of the tags a sql exception is thrown:

    SQLSTATE[42S22]: Column not found: 1054 Unknown column 'deleted' in 'where clause'
    

    Instead of removing the WHERE clause entirely I could change this to a JOIN with the postmortem_referenced_tags table to only show tags that are being used. Let me know and I can update the PR.

    opened by barrettcook 3
  • Feature Request: Add Slack integration documentation

    Feature Request: Add Slack integration documentation

    I see that this feature has been added some time ago (https://github.com/etsy/morgue/commit/4620f17692f29ac239ea391420eb91d6e04bebf8), but there is not documentation available.

    opened by mtmn 0
  • Issue:

    Issue: "Couldn't get connection object."

    Getting the following error: "Couldn't get connection object." when trying to access Morgue. Was working fine, not sure if an update has broken it or what not.

    Tried updating the php-mysql module but alas did not work.

    opened by deathkn3ll 0
  • syntax error, unexpected '[' in /var/www/morgue/htdocs/index.php

    syntax error, unexpected '[' in /var/www/morgue/htdocs/index.php

    I am running into 'PHP Parse error: syntax error, unexpected '[' in /var/www/morgue/htdocs/index.php on line 297'. Any ideas on how and where the error is? I have php 5.5 installed.

    opened by singhh 0
  • feature request: authentication mechanism

    feature request: authentication mechanism

    Is there any intention to integrate an authentication mechanism? be it mod_auth_ldap or alike? great tool, just lacking unique users so we can keep track of who is creating / editing postmortems.

    opened by mhorne484 1
  • Feature request: not-Jira / freeform remediation items

    Feature request: not-Jira / freeform remediation items

    Sometimes we come up with remediation items which aren't quite Jira-ticket-shaped quite yet... usually because they'd require more brainstorming before ticketing them out.

    It'd be neat to be able to record those in morgue along with the more immediate remediation items, for future reference/work. Often enough, ideas like that get lost -- but seeing them appear in multiple morgue entries could give them enough weight to move them forward.

    opened by ziel 0
Owner
Etsy, Inc.
Etsy, Inc.
LiveZilla - a help desk software that offers a help desk solution for small companies to large businesses

LiveZilla includes a live chat software with multi-website support, visitor monitoring and a help desk system that allows you to not only integrate emails that you receive from customers but also messages from Twitter and Facebook in your ticket system.

Maher Amara 9 Nov 10, 2022
Open Source Voucher Management System is a web application for manage voucher. used PHP with Laravel Framework and use MySQL for Database.

Voucher Management System is a web application for manage voucher. You can create and manage your voucher. Voucher Management System is used PHP with Laravel Framework and use MySQL for Database.

Artha Nugraha Jonar 34 Sep 17, 2022
ViMbAdmin project provides a web based virtual mailbox administration system to allow mail administrators to easily manage domains, mailboxes and aliases.

ViMbAdmin project (vim-be-admin) provides a web based virtual mailbox administration system to allow mail administrators to easily manage domains, mailboxes and aliases.

Open Solutions 464 Jan 1, 2023
Damn Vulnerable Web Application (DVWA) is a PHP/MySQL web application that is damn vulnerable.

Damn Vulnerable Web Application (DVWA) is a PHP/MySQL web application that is damn vulnerable. Its main goal is to be an aid for security professionals to test their skills and tools in a legal environment, help web developers better understand the processes of securing web applications and to aid both students & teachers to learn about web application security in a controlled class room environment.

Robin Wood 7k Jan 5, 2023
TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application

TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application for storing, uploading, editing and managing files and folders online via web browser. The Application runs on PHP 5.5+, It allows the creation of multiple users and each user can have its own directory and a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes.

Prasath Mani 3.5k Jan 7, 2023
DomainMOD is an open source application written in PHP & MySQL used to manage your domains and other internet assets in a central location

DomainMOD is an open source application written in PHP & MySQL used to manage your domains and other internet assets in a central location. DomainMOD also includes a Data Warehouse framework that allows you to import your web server data so that you can view, export, and report on your live data.

DomainMOD 349 Jan 8, 2023
This plugin was created to help you migrate your existing gallery from your old site.

WP Migrate Gallery 1. Steps to Import Gallery 1.1. Install ACF PRO 1.2. Create CPT Gallery 1.3. Create Gallery Taxomy 1.4. Copy Gallery media files to

null 3 Jun 23, 2022
Simple web interface to manage Redis databases.

phpRedisAdmin phpRedisAdmin is a simple web interface to manage Redis databases. It is released under the Creative Commons Attribution 3.0 license. Th

Erik Dubbelboer 3k Dec 31, 2022
MOFHY Lite is a free web hosting management system to manage MOFH hosting accounts and SSL certificates.

MOFHY Lite is a free of cost MOFH clientarea for account management and support services with free ssl service. It have easy to use feature

Mahtab Hassan 17 Dec 8, 2022
This web app aims to manage alumnus databases.

Aplikasi Database Alumni Aplikasi berbasis web ini bertujuan untuk melakukan pendataan alumni. Aplikasi ini dibuat menggunakan framework CodeIgniter d

Ardi Cahyono 1 Nov 24, 2021
MOFHY Lite is a free web hosting management system to manage MOFH hosting accounts and SSL certificates.

MOFHY Lite MOFHY LITE is a priceless MyOwnFreeHost Client Area for account management, ticket support system and a free ssl service. It has easy to us

Santiago Rodríguez 6 Dec 28, 2021
phpRedisAdmin is a simple web interface to manage Redis databases.

phpRedisAdmin phpRedisAdmin is a simple web interface to manage Redis databases. It is released under the Creative Commons Attribution 3.0 license. Th

Erik Dubbelboer 2.8k Dec 1, 2021
Web interface to manage multiple instance of lxd

LXDMosaic ?? Share your feedback ?? More input required ?? Roadmap ??️ Docs ?? Get Started Prepare LXD Setup LXD and ensure LXD is available over the

null 438 Dec 27, 2022
PHP, MySQL and JS based web chat application

About The Project Chat Application coded in PHP, CSS3 and JS. This is just a project to learn and improve understanding on certain topics. This is not

Neil 8 Apr 18, 2022
Open Source Point of Sale is a web based point of sale application written in PHP using CodeIgniter framework.

Open Source Point of Sale is a web based point of sale application written in PHP using CodeIgniter framework. It uses MySQL as the data back end and has a Bootstrap 3 based user interface.

opensourcepos 2.7k Jan 2, 2023
Bar management application to manage transactions and inventory.

Barbapappa Barbapappa bar management application. Installation This application requires some installation steps. Initial setup The project can be ins

Tim Visée 10 Dec 14, 2022
ControlPanel's Dashboard is a dashboard application designed to offer clients a management tool to manage their pterodactyl servers.

Features PayPal Integration Email Verification Audit Log Admin Dashboard User/Server Management Store (credit system) Vouchers and so much more! Contr

ControlPanel.gg 223 Jan 5, 2023
ATOS is a locally hosted application that allows you to easily manage clients/projects, generate invoices against backlogs, and estimate taxes.

Built by freelancer ??‍♂️, for freelancer ?? ?? ???? - ATOS is a locally hosted application that allows you to easily manage clients/projects, generate invoices against backlogs, and estimate taxes.

Jon Belelieu 33 Dec 27, 2022
A learning management system (LMS) is a software application or web-based technology used to plan, implement and assess a specific learning process.

vidyaprabodhan-gov-php-project A learning management system (LMS) is a software application or web-based technology used to plan, implement and assess

Narayan Pote 1 Dec 23, 2021