This commit is contained in:
Marcel Pociot
2022-02-24 12:58:39 +01:00
parent 83f49d49c2
commit 117424cf0e
4 changed files with 238 additions and 39 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Commands;
use App\Client\Factory;
use Illuminate\Support\Str;
use React\EventLoop\LoopInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ShareCommand extends ServerAwareCommand
{
@@ -15,6 +16,7 @@ class ShareCommand extends ServerAwareCommand
public function handle()
{
$auth = $this->option('auth') ?? config('expose.auth_token', '');
$this->info('Using auth token: '.$auth, OutputInterface::VERBOSITY_DEBUG);
if (strstr($this->argument('host'), 'host.docker.internal')) {
config(['expose.dns' => true]);
@@ -36,12 +38,12 @@ class ShareCommand extends ServerAwareCommand
if (! is_null($this->option('subdomain'))) {
$subdomains = explode(',', $this->option('subdomain'));
$this->info('Trying to use custom domain: '.$subdomains[0]);
$this->info('Trying to use custom domain: '.$subdomains[0].PHP_EOL, OutputInterface::VERBOSITY_VERBOSE);
} else {
$host = Str::beforeLast($this->argument('host'), '.');
$host = Str::beforeLast($host, ':');
$subdomains = [Str::slug($host)];
$this->info('Trying to use custom domain: '.$subdomains[0].PHP_EOL);
$this->info('Trying to use custom domain: '.$subdomains[0].PHP_EOL, OutputInterface::VERBOSITY_VERBOSE);
}
(new Factory())