mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Rename subdomain
This commit is contained in:
parent
e2e7d6578c
commit
86a68c50bc
1 changed files with 5 additions and 5 deletions
|
|
@ -64,7 +64,7 @@ class CreateSite extends Base
|
|||
->param('buildCommand', '', new Text(8192, 0), 'Build Command.', true)
|
||||
->param('outputDirectory', '', new Text(8192, 0), 'Output Directory for site.', true)
|
||||
->param('fallbackRedirect', '', new Text(8192, 0), 'Fallback Redirect URL for site in case a route is not found.', true)
|
||||
->param('subDomain', '', new CustomId(), 'Unique custom sub-domain. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true)
|
||||
->param('subdomain', '', new CustomId(), 'Unique custom sub-domain. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.', true)
|
||||
->param('installationId', '', new Text(128, 0), 'Appwrite Installation ID for VCS (Version Control System) deployment.', true)
|
||||
->param('providerRepositoryId', '', new Text(128, 0), 'Repository ID of the repo linked to the site.', true)
|
||||
->param('providerBranch', '', new Text(128, 0), 'Production branch for the repo linked to the site.', true)
|
||||
|
|
@ -92,7 +92,7 @@ class CreateSite extends Base
|
|||
->callback([$this, 'action']);
|
||||
}
|
||||
|
||||
public function action(string $siteId, string $name, string $framework, bool $enabled, string $installCommand, string $buildCommand, string $outputDirectory, string $fallbackRedirect, string $subDomain, string $installationId, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $templateRepository, string $templateOwner, string $templateRootDirectory, string $templateVersion, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Document $user, Event $queueForEvents, Build $queueForBuilds, Database $dbForConsole, GitHub $github)
|
||||
public function action(string $siteId, string $name, string $framework, bool $enabled, string $installCommand, string $buildCommand, string $outputDirectory, string $fallbackRedirect, string $subdomain, string $installationId, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $templateRepository, string $templateOwner, string $templateRootDirectory, string $templateVersion, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Document $user, Event $queueForEvents, Build $queueForBuilds, Database $dbForConsole, GitHub $github)
|
||||
{
|
||||
$sitesDomain = System::getEnv('_APP_DOMAIN_SITES', '');
|
||||
$ruleId = '';
|
||||
|
|
@ -101,14 +101,14 @@ class CreateSite extends Base
|
|||
|
||||
if (!empty($sitesDomain)) {
|
||||
$ruleId = ID::unique();
|
||||
$routeSubdomain = $subDomain ?? ID::unique();
|
||||
$routeSubdomain = $subdomain ?? ID::unique();
|
||||
$domain = "{$routeSubdomain}.{$sitesDomain}";
|
||||
|
||||
$subDomain = Authorization::skip(fn () => $dbForConsole->findOne('rules', [
|
||||
$subdomain = Authorization::skip(fn () => $dbForConsole->findOne('rules', [
|
||||
Query::equal('domain', [$domain])
|
||||
]));
|
||||
|
||||
if (!empty($subDomain)) {
|
||||
if (!empty($subdomain)) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Subdomain already exists. Please choose a different subdomain.');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue