File tree 3 files changed +15
-0
lines changed
3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 7
7
use Laravel \NightwatchAgent \Factories \ServerFactory ;
8
8
use Psr \Http \Message \ResponseInterface ;
9
9
use React \EventLoop \Loop ;
10
+ use RuntimeException ;
10
11
use Throwable ;
11
12
12
13
use function date ;
14
+ use function file_get_contents ;
13
15
use function gethostname ;
14
16
use function round ;
15
17
use function str_replace ;
46
48
$ ingestTimeout ??= 10 ;
47
49
/** @var ?string $server */
48
50
$ server ??= (string ) gethostname ();
51
+ /** @var ?string $signature */
52
+ $ signature ??= (function () use ($ basePath ) {
53
+ $ signature = file_get_contents ($ basePath .'/../../version.txt ' );
49
54
55
+ if ($ signature === false ) {
56
+ throw new RuntimeException ('Unable to verify the signature file ' );
57
+ }
50
58
59
+ return $ signature ;
60
+ })();
51
61
52
62
/*
53
63
* Logging helpers...
Original file line number Diff line number Diff line change 3
3
namespace Laravel \Nightwatch \Console ;
4
4
5
5
use Illuminate \Console \Command ;
6
+ use Laravel \Nightwatch \Ingest ;
6
7
use SensitiveParameter ;
7
8
use Symfony \Component \Console \Attribute \AsCommand ;
8
9
@@ -54,6 +55,8 @@ public function handle(): void
54
55
55
56
$ server = $ this ->option ('server ' ) ?? $ this ->server ;
56
57
58
+ $ signature = Ingest::AGENT_SIGNATURE ;
59
+
57
60
require __DIR__ .'/../../agent/build/agent.phar ' ;
58
61
}
59
62
}
Original file line number Diff line number Diff line change 11
11
*/
12
12
final class Ingest implements LocalIngest
13
13
{
14
+ public const AGENT_SIGNATURE = 'EA7F6BABFE0D3F3B53FEE7E9C5F2E657FAF8CA6156CC92AF7ADC0F750930A98963BC7BB69056C010F4A5B77B4B53C064618A53DE62B1B482A2D75EAEDA38B682 ' ;
15
+
14
16
/**
15
17
* @var (callable(string): void)|null
16
18
*/
You can’t perform that action at this time.
0 commit comments