mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Review fixes
This commit is contained in:
@@ -1069,9 +1069,9 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
|
||||
->param('roles', [], function (Document $project, Database $dbForProject) {
|
||||
if ($project->getId() === 'console') {
|
||||
$roles = array_keys(Config::getParam('roles', []));
|
||||
array_filter($roles, function ($role) {
|
||||
$roles = array_values(array_filter($roles, function ($role) {
|
||||
return !in_array($role, [Auth::USER_ROLE_APPS, Auth::USER_ROLE_GUESTS, Auth::USER_ROLE_USERS]);
|
||||
});
|
||||
}));
|
||||
return new ArrayList(new WhiteList($roles), APP_LIMIT_ARRAY_PARAMS_SIZE);
|
||||
}
|
||||
return new ArrayList(new Key(false, $dbForProject->getAdapter()->getMaxUIDLength()), APP_LIMIT_ARRAY_PARAMS_SIZE);
|
||||
|
||||
@@ -233,16 +233,28 @@ class Install extends Action
|
||||
$mongoInitScript = __DIR__ . '/../../../../mongo-init.js';
|
||||
$mongoEntrypoint = __DIR__ . '/../../../../mongo-entrypoint.sh';
|
||||
|
||||
if (file_exists($mongoInitScript)) {
|
||||
if (!copy($mongoInitScript, $this->path . '/mongo-init.js')) {
|
||||
Console::warning('Failed to copy mongo-init.js');
|
||||
}
|
||||
if (!file_exists($mongoInitScript)) {
|
||||
$message = 'Required MongoDB initialization file not found: mongo-init.js';
|
||||
Console::error($message);
|
||||
Console::exit(1);
|
||||
}
|
||||
|
||||
if (file_exists($mongoEntrypoint)) {
|
||||
if (!copy($mongoEntrypoint, $this->path . '/mongo-entrypoint.sh')) {
|
||||
Console::warning('Failed to copy mongo-entrypoint.sh');
|
||||
}
|
||||
if (!copy($mongoInitScript, $this->path . '/mongo-init.js')) {
|
||||
$message = 'Failed to copy mongo-init.js - this file is required for MongoDB replica set setup';
|
||||
Console::error($message);
|
||||
Console::exit(1);
|
||||
}
|
||||
|
||||
if (!file_exists($mongoEntrypoint)) {
|
||||
$message = 'Required MongoDB initialization file not found: mongo-entrypoint.sh';
|
||||
Console::error($message);
|
||||
Console::exit(1);
|
||||
}
|
||||
|
||||
if (!copy($mongoEntrypoint, $this->path . '/mongo-entrypoint.sh')) {
|
||||
$message = 'Failed to copy mongo-entrypoint.sh - this file is required for MongoDB replica set setup';
|
||||
Console::error($message);
|
||||
Console::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user