Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:10-alpine

COPY . /usr/local/caliper/

ENV MINI_BREAKPAD_SERVER_PORT 8080

RUN apk add --no-cache -q git && cd /usr/local/caliper && npm install && ./node_modules/.bin/grunt && npm cache clean --force

RUN chmod 755 /usr/local/caliper/bin/caliper

EXPOSE 8080
VOLUME ["/usr/local/caliper/pool"]

WORKDIR /usr/local/caliper
CMD ["/usr/local/caliper/bin/caliper"]
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Caliper

### Reviving mini-breakpad-server

Mini-breakpad-server is basically abandonded at this point. Breakpad is still amazing technology, and people want to use it. Caliper is intended to be a middle ground between nothing and Socorro (Mozilla's breakpad infrastructure).

## Caliper holds your breaks.

This intends to be a simple server for crash reports sent by
[google-breakpad](https://code.google.com/p/google-breakpad/).

Expand All @@ -15,11 +18,18 @@ This intends to be a simple server for crash reports sent by

## Run

### Using Docker

You can use Dockerfile provided by the repository to build and run server in Docker

### Directly

* `npm install .` -- if this fails make sure you have node-gyp setup correctly
* `grunt`
* Put your breakpad symbols under `pool/symbols/PDBNAME/PDBUNIQUEIDENTIFIER/PDBNAMEASSYM`
* OR send a POST request to your server at /symbol_upload using googles symupload tool.
* OR send a POST request to your server at /symbol_upload?key=APIKEY using google's symupload tool.
* `node lib/app.js`

## Breakpad crash sending

In the SendCrashReport function that breakpad provides, simply put "http://your.site/crash_upload".
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"dirty": "0.9.7",
"express": "4.13.3",
"express-session": "1.11.3",
"formidable": "~1.0.14",
"formidable": "~1.2.2",
"fs-plus": "0.10.0",
"github-releases": "0.1.x",
"glob": "3.x",
"jade": "~0.35.0",
"method-override": "2.3.5",
"minidump": "0.9.0",
"minidump": "0.22.0",
"mkdirp": "~0.3.5",
"node-uuid": "~1.4.1",
"passport": "0.3.0",
Expand Down
5 changes: 3 additions & 2 deletions src/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ app.post '/crash_upload', (req, res, next) ->
res.end()

# handle the sympol upload post command.
app.post '/symbol_upload', isLoggedIn, (req, res, next) ->
return symbols.saveSymbols req, (error, destination) ->
app.post '/symbol_upload', (req, res, next) ->
return next "Invalid key" if req.query.key != api_key
return symbols.saveSymbols req, symbDb, (error, destination) ->
return next error if error?
console.log "Saved Symbols: #{destination}"
return res.end()
Expand Down
5 changes: 3 additions & 2 deletions src/symbols.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mkdirp = require 'mkdirp'
formidable = require 'formidable'

# callback is of the form (error, destination).
module.exports.saveSymbols = (req, callback) ->
module.exports.saveSymbols = (req, symbDb, callback) ->
form = new formidable.IncomingForm()
return form.parse req, (error, fields, files) ->
# return if this is a malformed request.
Expand All @@ -15,7 +15,7 @@ module.exports.saveSymbols = (req, callback) ->

# this puts files in a path of:
# destination + fields.debug_file + debug_identifier
output_file_name = fields.debug_file.replace ".pdb", ".sym"
output_file_name = files.symbol_file.name.replace ".pdb", ".sym"
# TODO: make this serialize-able
destination = "pool/symbols"
destination = path.join destination, fields.debug_file
Expand All @@ -29,4 +29,5 @@ module.exports.saveSymbols = (req, callback) ->
# copy the POST to destination.
fs.copy files.symbol_file.path, destination, (error) ->
return callback new Error("Cannot create file: #{destination}") if error?
symbDb.saveSymbol fields.debug_identifier, fields.debug_file
return callback null, destination