diff --git a/Dockerfile b/Dockerfile index f3a87058af..12ac410b73 100755 --- a/Dockerfile +++ b/Dockerfile @@ -238,7 +238,6 @@ RUN chmod +x /usr/local/bin/doctor && \ chmod +x /usr/local/bin/worker-deletes && \ chmod +x /usr/local/bin/worker-functions && \ chmod +x /usr/local/bin/worker-mails && \ - chmod +x /usr/local/bin/worker-tasks && \ chmod +x /usr/local/bin/worker-usage && \ chmod +x /usr/local/bin/worker-webhooks diff --git a/app/config/collections.php b/app/config/collections.php index 67a40bbc1a..30c1976a01 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -807,16 +807,6 @@ $collections = [ 'array' => true, 'list' => [Database::SYSTEM_COLLECTION_KEYS], ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Tasks', - 'key' => 'tasks', - 'type' => Database::SYSTEM_VAR_TYPE_DOCUMENT, - 'default' => [], - 'required' => false, - 'array' => true, - 'list' => [Database::SYSTEM_COLLECTION_TASKS], - ], [ '$collection' => Database::SYSTEM_COLLECTION_RULES, 'label' => 'Platforms', @@ -939,160 +929,6 @@ $collections = [ ], ], ], - Database::SYSTEM_COLLECTION_TASKS => [ - '$collection' => Database::SYSTEM_COLLECTION_COLLECTIONS, - '$id' => Database::SYSTEM_COLLECTION_TASKS, - '$permissions' => ['read' => ['role:all']], - 'name' => 'Task', - 'structure' => true, - 'rules' => [ - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Name', - 'key' => 'name', - 'type' => Database::SYSTEM_VAR_TYPE_TEXT, - 'default' => null, - 'required' => true, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Status', - 'key' => 'status', - 'type' => Database::SYSTEM_VAR_TYPE_TEXT, - 'default' => '', - 'required' => false, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Updated', - 'key' => 'updated', - 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, - 'default' => '', - 'required' => false, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Schedule', - 'key' => 'schedule', - 'type' => Database::SYSTEM_VAR_TYPE_TEXT, - 'default' => '', - 'required' => false, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Previous', - 'key' => 'previous', - 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, - 'default' => '', - 'required' => false, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Next', - 'key' => 'next', - 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, - 'default' => '', - 'required' => false, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Duration', - 'key' => 'duration', - 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, - 'default' => '', - 'required' => false, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Delay', - 'key' => 'delay', - 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, - 'default' => '', - 'required' => false, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Security', - 'key' => 'security', - 'type' => Database::SYSTEM_VAR_TYPE_BOOLEAN, - 'default' => '', - 'required' => false, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'HTTP Method', - 'key' => 'httpMethod', - 'type' => Database::SYSTEM_VAR_TYPE_TEXT, - 'default' => '', - 'required' => false, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'HTTP URL', - 'key' => 'httpUrl', - 'type' => Database::SYSTEM_VAR_TYPE_TEXT, - 'default' => '', - 'required' => false, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'HTTP Headers', - 'key' => 'httpHeaders', - 'type' => Database::SYSTEM_VAR_TYPE_TEXT, - 'default' => null, - 'required' => false, - 'array' => true, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'HTTP User', - 'key' => 'httpUser', - 'type' => Database::SYSTEM_VAR_TYPE_TEXT, - 'default' => '', - 'required' => false, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'HTTP Password', - 'key' => 'httpPass', - 'type' => Database::SYSTEM_VAR_TYPE_TEXT, - 'default' => '', - 'required' => false, - 'array' => false, - 'filter' => ['encrypt'], - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Log', - 'key' => 'log', - 'type' => Database::SYSTEM_VAR_TYPE_TEXT, - 'default' => '', - 'required' => false, - 'array' => false, - ], - [ - '$collection' => Database::SYSTEM_COLLECTION_RULES, - 'label' => 'Failures', - 'key' => 'failures', - 'type' => Database::SYSTEM_VAR_TYPE_NUMERIC, - 'default' => '', - 'required' => false, - 'array' => false, - ], - ], - ], Database::SYSTEM_COLLECTION_PLATFORMS => [ '$collection' => Database::SYSTEM_COLLECTION_COLLECTIONS, '$id' => Database::SYSTEM_COLLECTION_PLATFORMS, diff --git a/app/config/collections2.php b/app/config/collections2.php index 7cfa518668..1eae34a818 100644 --- a/app/config/collections2.php +++ b/app/config/collections2.php @@ -188,17 +188,6 @@ $collections = [ 'array' => true, 'filters' => ['json'], ], - [ - '$id' => 'tasks', - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => ['json'], - ], [ '$id' => 'domains', 'type' => Database::VAR_STRING, diff --git a/app/config/platforms.php b/app/config/platforms.php index b12bf41cd2..a7282b7429 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -152,7 +152,7 @@ return [ 'name' => 'Console', 'enabled' => false, 'beta' => false, - 'languages' => [ // TODO change key to 'sdks' + 'languages' => [ [ 'key' => 'web', 'name' => 'Console', @@ -179,7 +179,7 @@ return [ 'description' => 'Libraries for integrating with Appwrite to build server side integrations. Read the [getting started for server](/docs/getting-started-for-server) tutorial to start building your first server integration.', 'enabled' => true, 'beta' => false, - 'languages' => [ // TODO change key to 'sdks' + 'languages' => [ [ 'key' => 'nodejs', 'name' => 'Node.js', diff --git a/app/config/roles.php b/app/config/roles.php index 34af1461ff..8548dcc2f1 100644 --- a/app/config/roles.php +++ b/app/config/roles.php @@ -40,8 +40,6 @@ $admins = [ 'platforms.write', 'keys.read', 'keys.write', - 'tasks.read', - 'tasks.write', 'webhooks.read', 'webhooks.write', 'locale.read', diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 27d9f82006..8c173844fe 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1156,8 +1156,8 @@ App::delete('/v1/account') $protocol = $request->getProtocol(); $user = $dbForInternal->updateDocument('users', $user->getId(), $user->setAttribute('status', false)); - //TODO delete all tokens or only current session? - //TODO delete all user data according to GDPR. Make sure everything is backed up and backups are deleted later + // TODO delete all tokens or only current session? + // TODO delete all user data according to GDPR. Make sure everything is backed up and backups are deleted later /* * Data to delete * * Tokens @@ -1550,7 +1550,7 @@ App::post('/v1/account/verification') ->label('sdk.response.model', Response::MODEL_TOKEN) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') - ->param('url', '', function ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) // TODO add built-in confirm page + ->param('url', '', function ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) ->inject('request') ->inject('response') ->inject('project') diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 968527d6cb..8b07593a72 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -133,21 +133,6 @@ App::get('/v1/health/queue/webhooks') $response->json(['size' => Resque::size(Event::WEBHOOK_QUEUE_NAME)]); }, ['response']); -App::get('/v1/health/queue/tasks') - ->desc('Get Tasks Queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueTasks') - ->label('sdk.description', '/docs/references/health/get-queue-tasks.md') - ->inject('response') - ->action(function ($response) { - /** @var Appwrite\Utopia\Response $response */ - - $response->json(['size' => Resque::size(Event::TASK_QUEUE_NAME)]); - }, ['response']); - App::get('/v1/health/queue/logs') ->desc('Get Logs Queue') ->groups(['api', 'health']) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index d8163a8328..1dee8ca4e2 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -80,7 +80,6 @@ App::post('/v1/projects') 'platforms' => [], 'webhooks' => [], 'keys' => [], - 'tasks' => [], 'domains' => [], 'usersAuthEmailPassword' => true, 'usersAuthAnonymous' => true, @@ -332,9 +331,6 @@ App::get('/v1/projects/:projectId/usage') $documents[] = ['name' => $collection['name'], 'total' => $projectDB->getSum()]; } - // Tasks - $tasksTotal = \count($project->getAttribute('tasks', [])); - $response->json([ 'range' => $range, 'requests' => [ @@ -369,10 +365,6 @@ App::get('/v1/projects/:projectId/usage') 'data' => [], 'total' => $usersTotal, ], - 'tasks' => [ - 'data' => [], - 'total' => $tasksTotal, - ], 'storage' => [ 'total' => $projectDB->getCount( [ @@ -966,238 +958,6 @@ App::delete('/v1/projects/:projectId/keys/:keyId') $response->noContent(); }); -// Tasks - -App::post('/v1/projects/:projectId/tasks') - ->desc('Create Task') - ->groups(['api', 'projects']) - ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createTask') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TASK) - ->param('projectId', null, new UID(), 'Project unique ID.') - ->param('name', null, new Text(128), 'Task name. Max length: 128 chars.') - ->param('status', null, new WhiteList(['play', 'pause'], true), 'Task status.') - ->param('schedule', null, new Cron(), 'Task schedule CRON syntax.') - ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.') - ->param('httpMethod', '', new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'], true), 'Task HTTP method.') - ->param('httpUrl', '', new URL(), 'Task HTTP URL') - ->param('httpHeaders', null, new ArrayList(new Text(256)), 'Task HTTP headers list.', true) - ->param('httpUser', '', new Text(256), 'Task HTTP user. Max length: 256 chars.', true) - ->param('httpPass', '', new Text(256), 'Task HTTP password. Max length: 256 chars.', true) - ->inject('response') - ->inject('dbForConsole') - ->action(function ($projectId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass, $response, $dbForConsole) { - /** @var Appwrite\Utopia\Response $response */ - /** @var Utopia\Database\Database $dbForConsole */ - - $project = $dbForConsole->getDocument('projects', $projectId); - - if ($project->isEmpty()) { - throw new Exception('Project not found', 404); - } - - $cron = new CronExpression($schedule); - $next = ($status == 'play') ? $cron->getNextRunDate()->format('U') : null; - $security = ($security === '1' || $security === 'true' || $security === 1 || $security === true); - - $task = new Document([ - '$id' => $dbForConsole->getId(), - 'projectId' => $project->getId(), - 'name' => $name, - 'status' => $status, - 'schedule' => $schedule, - 'updated' => \time(), - 'previous' => null, - 'next' => $next, - 'security' => $security, - 'httpMethod' => $httpMethod, - 'httpUrl' => $httpUrl, - 'httpHeaders' => $httpHeaders, - 'httpUser' => $httpUser, - 'httpPass' => $httpPass, - 'log' => '{}', - 'failures' => 0, - ]); - - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project - ->setAttribute('tasks', $task, Document::SET_TYPE_APPEND) - ); - - if ($next) { - ResqueScheduler::enqueueAt($next, 'v1-tasks', 'TasksV1', $task->getArrayCopy()); - } - - $response->setStatusCode(Response::STATUS_CODE_CREATED); - $response->dynamic($task, Response::MODEL_TASK); - }); - -App::get('/v1/projects/:projectId/tasks') - ->desc('List Tasks') - ->groups(['api', 'projects']) - ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listTasks') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TASK_LIST) - ->param('projectId', '', new UID(), 'Project unique ID.') - ->inject('response') - ->inject('dbForConsole') - ->action(function ($projectId, $response, $dbForConsole) { - /** @var Appwrite\Utopia\Response $response */ - /** @var Utopia\Database\Database $dbForConsole */ - - $project = $dbForConsole->getDocument('projects', $projectId); - - if ($project->isEmpty()) { - throw new Exception('Project not found', 404); - } - - $tasks = $project->getAttribute('tasks', []); - - $response->dynamic(new Document([ - 'tasks' => $tasks, - 'sum' => count($tasks), - ]), Response::MODEL_TASK_LIST); - - }); - -App::get('/v1/projects/:projectId/tasks/:taskId') - ->desc('Get Task') - ->groups(['api', 'projects']) - ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getTask') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TASK) - ->param('projectId', null, new UID(), 'Project unique ID.') - ->param('taskId', null, new UID(), 'Task unique ID.') - ->inject('response') - ->inject('dbForConsole') - ->action(function ($projectId, $taskId, $response, $dbForConsole) { - /** @var Appwrite\Utopia\Response $response */ - /** @var Utopia\Database\Database $dbForConsole */ - - $project = $dbForConsole->getDocument('projects', $projectId); - - if ($project->isEmpty()) { - throw new Exception('Project not found', 404); - } - - $task = $project->find('$id', $taskId, 'tasks'); - - if (empty($task) || !$task instanceof Document) { - throw new Exception('Task not found', 404); - } - - $response->dynamic($task, Response::MODEL_TASK); - }); - -App::put('/v1/projects/:projectId/tasks/:taskId') - ->desc('Update Task') - ->groups(['api', 'projects']) - ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateTask') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TASK) - ->param('projectId', null, new UID(), 'Project unique ID.') - ->param('taskId', null, new UID(), 'Task unique ID.') - ->param('name', null, new Text(128), 'Task name. Max length: 128 chars.') - ->param('status', null, new WhiteList(['play', 'pause'], true), 'Task status.') - ->param('schedule', null, new Cron(), 'Task schedule CRON syntax.') - ->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.') - ->param('httpMethod', '', new WhiteList(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'], true), 'Task HTTP method.') - ->param('httpUrl', '', new URL(), 'Task HTTP URL.') - ->param('httpHeaders', null, new ArrayList(new Text(256)), 'Task HTTP headers list.', true) - ->param('httpUser', '', new Text(256), 'Task HTTP user. Max length: 256 chars.', true) - ->param('httpPass', '', new Text(256), 'Task HTTP password. Max length: 256 chars.', true) - ->inject('response') - ->inject('dbForConsole') - ->action(function ($projectId, $taskId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass, $response, $dbForConsole) { - /** @var Appwrite\Utopia\Response $response */ - /** @var Utopia\Database\Database $dbForConsole */ - - $project = $dbForConsole->getDocument('projects', $projectId); - - if ($project->isEmpty()) { - throw new Exception('Project not found', 404); - } - - $task = $project->find('$id', $taskId, 'tasks'); - - if (empty($task) || !$task instanceof Document) { - throw new Exception('Task not found', 404); - } - - $cron = new CronExpression($schedule); - $next = ($status == 'play') ? $cron->getNextRunDate()->format('U') : null; - $security = ($security === '1' || $security === 'true' || $security === 1 || $security === true); - - $project->findAndReplace('$id', $task->getId(), $task - ->setAttribute('name', $name) - ->setAttribute('status', $status) - ->setAttribute('schedule', $schedule) - ->setAttribute('updated', \time()) - ->setAttribute('next', $next) - ->setAttribute('security', $security) - ->setAttribute('httpMethod', $httpMethod) - ->setAttribute('httpUrl', $httpUrl) - ->setAttribute('httpHeaders', $httpHeaders) - ->setAttribute('httpUser', $httpUser) - ->setAttribute('httpPass', $httpPass) - , 'tasks'); - - $dbForConsole->updateDocument('projects', $project->getId(), $project); - - if ($next) { - ResqueScheduler::enqueueAt($next, 'v1-tasks', 'TasksV1', $task->getArrayCopy()); - } - - $response->dynamic($task, Response::MODEL_TASK); - }); - -App::delete('/v1/projects/:projectId/tasks/:taskId') - ->desc('Delete Task') - ->groups(['api', 'projects']) - ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteTask') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) - ->param('projectId', null, new UID(), 'Project unique ID.') - ->param('taskId', null, new UID(), 'Task unique ID.') - ->inject('response') - ->inject('dbForConsole') - ->action(function ($projectId, $taskId, $response, $dbForConsole) { - /** @var Appwrite\Utopia\Response $response */ - /** @var Utopia\Database\Database $dbForConsole */ - - $project = $dbForConsole->getDocument('projects', $projectId); - - if ($project->isEmpty()) { - throw new Exception('Project not found', 404); - } - - if (!$project->findAndRemove('$id', $taskId, 'tasks')) { - throw new Exception('Task not found', 404); - } - - $dbForConsole->updateDocument('projects', $project->getId(), $project); - - $response->noContent(); - }); - // Platforms App::post('/v1/projects/:projectId/platforms') diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 4e82260343..b143be9b5c 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -246,7 +246,7 @@ App::post('/v1/teams/:teamId/memberships') ->param('email', '', new Email(), 'New team member email.') ->param('name', '', new Text(128), 'New team member name. Max length: 128 chars.', true) ->param('roles', [], new ArrayList(new Key()), 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.') - ->param('url', '', function ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) // TODO add our own built-in confirm page + ->param('url', '', function ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) ->inject('response') ->inject('project') ->inject('user') @@ -517,7 +517,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId') $membership->setAttribute('roles', $roles); $membership = $dbForInternal->updateDocument('memberships', $membership->getId(), $membership); - //TODO sync updated membership in the user $profile object using TYPE_REPLACE + // TODO sync updated membership in the user $profile object using TYPE_REPLACE $audits ->setParam('userId', $user->getId()) diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 2abbc5b50a..5849669455 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -447,7 +447,6 @@ App::delete('/v1/users/:userId/sessions/:sessionId') } } - // TODO : Response filter implementation $response->noContent(); }); @@ -538,6 +537,5 @@ App::delete('/v1/users/:userId') ->setParam('eventData', $response->output($user, Response::MODEL_USER)) ; - // TODO : Response filter implementation $response->noContent(); }); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 836ef8f714..9233df74f9 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -44,7 +44,7 @@ App::init(function ($utopia, $request, $response, $project, $user, $register, $e ->setParam('{url}', $request->getHostname().$route->getURL()) ; - //TODO make sure we get array here + // TODO make sure we get array here foreach ($request->getParams() as $key => $value) { // Set request params as potential abuse keys if(!empty($value)) { @@ -217,7 +217,7 @@ App::shutdown(function ($utopia, $request, $response, $project, $events, $audits $route = $utopia->match($request); if (App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled' && $project->getId() - && $mode !== APP_MODE_ADMIN //TODO: add check to make sure user is admin + && $mode !== APP_MODE_ADMIN // TODO: add check to make sure user is admin && !empty($route->getLabel('sdk.namespace', null))) { // Don't calculate console usage on admin mode $usage diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index d331de8dae..943605c636 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -189,21 +189,6 @@ App::get('/console/keys') ->setParam('body', $page); }); -App::get('/console/tasks') - ->groups(['web', 'console']) - ->label('permission', 'public') - ->label('scope', 'console') - ->inject('layout') - ->action(function ($layout) { - /** @var Utopia\View $layout */ - - $page = new View(__DIR__.'/../../views/console/tasks/index.phtml'); - - $layout - ->setParam('title', APP_NAME.' - Tasks') - ->setParam('body', $page); - }); - App::get('/console/database') ->groups(['web', 'console']) ->label('permission', 'public') diff --git a/app/views/console/comps/header.phtml b/app/views/console/comps/header.phtml index 631e89f5cc..1f49fd4d55 100644 --- a/app/views/console/comps/header.phtml +++ b/app/views/console/comps/header.phtml @@ -142,16 +142,6 @@ MANAGE