2020-06-04 17:38:27 +05:30
|
|
|
# rageshake [![Build status](https://badge.buildkite.com/76a4362a20b12dcd589f9308a905ffcc537278b9c363c0b5f1.svg?branch=master)](https://buildkite.com/matrix-dot-org/rageshake)
|
2017-04-04 20:49:18 +05:30
|
|
|
|
|
|
|
Web service which collects and serves bug reports.
|
|
|
|
|
2019-06-18 15:24:40 +05:30
|
|
|
rageshake requires Go version 1.11 or later.
|
2017-04-07 20:13:19 +05:30
|
|
|
|
2017-04-04 20:49:18 +05:30
|
|
|
To run it, do:
|
|
|
|
|
|
|
|
```
|
2019-06-18 15:19:26 +05:30
|
|
|
go build
|
2017-04-10 19:09:10 +05:30
|
|
|
./bin/rageshake
|
2017-04-04 20:49:18 +05:30
|
|
|
```
|
|
|
|
|
2017-04-10 19:09:10 +05:30
|
|
|
Optional parameters:
|
2017-04-07 20:13:19 +05:30
|
|
|
|
2017-04-12 19:52:28 +05:30
|
|
|
* `-config <path>`: The path to a YAML config file; see
|
|
|
|
[rageshake.sample.yaml](rageshake.sample.yaml) for more information.
|
2017-04-10 19:09:10 +05:30
|
|
|
* `-listen <address>`: TCP network address to listen for HTTP requests
|
|
|
|
on. Example: `:9110`.
|
2017-04-04 20:49:18 +05:30
|
|
|
|
|
|
|
## HTTP endpoints
|
|
|
|
|
|
|
|
The following HTTP endpoints are exposed:
|
|
|
|
|
|
|
|
### GET `/api/listing/`
|
|
|
|
|
|
|
|
Serves submitted bug reports. Protected by basic HTTP auth using the
|
|
|
|
username/password provided in the environment. A browsable list, collated by
|
|
|
|
report submission date and time.
|
|
|
|
|
|
|
|
### POST `/api/submit`
|
|
|
|
|
|
|
|
Submission endpoint: this is where applications should send their reports.
|
|
|
|
|
2017-04-18 20:13:04 +05:30
|
|
|
The body of the request should be a multipart form-data submission, with the
|
|
|
|
following form field names. (For backwards compatibility, it can also be a JSON
|
|
|
|
object, but multipart is preferred as it allows more efficient transfer of the
|
|
|
|
logs.)
|
2017-04-04 20:49:18 +05:30
|
|
|
|
|
|
|
* `text`: A textual description of the problem. Included in the
|
|
|
|
`details.log.gz` file.
|
|
|
|
|
|
|
|
* `user_agent`: Application user-agent. Included in the `details.log.gz` file.
|
|
|
|
|
2017-04-12 19:36:40 +05:30
|
|
|
* `app`: Identifier for the application (eg 'riot-web'). Should correspond to a
|
|
|
|
mapping configured in the configuration file for github issue reporting to
|
|
|
|
work.
|
2017-04-11 16:51:30 +05:30
|
|
|
|
2017-04-04 20:49:18 +05:30
|
|
|
* `version`: Application version. Included in the `details.log.gz` file.
|
|
|
|
|
2017-05-03 15:03:27 +05:30
|
|
|
* `label`: Label to attach to the github issue, and include in the details file.
|
|
|
|
|
|
|
|
If using the JSON upload encoding, this should be encoded as a `labels` field,
|
|
|
|
whose value should be a list of strings.
|
|
|
|
|
2017-04-18 20:13:04 +05:30
|
|
|
* `log`: a log file, with lines separated by newline characters. Multiple log
|
|
|
|
files can be included by including several `log` parts.
|
2017-04-04 20:49:18 +05:30
|
|
|
|
2017-05-04 20:28:23 +05:30
|
|
|
If the log is uploaded with a filename `name.ext`, where `name` contains only
|
|
|
|
alphanumerics, `.`, `-` or `_`, and `ext` is one of `log` or `txt`, then the
|
|
|
|
file saved to disk is based on that. Otherwise, a suitable name is
|
|
|
|
constructed.
|
|
|
|
|
2017-04-18 20:13:04 +05:30
|
|
|
If using the JSON upload encoding, the request object should instead include
|
|
|
|
a single `logs` field, which is an array of objects with the following
|
|
|
|
fields:
|
|
|
|
|
2017-05-04 20:28:23 +05:30
|
|
|
* `id`: textual identifier for the logs. Used as the filename, as above.
|
2017-04-18 20:13:04 +05:30
|
|
|
* `lines`: log data. Newlines should be encoded as `\n`, as normal in JSON).
|
|
|
|
|
2017-04-18 20:17:45 +05:30
|
|
|
* `compressed-log`: a gzipped logfile. Decompressed and then treated the same as
|
|
|
|
`log`.
|
|
|
|
|
|
|
|
Compressed logs are not supported for the JSON upload encoding.
|
|
|
|
|
2017-05-02 22:23:12 +05:30
|
|
|
* `file`: an arbitrary file to attach to the report. Saved as-is to disk, and
|
|
|
|
a link is added to the github issue. The filename must be in the format
|
|
|
|
`name.ext`, where `name` contains only alphanumerics, `-` or `_`, and `ext`
|
|
|
|
is one of `jpg`, `png`, or `txt`.
|
|
|
|
|
|
|
|
Not supported for the JSON upload encoding.
|
|
|
|
|
2017-04-18 20:13:04 +05:30
|
|
|
* Any other form field names are interpreted as arbitrary name/value strings to
|
|
|
|
include in the `details.log.gz` file.
|
|
|
|
|
|
|
|
If using the JSON upload encoding, this additional metadata should insted be
|
|
|
|
encoded as a `data` field, whose value should be a JSON map. (Note that the
|
|
|
|
values must be strings; numbers, objects and arrays will be rejected.)
|
2017-04-11 16:51:30 +05:30
|
|
|
|
2017-04-18 16:25:22 +05:30
|
|
|
The response (if successful) will be a JSON object with the following fields:
|
|
|
|
|
|
|
|
* `report_url`: A URL where the user can track their bug report. Omitted if
|
|
|
|
issue submission was disabled.
|
2020-09-02 20:32:54 +05:30
|
|
|
|
|
|
|
## Notifications
|
|
|
|
|
|
|
|
You can get notifications when a new rageshake arrives on the server.
|
|
|
|
|
|
|
|
Currently this tool supports pushing notifications as GitHub issues in a repo,
|
|
|
|
through a Slack webhook or by email, cf sample config file for how to
|
|
|
|
configure them.
|