diff --git a/app/Contracts/ConnectionManager.php b/app/Contracts/ConnectionManager.php index b4b5397..2898ded 100644 --- a/app/Contracts/ConnectionManager.php +++ b/app/Contracts/ConnectionManager.php @@ -6,7 +6,7 @@ use App\Server\Connections\ControlConnection; use App\Server\Connections\HttpConnection; use Ratchet\ConnectionInterface; -interface connectionmanager +interface ConnectionManager { public function storeConnection(string $host, ?string $subdomain, ?string $serverHost, ConnectionInterface $connection): ControlConnection; diff --git a/app/Logger/LoggedRequest.php b/app/Logger/LoggedRequest.php index 8ef568d..11ae899 100644 --- a/app/Logger/LoggedRequest.php +++ b/app/Logger/LoggedRequest.php @@ -49,6 +49,7 @@ class LoggedRequest implements \JsonSerializable /** * {@inheritdoc} */ + #[\ReturnTypeWillChange] public function jsonSerialize() { $data = [ diff --git a/app/Server/Configuration.php b/app/Server/Configuration.php index e70e2c2..5b048f6 100644 --- a/app/Server/Configuration.php +++ b/app/Server/Configuration.php @@ -40,6 +40,7 @@ class Configuration implements \JsonSerializable /** * {@inheritdoc} */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return array_merge([ diff --git a/app/Server/Http/Controllers/Admin/AdminController.php b/app/Server/Http/Controllers/Admin/AdminController.php index 21601dd..dcf5cd3 100644 --- a/app/Server/Http/Controllers/Admin/AdminController.php +++ b/app/Server/Http/Controllers/Admin/AdminController.php @@ -14,7 +14,7 @@ abstract class AdminController extends Controller protected function shouldHandleRequest(Request $request, ConnectionInterface $httpConnection): bool { try { - $authorization = Str::after($request->header('Authorization'), 'Basic '); + $authorization = Str::after($request->header('Authorization', ''), 'Basic '); $authParts = explode(':', base64_decode($authorization), 2); [$user, $password] = $authParts; diff --git a/app/Server/Http/Controllers/Admin/UpdateUsersController.php b/app/Server/Http/Controllers/Admin/UpdateUsersController.php deleted file mode 100644 index 0d83292..0000000 --- a/app/Server/Http/Controllers/Admin/UpdateUsersController.php +++ /dev/null @@ -1,54 +0,0 @@ -userRepository = $userRepository; - } - - public function handle(Request $request, ConnectionInterface $httpConnection) - { - $validator = Validator::make($request->all(), [ - 'name' => 'required', - ], [ - 'required' => 'The :attribute field is required.', - ]); - - if ($validator->fails()) { - $httpConnection->send(respond_json(['errors' => $validator->getMessageBag()], 401)); - $httpConnection->close(); - - return; - } - - $insertData = [ - 'name' => $request->get('name'), - 'auth_token' => $request->get('token', (string) Str::uuid()), - 'can_specify_subdomains' => (int) $request->get('can_specify_subdomains'), - 'can_specify_domains' => (int) $request->get('can_specify_domains'), - 'can_share_tcp_ports' => (int) $request->get('can_share_tcp_ports'), - 'max_connections' => (int) $request->get('max_connections'), - ]; - - $this->userRepository - ->storeUser($insertData) - ->then(function ($user) use ($httpConnection) { - $httpConnection->send(respond_json(['user' => $user], 200)); - $httpConnection->close(); - }); - } -} diff --git a/app/Server/Http/Controllers/ControlMessageController.php b/app/Server/Http/Controllers/ControlMessageController.php index e5d042d..e3becba 100644 --- a/app/Server/Http/Controllers/ControlMessageController.php +++ b/app/Server/Http/Controllers/ControlMessageController.php @@ -332,7 +332,7 @@ class ControlMessageController implements MessageComponentInterface }); if (count($foundSubdomains) > 0 && ! is_null($user) && is_null($ownSubdomain)) { - $message = config('expose.admin.messages.subdomain_reserved'); + $message = config('expose.admin.messages.subdomain_reserved', ''); $message = str_replace(':subdomain', $subdomain, $message); $connection->send(json_encode([ diff --git a/builds/expose b/builds/expose index be1603e..98075ea 100755 Binary files a/builds/expose and b/builds/expose differ diff --git a/composer.json b/composer.json index 351d40f..ee71014 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "clue/reactphp-sqlite": "dev-modular-worker-for-phar-support", "guzzlehttp/guzzle": "^7.2", "guzzlehttp/psr7": "^1.7", + "illuminate/log": "^8.0", "illuminate/http": "5.8.* || ^6.0 || ^7.0 || ^8.0", "illuminate/pipeline": "^7.6 || ^8.0", "illuminate/validation": "^7.7 || ^8.0", diff --git a/config/app.php b/config/app.php index d83ad80..868defa 100644 --- a/config/app.php +++ b/config/app.php @@ -26,7 +26,7 @@ return [ | */ - 'version' => '2.0.2', + 'version' => '2.1.0', /* |-------------------------------------------------------------------------- @@ -59,4 +59,6 @@ return [ Illuminate\Translation\TranslationServiceProvider::class, ], + 'locale' => 'en', + ]; diff --git a/expose b/expose index 527e03e..710be54 100755 --- a/expose +++ b/expose @@ -19,7 +19,7 @@ define('LARAVEL_START', microtime(true)); $autoloader = require file_exists(__DIR__.'/vendor/autoload.php') ? __DIR__.'/vendor/autoload.php' : __DIR__.'/../../autoload.php'; -$options = getopt(null, [ +$options = getopt('', [ 'sqlite-worker', ]); if (isset($options['sqlite-worker'])) { diff --git a/resources/views/client/dashboard.twig b/resources/views/client/dashboard.twig index 128e820..4e46acc 100644 --- a/resources/views/client/dashboard.twig +++ b/resources/views/client/dashboard.twig @@ -484,7 +484,7 @@