summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-18all: add "Hint" for Target, HTTP, and WebSocket TargetShulhan
The "Hint" provide a general description for Target, a single HttpTarget, and WebSocketTarget.
2021-09-18_www: add "hint" for input of Environment and Attack optionsShulhan
The hint is a text that will be displayed when the icon "i" on the right side of input is clicked. It provide a description of input.
2021-09-18www: refactoring using TypeScript and wui libraryShulhan
Previously, the web user interface is written in pure, single JavaScript file. The LOC is short but its become hard to maintenance, especially when there is a change in HTML layout or on the response format. This changes rewrite the interface to use TypeScript in order to easily maintenance. The generated JavaScript is loaded using module [1]. [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
2021-09-09_www: set the HTTP and WebSocket background titleShulhan
This is to make the target title distinguishable in between another titles.
2021-09-09_www: make the target also clickableShulhan
Previously only HTTP/WS targets that have their link when the navigation item is clicked. This changes make the header target to be clickable too. Also, changes the hash path to use the following format, * "/${target.ID}" - for target only * "/${target.ID}/http/${httptarget.ID}" - for HTTP target * "/${target.ID}/ws/${httptarget.ID}" - for WebSocket target
2021-09-06all: set the original HTTP target if IsCustomizable is trueShulhan
If the HTTP target IsCustomizable, user can set the request method, path, and/or request type. When user changes those values, the values should overwrite the configuration on server, so the Run method can use it for creating request.
2021-09-02_www: implement hash location on each targetShulhan
When user click the target, the location hash will be set to the target id. By setting the hash, we can allow user to refresh the page and render the previous selected target.
2021-09-02_www: hide the "Attack results" on each target if AllowAttack is falseShulhan
2021-09-02_www: reformat all with new prettier configShulhan
2021-08-07_www: only show Attack button if AllowAttack is trueShulhan
Previously, the Attack button always showed even for HTTP target that have AllowAttack false. This can be misleading for user. This changes, show the Attack button only if AllowAttack is true. While at it, reformat the JavaScript file with prettier.
2021-08-07all: embed the stylesheet directly into HTML fileShulhan
This is to minimize number of files being served by server.
2021-08-06go.mod: update the share module to v0.29.1Shulhan
2021-08-06all: add an handler ConvertParams to HttpTargetShulhan
The ConvertParams is a function that will be called inside the Run handler to convert the Params values to type that will be send as request.
2021-04-15_www: make the WebSocket target have the same style with HttpTargetShulhan
2021-04-15all: add function to clear output of HTTP and WebSocket TargetShulhan
2021-04-15all: store the response type and bodyShulhan
If the response type is "application/json", display the body as formatted JSON with two space identation.
2021-04-15_www: do not render empty headers and/or empty parametersShulhan
2021-04-15_www: allow changing the target variablesShulhan
When the target variables changes and user click "Run" all of its modified values will be passed inside Target.Vars.
2021-04-09all: reformat "if ... && ..." on RunRequestShulhan
2021-04-09_www: allow changing Target optionsShulhan
When user changes the Target Options, including Duration, Rate per second, and Timeout; store its value back to Target instance and pass it when calling attack.
2021-04-09all: wrap the websocket Run response inside the EndpointResponseShulhan
Any response from the trunks API must have the following format, { "code": <number>, "message": <number>, "data": <object> }
2021-04-09all: fix HTTP Run not called when executed from APIShulhan
2021-04-09all: fix double slash when logging attack URLShulhan
2021-04-09all: check for nil PreAttack when on worker attack queueShulhan
If the HttpTarget.PreAttack is not set we should not call it. While at it, reset the RunRequest result to nil at the end of attack.
2021-04-09all: return non-nil on ToHttpHeader, ToMultipartForm, and ToUrlValuesShulhan
The returned value can be set by the caller later, so to minimize checking for nil and recreate the instance, initialize the value in the function and return it even if its empty.
2021-04-09all: change the WebSocket run return type to interface{}Shulhan
Instead of []byte, the call to Run on WebSocketTarget can return anything, since we will wrap it inside the EndpointRequest.Data later.
2021-04-09_www: display Target Vars and HTTP Target headers in two rowsShulhan
The Target Vars or HTTP Target headers names can be longer and it will overlap with input if its displayed in one row. This changes render the Vars and headers label in single row and the input in another row below it.
2021-04-09all: add task to generate embedded files in _wwwShulhan
The content of _www directory is required to run the trunks as library.
2021-04-07go.mod: update the share module to v0.25.1Shulhan
2021-04-07_screenshots: update the screenshot with cropped imagesShulhan
2021-03-27_www: display list of HTTP and WebSocket target on navigationShulhan
While at it, fix height and autoscroll on left navigation.
2021-03-27all: change the Run result to return dump of HTTP request and responseShulhan
Previously, we display the actual response of the HTTP target only on the user interface. This changes make the Run function to display the actual HTTP request and response that being send and received on HTTP target.
2021-03-27all: allow client to customize request method, path, and typeShulhan
Previously, the HttpTarget Method, Path, and RequestType is fixed. Once its declared, the Run method will use the defined values to generate and call HTTP request. This changes add IsCustomizable field on HttpTarget. If its true, client or web user interface can modify the request method, path, and type. The values send by client to server after changes will be used instead of the fixed values. This changes also make the Run handler on HttpTarget to be optional. If its not defined, it will generated the HTTP request from the method, path, and type passed to server.
2021-03-27cmd: rename the program trunks to trunks-exampleShulhan
The trunks directory on command is actually the main program for example package.
2021-03-27all: make the HttpTarget Name to be requiredShulhan
Previously, the HttpTarget Name field is optional, and the ID is derived from Path. This changes make the Name field become required and changes the ID to be derived from Name instead of Path, because one or more same path can be used by more HttpTarget.
2021-03-24all: fix and update linter warningsShulhan
Check for error where it should and remove unused return and methods.
2021-03-24all: implement target for WebSocketShulhan
One can register WebSocketTarget just like HttpTarget, its have ID, Name, Headers, and Params. Unlike HTTP, the WebSocket target only able to execute Run, it does not have "Attack", yet.
2021-03-24all: move BaseUrl from AttackOptions to TargetShulhan
The BaseUrl seems like not a good fit on AttackOptions since its should never changes, so we move it to the Target.
2021-03-22all: add badge for pkg.go.dev and fix example package link on UsageShulhan
2021-03-22all: add README and update the package documentationShulhan
The README briefly describe the module and show some screenshots, similar with the module documentation.
2021-03-22_www: ask for confirmation before deleting resultShulhan
2021-03-22_www: make the layout to be responsiveShulhan
The minimize screen size is 740px when the layout become one column, from top to bottom, instead of two-columns, left and right.
2021-03-21all: implement interface and API to cancel running attackShulhan
On the top of the page, it will display currently running attack with target name and HTTP target name. User can cancel the attack by clicking "Cancel" button on the right.
2021-03-21all: implement interface and API to delete attack resultShulhan
When user clicking the "Delete" button on attack result item, it will send request to API to delete the selected item. Server will check if the requested result file name exist and delete them from file system if its exist, otherwise it will return 404 Not found.
2021-03-21all: load pass attack results and implement function to get attack resultShulhan
When the service started, it will load all previous attack results from directory Environment.ResultsDir. It will only scan the file name and append it to HttpTarget.Results due to the size and time to load one of them can take time. Through the web interface, user can click "Show" button to load the result and display it on the screen.
2021-03-21all: various changesShulhan
* Increase the DEBUG value to 3 to match with latest libhttp fix debug output of client request * _www: fix rendering HTTP headers, missing "target" parameter * Remove unused "IsRunning" from AttackResult * example: add an example endpoint for POST with x-www-form-urlencoded * Remove parameter Target on HttpRunHandler. The Target value can be retrieved from RunRequest.Target. * Target: change the field Vars type from map[string]string to KeyValue * Trunks: merge Target and HttpRequest from request to original Target and HttpTarget respectively before calling Run * Prefix the result file name with Target.ID * Move the package documentation to doc.go
2021-03-21all: rename loadTestingResult to AttackResultShulhan
2021-03-21all: remove unused request and WebSocketTarget typesShulhan
The request type has been replaced with RunRequest. The WebSocketTarget may be used again later, but let remove then now to make the documentation clear.
2021-03-21all: implement API and interface for attack functionalityShulhan
When the user click "Attack" it will call the API to run the load testing. If there is load testing currently, it will return with an error. On success, the result of load testing will be stored on directory defined in Environment.ResultsDir with file named <HttpTarget.ID>.<date_time>.<RPS>x<Duration>s.<ResultsSuffix>.bin This file contains the vegeta.Results.
2021-03-16all: update the vegeta to use module pathShulhan
The correct module name registered on go.mod is github.com/tsenart/vegeta/v12.