From 00c45c2507e2aebb0dc5961149835e9073707cf2 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 31 Mar 2024 03:32:55 +0000 Subject: [PATCH 01/19] new environment for certificates and security emails --- .env | 3 ++- app/config/variables.php | 20 ++++++++++++++++++- app/console | 2 +- app/controllers/api/avatars.php | 2 +- app/init.php | 2 +- app/views/install/compose.phtml | 8 ++++---- docker-compose.yml | 8 ++++---- .../Platform/Workers/Certificates.php | 6 +++--- src/Appwrite/Platform/Workers/Webhooks.php | 2 +- 9 files changed, 36 insertions(+), 17 deletions(-) diff --git a/.env b/.env index 09abb07be2..8d86049694 100644 --- a/.env +++ b/.env @@ -8,7 +8,8 @@ _APP_CONSOLE_COUNTRIES_DENYLIST=AQ _APP_CONSOLE_HOSTNAMES=localhost,appwrite.io,*.appwrite.io _APP_SYSTEM_EMAIL_NAME=Appwrite _APP_SYSTEM_EMAIL_ADDRESS=team@appwrite.io -_APP_SYSTEM_SECURITY_EMAIL_ADDRESS=security@appwrite.io +_APP_EMAIL_SECURITY=security@appwrite.io +_APP_EMAIL_CERTIFICATES=certificates@appwrite.io _APP_SYSTEM_RESPONSE_FORMAT= _APP_OPTIONS_ABUSE=disabled _APP_OPTIONS_ROUTER_PROTECTION=disabled diff --git a/app/config/variables.php b/app/config/variables.php index 185ab29d0c..cd6c492f9e 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -162,13 +162,31 @@ return [ ], [ 'name' => '_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', - 'description' => 'This is the email address used to issue SSL certificates for custom domains or the user agent in your webhooks payload.', + 'description' => 'Deprecated since 1.5.1 use _APP_EMAIL_SECURITY and _APP_EMAIL_CERTIFICATES instead', 'introduction' => '0.7.0', 'default' => 'certs@appwrite.io', 'required' => false, 'question' => '', 'filter' => '' ], + [ + 'name' => '_APP_EMAIL_SECURITY', + 'description' => 'This is the email address used as the user agent in your webhooks payload.', + 'introduction' => '1.5.1', + 'default' => '', + 'required' => false, + 'question' => '', + 'filter' => '' + ], + [ + 'name' => '_APP_EMAIL_CERTIFICATES', + 'description' => 'This is the email address used to issue SSL certificates for custom domains', + 'introduction' => '1.5.1', + 'default' => '', + 'required' => false, + 'question' => '', + 'filter' => '' + ], [ 'name' => '_APP_USAGE_STATS', 'description' => 'This variable allows you to disable the collection and displaying of usage stats. This value is set to \'enabled\' by default, to disable the usage stats set the value to \'disabled\'. When disabled, it\'s recommended to turn off the Worker Usage container to reduce resource usage.', diff --git a/app/console b/app/console index d75ef00fb0..0a007a3b1b 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit d75ef00fb088c909bf8fdc5b12c2fe25ed270b43 +Subproject commit 0a007a3b1b6eafc39dc19b7129f41643102f9676 diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 6304482b14..771f7cebbc 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -349,7 +349,7 @@ App::get('/v1/avatars/favicon') CURLOPT_USERAGENT => \sprintf( APP_USERAGENT, App::getEnv('_APP_VERSION', 'UNKNOWN'), - App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY) + App::getEnv('_APP_EMAIL_SECURITY', APP_EMAIL_SECURITY) ), ]); diff --git a/app/init.php b/app/init.php index 4b70b2601b..20d427f66c 100644 --- a/app/init.php +++ b/app/init.php @@ -1004,7 +1004,7 @@ foreach ($locales as $locale) { 'user_agent' => \sprintf( APP_USERAGENT, App::getEnv('_APP_VERSION', 'UNKNOWN'), - App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY) + App::getEnv('_APP_EMAIL_SECURITY', APP_EMAIL_SECURITY) ), 'timeout' => 2, ], diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 354ef4ea49..1f5ee606e7 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -81,7 +81,7 @@ services: - _APP_CONSOLE_HOSTNAMES - _APP_SYSTEM_EMAIL_NAME - _APP_SYSTEM_EMAIL_ADDRESS - - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS + - _APP_EMAIL_SECURITY - _APP_SYSTEM_RESPONSE_FORMAT - _APP_OPTIONS_ABUSE - _APP_OPTIONS_ROUTER_PROTECTION @@ -251,7 +251,7 @@ services: - _APP_ENV - _APP_WORKER_PER_CORE - _APP_OPENSSL_KEY_V1 - - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS + - _APP_EMAIL_SECURITY - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER @@ -427,7 +427,7 @@ services: - _APP_DOMAIN - _APP_DOMAIN_TARGET - _APP_DOMAIN_FUNCTIONS - - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS + - _APP_EMAIL_CERTIFICATES - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER @@ -549,7 +549,7 @@ services: - _APP_OPENSSL_KEY_V1 - _APP_DOMAIN - _APP_DOMAIN_TARGET - - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS + - _APP_EMAIL_SECURITY - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER diff --git a/docker-compose.yml b/docker-compose.yml index 58dff56901..097de3c9b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -102,7 +102,7 @@ services: - _APP_CONSOLE_HOSTNAMES - _APP_SYSTEM_EMAIL_NAME - _APP_SYSTEM_EMAIL_ADDRESS - - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS + - _APP_EMAIL_SECURITY - _APP_SYSTEM_RESPONSE_FORMAT - _APP_OPTIONS_ABUSE - _APP_OPTIONS_ROUTER_PROTECTION @@ -285,7 +285,7 @@ services: - _APP_ENV - _APP_WORKER_PER_CORE - _APP_OPENSSL_KEY_V1 - - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS + - _APP_EMAIL_SECURITY - _APP_DB_HOST - _APP_DB_PORT - _APP_DB_SCHEMA @@ -474,7 +474,7 @@ services: - _APP_DOMAIN - _APP_DOMAIN_TARGET - _APP_DOMAIN_FUNCTIONS - - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS + - _APP_EMAIL_CERTIFICATES - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER @@ -612,7 +612,7 @@ services: - _APP_OPENSSL_KEY_V1 - _APP_DOMAIN - _APP_DOMAIN_TARGET - - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS + - _APP_EMAIL_SECURITY - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index 7cc32ca1c9..2c1707b1c8 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -134,9 +134,9 @@ class Certificates extends Action try { // Email for alerts is required by LetsEncrypt - $email = App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS'); + $email = App::getEnv('_APP_EMAIL_CERTIFICATES'); if (empty($email)) { - throw new Exception('You must set a valid security email address (_APP_SYSTEM_SECURITY_EMAIL_ADDRESS) to issue an SSL certificate.'); + throw new Exception('You must set a valid security email address (_APP_EMAIL_CERTIFICATES) to issue an SSL certificate.'); } // Validate domain and DNS records. Skip if job is forced @@ -473,7 +473,7 @@ class Certificates extends Action ->setBody($body) ->setName('Appwrite Administrator') ->setVariables($emailVariables) - ->setRecipient(App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS')) + ->setRecipient(App::getEnv('_APP_EMAIL_CERTIFICATES')) ->trigger(); } diff --git a/src/Appwrite/Platform/Workers/Webhooks.php b/src/Appwrite/Platform/Workers/Webhooks.php index da5a82999f..857f552eda 100644 --- a/src/Appwrite/Platform/Workers/Webhooks.php +++ b/src/Appwrite/Platform/Workers/Webhooks.php @@ -104,7 +104,7 @@ class Webhooks extends Action \curl_setopt($ch, CURLOPT_USERAGENT, \sprintf( APP_USERAGENT, App::getEnv('_APP_VERSION', 'UNKNOWN'), - App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY) + App::getEnv('_APP_EMAIL_SECURITY', APP_EMAIL_SECURITY) )); \curl_setopt( $ch, From b61e0f08f67fddec1b438984ad0409fa02b006ff Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 6 May 2024 00:58:23 +0000 Subject: [PATCH 02/19] make required --- app/config/variables.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/variables.php b/app/config/variables.php index cd6c492f9e..f18dac5d73 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -183,7 +183,7 @@ return [ 'description' => 'This is the email address used to issue SSL certificates for custom domains', 'introduction' => '1.5.1', 'default' => '', - 'required' => false, + 'required' => true, 'question' => '', 'filter' => '' ], From be1c147658f49b7e39de9abb851a1ecc6078812b Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 6 May 2024 01:00:20 +0000 Subject: [PATCH 03/19] update console --- app/console | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/console b/app/console index 0a007a3b1b..f483d9631d 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 0a007a3b1b6eafc39dc19b7129f41643102f9676 +Subproject commit f483d9631d6f21e94aedb20b5c37c56fea06c23e From c29fc5e72e0ddd63f98dd020876699dd66ec5737 Mon Sep 17 00:00:00 2001 From: navjotNSK Date: Wed, 22 May 2024 16:43:40 +0530 Subject: [PATCH 04/19] hk added till cs.json --- app/config/locale/translations/af.json | 1 + app/config/locale/translations/ar.json | 1 + app/config/locale/translations/as.json | 1 + app/config/locale/translations/az.json | 1 + app/config/locale/translations/be.json | 1 + app/config/locale/translations/bg.json | 1 + app/config/locale/translations/bh.json | 1 + app/config/locale/translations/bn.json | 1 + app/config/locale/translations/bs.json | 1 + app/config/locale/translations/ca.json | 1 + app/config/locale/translations/cs.json | 1 + 11 files changed, 11 insertions(+) diff --git a/app/config/locale/translations/af.json b/app/config/locale/translations/af.json index f81800dbb2..284524c5b8 100644 --- a/app/config/locale/translations/af.json +++ b/app/config/locale/translations/af.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hongkong", "countries.hn": "Honduras", "countries.hr": "Kroasië", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/ar.json b/app/config/locale/translations/ar.json index 87d75d7643..da5f6ea01e 100644 --- a/app/config/locale/translations/ar.json +++ b/app/config/locale/translations/ar.json @@ -100,6 +100,7 @@ "countries.gd": "غرينادا", "countries.gt": "غواتيمالا", "countries.gy": "غيانا", + "countries.hk": "هونغ كونغ", "countries.hn": "هندوراس", "countries.hr": "كرواتيا", "countries.ht": "هايتي", diff --git a/app/config/locale/translations/as.json b/app/config/locale/translations/as.json index 31809f2bbd..bcfa3bbf2b 100644 --- a/app/config/locale/translations/as.json +++ b/app/config/locale/translations/as.json @@ -100,6 +100,7 @@ "countries.gd": "গ্ৰেনাডা", "countries.gt": "গুয়াতেমালা", "countries.gy": "গায়ানা", + "countries.hk": "হং কং", "countries.hn": "হণ্ডুৰাছ", "countries.hr": "ক্ৰোৱেছিয়া", "countries.ht": "হাইতি", diff --git a/app/config/locale/translations/az.json b/app/config/locale/translations/az.json index 55be9e805a..93c8a0ff2f 100644 --- a/app/config/locale/translations/az.json +++ b/app/config/locale/translations/az.json @@ -100,6 +100,7 @@ "countries.gd": "Qrenada", "countries.gt": "Qvatemala", "countries.gy": "Guyana", + "countries.hk": "Honq Konq", "countries.hn": "Honduras", "countries.hr": "Xorvatiya", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/be.json b/app/config/locale/translations/be.json index 73ae26c215..9cc3d65a51 100644 --- a/app/config/locale/translations/be.json +++ b/app/config/locale/translations/be.json @@ -100,6 +100,7 @@ "countries.gd": "Грэнада", "countries.gt": "Гватэмала", "countries.gy": "Гаяна", + "countries.hk": "Гонконг", "countries.hn": "Гандурас", "countries.hr": "Харватыя", "countries.ht": "Гаіці", diff --git a/app/config/locale/translations/bg.json b/app/config/locale/translations/bg.json index e7f5b50dda..7b408fe668 100644 --- a/app/config/locale/translations/bg.json +++ b/app/config/locale/translations/bg.json @@ -100,6 +100,7 @@ "countries.gd": "Гренада", "countries.gt": "Гватемала", "countries.gy": "Гвиана", + "countries.hk": "Хонконг", "countries.hn": "Хондурас", "countries.hr": "Хърватия", "countries.ht": "Хаити", diff --git a/app/config/locale/translations/bh.json b/app/config/locale/translations/bh.json index edbc15c28c..e8b46b3364 100644 --- a/app/config/locale/translations/bh.json +++ b/app/config/locale/translations/bh.json @@ -100,6 +100,7 @@ "countries.gd": "ग्रेनाडा", "countries.gt": "ग्वाटेमाला", "countries.gy": "गयाना", + "countries.hk": "हांगकांग", "countries.hn": "होंडुरस", "countries.hr": "क्रोएशिया", "countries.ht": "हैती", diff --git a/app/config/locale/translations/bn.json b/app/config/locale/translations/bn.json index 06ef081610..68a7f68e5f 100644 --- a/app/config/locale/translations/bn.json +++ b/app/config/locale/translations/bn.json @@ -100,6 +100,7 @@ "countries.gd": "গ্রেনাডা", "countries.gt": "গুয়াতেমালা", "countries.gy": "গায়ানা", + "countries.hk": "হংকং", "countries.hn": "হন্ডুরাস", "countries.hr": "ক্রোয়েশিয়া", "countries.ht": "হাইতি", diff --git a/app/config/locale/translations/bs.json b/app/config/locale/translations/bs.json index 133594a710..1656463f82 100644 --- a/app/config/locale/translations/bs.json +++ b/app/config/locale/translations/bs.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Gvajana", + "countries.hk": "Hongkong", "countries.hn": "Honduras", "countries.hr": "Hrvatska", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/ca.json b/app/config/locale/translations/ca.json index 281f1b9d5f..4647fb344e 100644 --- a/app/config/locale/translations/ca.json +++ b/app/config/locale/translations/ca.json @@ -100,6 +100,7 @@ "countries.gd": "Granada", "countries.gt": "Guatemala", "countries.gy": "Guaiana", + "countries.hk": "Hong Kong", "countries.hn": "Hondures", "countries.hr": "Croàcia", "countries.ht": "Haití", diff --git a/app/config/locale/translations/cs.json b/app/config/locale/translations/cs.json index 7d4a638b7f..60349ab612 100644 --- a/app/config/locale/translations/cs.json +++ b/app/config/locale/translations/cs.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Chorvatsko", "countries.ht": "Haiti", From 2621d948c6fa3368fc2f2ca9ed29ae9bdc3e10b0 Mon Sep 17 00:00:00 2001 From: navjotNSK Date: Thu, 23 May 2024 15:53:59 +0530 Subject: [PATCH 05/19] All translations added. --- app/config/locale/translations/eo.json | 1 + 1 file changed, 1 insertion(+) diff --git a/app/config/locale/translations/eo.json b/app/config/locale/translations/eo.json index bb553f1ced..87b065d65d 100644 --- a/app/config/locale/translations/eo.json +++ b/app/config/locale/translations/eo.json @@ -99,6 +99,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Croatia", "countries.ht": "Haiti", From fcbab74f04d91a45d5ce8ee214dd6e1afed9b1b4 Mon Sep 17 00:00:00 2001 From: navjotNSK Date: Thu, 23 May 2024 15:55:57 +0530 Subject: [PATCH 06/19] All translations added. --- app/config/locale/translations/af.json | 2 +- app/config/locale/translations/bg.json | 2 +- app/config/locale/translations/bs.json | 2 +- app/config/locale/translations/da.json | 1 + app/config/locale/translations/de.json | 1 + app/config/locale/translations/el.json | 1 + app/config/locale/translations/en.json | 1 + app/config/locale/translations/es.json | 1 + app/config/locale/translations/fa.json | 1 + app/config/locale/translations/fi.json | 1 + app/config/locale/translations/fo.json | 1 + app/config/locale/translations/fr.json | 1 + app/config/locale/translations/ga.json | 1 + app/config/locale/translations/gu.json | 1 + app/config/locale/translations/he.json | 1 + app/config/locale/translations/hi.json | 1 + app/config/locale/translations/hr.json | 1 + app/config/locale/translations/hu.json | 1 + app/config/locale/translations/hy.json | 1 + app/config/locale/translations/id.json | 1 + app/config/locale/translations/is.json | 1 + app/config/locale/translations/it.json | 1 + app/config/locale/translations/ja.json | 1 + app/config/locale/translations/jv.json | 1 + app/config/locale/translations/km.json | 1 + app/config/locale/translations/kn.json | 1 + app/config/locale/translations/ko.json | 1 + app/config/locale/translations/la.json | 1 + app/config/locale/translations/lb.json | 1 + app/config/locale/translations/lt.json | 1 + app/config/locale/translations/lv.json | 1 + app/config/locale/translations/ml.json | 1 + app/config/locale/translations/mr.json | 1 + app/config/locale/translations/ms.json | 1 + app/config/locale/translations/nb.json | 1 + app/config/locale/translations/ne.json | 1 + app/config/locale/translations/nl.json | 1 + app/config/locale/translations/nn.json | 1 + app/config/locale/translations/or.json | 1 + app/config/locale/translations/pa.json | 1 + app/config/locale/translations/pl.json | 1 + app/config/locale/translations/pt-br.json | 1 + app/config/locale/translations/pt-pt.json | 1 + app/config/locale/translations/ro.json | 1 + app/config/locale/translations/ru.json | 1 + app/config/locale/translations/sa.json | 1 + app/config/locale/translations/sd.json | 1 + app/config/locale/translations/si.json | 1 + app/config/locale/translations/sk.json | 1 + app/config/locale/translations/sl.json | 1 + app/config/locale/translations/sn.json | 1 + app/config/locale/translations/sq.json | 1 + app/config/locale/translations/sv.json | 1 + app/config/locale/translations/ta.json | 1 + app/config/locale/translations/te.json | 1 + app/config/locale/translations/th.json | 1 + app/config/locale/translations/tl.json | 1 + app/config/locale/translations/tr.json | 1 + app/config/locale/translations/uk.json | 1 + app/config/locale/translations/ur.json | 1 + app/config/locale/translations/vi.json | 1 + app/config/locale/translations/zh-cn.json | 1 + app/config/locale/translations/zh-tw.json | 1 + 63 files changed, 63 insertions(+), 3 deletions(-) diff --git a/app/config/locale/translations/af.json b/app/config/locale/translations/af.json index 284524c5b8..6fa77b5dfe 100644 --- a/app/config/locale/translations/af.json +++ b/app/config/locale/translations/af.json @@ -100,7 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", - "countries.hk": "Hongkong", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroasië", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/bg.json b/app/config/locale/translations/bg.json index 7b408fe668..6839ab1e11 100644 --- a/app/config/locale/translations/bg.json +++ b/app/config/locale/translations/bg.json @@ -100,7 +100,7 @@ "countries.gd": "Гренада", "countries.gt": "Гватемала", "countries.gy": "Гвиана", - "countries.hk": "Хонконг", + "countries.hk": "Хонг Конг", "countries.hn": "Хондурас", "countries.hr": "Хърватия", "countries.ht": "Хаити", diff --git a/app/config/locale/translations/bs.json b/app/config/locale/translations/bs.json index 1656463f82..729642d58b 100644 --- a/app/config/locale/translations/bs.json +++ b/app/config/locale/translations/bs.json @@ -100,7 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Gvajana", - "countries.hk": "Hongkong", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Hrvatska", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/da.json b/app/config/locale/translations/da.json index 73aaef5590..b4d3e715e8 100644 --- a/app/config/locale/translations/da.json +++ b/app/config/locale/translations/da.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroatien", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/de.json b/app/config/locale/translations/de.json index 5fa1c14c27..9776c06cfa 100644 --- a/app/config/locale/translations/de.json +++ b/app/config/locale/translations/de.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroatien", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/el.json b/app/config/locale/translations/el.json index 88ceeb873e..980fb852cc 100644 --- a/app/config/locale/translations/el.json +++ b/app/config/locale/translations/el.json @@ -100,6 +100,7 @@ "countries.gd": "Γρενάδα", "countries.gt": "Γουατεμάλα", "countries.gy": "Γουιάνα", + "countries.hk": "Χονγκ Κονγκ", "countries.hn": "Ονδούρα", "countries.hr": "Κροατία", "countries.ht": "Αϊτή", diff --git a/app/config/locale/translations/en.json b/app/config/locale/translations/en.json index 681c88ae94..ac4a02c3ee 100644 --- a/app/config/locale/translations/en.json +++ b/app/config/locale/translations/en.json @@ -106,6 +106,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Croatia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/es.json b/app/config/locale/translations/es.json index 3460bea4b9..fb6355cef5 100644 --- a/app/config/locale/translations/es.json +++ b/app/config/locale/translations/es.json @@ -100,6 +100,7 @@ "countries.gd": "Granada", "countries.gt": "Guatemala", "countries.gy": "Guayana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Croacia", "countries.ht": "Haití", diff --git a/app/config/locale/translations/fa.json b/app/config/locale/translations/fa.json index ef1e74cf0e..009fc765a6 100644 --- a/app/config/locale/translations/fa.json +++ b/app/config/locale/translations/fa.json @@ -100,6 +100,7 @@ "countries.gd": "گرنادا", "countries.gt": "گواتمالا", "countries.gy": "گویان", + "countries.hk": "هنگ کنگ", "countries.hn": "هندوراس", "countries.hr": "کرواسی", "countries.ht": "هائیتی", diff --git a/app/config/locale/translations/fi.json b/app/config/locale/translations/fi.json index 15d4508f5d..0a0c4a9831 100644 --- a/app/config/locale/translations/fi.json +++ b/app/config/locale/translations/fi.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroatia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/fo.json b/app/config/locale/translations/fo.json index b81562426f..0dbda37190 100644 --- a/app/config/locale/translations/fo.json +++ b/app/config/locale/translations/fo.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Gujana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroatia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/fr.json b/app/config/locale/translations/fr.json index 29fdb8645e..abb1eb25d6 100644 --- a/app/config/locale/translations/fr.json +++ b/app/config/locale/translations/fr.json @@ -106,6 +106,7 @@ "countries.gd": "Grenade", "countries.gt": "Guatemala", "countries.gy": "Guyane", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Croatie", "countries.ht": "Haïti", diff --git a/app/config/locale/translations/ga.json b/app/config/locale/translations/ga.json index 15471f4f66..2d6ba8b8ae 100644 --- a/app/config/locale/translations/ga.json +++ b/app/config/locale/translations/ga.json @@ -100,6 +100,7 @@ "countries.gd": "Greanáda", "countries.gt": "Guatamala", "countries.gy": "An Ghuáin", + "countries.hk": "Hong Kong", "countries.hn": "Hondúras", "countries.hr": "An Chróit", "countries.ht": "Háítí", diff --git a/app/config/locale/translations/gu.json b/app/config/locale/translations/gu.json index 1483f5b0b0..c04f6fdbca 100644 --- a/app/config/locale/translations/gu.json +++ b/app/config/locale/translations/gu.json @@ -100,6 +100,7 @@ "countries.gd": "ગ્રેનાડા", "countries.gt": "ગ્વાટેમાલા", "countries.gy": "ગુયાના", + "countries.hk": "હોંગ કોંગ", "countries.hn": "હોન્ડુરાસ", "countries.hr": "ક્રોએશિયા", "countries.ht": "હૈતી", diff --git a/app/config/locale/translations/he.json b/app/config/locale/translations/he.json index 2704341570..fc712b1489 100644 --- a/app/config/locale/translations/he.json +++ b/app/config/locale/translations/he.json @@ -100,6 +100,7 @@ "countries.gd": "גרנדה", "countries.gt": "גואטמלה", "countries.gy": "גיאנה", + "countries.hk": "הונג קונג", "countries.hn": "הונדורס", "countries.hr": "קרואטיה", "countries.ht": "האיטי", diff --git a/app/config/locale/translations/hi.json b/app/config/locale/translations/hi.json index 680044f660..0e5d08d189 100644 --- a/app/config/locale/translations/hi.json +++ b/app/config/locale/translations/hi.json @@ -100,6 +100,7 @@ "countries.gd": "ग्रेनाडा", "countries.gt": "ग्वाटेमाला", "countries.gy": "गयाना", + "countries.hk": "हांग कांग", "countries.hn": "होंडुरस", "countries.hr": "क्रोएशिया", "countries.ht": "हैती", diff --git a/app/config/locale/translations/hr.json b/app/config/locale/translations/hr.json index fb3057df86..8f4a0689c2 100644 --- a/app/config/locale/translations/hr.json +++ b/app/config/locale/translations/hr.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Gvatemala", "countries.gy": "Gvajana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Hrvatska", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/hu.json b/app/config/locale/translations/hu.json index 094f6dee1f..f5c997fd75 100644 --- a/app/config/locale/translations/hu.json +++ b/app/config/locale/translations/hu.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Horvátország", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/hy.json b/app/config/locale/translations/hy.json index b2c1f6929b..4b54d24135 100644 --- a/app/config/locale/translations/hy.json +++ b/app/config/locale/translations/hy.json @@ -100,6 +100,7 @@ "countries.gd": "Գրենադա", "countries.gt": "Գվատեմալա", "countries.gy": "Գայանա", + "countries.hk": "Հոնգ Կոնգ", "countries.hn": "Գոնդուրաս", "countries.hr": "Խորվաթիա", "countries.ht": "Հաիթի", diff --git a/app/config/locale/translations/id.json b/app/config/locale/translations/id.json index eb054d998e..5c0c98ffdb 100644 --- a/app/config/locale/translations/id.json +++ b/app/config/locale/translations/id.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroasia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/is.json b/app/config/locale/translations/is.json index 99db3b77fa..25af184b90 100644 --- a/app/config/locale/translations/is.json +++ b/app/config/locale/translations/is.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Gvatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Hondúras", "countries.hr": "Króatía", "countries.ht": "Haítí", diff --git a/app/config/locale/translations/it.json b/app/config/locale/translations/it.json index 727e46f94e..9d655d00ed 100644 --- a/app/config/locale/translations/it.json +++ b/app/config/locale/translations/it.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Croazia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/ja.json b/app/config/locale/translations/ja.json index 386a7e4870..8afc1ec465 100644 --- a/app/config/locale/translations/ja.json +++ b/app/config/locale/translations/ja.json @@ -100,6 +100,7 @@ "countries.gd": "グレナダ", "countries.gt": "グアテマラ", "countries.gy": "ガイアナ", + "countries.hk": "香港", "countries.hn": "ホンジュラス", "countries.hr": "クロアチア", "countries.ht": "ハイチ", diff --git a/app/config/locale/translations/jv.json b/app/config/locale/translations/jv.json index 6af2a88443..f7924ba092 100644 --- a/app/config/locale/translations/jv.json +++ b/app/config/locale/translations/jv.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Croatia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/km.json b/app/config/locale/translations/km.json index b1862d5e78..1925400bb7 100644 --- a/app/config/locale/translations/km.json +++ b/app/config/locale/translations/km.json @@ -100,6 +100,7 @@ "countries.gd": "ហ្គ្រេណាដា", "countries.gt": "ហ្គាតេម៉ាឡា", "countries.gy": "ហ្គីយ៉ាណា", + "countries.hk": "ហុងកុង", "countries.hn": "ហុងឌូរ៉ាស", "countries.hr": "ក្រូអាត", "countries.ht": "ហៃទី", diff --git a/app/config/locale/translations/kn.json b/app/config/locale/translations/kn.json index 570b5ddf01..c9f0264f66 100644 --- a/app/config/locale/translations/kn.json +++ b/app/config/locale/translations/kn.json @@ -100,6 +100,7 @@ "countries.gd": "ಗ್ರೆನಡಾ", "countries.gt": "ಗ್ವಾಟೆಮಾಲಾ", "countries.gy": "ಗಯಾನಾ", + "countries.hk": "ಹಾಂಗ್ ಕಾಂಗ್", "countries.hn": "ಹೊಂಡುರಾಸ್", "countries.hr": "ಕ್ರೊಯೇಷಿಯಾ", "countries.ht": "ಹೈಟಿ", diff --git a/app/config/locale/translations/ko.json b/app/config/locale/translations/ko.json index 6bb67d3cc3..820acccea0 100644 --- a/app/config/locale/translations/ko.json +++ b/app/config/locale/translations/ko.json @@ -100,6 +100,7 @@ "countries.gd": "그레나다", "countries.gt": "과테말라", "countries.gy": "기아나", + "countries.hk": "홍콩", "countries.hn": "온두라스", "countries.hr": "크로아티아", "countries.ht": "아이티", diff --git a/app/config/locale/translations/la.json b/app/config/locale/translations/la.json index 0d766af60f..672c5afffc 100644 --- a/app/config/locale/translations/la.json +++ b/app/config/locale/translations/la.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Croatia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/lb.json b/app/config/locale/translations/lb.json index 909887549d..23e5d1a86e 100644 --- a/app/config/locale/translations/lb.json +++ b/app/config/locale/translations/lb.json @@ -100,6 +100,7 @@ "countries.gd": "Granada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroatien", "countries.ht": "Haïti", diff --git a/app/config/locale/translations/lt.json b/app/config/locale/translations/lt.json index 43c5edc947..840b0a65be 100644 --- a/app/config/locale/translations/lt.json +++ b/app/config/locale/translations/lt.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Gvatemala", "countries.gy": "Gajana", + "countries.hk": "Honkongas", "countries.hn": "Hondūras", "countries.hr": "Kroatija", "countries.ht": "Haitis", diff --git a/app/config/locale/translations/lv.json b/app/config/locale/translations/lv.json index c193296184..71c2ed52cd 100644 --- a/app/config/locale/translations/lv.json +++ b/app/config/locale/translations/lv.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Gvatemala", "countries.gy": "Gajāna", + "countries.hk": "Honkonga", "countries.hn": "Hondurasa", "countries.hr": "Horvātija", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/ml.json b/app/config/locale/translations/ml.json index ae5339f645..e31f0af3bc 100644 --- a/app/config/locale/translations/ml.json +++ b/app/config/locale/translations/ml.json @@ -100,6 +100,7 @@ "countries.gd": "ഗ്രെനാഡ", "countries.gt": "ഗ്വാട്ടിമാല", "countries.gy": "ഗയാന", + "countries.hk": "ഹോങ്കോങ്", "countries.hn": "ഹോണ്ടുറാസ്", "countries.hr": "ക്രോയേഷ്യ", "countries.ht": "ഹെയ്തി", diff --git a/app/config/locale/translations/mr.json b/app/config/locale/translations/mr.json index 8f390a4ea0..51f020d273 100644 --- a/app/config/locale/translations/mr.json +++ b/app/config/locale/translations/mr.json @@ -100,6 +100,7 @@ "countries.gd": "ग्रेनाडा", "countries.gt": "ग्वाटेमाला", "countries.gy": "गुयाना", + "countries.hk": "हाँगकांग", "countries.hn": "होंडुरास", "countries.hr": "क्रोएशिया", "countries.ht": "हैती", diff --git a/app/config/locale/translations/ms.json b/app/config/locale/translations/ms.json index b0543bcc13..b4258c8843 100644 --- a/app/config/locale/translations/ms.json +++ b/app/config/locale/translations/ms.json @@ -100,6 +100,7 @@ "countries.gd": "Granada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroatia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/nb.json b/app/config/locale/translations/nb.json index 4b747d3836..6e3fa4f558 100644 --- a/app/config/locale/translations/nb.json +++ b/app/config/locale/translations/nb.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroatia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/ne.json b/app/config/locale/translations/ne.json index a55c8a7f84..50e81f06d9 100644 --- a/app/config/locale/translations/ne.json +++ b/app/config/locale/translations/ne.json @@ -100,6 +100,7 @@ "countries.gd": "ग्रेनेडा", "countries.gt": "ग्वाटेमाला", "countries.gy": "गुयाना", + "countries.hk": "हाँगकाँग", "countries.hn": "होन्डुरस", "countries.hr": "क्रोएशिया", "countries.ht": "हैती", diff --git a/app/config/locale/translations/nl.json b/app/config/locale/translations/nl.json index 98a3999096..4a93e4f370 100644 --- a/app/config/locale/translations/nl.json +++ b/app/config/locale/translations/nl.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hongkong", "countries.hn": "Honduras", "countries.hr": "Croatië", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/nn.json b/app/config/locale/translations/nn.json index 6c40f1a514..43821e5a87 100644 --- a/app/config/locale/translations/nn.json +++ b/app/config/locale/translations/nn.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroatia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/or.json b/app/config/locale/translations/or.json index 26ede93c3a..e0d65ead1a 100644 --- a/app/config/locale/translations/or.json +++ b/app/config/locale/translations/or.json @@ -100,6 +100,7 @@ "countries.gd": "ଗ୍ରେନାଡା", "countries.gt": "ଗୁଆଟେମାଲା", "countries.gy": "ଗୁଇନ୍ଦା", + "countries.hk": "ହଂ କଙ୍ଗ", "countries.hn": "ହୋଣ୍ଡୁରାସ୍", "countries.hr": "କ୍ରୋଏସିଆ", "countries.ht": "ହାଇତି", diff --git a/app/config/locale/translations/pa.json b/app/config/locale/translations/pa.json index dc21fddc37..49b10e94ba 100644 --- a/app/config/locale/translations/pa.json +++ b/app/config/locale/translations/pa.json @@ -100,6 +100,7 @@ "countries.gd": "ਗ੍ਰੇਨਾਡਾ", "countries.gt": "ਗੁਆਟੇਮਾਲਾ", "countries.gy": "ਗੇਆਨਾ", + "countries.hk": "ਹਾਂਗ ਕਾਂਗ", "countries.hn": "ਹੌਂਡੂਰਸ", "countries.hr": "ਕਰੋਸ਼ੀਆ", "countries.ht": "ਹੈਤੀ", diff --git a/app/config/locale/translations/pl.json b/app/config/locale/translations/pl.json index f351b8ce23..8bae8f9f82 100644 --- a/app/config/locale/translations/pl.json +++ b/app/config/locale/translations/pl.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Gwatemala", "countries.gy": "Gujana", + "countries.hk": "Hongkong", "countries.hn": "Honduras", "countries.hr": "Chorwacja", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/pt-br.json b/app/config/locale/translations/pt-br.json index d19f374b67..cd7f17ba46 100644 --- a/app/config/locale/translations/pt-br.json +++ b/app/config/locale/translations/pt-br.json @@ -100,6 +100,7 @@ "countries.gd": "Granada", "countries.gt": "Guatemala", "countries.gy": "Guiana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Croácia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/pt-pt.json b/app/config/locale/translations/pt-pt.json index ef45a319a3..f7de3cc62b 100644 --- a/app/config/locale/translations/pt-pt.json +++ b/app/config/locale/translations/pt-pt.json @@ -100,6 +100,7 @@ "countries.gd": "Granada", "countries.gt": "Guatemala", "countries.gy": "Guiana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Croácia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/ro.json b/app/config/locale/translations/ro.json index 1a3515dc9d..fc8a435f0c 100644 --- a/app/config/locale/translations/ro.json +++ b/app/config/locale/translations/ro.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Croația", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/ru.json b/app/config/locale/translations/ru.json index 112e320310..4d311e8168 100644 --- a/app/config/locale/translations/ru.json +++ b/app/config/locale/translations/ru.json @@ -100,6 +100,7 @@ "countries.gd": "Гренада", "countries.gt": "Гватемала", "countries.gy": "Гайана", + "countries.hk": "Гонконг", "countries.hn": "Гондурас", "countries.hr": "Хорватия", "countries.ht": "Гаити", diff --git a/app/config/locale/translations/sa.json b/app/config/locale/translations/sa.json index 09c5f7a8d2..8a51591474 100644 --- a/app/config/locale/translations/sa.json +++ b/app/config/locale/translations/sa.json @@ -100,6 +100,7 @@ "countries.gd": "ग्रेनेडा", "countries.gt": "ग्वाटेमाला", "countries.gy": "गुयाना", + "countries.hk": "हांगकांग", "countries.hn": "होंडुरस्‌", "countries.hr": "क्रोएशिया", "countries.ht": "हैती", diff --git a/app/config/locale/translations/sd.json b/app/config/locale/translations/sd.json index 7961b64e4c..e1a2c04071 100644 --- a/app/config/locale/translations/sd.json +++ b/app/config/locale/translations/sd.json @@ -100,6 +100,7 @@ "countries.gd": "گرينڊا", "countries.gt": "گٽيمالا", "countries.gy": "گيانا", + "countries.hk": "هانگ کانگ", "countries.hn": "هونڊرس", "countries.hr": "ڪوريٽيا", "countries.ht": "هيٽي", diff --git a/app/config/locale/translations/si.json b/app/config/locale/translations/si.json index b10240d77d..32ab398fee 100644 --- a/app/config/locale/translations/si.json +++ b/app/config/locale/translations/si.json @@ -100,6 +100,7 @@ "countries.gd": "ග්‍රෙනාඩා", "countries.gt": "ග්වාතමාලාව", "countries.gy": "ගයනා", + "countries.hk": "හොංකොං", "countries.hn": "හොන්ඩුරාස්", "countries.hr": "ක්‍රොඒෂියාව", "countries.ht": "හයිටි", diff --git a/app/config/locale/translations/sk.json b/app/config/locale/translations/sk.json index a5468ddd6d..1ec3bd2f13 100644 --- a/app/config/locale/translations/sk.json +++ b/app/config/locale/translations/sk.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hongkong", "countries.hn": "Honduras", "countries.hr": "Chorvátsko", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/sl.json b/app/config/locale/translations/sl.json index d4c7ccaeab..7bba60fc5f 100644 --- a/app/config/locale/translations/sl.json +++ b/app/config/locale/translations/sl.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Gvatemala", "countries.gy": "Gvajana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Hrvaška", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/sn.json b/app/config/locale/translations/sn.json index 07c00bc29b..76deee976c 100644 --- a/app/config/locale/translations/sn.json +++ b/app/config/locale/translations/sn.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Croatia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/sq.json b/app/config/locale/translations/sq.json index dea40f9f32..f9d7679722 100644 --- a/app/config/locale/translations/sq.json +++ b/app/config/locale/translations/sq.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guajana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroacia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/sv.json b/app/config/locale/translations/sv.json index 751fd292a3..33e80fe7cd 100644 --- a/app/config/locale/translations/sv.json +++ b/app/config/locale/translations/sv.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroatien", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/ta.json b/app/config/locale/translations/ta.json index 5cc09bd9fa..a5cd6115f4 100644 --- a/app/config/locale/translations/ta.json +++ b/app/config/locale/translations/ta.json @@ -100,6 +100,7 @@ "countries.gd": "கிரெனடா", "countries.gt": "குவாத்தமாலா", "countries.gy": "கயானா", + "countries.hk": "ஹாங்காங்", "countries.hn": "ஹொண்டூராஸ்", "countries.hr": "குரோவாசியா", "countries.ht": "ஹைத்தி", diff --git a/app/config/locale/translations/te.json b/app/config/locale/translations/te.json index 7cc5cf607b..72078a47cd 100644 --- a/app/config/locale/translations/te.json +++ b/app/config/locale/translations/te.json @@ -100,6 +100,7 @@ "countries.gd": "గ్రెనడా", "countries.gt": "గ్వాటెమాల", "countries.gy": "గయానా", + "countries.hk": "హాంగ్ కొంగ", "countries.hn": "హోండురాస్", "countries.hr": "క్రొయేషియా", "countries.ht": "హైతీ", diff --git a/app/config/locale/translations/th.json b/app/config/locale/translations/th.json index 750c173e80..7e2f1f16fd 100644 --- a/app/config/locale/translations/th.json +++ b/app/config/locale/translations/th.json @@ -100,6 +100,7 @@ "countries.gd": "เกรเนดา", "countries.gt": "กัวเตมาลา", "countries.gy": "กายอานา", + "countries.hk": "ฮ่องกง", "countries.hn": "ฮอนดูรัส", "countries.hr": "โครเอเชีย", "countries.ht": "ไฮติ", diff --git a/app/config/locale/translations/tl.json b/app/config/locale/translations/tl.json index 5e45857bfd..e8b7142764 100644 --- a/app/config/locale/translations/tl.json +++ b/app/config/locale/translations/tl.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guwatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Kroasya", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/tr.json b/app/config/locale/translations/tr.json index e82317de01..5034fd12bd 100644 --- a/app/config/locale/translations/tr.json +++ b/app/config/locale/translations/tr.json @@ -106,6 +106,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Hırvatistan", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/uk.json b/app/config/locale/translations/uk.json index b8269afc1f..3e9829cf90 100644 --- a/app/config/locale/translations/uk.json +++ b/app/config/locale/translations/uk.json @@ -100,6 +100,7 @@ "countries.gd": "Гренада", "countries.gt": "Гватемала", "countries.gy": "Гайана", + "countries.hk": "Гонконг", "countries.hn": "Гондурас", "countries.hr": "Хорватія", "countries.ht": "Гаїті", diff --git a/app/config/locale/translations/ur.json b/app/config/locale/translations/ur.json index 6f769fc604..b61bacbf9f 100644 --- a/app/config/locale/translations/ur.json +++ b/app/config/locale/translations/ur.json @@ -100,6 +100,7 @@ "countries.gd": "گریناڈا", "countries.gt": "گوئٹے مالا", "countries.gy": "گیانا", + "countries.hk": "ہانگ کانگ", "countries.hn": "ہونڈوراس", "countries.hr": "کروشیا", "countries.ht": "ہیٹی", diff --git a/app/config/locale/translations/vi.json b/app/config/locale/translations/vi.json index 3d946fcde4..752f6e13c9 100644 --- a/app/config/locale/translations/vi.json +++ b/app/config/locale/translations/vi.json @@ -100,6 +100,7 @@ "countries.gd": "Grenada", "countries.gt": "Guatemala", "countries.gy": "Guyana", + "countries.hk": "Hong Kong", "countries.hn": "Honduras", "countries.hr": "Croatia", "countries.ht": "Haiti", diff --git a/app/config/locale/translations/zh-cn.json b/app/config/locale/translations/zh-cn.json index 289f40dd74..63180f983b 100644 --- a/app/config/locale/translations/zh-cn.json +++ b/app/config/locale/translations/zh-cn.json @@ -100,6 +100,7 @@ "countries.gd": "格林纳达", "countries.gt": "危地马拉", "countries.gy": "圭亚那", + "countries.hk": "香港", "countries.hn": "洪都拉斯", "countries.hr": "克罗地亚", "countries.ht": "海地", diff --git a/app/config/locale/translations/zh-tw.json b/app/config/locale/translations/zh-tw.json index 67282e7591..7b17d116d7 100644 --- a/app/config/locale/translations/zh-tw.json +++ b/app/config/locale/translations/zh-tw.json @@ -106,6 +106,7 @@ "countries.gd": "格瑞那達", "countries.gt": "瓜地馬拉", "countries.gy": "蓋亞那", + "countries.hk": "香港", "countries.hn": "宏都拉斯", "countries.hr": "克羅埃西亞", "countries.ht": "海地", From 1a42d118f64b6af90ffa6787e58079e1dcd34e05 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Sat, 1 Jun 2024 19:18:35 +0530 Subject: [PATCH 07/19] add: test to validate user-id isn't overridden. --- .../Functions/FunctionsCustomClientTest.php | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index 119c1a2223..0acf297ea7 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -716,4 +716,92 @@ class FunctionsCustomClientTest extends Scope return []; } + + public function testExecutionWithUserId(): array + { + /** + * Test for SUCCESS + */ + $projectId = $this->getProject()['$id']; + $apikey = $this->getProject()['apiKey']; + + $function = $this->client->call(Client::METHOD_POST, '/functions', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $apikey, + ], [ + 'functionId' => ID::unique(), + 'name' => 'Test', + 'execute' => [Role::any()->toString()], + 'runtime' => 'node-18.0', + 'entrypoint' => 'index.js' + ]); + + $functionId = $function['body']['$id'] ?? ''; + + $this->assertEquals(201, $function['headers']['status-code']); + + $folder = 'node'; + $code = realpath(__DIR__ . '/../../../resources/functions') . "/$folder/code.tar.gz"; + $this->packageCode($folder); + + $deployment = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/deployments', [ + 'content-type' => 'multipart/form-data', + 'x-appwrite-project' => $projectId, + 'x-appwrite-key' => $apikey, + ], [ + 'entrypoint' => 'index.js', + 'code' => new CURLFile($code, 'application/x-gzip', \basename($code)), //different tarball names intentional + 'activate' => true + ]); + + $deploymentId = $deployment['body']['$id'] ?? ''; + + $this->assertEquals(202, $deployment['headers']['status-code']); + + // Poll until deployment is built + while (true) { + $deployment = $this->client->call(Client::METHOD_GET, '/functions/' . $function['body']['$id'] . '/deployments/' . $deploymentId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + + if ( + $deployment['headers']['status-code'] >= 400 + || \in_array($deployment['body']['status'], ['ready', 'failed']) + ) { + break; + } + + \sleep(1); + } + + $this->assertEquals('ready', $deployment['body']['status']); + + $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'x-appwrite-user-id' => "665b0df20031bdf527fb", + ]); + + $output = json_decode($execution['body']['responseBody'], true); + $this->assertNotEquals('665b0df20031bdf527fb', $this->getUser()['$id']); + $this->assertEquals($this->getUser()['$id'], $output['APPWRITE_FUNCTION_USER_ID']); + // Client should never see logs and errors + $this->assertEmpty($execution['body']['logs']); + $this->assertEmpty($execution['body']['errors']); + + // Cleanup : Delete function + $response = $this->client->call(Client::METHOD_DELETE, '/functions/' . $functionId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], []); + + $this->assertEquals(204, $response['headers']['status-code']); + + return []; + } } From 52f5a5c40c6a637a66cb34325cbd67034bd73b39 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Mon, 3 Jun 2024 14:10:20 +0530 Subject: [PATCH 08/19] update test. --- .../Functions/FunctionsCustomClientTest.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index 0acf297ea7..0adf11d057 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -783,15 +783,19 @@ class FunctionsCustomClientTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'x-appwrite-user-id' => "665b0df20031bdf527fb", + 'x-appwrite-event' => "OVERRIDDEN", + 'x-appwrite-trigger' => "OVERRIDDEN", + 'x-appwrite-user-id' => "OVERRIDDEN", + 'x-appwrite-user-jwt' => "OVERRIDDEN", ]); $output = json_decode($execution['body']['responseBody'], true); - $this->assertNotEquals('665b0df20031bdf527fb', $this->getUser()['$id']); + $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_JWT']); + $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_EVENT']); + $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_TRIGGER']); + $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_USER_ID']); + $this->assertEquals($this->getUser()['$id'], $output['APPWRITE_FUNCTION_USER_ID']); - // Client should never see logs and errors - $this->assertEmpty($execution['body']['logs']); - $this->assertEmpty($execution['body']['errors']); // Cleanup : Delete function $response = $this->client->call(Client::METHOD_DELETE, '/functions/' . $functionId, [ From b54a599960dbd21e52d8ef923bb4857f666eab9a Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Mon, 3 Jun 2024 14:13:08 +0530 Subject: [PATCH 09/19] update test name for clarity. --- tests/e2e/Services/Functions/FunctionsCustomClientTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index 0adf11d057..e10aef840c 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -717,7 +717,7 @@ class FunctionsCustomClientTest extends Scope return []; } - public function testExecutionWithUserId(): array + public function testNonOverrideOfHeaders(): array { /** * Test for SUCCESS From 37da4a0cd39e20aa9a1be37c8ef7a401a5843783 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Mon, 3 Jun 2024 14:19:59 +0530 Subject: [PATCH 10/19] review comments. --- tests/e2e/Services/Functions/FunctionsCustomClientTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index e10aef840c..0b8ea71aad 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -795,8 +795,6 @@ class FunctionsCustomClientTest extends Scope $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_TRIGGER']); $this->assertNotEquals('OVERRIDDEN', $output['APPWRITE_FUNCTION_USER_ID']); - $this->assertEquals($this->getUser()['$id'], $output['APPWRITE_FUNCTION_USER_ID']); - // Cleanup : Delete function $response = $this->client->call(Client::METHOD_DELETE, '/functions/' . $functionId, [ 'content-type' => 'application/json', From f762d66c5e87c233beeb490d7f2fab96aca3e663 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 4 Jun 2024 01:31:05 +0000 Subject: [PATCH 11/19] fix typo --- src/Appwrite/Platform/Workers/Webhooks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Workers/Webhooks.php b/src/Appwrite/Platform/Workers/Webhooks.php index a83183ec3e..88ca7871f2 100644 --- a/src/Appwrite/Platform/Workers/Webhooks.php +++ b/src/Appwrite/Platform/Workers/Webhooks.php @@ -103,7 +103,7 @@ class Webhooks extends Action \curl_setopt($ch, CURLOPT_MAXFILESIZE, self::MAX_FILE_SIZE); \curl_setopt($ch, CURLOPT_USERAGENT, \sprintf( APP_USERAGENT, - App::getEnv('_APP_VERSION', 'UNKNOWN'), + System::getEnv('_APP_VERSION', 'UNKNOWN'), System::getEnv('_APP_EMAIL_SECURITY', System::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY)) )); \curl_setopt( From cccda2a46cc7ee348864ae6c7be56bff1966c271 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi Date: Wed, 5 Jun 2024 23:34:01 +0530 Subject: [PATCH 12/19] fix: Don't set target attribute if no existing Target found --- app/controllers/api/account.php | 4 +++- app/controllers/api/users.php | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index e1ddeb6b68..20ce2541c5 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -290,7 +290,9 @@ App::post('/v1/account') $existingTarget = $dbForProject->findOne('targets', [ Query::equal('identifier', [$email]), ]); - $user->setAttribute('targets', [...$user->getAttribute('targets', []), $existingTarget]); + if($existingTarget) { + $user->setAttribute('targets', [...$user->getAttribute('targets', []), $existingTarget]); + } } $dbForProject->purgeCachedDocument('users', $user->getId()); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index abfcb34a5a..9d08fcf784 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -138,7 +138,9 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e $existingTarget = $dbForProject->findOne('targets', [ Query::equal('identifier', [$email]), ]); - $user->setAttribute('targets', [...$user->getAttribute('targets', []), $existingTarget]); + if($existingTarget) { + $user->setAttribute('targets', [...$user->getAttribute('targets', []), $existingTarget]); + } } } @@ -160,7 +162,9 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e $existingTarget = $dbForProject->findOne('targets', [ Query::equal('identifier', [$phone]), ]); - $user->setAttribute('targets', [...$user->getAttribute('targets', []), $existingTarget]); + if($existingTarget) { + $user->setAttribute('targets', [...$user->getAttribute('targets', []), $existingTarget]); + } } } From 485b8eeb8b2461f46a877cbc017baeaf487a9c33 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi Date: Wed, 5 Jun 2024 23:53:31 +0530 Subject: [PATCH 13/19] chore: misc test assertions improvements --- .../Account/AccountCustomClientTest.php | 47 +++++++++---------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index 23771712e8..b1f7c85cd9 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -150,7 +150,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['registration'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $name); $this->assertArrayHasKey('accessedAt', $response['body']); @@ -294,7 +294,7 @@ class AccountCustomClientTest extends Scope $this->assertIsNumeric($response['body']['total']); $this->assertEquals("user.create", $response['body']['logs'][2]['event']); $this->assertEquals(filter_var($response['body']['logs'][2]['ip'], FILTER_VALIDATE_IP), $response['body']['logs'][2]['ip']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['logs'][2]['time'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['logs'][2]['time'])); $this->assertEquals('Windows', $response['body']['logs'][1]['osName']); $this->assertEquals('WIN', $response['body']['logs'][1]['osCode']); @@ -327,7 +327,6 @@ class AccountCustomClientTest extends Scope $this->assertEquals('desktop', $response['body']['logs'][2]['deviceName']); $this->assertEquals('', $response['body']['logs'][2]['deviceBrand']); $this->assertEquals('', $response['body']['logs'][2]['deviceModel']); - $this->assertEquals($response['body']['logs'][2]['ip'], filter_var($response['body']['logs'][2]['ip'], FILTER_VALIDATE_IP)); $this->assertEquals('--', $response['body']['logs'][2]['countryCode']); $this->assertEquals('Unknown', $response['body']['logs'][2]['countryName']); @@ -343,7 +342,7 @@ class AccountCustomClientTest extends Scope ] ]); - $this->assertEquals($responseLimit['headers']['status-code'], 200); + $this->assertEquals(200, $responseLimit['headers']['status-code']); $this->assertIsArray($responseLimit['body']['logs']); $this->assertNotEmpty($responseLimit['body']['logs']); $this->assertCount(1, $responseLimit['body']['logs']); @@ -382,7 +381,7 @@ class AccountCustomClientTest extends Scope ] ]); - $this->assertEquals($responseLimitOffset['headers']['status-code'], 200); + $this->assertEquals(200, $responseLimitOffset['headers']['status-code']); $this->assertIsArray($responseLimitOffset['body']['logs']); $this->assertNotEmpty($responseLimitOffset['body']['logs']); $this->assertCount(1, $responseLimitOffset['body']['logs']); @@ -430,7 +429,7 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['registration'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $newName); @@ -497,7 +496,7 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['registration'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ @@ -587,7 +586,7 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['registration'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $newEmail); /** @@ -629,7 +628,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['registration'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $data['email']); $this->assertEquals($response['body']['name'], $data['name']); @@ -771,7 +770,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['expire'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['expire'])); $lastEmail = $this->getLastEmail(); @@ -1073,7 +1072,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['expire'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['expire'])); $lastEmail = $this->getLastEmail(); @@ -1668,7 +1667,7 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['registration'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ @@ -1756,13 +1755,11 @@ class AccountCustomClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals($response['body']['$id'], $userId); - $this->assertEquals($response['body']['name'], 'User Name'); - $this->assertEquals($response['body']['email'], 'useroauth@localhost.test'); + $this->assertEquals('User Name', $response['body']['name']); + $this->assertEquals('useroauth@localhost.test', $response['body']['email']); // Since we only support one oauth user, let's also check updateSession here - $this->assertEquals(200, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_GET, '/account/sessions/current', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', @@ -1808,7 +1805,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals($response['body']['provider'], 'anonymous'); + $this->assertEquals('anonymous', $response['body']['provider']); $sessionID = $response['body']['$id']; @@ -1821,7 +1818,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals($response['body']['provider'], 'anonymous'); + $this->assertEquals('anonymous', $response['body']['provider']); $response = $this->client->call(Client::METHOD_GET, '/account/sessions/97823askjdkasd80921371980', array_merge([ 'origin' => 'http://localhost', @@ -1934,7 +1931,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['expire'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['expire'])); $userId = $response['body']['userId']; @@ -2085,7 +2082,7 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['registration'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ @@ -2127,7 +2124,7 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['registration'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['registration'])); $this->assertEquals($response['body']['phone'], $newPhone); /** @@ -2240,7 +2237,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['expire'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['expire'])); $smsRequest = $this->getLastRequest(); @@ -2327,7 +2324,7 @@ class AccountCustomClientTest extends Scope $this->assertNotEmpty($response['body']['$id']); $this->assertEmpty($response['body']['secret']); $this->assertEmpty($response['body']['phrase']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['expire'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['expire'])); $userId = $response['body']['userId']; @@ -2452,7 +2449,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['registration'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertTrue($response['body']['emailVerification']); @@ -2512,7 +2509,7 @@ class AccountCustomClientTest extends Scope $this->assertIsArray($response['body']); $this->assertNotEmpty($response['body']); $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['registration'])); + $this->assertTrue((new DatetimeValidator())->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', array_merge([ From a34ec72048988776294290f34364a0242ba604e1 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Thu, 6 Jun 2024 12:01:32 +0530 Subject: [PATCH 14/19] fix: delete expired targets per project. --- src/Appwrite/Platform/Tasks/Maintenance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Tasks/Maintenance.php b/src/Appwrite/Platform/Tasks/Maintenance.php index cfbc4b200a..1da8a58ebe 100644 --- a/src/Appwrite/Platform/Tasks/Maintenance.php +++ b/src/Appwrite/Platform/Tasks/Maintenance.php @@ -49,6 +49,7 @@ class Maintenance extends Action $this->foreachProject($dbForConsole, function (Document $project) use ($queueForDeletes, $usageStatsRetentionHourly) { $queueForDeletes->setProject($project); + $this->notifyDeleteTargets($queueForDeletes); $this->notifyDeleteExecutionLogs($queueForDeletes); $this->notifyDeleteAbuseLogs($queueForDeletes); $this->notifyDeleteAuditLogs($queueForDeletes); @@ -60,7 +61,6 @@ class Maintenance extends Action $this->renewCertificates($dbForConsole, $queueForCertificates); $this->notifyDeleteCache($cacheRetention, $queueForDeletes); $this->notifyDeleteSchedules($schedulesDeletionRetention, $queueForDeletes); - $this->notifyDeleteTargets($queueForDeletes); }, $interval, $delay); } From c179e89fdf0f6ebc2044eeaae8a2d47b207b1f48 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 9 Jun 2024 01:03:40 +0000 Subject: [PATCH 15/19] update to use latest platform with module --- app/cli.php | 2 +- app/worker.php | 5 -- composer.json | 2 +- composer.lock | 67 +++++++++++----------- src/Appwrite/Platform/Appwrite.php | 6 +- src/Appwrite/Platform/Modules/Core.php | 17 ++++++ src/Appwrite/Platform/Services/Tasks.php | 2 +- src/Appwrite/Platform/Services/Workers.php | 2 +- 8 files changed, 57 insertions(+), 46 deletions(-) create mode 100644 src/Appwrite/Platform/Modules/Core.php diff --git a/app/cli.php b/app/cli.php index da7d23c18d..d132f25b1a 100644 --- a/app/cli.php +++ b/app/cli.php @@ -202,7 +202,7 @@ CLI::setResource('logError', function (Registry $register) { }, ['register']); $platform = new Appwrite(); -$platform->init(Service::TYPE_CLI); +$platform->init(Service::TYPE_TASK); $cli = $platform->getCli(); diff --git a/app/worker.php b/app/worker.php index 60358ad6b2..7037614f8e 100644 --- a/app/worker.php +++ b/app/worker.php @@ -284,11 +284,6 @@ if (!isset($args[1])) { \array_shift($args); $workerName = $args[0]; -$workerIndex = $args[1] ?? ''; - -if (!empty($workerIndex)) { - $workerName .= '_' . $workerIndex; -} if (\str_starts_with($workerName, 'databases')) { $queueName = System::getEnv('_APP_QUEUE_NAME', 'database_db_main'); diff --git a/composer.json b/composer.json index 205fe308f0..82e3e15a05 100644 --- a/composer.json +++ b/composer.json @@ -61,7 +61,7 @@ "utopia-php/messaging": "0.11.*", "utopia-php/migration": "0.4.*", "utopia-php/orchestration": "0.9.*", - "utopia-php/platform": "0.5.*", + "utopia-php/platform": "0.7.*", "utopia-php/pools": "0.5.*", "utopia-php/preloader": "0.2.*", "utopia-php/queue": "0.7.*", diff --git a/composer.lock b/composer.lock index 8acbbed541..5d31e14570 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "53996479cd4ba0c73dbc72d46b240be0", + "content-hash": "18bab1e5f72cc82896aef9e64bf566e8", "packages": [ { "name": "adhocore/jwt", @@ -1427,16 +1427,16 @@ }, { "name": "utopia-php/abuse", - "version": "0.37.0", + "version": "0.37.1", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "2de5c12886cbd516e511e559afdd9e615d871062" + "reference": "4dfcff4754c7804d1a70039792c0f2d59a5cc981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/2de5c12886cbd516e511e559afdd9e615d871062", - "reference": "2de5c12886cbd516e511e559afdd9e615d871062", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/4dfcff4754c7804d1a70039792c0f2d59a5cc981", + "reference": "4dfcff4754c7804d1a70039792c0f2d59a5cc981", "shasum": "" }, "require": { @@ -1470,9 +1470,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/0.37.0" + "source": "https://github.com/utopia-php/abuse/tree/0.37.1" }, - "time": "2024-03-06T21:20:27+00:00" + "time": "2024-06-05T18:03:59+00:00" }, { "name": "utopia-php/analytics", @@ -1522,16 +1522,16 @@ }, { "name": "utopia-php/audit", - "version": "0.39.0", + "version": "0.39.1", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "f0bc15012e05cc0b9dde012ab27d25f193768a2c" + "reference": "7ea91e0ceea7b94293612fea94022b73315677c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/f0bc15012e05cc0b9dde012ab27d25f193768a2c", - "reference": "f0bc15012e05cc0b9dde012ab27d25f193768a2c", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/7ea91e0ceea7b94293612fea94022b73315677c2", + "reference": "7ea91e0ceea7b94293612fea94022b73315677c2", "shasum": "" }, "require": { @@ -1563,9 +1563,9 @@ ], "support": { "issues": "https://github.com/utopia-php/audit/issues", - "source": "https://github.com/utopia-php/audit/tree/0.39.0" + "source": "https://github.com/utopia-php/audit/tree/0.39.1" }, - "time": "2024-03-06T21:20:37+00:00" + "time": "2024-06-05T19:28:22+00:00" }, { "name": "utopia-php/cache", @@ -1719,16 +1719,16 @@ }, { "name": "utopia-php/database", - "version": "0.49.10", + "version": "0.49.11", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "216209121bc97a2010f67a39c561fafe1e936bec" + "reference": "4f4b35d99ecdee971c3042279bb1ac8264825030" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/216209121bc97a2010f67a39c561fafe1e936bec", - "reference": "216209121bc97a2010f67a39c561fafe1e936bec", + "url": "https://api.github.com/repos/utopia-php/database/zipball/4f4b35d99ecdee971c3042279bb1ac8264825030", + "reference": "4f4b35d99ecdee971c3042279bb1ac8264825030", "shasum": "" }, "require": { @@ -1769,9 +1769,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.49.10" + "source": "https://github.com/utopia-php/database/tree/0.49.11" }, - "time": "2024-05-20T02:14:20+00:00" + "time": "2024-05-30T12:40:27+00:00" }, { "name": "utopia-php/domains", @@ -2327,16 +2327,16 @@ }, { "name": "utopia-php/platform", - "version": "0.5.2", + "version": "0.7.0", "source": { "type": "git", "url": "https://github.com/utopia-php/platform.git", - "reference": "b9feabc79b92dc2b05683a986ad43bce5c1583e3" + "reference": "beeea0f2c9bce14a6869fc5c87a1047cdecb5c52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/platform/zipball/b9feabc79b92dc2b05683a986ad43bce5c1583e3", - "reference": "b9feabc79b92dc2b05683a986ad43bce5c1583e3", + "url": "https://api.github.com/repos/utopia-php/platform/zipball/beeea0f2c9bce14a6869fc5c87a1047cdecb5c52", + "reference": "beeea0f2c9bce14a6869fc5c87a1047cdecb5c52", "shasum": "" }, "require": { @@ -2344,7 +2344,8 @@ "ext-redis": "*", "php": ">=8.0", "utopia-php/cli": "0.15.*", - "utopia-php/framework": "0.33.*" + "utopia-php/framework": "0.33.*", + "utopia-php/queue": "0.7.*" }, "require-dev": { "laravel/pint": "1.2.*", @@ -2370,9 +2371,9 @@ ], "support": { "issues": "https://github.com/utopia-php/platform/issues", - "source": "https://github.com/utopia-php/platform/tree/0.5.2" + "source": "https://github.com/utopia-php/platform/tree/0.7.0" }, - "time": "2024-05-22T12:50:35+00:00" + "time": "2024-05-08T17:00:55+00:00" }, { "name": "utopia-php/pools", @@ -3824,16 +3825,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.29.0", + "version": "1.29.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc" + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/536889f2b340489d328f5ffb7b02bb6b183ddedc", - "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", "shasum": "" }, "require": { @@ -3865,9 +3866,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" }, - "time": "2024-05-06T12:04:23+00:00" + "time": "2024-05-31T08:52:43+00:00" }, { "name": "phpunit/php-code-coverage", @@ -5613,5 +5614,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.6.0" } diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index 05224799f3..6b3eb077fa 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -2,15 +2,13 @@ namespace Appwrite\Platform; -use Appwrite\Platform\Services\Tasks; -use Appwrite\Platform\Services\Workers; +use Appwrite\Platform\Modules\Core; use Utopia\Platform\Platform; class Appwrite extends Platform { public function __construct() { - $this->addService('tasks', new Tasks()); - $this->addService('workers', new Workers()); + parent::__construct(new Core()); } } diff --git a/src/Appwrite/Platform/Modules/Core.php b/src/Appwrite/Platform/Modules/Core.php new file mode 100644 index 0000000000..355747e3ab --- /dev/null +++ b/src/Appwrite/Platform/Modules/Core.php @@ -0,0 +1,17 @@ +addService('tasks', new Tasks()); + $this->addService('workers', new Workers()); + } + +} \ No newline at end of file diff --git a/src/Appwrite/Platform/Services/Tasks.php b/src/Appwrite/Platform/Services/Tasks.php index ac1f99eec3..31465d2f26 100644 --- a/src/Appwrite/Platform/Services/Tasks.php +++ b/src/Appwrite/Platform/Services/Tasks.php @@ -22,7 +22,7 @@ class Tasks extends Service { public function __construct() { - $this->type = self::TYPE_CLI; + $this->type = Service::TYPE_TASK; $this ->addAction(Doctor::getName(), new Doctor()) ->addAction(Install::getName(), new Install()) diff --git a/src/Appwrite/Platform/Services/Workers.php b/src/Appwrite/Platform/Services/Workers.php index 62a7fcf3fb..0e79f4257c 100644 --- a/src/Appwrite/Platform/Services/Workers.php +++ b/src/Appwrite/Platform/Services/Workers.php @@ -20,7 +20,7 @@ class Workers extends Service { public function __construct() { - $this->type = self::TYPE_WORKER; + $this->type = Service::TYPE_WORKER; $this ->addAction(Audits::getName(), new Audits()) ->addAction(Builds::getName(), new Builds()) From 26413566dc07098b0b4db0917240bac51c01259e Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 9 Jun 2024 11:36:35 +0000 Subject: [PATCH 16/19] fix format --- src/Appwrite/Platform/Modules/Core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Core.php b/src/Appwrite/Platform/Modules/Core.php index 355747e3ab..859ca3b529 100644 --- a/src/Appwrite/Platform/Modules/Core.php +++ b/src/Appwrite/Platform/Modules/Core.php @@ -14,4 +14,4 @@ class Core extends Module $this->addService('workers', new Workers()); } -} \ No newline at end of file +} From 190560b8ef4604f81eae7a3f2aa393839066e875 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi Date: Tue, 11 Jun 2024 21:17:25 +0530 Subject: [PATCH 17/19] chore: append attributes instead of replace --- app/controllers/api/account.php | 2 +- app/controllers/api/users.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 20ce2541c5..6f0345cfdc 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -291,7 +291,7 @@ App::post('/v1/account') Query::equal('identifier', [$email]), ]); if($existingTarget) { - $user->setAttribute('targets', [...$user->getAttribute('targets', []), $existingTarget]); + $user->setAttribute('targets', $existingTarget, Document::SET_TYPE_APPEND); } } diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 9d08fcf784..193f3f095e 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -139,7 +139,7 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e Query::equal('identifier', [$email]), ]); if($existingTarget) { - $user->setAttribute('targets', [...$user->getAttribute('targets', []), $existingTarget]); + $user->setAttribute('targets', $existingTarget, Document::SET_TYPE_APPEND); } } } @@ -163,7 +163,7 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e Query::equal('identifier', [$phone]), ]); if($existingTarget) { - $user->setAttribute('targets', [...$user->getAttribute('targets', []), $existingTarget]); + $user->setAttribute('targets', $existingTarget, Document::SET_TYPE_APPEND); } } } From 897ae1c859315aa56cf4528ebc5cce4ee569764d Mon Sep 17 00:00:00 2001 From: choir27 Date: Wed, 12 Jun 2024 10:47:48 -0400 Subject: [PATCH 18/19] docs: update text description in request table --- app/controllers/api/teams.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index d003fcfd37..5891fb67f0 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -387,7 +387,7 @@ App::post('/v1/teams/:teamId/memberships') ->param('userId', '', new UID(), 'ID of the user to be added to a team.', true) ->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) ->param('roles', [], new ArrayList(new Key(), APP_LIMIT_ARRAY_PARAMS_SIZE), '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](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 32 characters long.') - ->param('url', '', fn ($clients) => 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.', true, ['clients']) // TODO add our own built-in confirm page + ->param('url', '', fn ($clients) => new Host($clients), 'URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.', true, ['clients']) // TODO add our own built-in confirm page ->param('name', '', new Text(128), 'Name of the new team member. Max length: 128 chars.', true) ->inject('response') ->inject('project') From 84d9b4befe0c10218bb4d6e3205eae6f6d6dbb23 Mon Sep 17 00:00:00 2001 From: choir27 Date: Thu, 13 Jun 2024 09:59:20 -0400 Subject: [PATCH 19/19] docs: fix hyperlink in storage code snippet --- app/controllers/api/storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 9215d99345..1dd3bb597c 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -351,7 +351,7 @@ App::post('/v1/storage/buckets/:bucketId/files') ->label('sdk.response.model', Response::MODEL_FILE) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new CustomId(), 'File ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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.') - ->param('file', [], new File(), 'Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/storage#file-input).', skipValidation: true) + ->param('file', [], new File(), 'Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).', skipValidation: true) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) ->inject('request') ->inject('response')