| Age | Commit message (Collapse) | Author |
|
The original idea of "trunks" is because the core library that we
use for load testing is named "vegeta" (from Dragon Ball) [1][2], and
Vegeta has a son named Trunks.
In English, trunks also have multiple meanings.
In order to have a unique name, we rename the project to "gorankusu",
which is a combination of "go" (the main programming language
that built the application) and "torankusu" the Hepburn of "Trunks".
[1]: https://github.com/tsenart/vegeta/
[2]: https://en.wikipedia.org/wiki/Vegeta
Implements: https://todo.sr.ht/~shulhan/gorankusu/2
|
|
The FormInput now can be set to FormInputKindFile that will rendered
as "<input type='file' ...>" on the web user interface.
Once submitted, the file name, type, size, and lastModification will
be stored under FormInput Filename, Filetype, Filesize, and Filemodms.
Implements: https://todo.sr.ht/~shulhan/trunks/1
|
|
The HTTPRequestDumper define an handler to convert [http.Request] into
[RunResponse] DumpRequest.
The HTTPResponseDumper define an handler to convert [http.Response]
into [RunResponse] DumpResponse.
|
|
Most of the fixes related to naming variables with acronyms, for example
HTTP, JSON, URL, and so on.
|
|
If HTTP Path contains key, for example "/:book", and the Params contains
the same key, the Path will be filled with value from Params.
The same key in Params will be deleted and not send on query parameter
or body.
|
|
This release only have chores, it should not break anything.
* go.mod: update all dependencies
This changes set minimum Go version to version 1.20.
The vegeta module finally has some update to v12.11.1.
* gitmodules: use https instead of git scheme
Using git scheme require private key to clone the remote repository.
* _www: update wui module
* _www: setup eslint for linting TypeScript files
This changes also apply all eslint recommendations.
* Makefile: replace the Go linter and apply all their recommendations
Previously, we use golangci-lint as linter. This linter does not
provides any useful recommendation lately and the development is quite
a mess, sometimes its break when using Go tip.
In this changes we replace it with revive, fieldalignment, and shadow;
and fix all of their recommendations.
|
|
Previously, we use golangci-lint as linter.
This linter does not provides any useful recommendation lately and the
development is quite a mess, sometimes its break when using Go tip.
In this changes we replace it with revive, fieldalignment, and shadow;
and fix all of their recommendations.
|
|
=== Bug fixes
* all: fix panic when attacking HTTP due to nil Attack handler
=== Enhancements
* _www: replace WebSocket handlers with HTTP endpoints
* all: add boolean Kind for FormInput, FormInputKindBoolean
* all: check and call ConvertParams when running HttpTarget
=== Chores
* all: move the _doc directory under _www
* all: convert the README from asciidoc to markdown
* all: remove WebSocket server
* go.mod: set Go version to 1.19 and update all dependencies
|
|
Using WebSocket for communication in client require additional
setup, especially if its behind proxy.
For example, if we server the trunks server under domain testing.local
behind proxy, we need to setup route for the WebSocket too.
|
|
This endpoints similar that we have in the WebSocket.
The idea is to replace the WebSocket endpoints with this one.
|
|
In attack endpoint, check if the Attack is nil before we push the request
to attack queue.
|
|
The req, RunRequest instance, is from request so the
HttpTarget.ConvertParams need to be set from the original HttpTarget.
This fix the conditional rr.HttpTarget.ConvertParams == nil always true
when calling runHttpTarget.
|
|
If the ConvertParams field is set, use it to convert the parameters into
desired type.
|
|
This release set the minimum Go version to 1.18 and update all modules.
== Chores
* all: group all documentations under directory _doc
* example: fix the HTTP POST handler
* all: remove unused field Locker in RunRequest
* all: fix all linter warnings
|
|
The mlog functions automatically add new line to each format, so we
did not need to add it manually.
|
|
|
|
See https://kilabit.info/journal/2022/gpl for more information.
|
|
Module trunks is a library and HTTP service that provide web user interface
to test HTTP service, similar to Postman, and for load testing.
For the load testing we use vegeta [1] as the backend.
|
|
|
|
Using Trunks.RegisterNavLink, one can register custom link into
left navigation menu.
|
|
Changes,
* AttackResult storage size decreased -24 bytes
* Environment storage size decreased -32 bytes
* HttpTarget storage size decreased -24 bytes
* RunRequest storage size decreased -32 bytes
* RunResponse storage size decreased -8 bytes
* Target storage size decreased -16 bytes
* WebSocketTarget storage size decreased -8 bytes
|
|
Previously, we have a workers to recompile TypeScript and regenerate
HTML files from adoc inside the Trunks type. The workers will run
if the environment variable TRUNKS_DEV set to non-zero.
This changes move those workers to the internal/cmd/trunks-example,
because those workers are related for development only not for running
Trunks server.
|
|
When the attack finished, the WebSocket server will broadcast the
result to all clients as message "/_trunks/api/attack/result".
|
|
Setting the websocket listen address on environment require,
re-parsing address port on the web side to connect to the server.
In order to simplify creating connection on client, we set only the
websocket port in the environment.
|
|
Instead of re-run the commands to recompile and embed for each file
changes on _www, we queue changes into channel and run the recompile
only if the channel is not empty.
|
|
The WebSocket API replace the HTTP APIs for running and canceling
attack. Later, it will use to notify the result of attack.
|
|
Since we will implement API using WebSocket later, we need to split
between the one that manage HTTP and one that manage WebSocket.
|
|
Previously to developer and test trunks on local we need to run "tsc -w"
on directory _www to watch and recompile any changes to TypeScript files,
and run "go run ./cmd/trunks-example" to view the Trunks web interface.
Since we will have internal documentation inside _www/docs, we need
to run another ciigo server that watch any changes to .adoc files
and convert it to HTML.
Three separate commands for development.
This changes refactoring the development process by running two
goroutines when TRUNKS_DEV environment variable is set to non-empty.
One goroutine watch any changes to TypeScript, HTML, and
tsconfig files inside the _www, and when there is an update it will
execute "tsc -p" to recompile and "go run ./internal/generate-memfs" to
embed them into Go source.
Another goroutine watch any changes to .adoc files inside "_www/docs"
directory and convert them into HTML files.
This goroutine will running in the background while the HTTP server is
running too.
|
|
If the content-type of request is multipart/form-data, convert the
parameters in HttpTarget using ToMultipartFormData().
|
|
In case two or more users access the Trunks web and set the target
variables, the last user that run any HttpTarget will set the
Target variables or HttpTarget headers/variables.
The next user that open the Trunks web will see the values of headers
and variables from the latest run.
This changes fix this issue by generating new RunRequest using request
original target
|
|
Since the HttpTarget Params type changes to KeyFormInput, we cannot
use the Params directly but need to convert it JSON object first
using map[string]interface{}.
|
|
Any response from the trunks API must have the following format,
{
"code": <number>,
"message": <number>,
"data": <object>
}
|
|
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
Check for error where it should and remove unused return and methods.
|
|
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.
|
|
The BaseUrl seems like not a good fit on AttackOptions since its
should never changes, so we move it to the Target.
|
|
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.
|
|
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.
|
|
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.
|
|
* 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
|
|
|
|
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.
|
|
Trunks is a library and HTTP service that provide web user interface
to test HTTP service, similar to Postman, and for load testing.
For the load testing we use vegeta [1] as the backend.
[1] https://github.com/tsenart/vegeta
|