mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
resorted docs
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# Adding a New OAuth 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).
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Agenda
|
||||
|
||||
OAuth providers help users to log in easily to apps and websites without the need to provide passwords or any other type of credentials. Appwrite goal is to have support from as many **major** OAuth providers as possible.
|
||||
|
||||
As of the writing of these lines, we do not accept any minor OAuth providers. For us to accept some smaller and potentially unlimited number of OAuth providers, some product design and software architecture changes must be applied first.
|
||||
|
||||
### List Your new Provider
|
||||
|
||||
The first step to follow in adding a new OAuth provider is to add it to the list in providers config file array, located at:
|
||||
|
||||
```
|
||||
./app/config/providers.php
|
||||
```
|
||||
|
||||
Make sure to fill all data needed and that your provider array key name is in camelCase format and has no spaces or special characters.
|
||||
|
||||
### Add Provider Logo
|
||||
|
||||
Add a logo image to your new provider in this path: `./public/images/oauth`. Your logo should be a png 100×100px file with the name of your provider (all lowercase). Please make sure to leave about 30px padding around the logo to be consistent with other logos.
|
||||
|
||||
### Add Provider Class
|
||||
|
||||
Once you have finished setting up all the metadata for the new provider, you need to start coding.
|
||||
|
||||
Create a new class that extends the basic OAuth provider abstract class in this location:
|
||||
|
||||
```bash
|
||||
./src/Auth/OAuth/ProviderName
|
||||
```
|
||||
|
||||
Note that the class name should start with a capital letter as PHP FIG standards suggest.
|
||||
|
||||
Once a new class is created, you can start to implement your new provider's login flow. The best way to do this right is to have a look at another provider's implementation and try to follow the same standards.
|
||||
|
||||
Please mention in your documentation what resources or API docs you used to implement the provider's OAuth protocol.
|
||||
|
||||
### Test Your Provider
|
||||
|
||||
After you finished adding your new provider to Appwrite you should be able to see it in your Appwrite console. Navigate to 'Project > Users > Providers' and check your new provider's settings form.
|
||||
|
||||
Add credentials and check both a successful and a failed login (where the user rejects integration on provider page).
|
||||
|
||||
If everything goes well, just send us the pull request and be ready to respond to any feedback which can arise during our code review.
|
||||
@@ -0,0 +1,119 @@
|
||||
# Environment Variables
|
||||
|
||||
Appwrite environment variables allow you to edit your server setup configuration and customize it. You can easily change the environment variables by changing them when running Appwrite using Docker CLI or Docker-Compose.
|
||||
|
||||
## General Options
|
||||
|
||||
### _APP_ENV
|
||||
|
||||
Set your server running environment. By default the var is set to 'development' when deploying to production, change to: 'production'.
|
||||
|
||||
### _APP_OPTIONS_ABUSE
|
||||
|
||||
Allows you to disabled abuse checks and API rate limiting. By default set to 'enabled'. To cancel the abuse checking set to 'disabled'. It is not recommended to disable this check-in production environment.
|
||||
|
||||
### _APP_OPENSSL_KEY_V1
|
||||
|
||||
This is your server private secret key that is used to encrypt all sensitive data on your server. Appwrite server is encrypting all secret data on your server like webhooks HTTP passwords, user sessions, and the storage files. The var is not set by default, if you wish to take advantage of Appwrite encryption capabilities you should change it and make sure to keep it a secret.
|
||||
|
||||
### _APP_CONSOLE_WHITELIST_EMAILS
|
||||
|
||||
This option is very useful for small teams or sole developers. To enable it, pass a list of allowed email addresses separated by a comma.
|
||||
|
||||
### _APP_CONSOLE_WHITELIST_DOMAINS
|
||||
|
||||
This option allows you to restrict access to Appwrite console for users sharing the same email domains. This option is very useful for team working with company emails domain.
|
||||
|
||||
To enable this option, pass a list of allowed email domains separated by a comma.
|
||||
|
||||
### _APP_CONSOLE_WHITELIST_IPS
|
||||
|
||||
This last option available allows you to restrict access to Appwrite console for users sharing the same set op IP addresses. This option is very useful for team working with a VPN service or a company IP.
|
||||
|
||||
To enable activate this option, pass a list of allowed IP addresses separated by a comma.
|
||||
|
||||
## Redis Server
|
||||
|
||||
Appwrite is using a Redis server for managing cache, queues and scheduled tasks. The Redis env vars are used to allow Appwrite server to connect to the Redis container.
|
||||
|
||||
### _APP_REDIS_HOST
|
||||
|
||||
Redis server hostname address. Default value is: 'redis'
|
||||
|
||||
### _APP_REDIS_PORT
|
||||
|
||||
Redis server TCP port. Default value is: '6379'
|
||||
|
||||
## MariaDB Server
|
||||
|
||||
Appwrite is using a MariaDB server for managing persistent database data. The MariaDB env vars are used to allow Appwrite server to connect to the MariaDB container.
|
||||
|
||||
### _APP_DB_HOST
|
||||
|
||||
MariaDB server host name address. Default value is: 'mariadb'
|
||||
|
||||
### _APP_DB_PORT
|
||||
|
||||
MariaDB server TCP port. Default value is: '3306'
|
||||
|
||||
### _APP_DB_USER
|
||||
|
||||
MariaDB server user name. Default value is: 'root'
|
||||
|
||||
### _APP_DB_PASS
|
||||
|
||||
MariaDB server user password. Default value is: 'password'
|
||||
|
||||
### _APP_DB_SCHEMA
|
||||
|
||||
MariaDB server database schema. Default value is: 'appwrite'
|
||||
|
||||
## InfluxDB
|
||||
|
||||
Appwrite is using an InfluxDB server for managing time-series data and server stats. The InfluxDB env vars are used to allow Appwrite server to connect to the InfluxDB container.
|
||||
|
||||
### _APP_INFLUXDB_HOST
|
||||
|
||||
InfluxDB server host name address. Default value is: 'influxdb'
|
||||
|
||||
### _APP_INFLUXDB_PORT
|
||||
|
||||
InfluxDB server TCP port. Default value is: '8086'
|
||||
|
||||
## StatsD
|
||||
|
||||
Appwrite is using a StatsD server for aggregating and sending stats data over a fast UDP connection. The StatsD env vars are used to allow Appwrite server to connect to the StatsD container.
|
||||
|
||||
### _APP_INFLUXDB_HOST
|
||||
|
||||
StatsD server host name address. Default value is: 'telegraf'
|
||||
|
||||
### _APP_INFLUXDB_PORT
|
||||
|
||||
StatsD server TCP port. Default value is: '8125'
|
||||
|
||||
## SMTP
|
||||
|
||||
Appwrite is using an SMTP server for emailing your projects users and server admins. The SMTP env vars are used to allow Appwrite server to connect to the SMTP container.
|
||||
|
||||
If running in production, it might be easier to use a 3rd party SMTP server as it might be a little more difficult to set up a production SMTP server that will not send all your emails into your user's SPAM folder.
|
||||
|
||||
### _APP_SMTP_HOST
|
||||
|
||||
SMTP server host name address. Default value is: 'smtp'
|
||||
|
||||
### _APP_SMTP_PORT
|
||||
|
||||
SMTP server TCP port. Default value is: '25'
|
||||
|
||||
### _APP_SMTP_SECURE
|
||||
|
||||
SMTP secure connection protocol. Empty by default, Change to 'tls' if running on a secure connection.
|
||||
|
||||
### _APP_SMTP_USERNAME
|
||||
|
||||
SMTP server user name. Empty by default.
|
||||
|
||||
### _APP_SMTP_PASSWORD
|
||||
|
||||
SMTP server user password. Empty by default.
|
||||
Reference in New Issue
Block a user