mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 21:45:55 +00:00
Dashboard UI updates, allow multiple expose servers, exclude subdomains
This commit is contained in:
@@ -8,37 +8,24 @@ use LaravelZero\Framework\Commands\Command;
|
||||
use React\EventLoop\LoopInterface;
|
||||
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
|
||||
class ShareFilesCommand extends Command
|
||||
class ShareFilesCommand extends ServerAwareCommand
|
||||
{
|
||||
protected $signature = 'share-files {folder=.} {--name=} {--subdomain=} {--auth=} {--server-host=} {--server-port=}';
|
||||
protected $signature = 'share-files {folder=.} {--name=} {--subdomain=} {--auth=}';
|
||||
|
||||
protected $description = 'Share a local folder with a remote expose server';
|
||||
|
||||
protected function configureConnectionLogger()
|
||||
{
|
||||
app()->bind(CliRequestLogger::class, function () {
|
||||
return new CliRequestLogger(new ConsoleOutput());
|
||||
});
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
if (! is_dir($this->argument('folder'))) {
|
||||
throw new \InvalidArgumentException('The folder '.$this->argument('folder').' does not exist.');
|
||||
}
|
||||
|
||||
$this->configureConnectionLogger();
|
||||
|
||||
$serverHost = $this->option('server-host') ?? config('expose.host', 'localhost');
|
||||
$serverPort = $this->option('server-port') ?? config('expose.port', 8080);
|
||||
$auth = $this->option('auth') ?? config('expose.auth_token', '');
|
||||
|
||||
(new Factory())
|
||||
->setLoop(app(LoopInterface::class))
|
||||
->setHost($serverHost)
|
||||
->setPort($serverPort)
|
||||
->setHost($this->getServerHost())
|
||||
->setPort($this->getServerPort())
|
||||
->setAuth($auth)
|
||||
->createClient()
|
||||
->shareFolder(
|
||||
|
||||
Reference in New Issue
Block a user