mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
detect valet secured sites automatically
This commit is contained in:
@@ -8,7 +8,9 @@ class ShareCurrentWorkingDirectoryCommand extends ShareCommand
|
|||||||
|
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$this->input->setArgument('host', basename(getcwd()).'.'.$this->detectTld());
|
$host = $this->prepareSharedHost(basename(getcwd()).'.'.$this->detectTld());
|
||||||
|
|
||||||
|
$this->input->setArgument('host', $host);
|
||||||
|
|
||||||
if (! $this->hasOption('subdomain')) {
|
if (! $this->hasOption('subdomain')) {
|
||||||
$subdomain = str_replace('.', '_', basename(getcwd()));
|
$subdomain = str_replace('.', '_', basename(getcwd()));
|
||||||
@@ -30,4 +32,15 @@ class ShareCurrentWorkingDirectoryCommand extends ShareCommand
|
|||||||
|
|
||||||
return config('expose.default_tld', 'test');
|
return config('expose.default_tld', 'test');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function prepareSharedHost($host): string
|
||||||
|
{
|
||||||
|
$certificateFile = ($_SERVER['HOME'] ?? $_SERVER['USERPROFILE']).DIRECTORY_SEPARATOR.'.config'.DIRECTORY_SEPARATOR.'valet'.DIRECTORY_SEPARATOR.'Certificates'.DIRECTORY_SEPARATOR.$host.'.crt';
|
||||||
|
|
||||||
|
if (file_exists($certificateFile)) {
|
||||||
|
return 'https://'.$host;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $host;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
"ratchet/pawl": "^0.3.4",
|
"ratchet/pawl": "^0.3.4",
|
||||||
"react/http": "^0.8.6",
|
"react/http": "^0.8.6",
|
||||||
"react/stream": "^1.1.1",
|
"react/stream": "^1.1.1",
|
||||||
"react/socket": "^1.4",
|
"react/socket": "dev-master as 1.1",
|
||||||
"riverline/multipart-parser": "^2.0",
|
"riverline/multipart-parser": "^2.0",
|
||||||
"symfony/expression-language": "^5.0",
|
"symfony/expression-language": "^5.0",
|
||||||
"symfony/http-kernel": "^4.0|^5.0",
|
"symfony/http-kernel": "^4.0|^5.0",
|
||||||
|
|||||||
1257
composer.lock
generated
1257
composer.lock
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user