2025-03-10 10:48:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Initializes console project document.
|
|
|
|
|
*/
|
|
|
|
|
|
2025-04-14 11:56:42 +00:00
|
|
|
use Appwrite\Network\Platform;
|
2025-03-10 10:48:44 +00:00
|
|
|
use Utopia\Database\Helpers\ID;
|
|
|
|
|
use Utopia\System\System;
|
|
|
|
|
|
|
|
|
|
$console = [
|
|
|
|
|
'$id' => ID::custom('console'),
|
2025-05-26 05:42:11 +00:00
|
|
|
'$sequence' => ID::custom('console'),
|
2025-03-10 10:48:44 +00:00
|
|
|
'name' => 'Appwrite',
|
|
|
|
|
'$collection' => ID::custom('projects'),
|
|
|
|
|
'description' => 'Appwrite core engine',
|
|
|
|
|
'logo' => '',
|
|
|
|
|
'teamId' => null,
|
|
|
|
|
'webhooks' => [],
|
|
|
|
|
'keys' => [],
|
|
|
|
|
'platforms' => [
|
|
|
|
|
[
|
|
|
|
|
'$collection' => ID::custom('platforms'),
|
|
|
|
|
'name' => 'Localhost',
|
2025-04-14 11:56:42 +00:00
|
|
|
'type' => Platform::TYPE_WEB,
|
2025-03-10 10:48:44 +00:00
|
|
|
'hostname' => 'localhost',
|
|
|
|
|
], // Current host is added on app init
|
|
|
|
|
],
|
2025-03-14 11:07:38 +00:00
|
|
|
'region' => 'fra',
|
2025-03-10 10:48:44 +00:00
|
|
|
'legalName' => '',
|
|
|
|
|
'legalCountry' => '',
|
|
|
|
|
'legalState' => '',
|
|
|
|
|
'legalCity' => '',
|
|
|
|
|
'legalAddress' => '',
|
|
|
|
|
'legalTaxId' => '',
|
|
|
|
|
'auths' => [
|
|
|
|
|
'mockNumbers' => [],
|
|
|
|
|
'invites' => System::getEnv('_APP_CONSOLE_INVITES', 'enabled') === 'enabled',
|
|
|
|
|
'limit' => (System::getEnv('_APP_CONSOLE_WHITELIST_ROOT', 'enabled') === 'enabled') ? 1 : 0, // limit signup to 1 user
|
2025-11-04 06:08:35 +00:00
|
|
|
'duration' => TOKEN_EXPIRATION_LOGIN_LONG, // 1 Year in seconds
|
2025-06-14 12:45:41 +00:00
|
|
|
'sessionAlerts' => System::getEnv('_APP_CONSOLE_SESSION_ALERTS', 'disabled') === 'enabled',
|
2025-06-16 17:35:52 +00:00
|
|
|
'invalidateSessions' => true
|
2025-03-10 10:48:44 +00:00
|
|
|
],
|
|
|
|
|
'authWhitelistEmails' => (!empty(System::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null))) ? \explode(',', System::getEnv('_APP_CONSOLE_WHITELIST_EMAILS', null)) : [],
|
|
|
|
|
'authWhitelistIPs' => (!empty(System::getEnv('_APP_CONSOLE_WHITELIST_IPS', null))) ? \explode(',', System::getEnv('_APP_CONSOLE_WHITELIST_IPS', null)) : [],
|
|
|
|
|
'oAuthProviders' => [
|
|
|
|
|
'githubEnabled' => true,
|
|
|
|
|
'githubSecret' => System::getEnv('_APP_CONSOLE_GITHUB_SECRET', ''),
|
|
|
|
|
'githubAppid' => System::getEnv('_APP_CONSOLE_GITHUB_APP_ID', '')
|
|
|
|
|
],
|
2025-10-06 16:22:18 +00:00
|
|
|
'smtpBaseTemplate' => APP_BRANDED_EMAIL_BASE_TEMPLATE,
|
2025-03-10 10:48:44 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return $console;
|