/electron-crash-report-server

:bomb: crash report server for Electron applications

Primary LanguageJavaScriptThe UnlicenseUnlicense

electron-crash-report-server is a Node.js (hapi) and PostgreSQL (massive) application for collecting crash reports from Electron applications.

install

Deploy

During setup change the AUTH_USER and AUTH_PASS environment variables. Once the app has deployed use those values to login.

docker

🐳 electron-crash-report-server is available on Docker Hub. Refer to the docker-compose.yaml file for usage.


If crash reports do not appear after the first deploy restart the app.

Read the development section for information about running in other environments.

usage

const { crashReporter } = require("electron");
crashReporter.start({
	// ...other options
	submitURL: "https://app-name-12345.herokuapp.com/",
});

Refer to the crashReporter documentation for the full details.

Important: Don't forget to start the crashReporter in the main process and each renderer that will create crash reports.

Check out the example electron app and demo server for a working example. The login and password for the demo are crash and electron.

If there are no sample reports use the example (or any other) app to add some reports to the demo server.

github & gitlab

electron-crash-report-server can create new issues on GitHub and/or GitLab when it receives a crash report. Using a private repository for these issues is recommended since stack traces and dump files may contain sensitive information about your users or application.

To get setup you need to add a few environment variables.

github & gitlab

Both services require you to set ECRS_URL; note the lack of trailing slash.

ECRS_URL = "https://pacific-falls-32011.herokuapp.com"

github

GITHUB_OWNER = "user_name"
GITHUB_REPO = "repo_name"
GITHUB_TOKEN = "user_token"

gitlab

GITLAB_ID = "repo_id"
GITLAB_TOKEN = "user_token"

email

electron-crash-report-server can send an email when it receives a crash report.

SMTP_LOGIN = "postmaster@xxx.mailgun.org"
SMTP_PASSWORD = "password is secret"
SMTP_SERVER = "smtp.mailgun.org"
SMTP_PORT = "587"
SMTP_TO = "support@example.org"
SMTP_FROM = "ecrs@example.org"
SMTP_SUBJECT = "`ecrs: Crash report ${document.id}`"

🚨 SMTP_SUBJECT is evaled at runtime so be careful what you include; a malicious user may be able to craft a crash report that executes code on your server.

development

Requirements: Node.js LTS 10.x and PostgreSQL 11.x.

git clone https://github.com/johnmuhl/electron-crash-report-server
cd electron-crash-report-server
createdb electron_crash_report_server_development
cp .env.example .env
yarn install
yarn start:dev
# make changes
yarn fmt
yarn test

bugs & features

Use the issue tracker to report bugs or discuss changes and features.

license

The Unlicense