From b719a030e0edd68cd5f5c4dfaa28d0b67044df4a Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 17 Jan 2021 08:17:19 +0200 Subject: [PATCH 01/41] removed db instance, added time log --- app/tasks/maintenance.php | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/app/tasks/maintenance.php b/app/tasks/maintenance.php index f8786bcac..78930821c 100644 --- a/app/tasks/maintenance.php +++ b/app/tasks/maintenance.php @@ -4,23 +4,13 @@ global $cli; require_once __DIR__.'/../init.php'; -use Appwrite\Database\Database; -use Appwrite\Database\Adapter\MySQL as MySQLAdapter; -use Appwrite\Database\Adapter\Redis as RedisAdapter; use Appwrite\Event\Event; use Utopia\App; use Utopia\CLI\Console; -use Utopia\Config\Config; -// TODO: Think of a better way to access consoleDB -function getConsoleDB() { - global $register; - $consoleDB = new Database(); - $consoleDB->setAdapter(new RedisAdapter(new MySQLAdapter($register), $register)); - $consoleDB->setNamespace('app_console'); // Main DB - $consoleDB->setMocks(Config::getParam('collections', [])); - return $consoleDB; -} +Console::title('Maintenance V1'); + +Console::success(APP_NAME.' maintenance process v1 has started'); function notifyDeleteExecutionLogs() { @@ -54,10 +44,9 @@ $cli //Convert Seconds to microseconds $intervalMicroseconds = $interval * 1000000; - $consoleDB = getConsoleDB(); - - Console::loop(function() use ($consoleDB, $interval){ - Console::info("[ MAINTENANCE TASK ] Notifying deletes workers every {$interval} seconds"); + Console::loop(function() use ($interval){ + $time = date('d-m-Y H:i:s', time()); + Console::info("[{$time}] Notifying deletes workers every {$interval} seconds"); notifyDeleteExecutionLogs(); notifyDeleteAbuseLogs($interval); notifyDeleteAuditLogs($interval); From c3971a68de7628825224b73206aa00c7b67beaf7 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sun, 17 Jan 2021 08:17:54 +0200 Subject: [PATCH 02/41] Removed DB vars, added dev mounts --- docker-compose.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 38858e291..e9d82cbf0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -319,6 +319,9 @@ services: context: . networks: - appwrite + volumes: + - ./app:/usr/src/code/app + - ./src:/usr/src/code/src depends_on: - redis environment: @@ -326,11 +329,6 @@ services: - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_MAINTENANCE_INTERVAL - - _APP_DB_HOST - - _APP_DB_PORT - - _APP_DB_SCHEMA - - _APP_DB_USER - - _APP_DB_PASS appwrite-schedule: entrypoint: schedule From a8b666dfc31accea034f55dfa0da5c242293a8ef Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Mon, 18 Jan 2021 08:29:26 +0200 Subject: [PATCH 03/41] First commit --- app/controllers/general.php | 4 + app/views/console/account/index.phtml | 16 ++ app/views/console/comps/footer.phtml | 3 + app/views/console/comps/header.phtml | 13 ++ app/views/console/database/collection.phtml | 7 + app/views/console/database/document.phtml | 4 + app/views/console/database/index.phtml | 2 + app/views/console/functions/function.phtml | 14 ++ app/views/console/functions/index.phtml | 2 + app/views/console/home/index.phtml | 13 ++ app/views/console/index.phtml | 7 +- app/views/console/keys/index.phtml | 6 + app/views/console/settings/index.phtml | 16 ++ app/views/console/storage/index.phtml | 6 + app/views/console/tasks/index.phtml | 6 + app/views/console/users/index.phtml | 6 + app/views/console/users/team.phtml | 8 + app/views/console/users/user.phtml | 10 + app/views/console/webhooks/index.phtml | 6 + app/views/home/auth/join.phtml | 2 + app/views/home/auth/recovery.phtml | 2 + app/views/home/auth/recovery/reset.phtml | 2 + app/views/home/auth/signin.phtml | 2 + app/views/home/auth/signup.phtml | 2 + gulpfile.js | 2 + public/dist/scripts/app-all.js | 18 +- public/dist/scripts/app.js | 18 +- public/scripts/services/api.js | 199 ++++++++++++++++++++ public/scripts/views/analytics/activity.js | 17 ++ public/scripts/views/analytics/event.js | 2 +- 30 files changed, 407 insertions(+), 8 deletions(-) create mode 100644 public/scripts/services/api.js create mode 100644 public/scripts/views/analytics/activity.js diff --git a/app/controllers/general.php b/app/controllers/general.php index 0ac19d589..5cc69346f 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -233,6 +233,10 @@ App::options(function ($request, $response) { $origin = $request->getOrigin(); + var_dump('-----------'); + var_dump($origin); + var_dump('-----------'); + $response ->addHeader('Server', 'Appwrite') ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') diff --git a/app/views/console/account/index.phtml b/app/views/console/account/index.phtml index 84a18521d..3f1e7decc 100644 --- a/app/views/console/account/index.phtml +++ b/app/views/console/account/index.phtml @@ -29,6 +29,8 @@
Update Password PLEASE NOTE: Account deletion is irreversible.

getParam('version', '').'.'.APP_CACHE_BUSTER;