1
0
Fork 0
mirror of synced 2024-07-01 04:30:59 +12:00

Merge pull request #805 from appwrite/feat-update-env-var-docs

Feat update env var docs
This commit is contained in:
Eldad A. Fux 2021-01-07 22:58:20 +02:00 committed by GitHub
commit a0582c2039
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 346 additions and 320 deletions

View file

@ -2,195 +2,347 @@
return [
[
'name' => '_APP_ENV',
'default' => 'production',
'required' => false,
'question' => '',
'category' => 'General',
'description' => '',
'variables' => [
[
'name' => '_APP_ENV',
'description' => 'Set your server running environment. By default, the var is set to \'development\'. When deploying to production, change it to: \'production\'.',
'introduction' => '',
'default' => 'production',
'required' => false,
'question' => '',
],
[
'name' => '_APP_OPTIONS_ABUSE',
'description' => 'Allows you to disable 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 a production environment.',
'introduction' => '',
'default' => 'enabled',
'required' => false,
'question' => '',
],
[
'name' => '_APP_OPTIONS_FORCE_HTTPS',
'description' => 'Allows you to force HTTPS connection to your API. This feature redirects any HTTP call to HTTPS and adds the \'Strict-Transport-Security\' header to all HTTP responses. By default, set to \'disabled\'. To enable, set to \'enabled\'. This feature will work only when your ports are set to default 80 and 443.',
'introduction' => '',
'default' => 'enabled',
'required' => false,
'question' => '',
],
[
'name' => '_APP_OPENSSL_KEY_V1',
'description' => 'This is your server private secret key that is used to encrypt all sensitive data on your server. Appwrite server encrypts all secret data on your server like webhooks, HTTP passwords, user sessions, and 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 and have a backup for it**.',
'introduction' => '',
'default' => 'your-secret-key',
'required' => true,
'question' => 'Choose a secret API key, make sure to make a backup of your key in a secure location',
],
[
'name' => '_APP_DOMAIN',
'description' => 'Your Appwrite domain address. When setting a public suffix domain, Appwrite will attempt to issue a valid SSL certificate automatically. When used with a dev domain, Appwrite will assign a self-signed SSL certificate. The default value is \'localhost\'.',
'introduction' => '',
'default' => 'localhost',
'required' => true,
'question' => 'Enter your Appwrite hostname',
],
[
'name' => '_APP_DOMAIN_TARGET',
'description' => 'A DNS A record hostname to serve as a CNAME target for your Appwrite custom domains. You can use the same value as used for the Appwrite \'_APP_DOMAIN\' variable. The default value is \'localhost\'.',
'introduction' => '',
'default' => 'localhost',
'required' => true,
'question' => "Enter a DNS A record hostname to serve as a CNAME for your custom domains.\nYou can use the same value as used for the Appwrite hostname.",
],
[
'name' => '_APP_CONSOLE_WHITELIST_EMAILS',
'description' => 'This option allows you to limit creation of users to Appwrite console. 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.',
'introduction' => '',
'default' => '',
'required' => false,
'question' => '',
],
[
'name' => '_APP_CONSOLE_WHITELIST_DOMAINS',
'description' => "This option allows you to limit creation of users to Appwrite console for users sharing the same email domains. This option is very useful for team working with company emails domain.\n\nTo enable this option, pass a list of allowed email domains separated by a comma.",
'introduction' => '',
'default' => '',
'required' => false,
'question' => '',
],
[
'name' => '_APP_CONSOLE_WHITELIST_IPS',
'description' => "This last option allows you to limit creation of users in Appwrite console for users sharing the same set of IP addresses. This option is very useful for team working with a VPN service or a company IP.\n\nTo enable/activate this option, pass a list of allowed IP addresses separated by a comma.",
'introduction' => '',
'default' => '',
'required' => false,
'question' => '',
],
[
'name' => '_APP_SYSTEM_EMAIL_NAME',
'description' => 'This is the sender name value that will appear on email messages sent to developers from the Appwrite console. The default value is: \'Appwrite\'. You can use url encoded strings for spaces and special chars.',
'introduction' => '0.7.0',
'default' => 'Appwrite',
'required' => false,
'question' => '',
],
[
'name' => '_APP_SYSTEM_EMAIL_ADDRESS',
'description' => 'This is the sender email address that will appear on email messages sent to developers from the Appwrite console. The default value is \'team@appwrite.io\'. You should choose an email address that is allowed to be used from your SMTP server to avoid the server email ending in the users\' SPAM folders.',
'introduction' => '0.7.0',
'default' => 'team@appwrite.io',
'required' => false,
'question' => '',
],
],
],
[
'name' => '_APP_OPTIONS_ABUSE',
'default' => 'enabled',
'required' => false,
'question' => '',
'category' => 'Redis',
'description' => '',
'variables' => [
[
'name' => '_APP_REDIS_HOST',
'description' => 'Redis server hostname address. Default value is: \'redis\'.',
'introduction' => '',
'default' => 'redis',
'required' => false,
'question' => '',
],
[
'name' => '_APP_REDIS_PORT',
'description' => 'Redis server TCP port. Default value is: \'6379\'.',
'introduction' => '',
'default' => '6379',
'required' => false,
'question' => '',
],
],
],
[
'name' => '_APP_OPTIONS_FORCE_HTTPS',
'default' => 'enabled',
'required' => false,
'question' => '',
'category' => 'MariaDB',
'description' => '',
'variables' => [
[
'name' => '_APP_DB_HOST',
'description' => 'MariaDB server host name address. Default value is: \'mariadb\'.',
'introduction' => '',
'default' => 'mariadb',
'required' => false,
'question' => '',
],
[
'name' => '_APP_DB_PORT',
'description' => 'MariaDB server TCP port. Default value is: \'3306\'.',
'introduction' => '',
'default' => '3306',
'required' => false,
'question' => '',
],
[
'name' => '_APP_DB_SCHEMA',
'description' => 'MariaDB server database schema. Default value is: \'appwrite\'.',
'introduction' => '',
'default' => 'appwrite',
'required' => false,
'question' => '',
],
[
'name' => '_APP_DB_USER',
'description' => 'MariaDB server user name. Default value is: \'root\'.',
'introduction' => '',
'default' => 'user',
'required' => false,
'question' => '',
],
[
'name' => '_APP_DB_PASS',
'description' => 'MariaDB server user password. Default value is: \'password\'.',
'introduction' => '',
'default' => 'password',
'required' => false,
'question' => '',
],
],
],
[
'name' => '_APP_OPENSSL_KEY_V1',
'default' => 'your-secret-key',
'required' => true,
'question' => 'Choose a secret API key, make sure to make a backup of your key in a secure location',
'category' => 'InfluxDB',
'description' => '',
'variables' => [
[
'name' => '_APP_INFLUXDB_HOST',
'description' => 'InfluxDB server host name address. Default value is: \'influxdb\'.',
'introduction' => '',
'default' => 'influxdb',
'required' => false,
'question' => '',
],
[
'name' => '_APP_INFLUXDB_PORT',
'description' => 'InfluxDB server TCP port. Default value is: \'8086\'.',
'introduction' => '',
'default' => '8086',
'required' => false,
'question' => '',
],
],
],
[
'name' => '_APP_DOMAIN',
'default' => 'localhost',
'required' => true,
'question' => 'Enter your Appwrite hostname',
'category' => 'StatsD',
'description' => '',
'variables' => [
[
'name' => '_APP_STATSD_HOST',
'description' => 'StatsD server host name address. Default value is: \'telegraf\'.',
'introduction' => '',
'default' => 'telegraf',
'required' => false,
'question' => '',
],
[
'name' => '_APP_STATSD_PORT',
'description' => 'StatsD server TCP port. Default value is: \'8125\'.',
'introduction' => '',
'default' => '8125',
'required' => false,
'question' => '',
],
],
],
[
'name' => '_APP_DOMAIN_TARGET',
'default' => 'localhost',
'required' => true,
'question' => "Enter a DNS A record hostname to serve as a CNAME for your custom domains.\nYou can use the same value as used for the Appwrite hostname.",
'category' => 'SMTP',
'description' => '',
'variables' => [
[
'name' => '_APP_SMTP_HOST',
'description' => 'SMTP server host name address. Default value is: \'smtp\'. Pass an empty string to disable all mail sending from the server.',
'introduction' => '',
'default' => 'smtp',
'required' => false,
'question' => '',
],
[
'name' => '_APP_SMTP_PORT',
'description' => 'SMTP server TCP port. Default value is: \'25\'.',
'introduction' => '',
'default' => '25',
'required' => false,
'question' => '',
],
[
'name' => '_APP_SMTP_SECURE',
'description' => 'SMTP secure connection protocol. Empty by default, change to \'tls\' if running on a secure connection.',
'introduction' => '',
'default' => '',
'required' => false,
'question' => '',
],
[
'name' => '_APP_SMTP_USERNAME',
'description' => 'SMTP server user name. Empty by default.',
'introduction' => '',
'default' => '',
'required' => false,
'question' => '',
],
[
'name' => '_APP_SMTP_PASSWORD',
'description' => 'SMTP server user password. Empty by default.',
'introduction' => '',
'default' => '',
'required' => false,
'question' => '',
],
],
],
[
'name' => '_APP_REDIS_HOST',
'default' => 'redis',
'required' => false,
'question' => '',
'category' => 'Storage',
'description' => '',
'variables' => [
[
'name' => '_APP_STORAGE_LIMIT',
'description' => 'Maximun file size allowed for file upload. The default value is 10MB limitation. You should pass your size limit value in bytes.',
'introduction' => '0.7.0',
'default' => '10000000',
'required' => false,
'question' => '',
],
[
'name' => '_APP_STORAGE_ANTIVIRUS',
'description' => 'This variable allows you to disable the internal anti-virus scans. This value is set to \'enabled\' by default, to cancel the scans set the value to \'disabled\'. When disabled, it\'s recommended to turn off the ClamAV container for better resource usage.',
'introduction' => '',
'default' => 'enabled',
'required' => false,
'question' => '',
],
[
'name' => '_APP_STORAGE_ANTIVIRUS_HOST',
'description' => 'ClamAV server host name address. Default value is: \'clamav\'.',
'introduction' => '0.7.0',
'default' => 'clamav',
'required' => false,
'question' => '',
],
[
'name' => '_APP_STORAGE_ANTIVIRUS_PORT',
'description' => 'ClamAV server TCP port. Default value is: \'3310\'.',
'introduction' => '0.7.0',
'default' => '3310',
'required' => false,
'question' => '',
],
],
],
[
'name' => '_APP_REDIS_PORT',
'default' => '6379',
'required' => false,
'question' => '',
],
[
'name' => '_APP_DB_HOST',
'default' => 'mariadb',
'required' => false,
'question' => '',
],
[
'name' => '_APP_DB_PORT',
'default' => '3306',
'required' => false,
'question' => '',
],
[
'name' => '_APP_DB_SCHEMA',
'default' => 'appwrite',
'required' => false,
'question' => '',
],
[
'name' => '_APP_DB_USER',
'default' => 'user',
'required' => false,
'question' => '',
],
[
'name' => '_APP_DB_PASS',
'default' => 'password',
'required' => false,
'question' => '',
],
[
'name' => '_APP_INFLUXDB_HOST',
'default' => 'influxdb',
'required' => false,
'question' => '',
],
[
'name' => '_APP_INFLUXDB_PORT',
'default' => '8086',
'required' => false,
'question' => '',
],
[
'name' => '_APP_STATSD_HOST',
'default' => 'telegraf',
'required' => false,
'question' => '',
],
[
'name' => '_APP_STATSD_PORT',
'default' => '8125',
'required' => false,
'question' => '',
],
[
'name' => '_APP_SMTP_HOST',
'default' => 'smtp',
'required' => false,
'question' => '',
],
[
'name' => '_APP_SMTP_PORT',
'default' => '25',
'required' => false,
'question' => '',
],
[
'name' => '_APP_SMTP_SECURE',
'default' => '',
'required' => false,
'question' => '',
],
[
'name' => '_APP_SMTP_USERNAME',
'default' => '',
'required' => false,
'question' => '',
],
[
'name' => '_APP_SMTP_PASSWORD',
'default' => '',
'required' => false,
'question' => '',
],
[
'name' => '_APP_STORAGE_LIMIT',
'default' => '10000000',
'required' => false,
'question' => '',
],
[
'name' => '_APP_STORAGE_ANTIVIRUS',
'default' => 'enabled',
'required' => false,
'question' => '',
],
[
'name' => '_APP_STORAGE_ANTIVIRUS_HOST',
'default' => 'clamav',
'required' => false,
'question' => '',
],
[
'name' => '_APP_STORAGE_ANTIVIRUS_PORT',
'default' => '3310',
'required' => false,
'question' => '',
],
[
'name' => '_APP_FUNCTIONS_TIMEOUT',
'default' => '900',
'required' => false,
'question' => '',
],
[
'name' => '_APP_FUNCTIONS_CONTAINERS',
'default' => '10',
'required' => false,
'question' => '',
],
[
'name' => '_APP_FUNCTIONS_CPUS',
'default' => '1',
'required' => false,
'question' => '',
],
[
'name' => '_APP_FUNCTIONS_MEMORY',
'default' => '128',
'required' => false,
'question' => '',
],
[
'name' => '_APP_FUNCTIONS_MEMORY_SWAP',
'default' => '128',
'required' => false,
'question' => '',
],
[
'name' => '_APP_MAINTENANCE_INTERVAL',
'default' => '86400',
'required' => false,
'question' => '',
'category' => 'Functions',
'description' => '',
'variables' => [
[
'name' => '_APP_FUNCTIONS_TIMEOUT',
'description' => 'The maximum number of seconds allowed as a timeout value when creating a new function. The default value is 900 seconds.',
'introduction' => '0.7.0',
'default' => '900',
'required' => false,
'question' => '',
],
[
'name' => '_APP_FUNCTIONS_CONTAINERS',
'description' => 'The maximum number of containers Appwrite is allowed to keep alive in the background for function environments. Running containers allow faster execution time as there is no need to recreate each container every time a function gets executed. The default value is 10.',
'introduction' => '0.7.0',
'default' => '10',
'required' => false,
'question' => '',
],
[
'name' => '_APP_FUNCTIONS_CPUS',
'description' => 'The maximum number of CPU core a single cloud function is allowed to use. Please note that setting a value higher than available cores will result in a function error, which might result in an error. The default value is 1.',
'introduction' => '0.7.0',
'default' => '1',
'required' => false,
'question' => '',
],
[
'name' => '_APP_FUNCTIONS_MEMORY',
'description' => 'The maximum amount of memory a single cloud function is allowed to use in megabytes. The default value is 128.',
'introduction' => '0.7.0',
'default' => '128',
'required' => false,
'question' => '',
],
[
'name' => '_APP_FUNCTIONS_MEMORY_SWAP',
'description' => 'The maximum amount of swap memory a single cloud function is allowed to use in megabytes. The default value is 128.',
'introduction' => '0.7.0',
'default' => '128',
'required' => false,
'question' => '',
],
[
'name' => '_APP_MAINTENANCE_INTERVAL',
'description' => 'Interval value containing the number of seconds that the Appwrite maintenance process should wait before executing system cleanups and optimizations. The default value is 86400 seconds (1 day).',
'introduction' => '0.7.0',
'default' => '86400',
'required' => false,
'question' => '',
],
],
],
];

View file

@ -30,10 +30,17 @@ $cli
* 5. Run docker-compose up -d - DONE
* 6. Run data migration
*/
$vars = Config::getParam('variables');
$config = Config::getParam('variables');
$path = '/usr/src/code/appwrite';
$defaultHTTPPort = '80';
$defaultHTTPSPort = '443';
$vars = [];
foreach($config as $category) {
foreach($category['variables'] ?? [] as $var) {
$vars[] = $var;
}
}
Console::success('Starting Appwrite installation...');

View file

@ -10,9 +10,17 @@ $cli
->task('vars')
->desc('List all the server environment variables')
->action(function () {
$variables = Config::getParam('variables', []);
$config = Config::getParam('variables', []);
$vars = [];
foreach ($variables as $key => $value) {
foreach($config as $category) {
foreach($category['variables'] ?? [] as $var) {
$vars[] = $var;
}
}
foreach ($vars as $key => $value) {
Console::log('- '.$value['name'].'='.App::getEnv($value['name'], ''));
}
});

View file

@ -1,141 +0,0 @@
# Environment Variables
Appwrite environment variables allow you to edit your server setup configuration and customize it. You can 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 it to: 'production'.
### _APP_OPTIONS_ABUSE
Allows you to turn off abuse checks and API rate limiting. By default, set to 'enabled'. To cancel the abuse checking, set to 'disabled'. It is not recommended to turn off this feature in a production environment.
### _APP_OPTIONS_FORCE_HTTPS
Allows you to force HTTPS connection to your API. This feature redirects any HTTP call to HTTPS and adds the 'Strict-Transport-Security' header to all HTTP responses. By default, set to 'disabled'. To enable, set to 'enabled'. This feature will work only when your ports are set to default 80 and 443.
### _APP_OPENSSL_KEY_V1
This is your server private secret key that is used to encrypt all sensitive data on your server. Appwrite server encrypts all secret data on your server like webhooks, HTTP passwords, user sessions, and 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_STORAGE_LIMIT
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
This variable allows you to disable the internal anti-virus scans. This value is set to 'enabled' by default, to cancel the scans set the value to 'disabled'. When disabled, it's recommended to turn off the ClamAV container for better resource usage.
### _APP_CONSOLE_WHITELIST_EMAILS
This option allows you to limit creation of users to Appwrite console. 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 limit creation of users 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 allows you to limit creation of users in Appwrite console for users sharing the same set of 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 uses 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 uses 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 uses 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_STATSD_HOST
StatsD server host name address. Default value is: 'telegraf'
### _APP_STATSD_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'. Pass an empty string to disable all mail sending from the server.
### _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.
## System Settings
### _APP_SYSTEM_EMAIL_NAME
This is the sender name value that will appear on email messages sent to developers from the Appwrite console. The default value is: 'Appwrite Team'. You can use url encoded strings for spaces and special chars.
### _APP_SYSTEM_EMAIL_ADDRESS
This is the sender email address that will appear on email messages sent to developers from the Appwrite console. The default value is 'team@appwrite.io'. You should choose an email address that is allowed to be used from your SMTP server to avoid the server email ending in the users' SPAM folders.