diff --git a/CHANGELOG.md b/CHANGELOG.md index dea6d03..77a7c1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ v1.7 - Fix FLEXIAPI-271 Handle properly reversed attributes in objects - Fix FLEXIAPI-237 Add internationalisation support in the app - Fix FLEXIAPI-261 Remove the TURN part in the XML provisioning (and only keep the API endpoint) +- Fix FLEXIAPI-275 Add names in Spaces v1.6 ---- diff --git a/INSTALL.md b/INSTALL.md index 616f97d..183c2bf 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -80,7 +80,7 @@ Create a first administator account: For example: - php artisan accounts:create-admin-account admin strong_password my-company-sip-domain.tld + php artisan accounts:create-admin-account -u admin -p strong_password -d my-company-sip-domain.tld You can now try to authenticate on the web panel and continue the setup using your admin account. diff --git a/README.md b/README.md index 09d854f..883ba2b 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ FlexiAPI is shipped with several console commands that you can launch using the Create or update a Space, required to then create accounts afterward. The `super` option enable/disable the domain as a super domain. - php artisan spaces:create-update {sip_domain} {host} {--super} + php artisan spaces:create-update {sip_domain} {host} {name} {--super} ### Import the old DotEnv instance configuration into a Space diff --git a/flexiapi/app/Console/Commands/Spaces/CreateUpdate.php b/flexiapi/app/Console/Commands/Spaces/CreateUpdate.php index d7bf3e2..a897704 100644 --- a/flexiapi/app/Console/Commands/Spaces/CreateUpdate.php +++ b/flexiapi/app/Console/Commands/Spaces/CreateUpdate.php @@ -24,7 +24,7 @@ use Illuminate\Console\Command; class CreateUpdate extends Command { - protected $signature = 'spaces:create-update {sip_domain} {host} {--super}'; + protected $signature = 'spaces:create-update {sip_domain} {host} {name} {--super}'; protected $description = 'Create a Space'; public function handle() @@ -42,6 +42,7 @@ class CreateUpdate extends Command $space = Space::where('domain', $this->argument('sip_domain'))->firstOrNew(); $space->host = $this->argument('host'); $space->domain = $this->argument('sip_domain'); + $space->name = $this->argument('name'); $space->exists ? $this->info('The domain already exists, updating it') diff --git a/flexiapi/app/Console/Commands/Spaces/ImportConfigurationFromDotEnv.php b/flexiapi/app/Console/Commands/Spaces/ImportConfigurationFromDotEnv.php index 6dd1c87..31d78d0 100644 --- a/flexiapi/app/Console/Commands/Spaces/ImportConfigurationFromDotEnv.php +++ b/flexiapi/app/Console/Commands/Spaces/ImportConfigurationFromDotEnv.php @@ -23,6 +23,8 @@ class ImportConfigurationFromDotEnv extends Command $this->info('The following configuration will be imported in the space ' . $space->domain); $this->info('The existing settings will be overwritten:'); + $space->name = env('APP_NAME', null); + $space->custom_theme = env('INSTANCE_CUSTOM_THEME', false); $space->web_panel = env('WEB_PANEL', true); diff --git a/flexiapi/app/Helpers/Utils.php b/flexiapi/app/Helpers/Utils.php index 1e49764..a4c9303 100644 --- a/flexiapi/app/Helpers/Utils.php +++ b/flexiapi/app/Helpers/Utils.php @@ -110,7 +110,7 @@ function markdownDocumentationView(string $view): string return (string) $converter->convert( (string)view($view, [ - 'app_name' => config('app.name') + 'app_name' => space()->name ])->render() ); } diff --git a/flexiapi/app/Http/Controllers/Admin/SpaceController.php b/flexiapi/app/Http/Controllers/Admin/SpaceController.php index cf34920..ebe3de3 100644 --- a/flexiapi/app/Http/Controllers/Admin/SpaceController.php +++ b/flexiapi/app/Http/Controllers/Admin/SpaceController.php @@ -62,12 +62,14 @@ class SpaceController extends Controller $request->merge(['full_host' => $fullHost]); $request->validate([ + 'name' => 'required|unique:spaces', 'domain' => 'required|unique:spaces|regex:/'. Space::DOMAIN_REGEX . '/', 'host' => 'nullable|regex:/'. Space::HOST_REGEX . '/', 'full_host' => 'required|unique:spaces,host', ]); $space = new Space(); + $space->name = $request->get('name'); $space->domain = $request->get('domain'); $space->host = $request->get('full_host'); $space->save(); @@ -119,6 +121,7 @@ class SpaceController extends Controller public function administrationUpdate(Request $request, Space $space) { $request->validate([ + 'name' => ['required', Rule::unique('spaces')->ignore($space->id)], 'max_accounts' => 'required|integer|min:0', 'expire_at' => 'nullable|date|after_or_equal:today' ]); @@ -129,6 +132,7 @@ class SpaceController extends Controller ]); } + $space->name = $request->get('name'); $space->super = getRequestBoolean($request, 'super'); $space->max_accounts = $request->get('max_accounts'); $space->expire_at = $request->get('expire_at'); diff --git a/flexiapi/app/Http/Controllers/Api/Account/AccountController.php b/flexiapi/app/Http/Controllers/Api/Account/AccountController.php index a123118..cd3597f 100644 --- a/flexiapi/app/Http/Controllers/Api/Account/AccountController.php +++ b/flexiapi/app/Http/Controllers/Api/Account/AccountController.php @@ -160,7 +160,7 @@ class AccountController extends Controller : config('app.sip_domain'); $account->ip_address = $request->ip(); $account->created_at = Carbon::now(); - $account->user_agent = $request->header('User-Agent') ?? config('app.name'); + $account->user_agent = $request->header('User-Agent') ?? space()->name; $account->save(); $account->updatePassword($request->get('password'), $request->get('algorithm')); @@ -182,7 +182,7 @@ class AccountController extends Controller Log::channel('events')->info('API deprecated: Account created using the public endpoint by phone', ['id' => $account->identifier]); $ovhSMS = new OvhSMS; - $ovhSMS->send($request->get('phone'), 'Your ' . config('app.name') . ' creation code is ' . $account->confirmation_key); + $ovhSMS->send($request->get('phone'), 'Your ' . space()->name . ' creation code is ' . $account->confirmation_key); } elseif ($request->has('email')) { // Send validation by email $account->confirmation_key = Str::random(WebAuthenticateController::$emailCodeSize); @@ -233,7 +233,7 @@ class AccountController extends Controller Log::channel('events')->info('API deprecated - Account recovery: Account recovery by phone', ['id' => $account->identifier]); $ovhSMS = new OvhSMS; - $ovhSMS->send($request->get('phone'), 'Your ' . config('app.name') . ' recovery code is ' . $account->confirmation_key); + $ovhSMS->send($request->get('phone'), 'Your ' . space()->name . ' recovery code is ' . $account->confirmation_key); } /** diff --git a/flexiapi/app/Http/Controllers/Api/Admin/SpaceController.php b/flexiapi/app/Http/Controllers/Api/Admin/SpaceController.php index a1deb4e..697491a 100644 --- a/flexiapi/app/Http/Controllers/Api/Admin/SpaceController.php +++ b/flexiapi/app/Http/Controllers/Api/Admin/SpaceController.php @@ -35,6 +35,7 @@ class SpaceController extends Controller public function store(Request $request) { $request->validate([ + 'name' => 'required|unique:spaces', 'domain' => 'required|unique:spaces', 'host' => 'required|unique:spaces', 'max_accounts' => 'nullable|integer', @@ -42,6 +43,7 @@ class SpaceController extends Controller ]); $space = new Space; + $space->name = $request->get('name'); $space->domain = $request->get('domain'); $space->host = $request->get('host'); $this->setRequestBoolean($request, $space, 'super'); @@ -120,9 +122,11 @@ class SpaceController extends Controller } $request->validate([ + 'name' => ['required', Rule::unique('spaces')->ignore($space->id)], 'host' => ['required', Rule::unique('spaces')->ignore($space->id)] ]); + $space->name = $request->get('name'); $space->host = $request->get('host'); $space->super = $request->get('super'); $space->disable_chat_feature = $request->get('disable_chat_feature'); diff --git a/flexiapi/app/Services/AccountService.php b/flexiapi/app/Services/AccountService.php index b6870d4..cbd8e03 100644 --- a/flexiapi/app/Services/AccountService.php +++ b/flexiapi/app/Services/AccountService.php @@ -63,7 +63,7 @@ class AccountService $account->domain = config('app.sip_domain'); $account->ip_address = $request->ip(); $account->created_at = Carbon::now(); - $account->user_agent = config('app.name'); + $account->user_agent = space()->name; $account->dtmf_protocol = $request->get('dtmf_protocol'); if ($request->asAdmin) { @@ -71,7 +71,7 @@ class AccountService $account->display_name = $request->get('display_name'); $account->activated = $request->has('activated') ? (bool)$request->get('activated') : false; $account->domain = resolveDomain($request); - $account->user_agent = $request->header('User-Agent') ?? config('app.name'); + $account->user_agent = $request->header('User-Agent') ?? space()->name; $account->admin = $request->has('admin') && (bool)$request->get('admin'); if (!$request->api && $request->has('role')) { @@ -149,7 +149,7 @@ class AccountService $account->email = $request->get('email'); $account->display_name = $request->get('display_name'); $account->dtmf_protocol = $request->get('dtmf_protocol'); - $account->user_agent = $request->header('User-Agent') ?? config('app.name'); + $account->user_agent = $request->header('User-Agent') ?? $account->space->name; $account->admin = $request->has('admin') && (bool)$request->get('admin'); if ($request->api && $request->has('admin')) { @@ -245,7 +245,7 @@ class AccountService Log::channel('events')->info('Account Service: Account phone change requested by SMS', ['id' => $account->identifier]); - $message = 'Your ' . config('app.name') . ' validation code is ' . $phoneChangeCode->code . '.'; + $message = 'Your ' . $account->space->name . ' validation code is ' . $phoneChangeCode->code . '.'; if (config('app.recovery_code_expiration_minutes') > 0) { $message .= ' The code is available for ' . config('app.recovery_code_expiration_minutes') . ' minutes'; @@ -391,7 +391,7 @@ class AccountService { $account = $this->recoverAccount($account); - $message = 'Your ' . config('app.name') . ' validation code is ' . $account->recovery_code . '.'; + $message = 'Your ' . $account->space->name . ' validation code is ' . $account->recovery_code . '.'; if (config('app.recovery_code_expiration_minutes') > 0) { $message .= ' The code is available for ' . config('app.recovery_code_expiration_minutes') . ' minutes'; diff --git a/flexiapi/composer.lock b/flexiapi/composer.lock index c7aca0d..b513414 100644 --- a/flexiapi/composer.lock +++ b/flexiapi/composer.lock @@ -8,25 +8,25 @@ "packages": [ { "name": "awobaz/compoships", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/topclaudy/compoships.git", - "reference": "63fcb664b8c21d2f98db6a70f7f351b7db77f9f4" + "reference": "49ef79d912201c8649651d63b5682afae092502e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/topclaudy/compoships/zipball/63fcb664b8c21d2f98db6a70f7f351b7db77f9f4", - "reference": "63fcb664b8c21d2f98db6a70f7f351b7db77f9f4", + "url": "https://api.github.com/repos/topclaudy/compoships/zipball/49ef79d912201c8649651d63b5682afae092502e", + "reference": "49ef79d912201c8649651d63b5682afae092502e", "shasum": "" }, "require": { - "illuminate/database": ">=5.6 <12.0" + "illuminate/database": ">=5.6 <13.0" }, "require-dev": { "ext-sqlite3": "*", "fakerphp/faker": "^1.18", - "phpunit/phpunit": "^6.0|^8.0|^9.0|^10.0" + "phpunit/phpunit": "^6.0|^8.0|^9.0|^10.0|^11.0" }, "suggest": { "awobaz/blade-active": "Blade directives for the Laravel 'Active' package", @@ -58,7 +58,7 @@ ], "support": { "issues": "https://github.com/topclaudy/compoships/issues", - "source": "https://github.com/topclaudy/compoships/tree/2.4.0" + "source": "https://github.com/topclaudy/compoships/tree/2.4.1" }, "funding": [ { @@ -66,7 +66,7 @@ "type": "custom" } ], - "time": "2025-01-09T12:32:04+00:00" + "time": "2025-02-24T15:12:08+00:00" }, { "name": "bacon/bacon-qr-code", @@ -124,16 +124,16 @@ }, { "name": "brick/math", - "version": "0.12.1", + "version": "0.12.3", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "f510c0a40911935b77b86859eb5223d58d660df1" + "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", - "reference": "f510c0a40911935b77b86859eb5223d58d660df1", + "url": "https://api.github.com/repos/brick/math/zipball/866551da34e9a618e64a819ee1e01c20d8a588ba", + "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba", "shasum": "" }, "require": { @@ -142,7 +142,7 @@ "require-dev": { "php-coveralls/php-coveralls": "^2.2", "phpunit/phpunit": "^10.1", - "vimeo/psalm": "5.16.0" + "vimeo/psalm": "6.8.8" }, "type": "library", "autoload": { @@ -172,7 +172,7 @@ ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.12.1" + "source": "https://github.com/brick/math/tree/0.12.3" }, "funding": [ { @@ -180,7 +180,7 @@ "type": "github" } ], - "time": "2023-11-29T23:19:16+00:00" + "time": "2025-02-28T13:11:00+00:00" }, { "name": "carbonphp/carbon-doctrine-types", @@ -2784,16 +2784,16 @@ }, { "name": "league/oauth2-client", - "version": "2.8.0", + "version": "2.8.1", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-client.git", - "reference": "3d5cf8d0543731dfb725ab30e4d7289891991e13" + "reference": "9df2924ca644736c835fc60466a3a60390d334f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/3d5cf8d0543731dfb725ab30e4d7289891991e13", - "reference": "3d5cf8d0543731dfb725ab30e4d7289891991e13", + "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/9df2924ca644736c835fc60466a3a60390d334f9", + "reference": "9df2924ca644736c835fc60466a3a60390d334f9", "shasum": "" }, "require": { @@ -2843,9 +2843,9 @@ ], "support": { "issues": "https://github.com/thephpleague/oauth2-client/issues", - "source": "https://github.com/thephpleague/oauth2-client/tree/2.8.0" + "source": "https://github.com/thephpleague/oauth2-client/tree/2.8.1" }, - "time": "2024-12-11T05:05:52+00:00" + "time": "2025-02-26T04:37:30+00:00" }, { "name": "monolog/monolog", @@ -4199,29 +4199,29 @@ }, { "name": "propaganistas/laravel-phone", - "version": "5.3.3", + "version": "5.3.4", "source": { "type": "git", "url": "https://github.com/Propaganistas/Laravel-Phone.git", - "reference": "2172362ae5714ddc397d9df96a44b82bd125631a" + "reference": "a76eae715b927f8f30add4bb2228926091d3e152" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Propaganistas/Laravel-Phone/zipball/2172362ae5714ddc397d9df96a44b82bd125631a", - "reference": "2172362ae5714ddc397d9df96a44b82bd125631a", + "url": "https://api.github.com/repos/Propaganistas/Laravel-Phone/zipball/a76eae715b927f8f30add4bb2228926091d3e152", + "reference": "a76eae715b927f8f30add4bb2228926091d3e152", "shasum": "" }, "require": { "giggsey/libphonenumber-for-php-lite": "^8.13.35", - "illuminate/contracts": "^10.0|^11.0", - "illuminate/support": "^10.0|^11.0", - "illuminate/validation": "^10.0|^11.0", + "illuminate/contracts": "^10.0|^11.0|^12.0", + "illuminate/support": "^10.0|^11.0|^12.0", + "illuminate/validation": "^10.0|^11.0|^12.0", "php": "^8.1" }, "require-dev": { "laravel/pint": "^1.14", "orchestra/testbench": "*", - "phpunit/phpunit": "^10.5" + "phpunit/phpunit": "^10.5|^11.5.3" }, "type": "library", "extra": { @@ -4258,7 +4258,7 @@ ], "support": { "issues": "https://github.com/Propaganistas/Laravel-Phone/issues", - "source": "https://github.com/Propaganistas/Laravel-Phone/tree/5.3.3" + "source": "https://github.com/Propaganistas/Laravel-Phone/tree/5.3.4" }, "funding": [ { @@ -4266,7 +4266,7 @@ "type": "github" } ], - "time": "2024-12-27T11:45:47+00:00" + "time": "2025-02-24T15:09:06+00:00" }, { "name": "psr/cache", @@ -4854,16 +4854,16 @@ }, { "name": "ramsey/collection", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/ramsey/collection.git", - "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" + "reference": "3c5990b8a5e0b79cd1cf11c2dc1229e58e93f109" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", - "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "url": "https://api.github.com/repos/ramsey/collection/zipball/3c5990b8a5e0b79cd1cf11c2dc1229e58e93f109", + "reference": "3c5990b8a5e0b79cd1cf11c2dc1229e58e93f109", "shasum": "" }, "require": { @@ -4871,25 +4871,22 @@ }, "require-dev": { "captainhook/plugin-composer": "^5.3", - "ergebnis/composer-normalize": "^2.28.3", - "fakerphp/faker": "^1.21", + "ergebnis/composer-normalize": "^2.45", + "fakerphp/faker": "^1.24", "hamcrest/hamcrest-php": "^2.0", - "jangregor/phpstan-prophecy": "^1.0", - "mockery/mockery": "^1.5", + "jangregor/phpstan-prophecy": "^2.1", + "mockery/mockery": "^1.6", "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpcsstandards/phpcsutils": "^1.0.0-rc1", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1.2", - "phpstan/phpstan": "^1.9", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5", - "psalm/plugin-mockery": "^1.1", - "psalm/plugin-phpunit": "^0.18.4", - "ramsey/coding-standard": "^2.0.3", - "ramsey/conventional-commits": "^1.3", - "vimeo/psalm": "^5.4" + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpspec/prophecy-phpunit": "^2.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5", + "ramsey/coding-standard": "^2.3", + "ramsey/conventional-commits": "^1.6", + "roave/security-advisories": "dev-latest" }, "type": "library", "extra": { @@ -4927,19 +4924,9 @@ ], "support": { "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/2.0.0" + "source": "https://github.com/ramsey/collection/tree/2.1.0" }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", - "type": "tidelift" - } - ], - "time": "2022-12-31T21:50:55+00:00" + "time": "2025-03-02T04:48:29+00:00" }, { "name": "ramsey/uuid", @@ -7059,16 +7046,16 @@ }, { "name": "symfony/error-handler", - "version": "v6.4.18", + "version": "v6.4.19", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "e8d3b5b1975e67812a54388b1ba8e9ec28eb770e" + "reference": "3d4e55cd2b8f1979a65eba9ab749d6466c316f71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/e8d3b5b1975e67812a54388b1ba8e9ec28eb770e", - "reference": "e8d3b5b1975e67812a54388b1ba8e9ec28eb770e", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/3d4e55cd2b8f1979a65eba9ab749d6466c316f71", + "reference": "3d4e55cd2b8f1979a65eba9ab749d6466c316f71", "shasum": "" }, "require": { @@ -7114,7 +7101,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.4.18" + "source": "https://github.com/symfony/error-handler/tree/v6.4.19" }, "funding": [ { @@ -7130,7 +7117,7 @@ "type": "tidelift" } ], - "time": "2025-01-06T09:38:16+00:00" + "time": "2025-02-02T20:16:33+00:00" }, { "name": "symfony/event-dispatcher", @@ -7431,16 +7418,16 @@ }, { "name": "symfony/http-kernel", - "version": "v6.4.18", + "version": "v6.4.19", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "fca7197bfe9e99dfae7fb1ad3f7f5bd9ef80e1b7" + "reference": "88f2c9f7feff86bb7b9105c5151bc2c1404cd64c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/fca7197bfe9e99dfae7fb1ad3f7f5bd9ef80e1b7", - "reference": "fca7197bfe9e99dfae7fb1ad3f7f5bd9ef80e1b7", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/88f2c9f7feff86bb7b9105c5151bc2c1404cd64c", + "reference": "88f2c9f7feff86bb7b9105c5151bc2c1404cd64c", "shasum": "" }, "require": { @@ -7525,7 +7512,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.18" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.19" }, "funding": [ { @@ -7541,7 +7528,7 @@ "type": "tidelift" } ], - "time": "2025-01-29T07:25:58+00:00" + "time": "2025-02-26T10:51:37+00:00" }, { "name": "symfony/mailer", @@ -7625,16 +7612,16 @@ }, { "name": "symfony/mime", - "version": "v6.4.18", + "version": "v6.4.19", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "917d77981eb1ea963608d5cda4d9c0cf72eaa68e" + "reference": "ac537b6c55ccc2c749f3c979edfa9ec14aaed4f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/917d77981eb1ea963608d5cda4d9c0cf72eaa68e", - "reference": "917d77981eb1ea963608d5cda4d9c0cf72eaa68e", + "url": "https://api.github.com/repos/symfony/mime/zipball/ac537b6c55ccc2c749f3c979edfa9ec14aaed4f3", + "reference": "ac537b6c55ccc2c749f3c979edfa9ec14aaed4f3", "shasum": "" }, "require": { @@ -7690,7 +7677,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.4.18" + "source": "https://github.com/symfony/mime/tree/v6.4.19" }, "funding": [ { @@ -7706,7 +7693,7 @@ "type": "tidelift" } ], - "time": "2025-01-23T13:10:52+00:00" + "time": "2025-02-17T21:23:52+00:00" }, { "name": "symfony/polyfill-ctype", @@ -8346,16 +8333,16 @@ }, { "name": "symfony/process", - "version": "v6.4.15", + "version": "v6.4.19", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3cb242f059c14ae08591c5c4087d1fe443564392" + "reference": "7a1c12e87b08ec9c97abdd188c9b3f5a40e37fc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3cb242f059c14ae08591c5c4087d1fe443564392", - "reference": "3cb242f059c14ae08591c5c4087d1fe443564392", + "url": "https://api.github.com/repos/symfony/process/zipball/7a1c12e87b08ec9c97abdd188c9b3f5a40e37fc3", + "reference": "7a1c12e87b08ec9c97abdd188c9b3f5a40e37fc3", "shasum": "" }, "require": { @@ -8387,7 +8374,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.4.15" + "source": "https://github.com/symfony/process/tree/v6.4.19" }, "funding": [ { @@ -8403,7 +8390,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:19:14+00:00" + "time": "2025-02-04T13:35:48+00:00" }, { "name": "symfony/routing", @@ -8659,16 +8646,16 @@ }, { "name": "symfony/translation", - "version": "v6.4.13", + "version": "v6.4.19", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "bee9bfabfa8b4045a66bf82520e492cddbaffa66" + "reference": "3b9bf9f33997c064885a7bfc126c14b9daa0e00e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/bee9bfabfa8b4045a66bf82520e492cddbaffa66", - "reference": "bee9bfabfa8b4045a66bf82520e492cddbaffa66", + "url": "https://api.github.com/repos/symfony/translation/zipball/3b9bf9f33997c064885a7bfc126c14b9daa0e00e", + "reference": "3b9bf9f33997c064885a7bfc126c14b9daa0e00e", "shasum": "" }, "require": { @@ -8734,7 +8721,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.4.13" + "source": "https://github.com/symfony/translation/tree/v6.4.19" }, "funding": [ { @@ -8750,7 +8737,7 @@ "type": "tidelift" } ], - "time": "2024-09-27T18:14:25+00:00" + "time": "2025-02-13T10:18:43+00:00" }, { "name": "symfony/translation-contracts", @@ -10065,16 +10052,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v6.4.16", + "version": "v6.4.19", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "7a379d8871f6a36f01559c14e11141cc02eb8dc8" + "reference": "b343c3b2f1539fe41331657b37d5c96c1d1ea842" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/7a379d8871f6a36f01559c14e11141cc02eb8dc8", - "reference": "7a379d8871f6a36f01559c14e11141cc02eb8dc8", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/b343c3b2f1539fe41331657b37d5c96c1d1ea842", + "reference": "b343c3b2f1539fe41331657b37d5c96c1d1ea842", "shasum": "" }, "require": { @@ -10126,7 +10113,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.4.16" + "source": "https://github.com/symfony/dependency-injection/tree/v6.4.19" }, "funding": [ { @@ -10142,7 +10129,7 @@ "type": "tidelift" } ], - "time": "2024-11-25T14:52:46+00:00" + "time": "2025-02-20T10:02:49+00:00" }, { "name": "symfony/filesystem", @@ -10212,16 +10199,16 @@ }, { "name": "symfony/var-exporter", - "version": "v6.4.13", + "version": "v6.4.19", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "0f605f72a363f8743001038a176eeb2a11223b51" + "reference": "be6e71b0c257884c1107313de5d247741cfea172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/0f605f72a363f8743001038a176eeb2a11223b51", - "reference": "0f605f72a363f8743001038a176eeb2a11223b51", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/be6e71b0c257884c1107313de5d247741cfea172", + "reference": "be6e71b0c257884c1107313de5d247741cfea172", "shasum": "" }, "require": { @@ -10269,7 +10256,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.4.13" + "source": "https://github.com/symfony/var-exporter/tree/v6.4.19" }, "funding": [ { @@ -10285,7 +10272,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2025-02-13T09:33:32+00:00" } ], "aliases": [], diff --git a/flexiapi/composer.phar b/flexiapi/composer.phar index b59d7e1..3b71ca6 100755 Binary files a/flexiapi/composer.phar and b/flexiapi/composer.phar differ diff --git a/flexiapi/config/app.php b/flexiapi/config/app.php index ec548b7..0b7e682 100644 --- a/flexiapi/config/app.php +++ b/flexiapi/config/app.php @@ -14,7 +14,6 @@ return [ */ 'name' => env('APP_NAME', 'Account Manager'), - //'sip_domain' => 'sip.domain.com', 'project_url' => env('APP_PROJECT_URL', ''), 'terms_of_use_url' => env('TERMS_OF_USE_URL', ''), diff --git a/flexiapi/database/factories/SpaceFactory.php b/flexiapi/database/factories/SpaceFactory.php index da866ad..4310b77 100644 --- a/flexiapi/database/factories/SpaceFactory.php +++ b/flexiapi/database/factories/SpaceFactory.php @@ -30,6 +30,7 @@ class SpaceFactory extends Factory public function definition() { return [ + 'name' => $this->faker->name, 'domain' => config('app.sip_domain'), 'host' => config('app.sip_domain'), ]; diff --git a/flexiapi/database/migrations/2025_03_04_105856_add_name_in_spaces_table.php b/flexiapi/database/migrations/2025_03_04_105856_add_name_in_spaces_table.php new file mode 100644 index 0000000..ea0087c --- /dev/null +++ b/flexiapi/database/migrations/2025_03_04_105856_add_name_in_spaces_table.php @@ -0,0 +1,30 @@ +string('name')->nullable(); + }); + + DB::statement("update spaces set name = domain"); + + Schema::table('spaces', function (Blueprint $table) { + $table->string('name')->nullable(false)->unique()->change(); + }); + } + + public function down(): void + { + Schema::table('spaces', function (Blueprint $table) { + $table->dropColumn('name'); + }); + } +}; diff --git a/flexiapi/lang/fr.json b/flexiapi/lang/fr.json index eda981b..b2c0715 100644 --- a/flexiapi/lang/fr.json +++ b/flexiapi/lang/fr.json @@ -62,6 +62,7 @@ "Features": "Fonctionnalités", "From": "Depuis", "General settings": "Paramètres généraux", + "Host": "Hôte", "I would like to subscribe to the newsletter": "Je voudrais m'inscrire à la newsletter", "I'm not a robot": "Je ne suis pas un robot", "Identifier": "Identifiant", diff --git a/flexiapi/resources/views/account/dashboard.blade.php b/flexiapi/resources/views/account/dashboard.blade.php index 93c755b..1a25985 100644 --- a/flexiapi/resources/views/account/dashboard.blade.php +++ b/flexiapi/resources/views/account/dashboard.blade.php @@ -6,7 +6,7 @@
-

hand-waving {{ __('Welcome on :app_name' , ['app_name' => config('app.name')]) }}

+

hand-waving {{ __('Welcome on :app_name' , ['app_name' => space()->name]) }}

envelope @if (!empty($account->email)) diff --git a/flexiapi/resources/views/account/login.blade.php b/flexiapi/resources/views/account/login.blade.php index ba16cae..dbcad4a 100644 --- a/flexiapi/resources/views/account/login.blade.php +++ b/flexiapi/resources/views/account/login.blade.php @@ -2,7 +2,7 @@ @section('content')

-

hand-waving {{ __('Welcome on :app_name' , ['app_name' => config('app.name')]) }}

+

hand-waving {{ __('Welcome on :app_name' , ['app_name' => space()->name]) }}

@if (space()->intro_registration_text) @parsedown(space()->intro_registration_text) diff --git a/flexiapi/resources/views/admin/space/administration.blade.php b/flexiapi/resources/views/admin/space/administration.blade.php index 544090a..5130e69 100644 --- a/flexiapi/resources/views/admin/space/administration.blade.php +++ b/flexiapi/resources/views/admin/space/administration.blade.php @@ -6,7 +6,7 @@ @@ -14,7 +14,7 @@ @section('content')
-

globe-hemisphere-west {{ $space->host }}

+

globe-hemisphere-west {{ $space->name }}

@include('admin.space.tabs') @@ -25,6 +25,12 @@ @csrf @method('put') +
+ + + @include('parts.errors', ['name' => 'name']) +
+
diff --git a/flexiapi/resources/views/admin/space/configuration.blade.php b/flexiapi/resources/views/admin/space/configuration.blade.php index 3a3c56d..2c3de03 100644 --- a/flexiapi/resources/views/admin/space/configuration.blade.php +++ b/flexiapi/resources/views/admin/space/configuration.blade.php @@ -7,13 +7,13 @@ @else @endif @@ -22,7 +22,7 @@ @section('content')
-

globe-hemisphere-west {{ $space->host }}

+

globe-hemisphere-west {{ $space->name }}

@include('admin.space.tabs') diff --git a/flexiapi/resources/views/admin/space/create.blade.php b/flexiapi/resources/views/admin/space/create.blade.php index 9760f53..2a2e55e 100644 --- a/flexiapi/resources/views/admin/space/create.blade.php +++ b/flexiapi/resources/views/admin/space/create.blade.php @@ -19,7 +19,13 @@ @csrf @method('post') -
+
+ + + @include('parts.errors', ['name' => 'name']) +
+ +
diff --git a/flexiapi/resources/views/admin/space/edit.blade.php b/flexiapi/resources/views/admin/space/edit.blade.php index e1777d6..ef2990a 100644 --- a/flexiapi/resources/views/admin/space/edit.blade.php +++ b/flexiapi/resources/views/admin/space/edit.blade.php @@ -6,7 +6,7 @@ @@ -14,7 +14,7 @@ @section('content')
-

globe-hemisphere-west {{ $space->host }}

+

globe-hemisphere-west {{ $space->name }}

@include('admin.space.tabs') diff --git a/flexiapi/resources/views/admin/space/index.blade.php b/flexiapi/resources/views/admin/space/index.blade.php index 8e2949b..7da71ee 100644 --- a/flexiapi/resources/views/admin/space/index.blade.php +++ b/flexiapi/resources/views/admin/space/index.blade.php @@ -18,6 +18,7 @@ {{ __('Space') }} + {{ __('Host') }} {{ __('SIP Domain') }} {{ __('Accounts') }} {{ __('Expiration') }} @@ -28,10 +29,11 @@ - {{ $space->host }} + {{ $space->name }} @if ($space->super) Super @endif + {{ $space->host }} {{ $space->domain }} {{ $space->accounts_count }} / @if ($space->max_accounts > 0){{ $space->max_accounts }} @else infinity@endif diff --git a/flexiapi/resources/views/admin/space/show.blade.php b/flexiapi/resources/views/admin/space/show.blade.php index 4a79ada..4dd19b7 100644 --- a/flexiapi/resources/views/admin/space/show.blade.php +++ b/flexiapi/resources/views/admin/space/show.blade.php @@ -6,13 +6,13 @@ {{ __('Spaces') }} @endif - + @endsection @section('content')
-

globe-hemisphere-west {{ $space->host }}

+

globe-hemisphere-west {{ $space->name }}

isFull())disabled @endif href="{{ route('admin.account.create', ['domain' => $space->domain]) }}"> user-plus {{ __('Create') }} diff --git a/flexiapi/resources/views/api/documentation_markdown.blade.php b/flexiapi/resources/views/api/documentation_markdown.blade.php index 0098349..1606fc7 100644 --- a/flexiapi/resources/views/api/documentation_markdown.blade.php +++ b/flexiapi/resources/views/api/documentation_markdown.blade.php @@ -153,6 +153,7 @@ Create a new `sip_domain`. JSON parameters: +* `name` **required**, the space name * `domain` **required**, the SIP domain to use, must be unique * `super` **required**, boolean, set the domain as a Super Domain * `disable_chat_feature` boolean, disable the chat feature, default to `false` @@ -190,6 +191,7 @@ Update an existing `sip_domain`. JSON parameters: +* `name` **required**, the space name * `super` **required**, boolean, set the domain as a Super Domain * `disable_chat_feature` **required**, boolean * `disable_meetings_feature` **required**, boolean diff --git a/flexiapi/resources/views/layouts/main.blade.php b/flexiapi/resources/views/layouts/main.blade.php index 1eca4d2..c42ed5d 100644 --- a/flexiapi/resources/views/layouts/main.blade.php +++ b/flexiapi/resources/views/layouts/main.blade.php @@ -6,7 +6,7 @@ - {{ config('app.name') }} + {{ space()->name }} @@ -27,7 +27,7 @@