Doc add environment variable - #867
Conversation
| This tutorial will cover, how to properly add new environment variable in Appwrite. | ||
|
|
||
| ### Naming environment varialbe | ||
| The environment variables in Appwrite is prefixed with `_APP_`. Then if it belongs to specific cateogry, the category name is appended as `_APP_REDIS` for redis category. Finally the properly describing name is given to the variable as `_APP_REDIS_HOST` for redis host. |
There was a problem hiding this comment.
Mention list of categories is available at https://appwrite.io/docs/environment-variables
| First of all we add the new environment variable to `app/config/variables.php` under specific category. If none of the categories fit, add it in general category. Copy the existing variables description to create new one so that you will not miss any required fields. | ||
|
|
||
| ### Add to .env and Dockerfile | ||
| If newly introduced environment variable has a default value, add it to the `.env` and `Dockerfile` along with other environment variables. |
There was a problem hiding this comment.
Add a note that we use the .env file as setting for the Appwrite development environment.
|
|
||
| If everything goes well, commit and initiate a PR and wait for the Appwrite team's approval. | ||
|
|
||
| Whooho! you have successfully added new environment variable to Appwrite. No newline at end of file |
There was a problem hiding this comment.
This requires a celebration emoji!! 😉
There was a problem hiding this comment.
The more emojis the better hehe
There was a problem hiding this comment.
Hehe I mean inside the tutorial, make it happier add emojis 😃
| ### Agenda | ||
| Adding new features may require various configurations options to be set by the users. And for such options we use environment variables in Appwrite. | ||
|
|
||
| This tutorial will cover, how to properly add new environment variable in Appwrite. |
There was a problem hiding this comment.
a new environment *
| This tutorial will cover, how to properly add new environment variable in Appwrite. | ||
|
|
||
| ### Naming environment varialbe | ||
| The environment variables in Appwrite is prefixed with `_APP_`. Then if it belongs to specific cateogry, the category name is appended as `_APP_REDIS` for redis category. The available categories are General, Redis, MariaDB, InfluxDB, StatsD, SMTP, Storage and Functions. Finally the properly describing name is given to the variable as `_APP_REDIS_HOST` for redis host. You can find more information on available categories and existing environment variables at [environment variables doc](https://appwrite.io/docs/environment-variables). |
There was a problem hiding this comment.
in Appwrite are *
Then if it belongs <- remove the Then
to a specific cateogry *
for the Redis category *
| The environment variables in Appwrite is prefixed with `_APP_`. Then if it belongs to specific cateogry, the category name is appended as `_APP_REDIS` for redis category. The available categories are General, Redis, MariaDB, InfluxDB, StatsD, SMTP, Storage and Functions. Finally the properly describing name is given to the variable as `_APP_REDIS_HOST` for redis host. You can find more information on available categories and existing environment variables at [environment variables doc](https://appwrite.io/docs/environment-variables). | ||
|
|
||
| ### Describe new environment variable | ||
| First of all we add the new environment variable to `app/config/variables.php` under specific category. If none of the categories fit, add it in general category. Copy the existing variables description to create new one so that you will not miss any required fields. |
There was a problem hiding this comment.
First of all, we *
in the designated category. *
add it to the General category *
Copy the existing variables description to create a new one, so that you will not miss any required fields. *
|
|
||
| The `docker-compose.yml` file is used by the Appwrite maintainers during development where as `app/views/install/compose.phtml` file is used by the Appwrite setup script. | ||
|
|
||
| With these steps, your environment variable is properly added and can be accessed inside Appwrite code or any other containers where it is passed. You can access and use those variables to implement the features you are trying to implement. |
There was a problem hiding this comment.
accessed inside Appwrite code and any other containers *
You can access and use those variables to implement the features you are trying to achieve. *
|
|
||
| With these steps, your environment variable is properly added and can be accessed inside Appwrite code or any other containers where it is passed. You can access and use those variables to implement the features you are trying to implement. | ||
|
|
||
| If everything goes well, commit and initiate a PR and wait for the Appwrite team's approval. |
There was a problem hiding this comment.
If everything went well *
|
@eldadfux I believe this is ready too! |
Co-authored-by: Christy Jacob <[email protected]>
Co-authored-by: Christy Jacob <[email protected]>
What does this PR do?
New doc for adding Environment variables
Test Plan
N/A
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?
YES