From 876a11cd99c72159430a0bb8d8d8b302bbcdf318 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Thu, 2 May 2024 00:39:33 +0400 Subject: [PATCH] Update readme --- README.md | 8 +++++++- src/Config/Server/Frontend.php | 2 +- src/Config/Server/TcpPorts.php | 2 +- src/Service/Config/Env.php | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f006d738..019bad02 100644 --- a/README.md +++ b/README.md @@ -154,9 +154,15 @@ Sometimes, it's convenient to run Trap on the same ports that [Buggregator](http uses by default. Well, that's also possible: ```bash -vendor/bin/trap -p1025 -p9912 -p9913 -p8000 +vendor/bin/trap -p1025 -p9912 -p9913 -p8000 --ui=8080 ``` +Environment variables can also be used to set endpoints: +- `TRAP_TCP_PORTS` - for TCP traffic: `9912,9913,1025,8000` +- `TRAP_TCP_HOST` - for the TCP host (default: `127.0.0.1`) +- `TRAP_UI_PORT` - for the web interface: `8080` + + ### Choosing Your Senders Buggregator Trap provides a variety of "senders" that dictate where the dumps will be sent. Currently, the available diff --git a/src/Config/Server/Frontend.php b/src/Config/Server/Frontend.php index 8ad3bb60..115073c1 100644 --- a/src/Config/Server/Frontend.php +++ b/src/Config/Server/Frontend.php @@ -14,7 +14,7 @@ final class Frontend { /** @var int<1, 65535> */ - #[Env('TRAP_FRONTEND_PORT')] + #[Env('TRAP_UI_PORT')] #[InputOption('ui')] #[XPath('/trap/frontend/@port')] public int $port = 8000; diff --git a/src/Config/Server/TcpPorts.php b/src/Config/Server/TcpPorts.php index 7a537c69..513a2955 100644 --- a/src/Config/Server/TcpPorts.php +++ b/src/Config/Server/TcpPorts.php @@ -22,7 +22,7 @@ final class TcpPorts */ #[Env('TRAP_TCP_PORTS')] #[InputOption('port')] - public array $ports = [9912, 9913]; + public array $ports = [9912]; /** * Host to listen diff --git a/src/Service/Config/Env.php b/src/Service/Config/Env.php index 5ce1d1d3..a8633324 100644 --- a/src/Service/Config/Env.php +++ b/src/Service/Config/Env.php @@ -7,7 +7,7 @@ /** * @internal */ -#[\Attribute(\Attribute::TARGET_PROPERTY)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)] final class Env implements ConfigAttribute { public function __construct(