diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000000..63e0e64f94 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,44 @@ +--- +name: 🐛 Bug Report +about: Submit a bug report to help us improve +labels: "bug" +--- + +## 🐛 Bug Report + +(A clear and concise description of what the bug is) + +## Have you spent some time to check if this issue has been raised before? + +(Have you googled for a similar issue or checked our older issues for a similar bug) + +## To Reproduce + +(Write your steps here:) + +## Expected behavior + + + +(Write what you thought would happen.) + +## Actual Behavior + + + +(Write what happened. Add screenshots, if applicable.) + +## Your Environment + + + +(Write Environment, Operating system and version etc.) diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md new file mode 100644 index 0000000000..9aa7e59e19 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.md @@ -0,0 +1,17 @@ +--- +name: 📚 Documentation +about: Report an issue related to documentation +labels: "documentation" +--- + +## 📚 Documentation + +(A clear and concise description of what the issue is.) + +## Have you spent some time to check if this issue has been raised before? + +(Have you googled for a similar issue or checked our older issues for a similar bug) + +### Have you read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/master/CODE_OF_CONDUCT.md)? + +(Write your answer here.) diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md new file mode 100644 index 0000000000..35ad1b9d8f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -0,0 +1,21 @@ +--- +name: 🚀 Feature +about: Submit a proposal for a new feature +labels: "feature" +--- + +## 🚀 Feature + +(A clear and concise description of what the feature is.) + +## Have you spent some time to check if this issue has been raised before? + +(Have you googled for a similar issue or checked our older issues for a similar bug) + +### Have you read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/master/CODE_OF_CONDUCT.md)? + +(Write your answer here.) + +## Pitch + +(Please explain why this feature should be implemented and how it would be used. Add examples, if applicable.) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..faa18b5ab9 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,26 @@ + + +## What does this PR do? + +(Provide a description of what this PR does.) + +## Test Plan + +(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.) + +## Related PRs and Issues + +(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.) + +### Have you read the [Contributing Guidelines on issues](https://github.com/appwrite/appwrite/blob/master/CONTRIBUTING.md)? + +(Write your answer here.) diff --git a/CHANGES.md b/CHANGES.md index f5ffdc97fb..2dc3db25a3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,7 +10,7 @@ - Added option to join a user to any team from the console - Added support for Brotli compression (@PedroCisnerosSantana, @Rohitub222) - New UI micro-interactions and CSS fixes (@AnatoleLucet) -- UI performance & accessibility improvments (#406) +- UI performance & accessibility improvements (#406) - New Doctor CLI to debug the Appwrite server ([#415](https://github.com/appwrite/appwrite/issues/415)) - All emails are now sent asynchronously for improved performance (@TorstenDittmann) - Updated grid for OAuth2 providers list in the console @@ -28,11 +28,11 @@ - Fixed a UI bug preventing float values in numeric fields - Fixed scroll positioning when moving rules order up & down - Fixed missing validation for database documents key length (32 chars) -- Grammer fix for pt-br email templates (@rubensdemelo) +- Grammar fix for pt-br email templates (@rubensdemelo) - Fixed update form labels and tooltips for Flutter Android apps - Fixed missing custom scopes param for OAuth2 session create API route -- Fixed wrong JSON validation when creating and updating database documnets -- Fixed bug where max file size was limited to max of 10MB +- Fixed wrong JSON validation when creating and updating database documents +- Fixed bug where max file size was limited to a max of 10MB - Fixed bug preventing the deletion of the project logo - Fixed Bug when trying to overwrite OAuth cookie in the Flutter SDK - Fixed OAuth redirect when using the self-hosted instance default success URL ([#454](https://github.com/appwrite/appwrite/issues/454)) @@ -43,7 +43,7 @@ ## Breaking Changes - **Deprecated** `first` and `last` query params for documents list route in the database API -- **Deprecated** Deprectaed Pubjabi Translations ('pn') +- **Deprecated** Deprecated Punjabi Translations ('pn') ## Security @@ -142,7 +142,7 @@ - Allow non-web platform to skip origin header - Limited console dashboard to show max 5 alerts at the same time - Added more webhooks events -- Normailized all webhooks event names +- Normalized all webhooks event names - Added support for SameSite cookie option with fallback cookie for old clients - Added a new Discord OAuth adapter - Added a new Twitch OAuth adapter diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e2bb82a65..223312c88d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,6 +10,52 @@ If you are worried or don’t know where to start, check out our next section ex Help us keep Appwrite open and inclusive. Please read and follow our [Code of Conduct](/CODE_OF_CONDUCT.md). +## Submit a Pull Request 🚀 + +Branch naming convention is as following + +`TYPE-ISSUE_ID-DESCRIPTION` + +example: +``` +doc-548-submit-a-pull-request-section-to-contribution-guide +``` + +When `TYPE` can be: + +- **feat** - is a new feature +- **doc** - documentation only changes +- **cicd** - changes related to CI/CD system +- **fix** - a bug fix +- **refactor** - code change that neither fixes a bug nor adds a feature + +**All PRs must include a commit message with the changes description!** + +For the initial start, fork the project and use git clone command to download the repository to your computer. A standard procedure for working on an issue would be to: + +1. `git pull`, before creating a new branch, pull the changes from upstream. Your master needs to be up to date. +``` +$ git pull +``` +2. Create new branch from `master` like: `doc-548-submit-a-pull-request-section-to-contribution-guide`
+``` +$ git checkout -b [name_of_your_new_branch] +``` +3. Work - commit - repeat ( be sure to be in your branch ) + +4. Push changes to GitHub +``` +$ git push origin [name_of_your_new_branch] +``` + +5. Submit your changes for review +If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button. +6. Start a Pull Request +Now submit the pull request and click on `Create pull request`. +7. Get a code review approval/reject +8. After approval, merge your PR +9. GitHub will automatically delete the branch after the merge is done. (they can still be restored). + ## Setup From Source To set up a working **development environment**, just fork the project git repository and install the backend and frontend dependencies using the proper package manager and create run the docker-compose stack. @@ -32,6 +78,59 @@ After finishing the installation process, you can start writing and editing code Appwrite's current structure is a combination of both [Monolithic](https://en.wikipedia.org/wiki/Monolithic_application) and [Microservice](https://en.wikipedia.org/wiki/Microservices) architectures, but our final goal, as we grow, is to be using only microservices. +### File Structure + +```bash +. +├── app # Main application +│ ├── config # Config files +│ ├── controllers # API & dashboard controllers +│ │ ├── api +│ │ ├── shared +│ │ └── web +│ ├── db # DB schemas +│ ├── sdks # SDKs generated copies (used for generating code examples) +│ ├── tasks # Server CLI commands +│ ├── views # HTML server-side templates +│ └── workers # Background workers +├── bin # Server executables (tasks & workers) +├── docker # Docker related resources and configs +├── docs # Docs and tutorials +│ ├── examples +│ ├── references +│ ├── sdks +│ ├── services +│ ├── specs +│ └── tutorials +├── public # Public files +│ ├── dist +│ ├── fonts +│ ├── images +│ ├── scripts +│ └── styles +├── src # Supporting libraries (each lib has one role, common libs are released as individual projects) +│ └── Appwrite +│ ├── Auth +│ ├── Database +│ ├── Docker +│ ├── Event +│ ├── Extend +│ ├── Network +│ ├── OpenSSL +│ ├── Preloader +│ ├── Resize +│ ├── Storage +│ ├── Swoole +│ ├── Task +│ ├── Template +│ ├── URL +│ └── Utopia +└── tests # End to end & unit tests + ├── e2e + ├── resources + └── unit +``` + --- ![Appwrite](docs/specs/overview.drawio.svg) --- @@ -78,9 +177,9 @@ Appwrite uses [PHP's Composer](https://getcomposer.org/) for managing dependenci Appwrite is following the [PHP-FIG standards](https://www.php-fig.org/). Currently, we are using both PSR-0 and PSR-4 for coding standards and autoloading standards. Soon we will also review the project for support with PSR-12 (Extended Coding Style). -We use prettier for our JS coding standards and for auto-formatting our code. +We use prettier for our JS coding standards and auto-formatting our code. -## Scalability, Speed and Performance +## Scalability, Speed, and Performance Appwrite is built to scale. Please keep in mind that the Appwrite stack can run in different environments and different scales. @@ -117,7 +216,7 @@ For us to find the right balance, please open an issue explaining your ideas bef This will allow the Appwrite community to have sufficient discussion about the new feature value and how it fits in the product roadmap and vision. -This is also important for the Appwrite lead developers to be able to give technical input and different emphasize regarding the feature design and architecture. +This is also important for the Appwrite lead developers to be able to give technical input and different emphasis regarding the feature design and architecture. ## Build @@ -145,9 +244,9 @@ docker exec appwrite test ## Code Maintenance -We use some automation tools to help us keep a healthy code base. +We use some automation tools to help us keep a healthy codebase. -Improve PHP exeution time by using [fully-qualified function calls](https://veewee.github.io/blog/optimizing-php-performance-by-fq-function-calls/): +Improve PHP execution time by using [fully-qualified function calls](https://veewee.github.io/blog/optimizing-php-performance-by-fq-function-calls/): ```bash php-cs-fixer fix src/ --rules=native_function_invocation --allow-risky=yes @@ -178,7 +277,7 @@ Pull requests are great, but there are many other areas where you can help Appwr ### Blogging & Speaking -Blogging, speaking about, or creating tutorials about one of Appwrite’s many features. Mention [@appwrite_io](https://twitter.com/appwrite_io) on Twitter and/or email team [at] appwrite [dot] io so we can give pointers and tips and help you spread the word by promoting your content on the different Appwrite communication channels. Please add your blog posts and videos of talks to our [Awesome Appwrite]() repo on GitHub. +Blogging, speaking about, or creating tutorials about one of Appwrite’s many features. Mention [@appwrite_io](https://twitter.com/appwrite_io) on Twitter and/or email team [at] appwrite [dot] io so we can give pointers and tips and help you spread the word by promoting your content on the different Appwrite communication channels. Please add your blog posts and videos of talks to our [Awesome Appwrite](https://github.com/appwrite/awesome-appwrite) repo on GitHub. ### Presenting at Meetups @@ -198,5 +297,5 @@ Submitting documentation updates, enhancements, designs, or bug fixes. Spelling ### Helping Someone -Searching for Appwrite on Discord, GitHub or StackOverflow and helping someone else who needs help. You can also help by reaching others how to contribute to Appwrite's repo! +Searching for Appwrite on Discord, GitHub, or StackOverflow and helping someone else who needs help. You can also help by reaching others how to contribute to Appwrite's repo! diff --git a/README.md b/README.md index fc70207572..34ec39b410 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ [![Twitter Account](https://badgen.net/twitter/follow/appwrite_io?label=twitter)](https://twitter.com/appwrite_io) [![Follow Appwrite on StackShare](https://badgen.net/badge/follow%20on/stackshare/blue)](https://stackshare.io/appwrite) -Appwrite is an end-to-end backend server for Web, Mobile, Native, or Backend apps packaged as a set of Docker microservices. Appwrite abstract the complexity and repetitiveness required to build a modern backend API from scratch to allow you to build secure apps faster. +Appwrite is an end-to-end backend server for Web, Mobile, Native, or Backend apps packaged as a set of Docker microservices. Appwrite abstracts the complexity and repetitiveness required to build a modern backend API from scratch and allows you to build secure apps faster. Using Appwrite, you can easily integrate your app with user authentication & multiple sign-in methods, a database for storing and querying users and team data, storage and file management, image manipulation, schedule CRON tasks, and [more services](https://appwrite.io/docs). -[https://appwrite.io](https://appwrite.io) +Find out more at: [https://appwrite.io](https://appwrite.io) ![Appwrite](public/images/github.png) @@ -29,6 +29,7 @@ Table of Contents: - [Windows](#windows) - [CMD](#cmd) - [PowerShell](#powershell) + - [Upgrade from an Older Version](#upgrade-from-an-older-version) - [Getting Started](#getting-started) - [Services](#services) - [SDKs](#sdks) @@ -41,7 +42,7 @@ Table of Contents: ## Installation -Appwrite backend server is designed to run in a container environment. Running your server is as easy as running one command from your terminal. You can either run Appwrite on your localhost using docker-compose or on any other container orchestration tool like Kubernetes, Docker Swarm or Rancher. +Appwrite backend server is designed to run in a container environment. Running your server is as easy as running one command from your terminal. You can either run Appwrite on your localhost using docker-compose or on any other container orchestration tool like Kubernetes, Docker Swarm, or Rancher. The easiest way to start running your Appwrite server is by running our docker-compose file. Before running the installation command make sure you have [Docker](https://www.docker.com/products/docker-desktop) installed on your machine: @@ -82,15 +83,19 @@ Once the Docker installation completes, go to http://localhost to access the App For advanced production and custom installation, check out our Docker [environment variables](docs/tutorials/environment-variables.md) docs. You can also use our public [docker-compose.yml](https://appwrite.io/docker-compose.yml) file to manually set up and environment. +### Upgrade from an Older Version + +If you are upgrading your Appwrite server from an older version, you should use the Appwrite migration tool once your setup is completed. For more information regarding this, check out the [Installation Docs](https://appwrite.io/docs/installation). + ## Getting Started -Getting started with Appwrite is as easy as creating a new project, choosing your platform and integrating its SDK in your code. You can easily get started with your platform of choice by reading one of our Getting Started tutorials. +Getting started with Appwrite is as easy as creating a new project, choosing your platform, and integrating its SDK in your code. You can easily get started with your platform of choice by reading one of our Getting Started tutorials. * [Getting Started for Web](https://appwrite.io/docs/getting-started-for-web) * [Getting Started for Flutter](https://appwrite.io/docs/getting-started-for-flutter) * [Getting Started for Server](https://appwrite.io/docs/getting-started-for-server) -* Getting Started for Android (soon...) -* Getting Started for iOS (soon...) +* Getting Started for Android (Coming soon...) +* Getting Started for iOS (Coming soon...) ### Services @@ -131,7 +136,7 @@ We truly ❤️ pull requests! If you wish to help, you can learn more about how ## Security -For security issues, kindly email us [security@appwrite.io](mailto:security@appwrite.io) instead of posting a public issue in GitHub. +For security issues, kindly email us at [security@appwrite.io](mailto:security@appwrite.io) instead of posting a public issue in GitHub. ## Follow Us diff --git a/SECURITY.md b/SECURITY.md index a09be23628..e8bdef2da9 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -11,4 +11,4 @@ ## Reporting a Vulnerability -For security issues, kindly email us security@appwrite.io instead of posting a public issue in GitHub. +For security issues, kindly email us at security@appwrite.io instead of posting a public issue in GitHub. diff --git a/app/config/avatars/credit-cards.php b/app/config/avatars/credit-cards.php index 63c159ae58..daa53a9056 100644 --- a/app/config/avatars/credit-cards.php +++ b/app/config/avatars/credit-cards.php @@ -15,4 +15,6 @@ return [ 'targeta-shopping' => __DIR__.'/credit-cards/tarjeta-shopping.png', 'union-china-pay' => __DIR__.'/credit-cards/union-china-pay.png', 'visa' => __DIR__.'/credit-cards/visa.png', + 'mir' => __DIR__.'/credit-cards/mir.png', + 'maestro' => __DIR__.'/credit-cards/maestro.png', ]; diff --git a/app/config/avatars/credit-cards/maestro.png b/app/config/avatars/credit-cards/maestro.png new file mode 100644 index 0000000000..bc89ed81de Binary files /dev/null and b/app/config/avatars/credit-cards/maestro.png differ diff --git a/app/config/avatars/credit-cards/mir.png b/app/config/avatars/credit-cards/mir.png new file mode 100644 index 0000000000..19b6818332 Binary files /dev/null and b/app/config/avatars/credit-cards/mir.png differ diff --git a/app/config/locales/af.countries.php b/app/config/locales/af.countries.php index b3c4838f36..f5f7f47ac5 100644 --- a/app/config/locales/af.countries.php +++ b/app/config/locales/af.countries.php @@ -44,7 +44,7 @@ return [ 'CR' => 'Costa Rica', 'CU' => 'Kuba', 'CY' => 'Ciprus', - 'CZ' => 'Tsjeggiese Republiek', + 'CZ' => 'Tsjeggië', 'DE' => 'Duitsland', 'DJ' => 'Djiboeti', 'DM' => 'Dominica', @@ -195,4 +195,4 @@ return [ 'ZA' => 'Suid-Afrika', 'ZM' => 'Zambia', 'ZW' => 'Zimbabwe', -]; \ No newline at end of file +]; diff --git a/app/config/locales/es.countries.php b/app/config/locales/es.countries.php index 4479c27806..57f9c3c313 100644 --- a/app/config/locales/es.countries.php +++ b/app/config/locales/es.countries.php @@ -44,7 +44,7 @@ return [ 'CR' => 'Costa Rica', 'CU' => 'Cuba', 'CY' => 'Chipre', - 'CZ' => 'República Checa', + 'CZ' => 'Chequia', 'DE' => 'Alemania', 'DJ' => 'Yibuti', 'DM' => 'Dominica', diff --git a/app/config/locales/fo.countries.php b/app/config/locales/fo.countries.php index bc6aa77e8a..337d06b667 100644 --- a/app/config/locales/fo.countries.php +++ b/app/config/locales/fo.countries.php @@ -44,7 +44,7 @@ return [ 'CR' => 'Kosta Rika', 'CU' => 'Kuba', 'CY' => 'Kýpros', - 'CZ' => 'Kekkoslovakia', + 'CZ' => 'Kekkia', 'DE' => 'Týskland', 'DJ' => 'Djibouti', 'DM' => 'Dominika', diff --git a/app/config/locales/fr.countries.php b/app/config/locales/fr.countries.php index 28bff2bdde..02324e0634 100644 --- a/app/config/locales/fr.countries.php +++ b/app/config/locales/fr.countries.php @@ -44,7 +44,7 @@ return [ 'CR' => 'Costa Rica', 'CU' => 'Cuba', 'CY' => 'Chypre', - 'CZ' => 'République Tchèque', + 'CZ' => 'Tchéquie', 'DE' => 'Allemagne', 'DJ' => 'Djibouti', 'DM' => 'Dominique', diff --git a/app/config/locales/hi.countries.php b/app/config/locales/hi.countries.php index f9f40230a0..cb6cec9229 100644 --- a/app/config/locales/hi.countries.php +++ b/app/config/locales/hi.countries.php @@ -13,7 +13,6 @@ return [ 'AU' => 'ऑस्ट्रेलिया', 'AT' => 'ऑस्ट्रिया', 'AZ' => 'अजरबैजान', - 'BI' => 'बुरुंडी', 'BE' => 'बेल्जियम', 'BJ' => 'बेनिन', diff --git a/app/config/locales/it.countries.php b/app/config/locales/it.countries.php index ce4e56349d..45851f6fcc 100644 --- a/app/config/locales/it.countries.php +++ b/app/config/locales/it.countries.php @@ -44,7 +44,7 @@ return [ 'CR' => 'Costa Rica', 'CU' => 'Cuba', 'CY' => 'Cipro', - 'CZ' => 'Repubblica Ceca', + 'CZ' => 'Cechia', 'DE' => 'Germania', 'DJ' => 'Gibuti', 'DM' => 'Dominica', diff --git a/app/config/locales/sq.countries.php b/app/config/locales/sq.countries.php index e1744bf889..a8ef59ec06 100644 --- a/app/config/locales/sq.countries.php +++ b/app/config/locales/sq.countries.php @@ -44,7 +44,7 @@ return [ 'CR' => 'Kosta Rika', 'CU' => 'Kuba', 'CY' => 'Qipro', - 'CZ' => 'Republika Czecheke', + 'CZ' => 'Çekia', 'DE' => 'Gjermani', 'DJ' => 'Djibouti', 'DM' => 'Dominica', @@ -195,4 +195,4 @@ return [ 'ZA' => 'Afrika e Jugut', 'ZM' => 'Zambia', 'ZW' => 'Zimbabve', -]; \ No newline at end of file +]; diff --git a/app/config/locales/tr.countries.php b/app/config/locales/tr.countries.php index 5fd899e911..bb87d8e480 100644 --- a/app/config/locales/tr.countries.php +++ b/app/config/locales/tr.countries.php @@ -44,7 +44,7 @@ return [ 'CR' => 'Kosta Rika', 'CU' => 'Küba', 'CY' => 'Güney Kıbrıs Rum Kesimi', - 'CZ' => 'Çek Cumhuriyeti', + 'CZ' => 'Çekya', 'DE' => 'Almanya', 'DJ' => 'Cibuti', 'DM' => 'Dominika', diff --git a/app/config/providers.php b/app/config/providers.php index 65e2127b3e..a377cae6f0 100644 --- a/app/config/providers.php +++ b/app/config/providers.php @@ -224,5 +224,14 @@ return [ // Ordered by ABC. 'form' => false, 'beta' => false, 'mock' => true, + ], + 'wordpress' => [ + 'name' => 'WordPress', + 'developers' => 'https://developer.wordpress.com/docs/oauth2/', + 'icon' => 'icon-wordpress', + 'enabled' => true, + 'form' => false, + 'beta' => false, + 'mock' => false ] ]; diff --git a/app/init.php b/app/init.php index 327bfbab67..7c4c03fa1e 100644 --- a/app/init.php +++ b/app/init.php @@ -3,7 +3,7 @@ /** * Init * - * Inializes both Appwrite API entry point, queue workers, and CLI tasks. + * Initializes both Appwrite API entry point, queue workers, and CLI tasks. * Set configuration, framework resources, app constants * */ diff --git a/app/views/console/account/index.phtml b/app/views/console/account/index.phtml index da40715f19..b90e2b4e11 100644 --- a/app/views/console/account/index.phtml +++ b/app/views/console/account/index.phtml @@ -236,16 +236,16 @@ - + - on + Unknown on Unknown   Current Session
- + /
@@ -294,11 +294,11 @@ - + - + diff --git a/app/views/console/users/user.phtml b/app/views/console/users/user.phtml index 7288d2f6a4..3788a9e3aa 100644 --- a/app/views/console/users/user.phtml +++ b/app/views/console/users/user.phtml @@ -179,12 +179,12 @@ - + - on + Unknown on Unknown
- + /
@@ -239,11 +239,11 @@ - + - + diff --git a/app/views/home/auth/recovery/reset.phtml b/app/views/home/auth/recovery/reset.phtml index 581447ec10..87f10a5360 100644 --- a/app/views/home/auth/recovery/reset.phtml +++ b/app/views/home/auth/recovery/reset.phtml @@ -28,9 +28,9 @@ - + - \ No newline at end of file + diff --git a/docs/references/account/create-verification.md b/docs/references/account/create-verification.md index 54e0bf77be..3e6abf6a77 100644 --- a/docs/references/account/create-verification.md +++ b/docs/references/account/create-verification.md @@ -1,3 +1,3 @@ -Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/client/account#updateAccountVerification). +Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/client/account#updateVerification). Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. diff --git a/docs/tutorials/add-oauth2-provider.md b/docs/tutorials/add-oauth2-provider.md index b7c71b742b..5e1c07dabc 100644 --- a/docs/tutorials/add-oauth2-provider.md +++ b/docs/tutorials/add-oauth2-provider.md @@ -1,6 +1,6 @@ # Adding a New OAuth2 Provider -This document is part of the Appwrite contributors' guide. Before you continue reading this document make sure you have read the [Code of Conduct](../CODE_OF_CONDUCT.md) and the [Contributing Guide](../CONTRIBUTING.md). +This document is part of the Appwrite contributors' guide. Before you continue reading this document make sure you have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/master/CODE_OF_CONDUCT.md) and the [Contributing Guide](https://github.com/appwrite/appwrite/blob/master/CONTRIBUTING.md). ## Getting Started diff --git a/docs/tutorials/environment-variables.md b/docs/tutorials/environment-variables.md index 9bf761563f..1987171324 100644 --- a/docs/tutorials/environment-variables.md +++ b/docs/tutorials/environment-variables.md @@ -22,7 +22,7 @@ This is your server private secret key that is used to encrypt all sensitive dat ### _APP_STORAGE_LIMIT -Maximun file size allowed for file upload. The deafult value is 100MB limitation. You should pass your size limit value in bytes. +Maximum file size allowed for file upload. The default value is 100MB limitation. You should pass your size limit value in bytes. ### _APP_STORAGE_ANTIVIRUS diff --git a/docs/tutorials/my-first-issue.md b/docs/tutorials/my-first-issue.md new file mode 100644 index 0000000000..26556b6e57 --- /dev/null +++ b/docs/tutorials/my-first-issue.md @@ -0,0 +1 @@ +### Thats Your Place To create Your First Issue \ No newline at end of file diff --git a/docs/tutorials/running-in-production.md b/docs/tutorials/running-in-production.md index 2cbe4feecf..612498c397 100644 --- a/docs/tutorials/running-in-production.md +++ b/docs/tutorials/running-in-production.md @@ -26,7 +26,7 @@ Appwrite was built with scalability in mind. Appwrite can potentially scale hori Appwrite uses a few containers to run, where each container has its job. Most of the Appwrite containers are stateless, and in order to scale them, all you need is run multiple instances of them and setup a load balancer in front of them. -If you decide to set up a load balancer for a specific container, make sure that the containers that are trying to communicate with him are accessing him trough a load balancer and not directly. All connections between Appwrite different containers are set using Docker environment variables. +If you decide to set up a load balancer for a specific container, make sure that the containers that are trying to communicate with it are accessing it through a load balancer and not directly. All connections between Appwrite different containers are set using Docker environment variables. There are three Appwrite containers that do keep their state are the MariaDB, Redis, and InfluxDB containers that are used for storing data, cache, and stats (in this order). To scale them out, all you need to do is set up a standard cluster (just like you would with any other app using these technologies) according to your needs and performance. @@ -34,7 +34,7 @@ There are three Appwrite containers that do keep their state are the MariaDB, Re Sending emails is hard. There are a lot of SPAM rules and configurations to master in order to set a functional SMTP server. The SMTP server that comes packaged with Appwrite is great for development but needs some work done to function well against SPAM filters. You can find some guidelines in this [tutorial]([https://www.digitalocean.com/community/tutorials/how-to-use-an-spf-record-to-prevent-spoofing-improve-e-mail-reliability](https://www.digitalocean.com/community/tutorials/how-to-use-an-spf-record-to-prevent-spoofing-improve-e-mail-reliability)). -Another **easier option** is to use an ‘SMTP as a service’ product like [Sendgrid]([https://sendgrid.com/](https://sendgrid.com/)) or [Mailgun]([https://www.mailgun.com/](https://www.mailgun.com/)). You can change Appwrite SMTP settings and credentials to any 3rrd party provider you like who support SMTP integration using our [Docker environment variables]([https://github.com/appwrite/appwrite/blob/master/docs/tutorials/environment-variables.md#smtp](https://github.com/appwrite/appwrite/blob/master/docs/tutorials/environment-variables.md#smtp)). Most services offer a decent free tier to get started with. +Another **easier option** is to use an ‘SMTP as a service’ product like [Sendgrid]([https://sendgrid.com/](https://sendgrid.com/)) or [Mailgun]([https://www.mailgun.com/](https://www.mailgun.com/)). You can change Appwrite SMTP settings and credentials to any 3rd party provider you like who support SMTP integration using our [Docker environment variables]([https://github.com/appwrite/appwrite/blob/master/docs/tutorials/environment-variables.md#smtp](https://github.com/appwrite/appwrite/blob/master/docs/tutorials/environment-variables.md#smtp)). Most services offer a decent free tier to get started with. ## Backups @@ -42,4 +42,4 @@ Backups are highly recommended for any production environment. Currently, there 1. Create a script to backups and restore your MariaDB Appwrite schema. Note that trying to backup MariaDB using a docker volume backup can result in a corrupted copy of your data. It is recommended to use MariaDB or MySQL built-in tools for this. 2. Create a script to backups and restore your InfluxDB stats. If you don’t care much about your server stats, you can skip this. -3. Create a script to backup Appwrite storage volume. There are many [online resources]([https://blog.ssdnodes.com/blog/docker-backup-volumes/](https://blog.ssdnodes.com/blog/docker-backup-volumes/)) explaining different ways to backup a docker volume. When running on multiple servers, it is very recommended to use an attachable storage point. Some cloud providers offer integrated backups to such attachable mount, some of them are GCP, AWS, DigitalOcean, and the list continues. +3. Create a script to backup Appwrite storage volume. There are many [online resources]([https://blog.ssdnodes.com/blog/docker-backup-volumes/](https://blog.ssdnodes.com/blog/docker-backup-volumes/)) explaining different ways to backup a docker volume. When running on multiple servers, it is very recommended to use an attachable storage point. Some cloud providers offer integrated backups to such attachable mount like GCP, AWS, DigitalOcean, and the list continues. diff --git a/public/images/oauth2/wordpress.png b/public/images/oauth2/wordpress.png new file mode 100644 index 0000000000..f1d664ada1 Binary files /dev/null and b/public/images/oauth2/wordpress.png differ diff --git a/public/images/unknown.svg b/public/images/unknown.svg new file mode 100644 index 0000000000..d0926cb301 --- /dev/null +++ b/public/images/unknown.svg @@ -0,0 +1,25 @@ + + + + + + + diff --git a/src/Appwrite/Auth/OAuth2/WordPress.php b/src/Appwrite/Auth/OAuth2/WordPress.php new file mode 100644 index 0000000000..a83953405e --- /dev/null +++ b/src/Appwrite/Auth/OAuth2/WordPress.php @@ -0,0 +1,136 @@ + $this->appID, + 'redirect_uri' => $this->callback, + 'response_type' => 'code', + 'scope' => $this->getScopes(), + 'state' => \json_encode($this->state) + ]); + } + + /** + * @param string $code + * + * @return string + */ + public function getAccessToken(string $code):string + { + $accessToken = $this->request( + 'POST', + 'https://public-api.wordpress.com/oauth2/token', + [], + \http_build_query([ + 'client_id' => $this->appID, + 'redirect_uri' => $this->callback, + 'client_secret' => $this->appSecret, + 'grant_type' => 'authorization_code', + 'code' => $code + ]) + ); + + $accessToken = \json_decode($accessToken, true); + + if (isset($accessToken['access_token'])) { + return $accessToken['access_token']; + } + + return ''; + } + + /** + * @param $accessToken + * + * @return string + */ + public function getUserID(string $accessToken):string + { + $user = $this->getUser($accessToken); + + if (isset($user['ID'])) { + return $user['ID']; + } + + return ''; + } + + /** + * @param $accessToken + * + * @return string + */ + public function getUserEmail(string $accessToken):string + { + $user = $this->getUser($accessToken); + + if (isset($user['email']) && $user['verified']) { + return $user['email']; + } + + return ''; + } + + /** + * @param $accessToken + * + * @return string + */ + public function getUserName(string $accessToken):string + { + $user = $this->getUser($accessToken); + + if (isset($user['username'])) { + return $user['username']; + } + + return ''; + } + + /** + * @param string $accessToken + * + * @return array + */ + protected function getUser(string $accessToken) + { + if (empty($this->user)) { + $this->user = \json_decode($this->request('GET', 'https://public-api.wordpress.com/rest/v1/me', ['Authorization: Bearer '.$accessToken]), true); + } + + return $this->user; + } +}