diff --git a/.gitpod.yml b/.gitpod.yml index dfc306c59..5f8eac91e 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -3,6 +3,7 @@ tasks: init: | docker compose pull docker compose build + docker pull composer command: | docker run --rm --interactive --tty \ --volume $PWD:/app \ diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 40be033f8..4cec00005 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -615,6 +615,11 @@ services: container_name: appwrite-redis <<: *x-logging restart: unless-stopped + command: > + redis-server + --maxmemory 512mb + --maxmemory-policy allkeys-lru + --maxmemory-samples 5 networks: - appwrite volumes: diff --git a/docker-compose.yml b/docker-compose.yml index 45721df6c..64f27cf8f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -671,6 +671,11 @@ services: image: redis:6.2-alpine <<: *x-logging container_name: appwrite-redis + command: > + redis-server + --maxmemory 512mb + --maxmemory-policy allkeys-lru + --maxmemory-samples 5 ports: - "6379:6379" networks: diff --git a/docs/tutorials/add-oauth2-provider.md b/docs/tutorials/add-oauth2-provider.md index ef343f7ac..e1f605fcf 100644 --- a/docs/tutorials/add-oauth2-provider.md +++ b/docs/tutorials/add-oauth2-provider.md @@ -76,126 +76,84 @@ use Appwrite\Auth\OAuth2; class [PROVIDER NAME] extends OAuth2 { - /** - * @var string - */ - private $endpoint = '[ENDPOINT API URL]'; - - /** - * @var array - */ - protected $scopes = [ + private string $endpoint = '[ENDPOINT API URL]'; + protected array $user = []; + protected array $tokens = []; + protected array $scopes = [ // [ARRAY_OF_REQUIRED_SCOPES] ]; - - /** - * @var array - */ - protected $user = []; - - /** - * @var array - */ - protected $tokens = []; - - /** - * @return string - */ + public function getName(): string { return '[PROVIDER NAME]'; } - /** - * @return string - */ public function getLoginURL(): string { $url = $this->endpoint . '[LOGIN_URL_STUFF]'; return $url; } - /** - * @param string $code - * - * @return array - */ protected function getTokens(string $code): array { - if(empty($this->tokens)) { + if (empty($this->tokens)) { // TODO: Fire request to oauth API to generate access_token // Make sure to use '$this->getScopes()' to include all scopes properly - $this->tokens = "[FETCH TOKEN RESPONSE]"; + $this->tokens = ["[FETCH TOKEN RESPONSE]"]; } return $this->tokens; } - - - /** - * @param string $refreshToken - * - * @return array - */ - public function refreshTokens(string $refreshToken):array + + public function refreshTokens(string $refreshToken): array { // TODO: Fire request to oauth API to generate access_token using refresh token - $this->tokens = "[FETCH TOKEN RESPONSE]"; + $this->tokens = ["[FETCH TOKEN RESPONSE]"]; return $this->tokens; } - /** - * @param string $accessToken - * - * @return string - */ public function getUserID(string $accessToken): string { $user = $this->getUser($accessToken); - - // TODO: Pick user ID from $user response + + // TODO: Pick user ID from $user response $userId = "[USER ID]"; - + return $userId; } - /** - * @param string $accessToken - * - * @return string - */ public function getUserEmail(string $accessToken): string { $user = $this->getUser($accessToken); - - // TODO: Pick user email from $user response + + // TODO: Pick user email from $user response $userEmail = "[USER EMAIL]"; - + return $userEmail; } - /** - * @param string $accessToken - * - * @return string - */ + public function isEmailVerified(string $accessToken): bool + { + $user = $this->getUser($accessToken); + + // TODO: Pick user verification status from $user response + $isVerified = "[USER VERIFICATION STATUS]"; + + return $isVerified; + } + public function getUserName(string $accessToken): string { $user = $this->getUser($accessToken); - - // TODO: Pick username from $user response + + // TODO: Pick username from $user response $username = "[USERNAME]"; - + return $username; } - - /** - * @param string $accessToken - * - * @return array - */ - protected function getUser(string $accessToken) + + protected function getUser(string $accessToken): array { if (empty($this->user)) { // TODO: Fire request to oauth API to get information about users @@ -205,6 +163,7 @@ class [PROVIDER NAME] extends OAuth2 return $this->user; } } + ``` > If you copy this template, make sure to replace all placeholders wrapped like `[THIS]` and to implement everything marked as `TODO:`. @@ -233,7 +192,7 @@ First of all, commit the changes with the message `Added XXX OAuth2 Provider` an ## 🤕 Stuck ? -If you need any help with the contribution, feel free to head over to [our discord channel](https://appwrite.io/discord) and we'll be happy to help you out. +If you need any help with the contribution, feel free to head over to [our Discord channel](https://appwrite.io/discord) and we'll be happy to help you out. ## 😉 Need more freedom diff --git a/docs/tutorials/add-runtime.md b/docs/tutorials/add-runtime.md index 841daae9a..ea8eb4dd8 100644 --- a/docs/tutorials/add-runtime.md +++ b/docs/tutorials/add-runtime.md @@ -254,4 +254,4 @@ First of all, commit the changes with the message `Added XXX Runtime` and push i ## ![face_with_head_bandage](https://github.githubassets.com/images/icons/emoji/unicode/1f915.png) Stuck ? -If you need any help with the contribution, feel free to head over to [our discord channel](https://appwrite.io/discord) and we'll be happy to help you out. +If you need any help with the contribution, feel free to head over to [our Discord channel](https://appwrite.io/discord) and we'll be happy to help you out. diff --git a/docs/tutorials/add-translations.md b/docs/tutorials/add-translations.md index b42eb607b..a1d34cba2 100644 --- a/docs/tutorials/add-translations.md +++ b/docs/tutorials/add-translations.md @@ -179,4 +179,4 @@ If you can see countries names translated, everything works, and you are ready f First of all, commit the changes with the message `Added YYY translations` where `YYY` is the translated language and push it. This will publish a new branch to your forked version of Appwrite. If you visit it at `github.com/YOUR_USERNAME/appwrite`, you will see a new alert saying you are ready to submit a pull request. Follow the steps GitHub provides, and at the end, you will have your pull request submitted. ## 🤕 Stuck ? -If you need any help with the contribution, feel free to head over to [our discord channel](https://appwrite.io/discord) and we'll be happy to help you out. +If you need any help with the contribution, feel free to head over to [our Discord channel](https://appwrite.io/discord) and we'll be happy to help you out.