mirror of
https://github.com/bitinflow/expose.git
synced 2026-10-31 20:59:09 +00:00
detect valet secured sites automatically
This commit is contained in:
1 parent
38efb0b879
commit
18d67abc3f
3 files changed
+107
-1167
No files matched your search
@@ -8,7 +8,9 @@ class ShareCurrentWorkingDirectoryCommand extends ShareCommand
|
||||
|
||||
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')) {
|
||||
$subdomain = str_replace('.', '_', basename(getcwd()));
|
||||
@@ -30,4 +32,15 @@ class ShareCurrentWorkingDirectoryCommand extends ShareCommand
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -42,7 +42,7 @@
|
||||
"ratchet/pawl": "^0.3.4",
|
||||
"react/http": "^0.8.6",
|
||||
"react/stream": "^1.1.1",
|
||||
"react/socket": "^1.4",
|
||||
"react/socket": "dev-master as 1.1",
|
||||
"riverline/multipart-parser": "^2.0",
|
||||
"symfony/expression-language": "^5.0",
|
||||
"symfony/http-kernel": "^4.0|^5.0",
|
||||
|
||||
Generated
+92
-1165
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user