Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEA-547 new environment for certificates and security emails #7888

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env
Expand Up @@ -8,7 +8,8 @@ _APP_CONSOLE_COUNTRIES_DENYLIST=AQ
_APP_CONSOLE_HOSTNAMES=localhost,appwrite.io,*.appwrite.io
_APP_SYSTEM_EMAIL_NAME=Appwrite
[email protected]
[email protected]
[email protected]
[email protected]
stnguyen90 marked this conversation as resolved.
Show resolved Hide resolved
_APP_SYSTEM_RESPONSE_FORMAT=
_APP_OPTIONS_ABUSE=disabled
_APP_OPTIONS_ROUTER_PROTECTION=disabled
Expand Down
20 changes: 19 additions & 1 deletion app/config/variables.php
Expand Up @@ -162,13 +162,31 @@
],
[
'name' => '_APP_SYSTEM_SECURITY_EMAIL_ADDRESS',
'description' => 'This is the email address used to issue SSL certificates for custom domains or the user agent in your webhooks payload.',
'description' => 'Deprecated since 1.5.1 use _APP_EMAIL_SECURITY and _APP_EMAIL_CERTIFICATES instead',
'introduction' => '0.7.0',
'default' => '[email protected]',
'required' => false,
'question' => '',
'filter' => ''
],
[
'name' => '_APP_EMAIL_SECURITY',
'description' => 'This is the email address used as the user agent in your webhooks payload.',
'introduction' => '1.5.1',
'default' => '',
'required' => false,
'question' => '',
'filter' => ''
],
[
'name' => '_APP_EMAIL_CERTIFICATES',
'description' => 'This is the email address used to issue SSL certificates for custom domains',
'introduction' => '1.5.1',
'default' => '',
'required' => false,
'question' => '',
'filter' => ''
],
stnguyen90 marked this conversation as resolved.
Show resolved Hide resolved
[
'name' => '_APP_USAGE_STATS',
'description' => 'This variable allows you to disable the collection and displaying of usage stats. This value is set to \'enabled\' by default, to disable the usage stats set the value to \'disabled\'. When disabled, it\'s recommended to turn off the Worker Usage container to reduce resource usage.',
Expand Down
2 changes: 1 addition & 1 deletion app/console
stnguyen90 marked this conversation as resolved.
Show resolved Hide resolved
Submodule console updated 624 files
2 changes: 1 addition & 1 deletion app/controllers/api/avatars.php
Expand Up @@ -349,7 +349,7 @@
CURLOPT_USERAGENT => \sprintf(
APP_USERAGENT,
App::getEnv('_APP_VERSION', 'UNKNOWN'),
App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY)
App::getEnv('_APP_EMAIL_SECURITY', APP_EMAIL_SECURITY)
stnguyen90 marked this conversation as resolved.
Show resolved Hide resolved
),
]);

Expand Down
2 changes: 1 addition & 1 deletion app/init.php
Expand Up @@ -1004,7 +1004,7 @@ function (mixed $value) {
'user_agent' => \sprintf(
APP_USERAGENT,
App::getEnv('_APP_VERSION', 'UNKNOWN'),
App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY)
App::getEnv('_APP_EMAIL_SECURITY', APP_EMAIL_SECURITY)
),
'timeout' => 2,
],
Expand Down
8 changes: 4 additions & 4 deletions app/views/install/compose.phtml
Expand Up @@ -81,7 +81,7 @@ services:
- _APP_CONSOLE_HOSTNAMES
- _APP_SYSTEM_EMAIL_NAME
- _APP_SYSTEM_EMAIL_ADDRESS
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS
- _APP_EMAIL_SECURITY
- _APP_SYSTEM_RESPONSE_FORMAT
- _APP_OPTIONS_ABUSE
- _APP_OPTIONS_ROUTER_PROTECTION
Expand Down Expand Up @@ -251,7 +251,7 @@ services:
- _APP_ENV
- _APP_WORKER_PER_CORE
- _APP_OPENSSL_KEY_V1
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS
- _APP_EMAIL_SECURITY
- _APP_REDIS_HOST
- _APP_REDIS_PORT
- _APP_REDIS_USER
Expand Down Expand Up @@ -427,7 +427,7 @@ services:
- _APP_DOMAIN
- _APP_DOMAIN_TARGET
- _APP_DOMAIN_FUNCTIONS
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS
- _APP_EMAIL_CERTIFICATES
- _APP_REDIS_HOST
- _APP_REDIS_PORT
- _APP_REDIS_USER
Expand Down Expand Up @@ -549,7 +549,7 @@ services:
- _APP_OPENSSL_KEY_V1
- _APP_DOMAIN
- _APP_DOMAIN_TARGET
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS
- _APP_EMAIL_SECURITY
- _APP_REDIS_HOST
- _APP_REDIS_PORT
- _APP_REDIS_USER
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Expand Up @@ -102,7 +102,7 @@ services:
- _APP_CONSOLE_HOSTNAMES
- _APP_SYSTEM_EMAIL_NAME
- _APP_SYSTEM_EMAIL_ADDRESS
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS
- _APP_EMAIL_SECURITY
- _APP_SYSTEM_RESPONSE_FORMAT
- _APP_OPTIONS_ABUSE
- _APP_OPTIONS_ROUTER_PROTECTION
Expand Down Expand Up @@ -285,7 +285,7 @@ services:
- _APP_ENV
- _APP_WORKER_PER_CORE
- _APP_OPENSSL_KEY_V1
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS
- _APP_EMAIL_SECURITY
- _APP_DB_HOST
- _APP_DB_PORT
- _APP_DB_SCHEMA
Expand Down Expand Up @@ -474,7 +474,7 @@ services:
- _APP_DOMAIN
- _APP_DOMAIN_TARGET
- _APP_DOMAIN_FUNCTIONS
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS
- _APP_EMAIL_CERTIFICATES
- _APP_REDIS_HOST
- _APP_REDIS_PORT
- _APP_REDIS_USER
Expand Down Expand Up @@ -612,7 +612,7 @@ services:
- _APP_OPENSSL_KEY_V1
- _APP_DOMAIN
- _APP_DOMAIN_TARGET
- _APP_SYSTEM_SECURITY_EMAIL_ADDRESS
- _APP_EMAIL_SECURITY
- _APP_REDIS_HOST
- _APP_REDIS_PORT
- _APP_REDIS_USER
Expand Down
6 changes: 3 additions & 3 deletions src/Appwrite/Platform/Workers/Certificates.php
Expand Up @@ -134,9 +134,9 @@ private function execute(Domain $domain, Database $dbForConsole, Mail $queueForM

try {
// Email for alerts is required by LetsEncrypt
$email = App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS');
$email = App::getEnv('_APP_EMAIL_CERTIFICATES');
if (empty($email)) {
throw new Exception('You must set a valid security email address (_APP_SYSTEM_SECURITY_EMAIL_ADDRESS) to issue an SSL certificate.');
throw new Exception('You must set a valid security email address (_APP_EMAIL_CERTIFICATES) to issue an SSL certificate.');
}

// Validate domain and DNS records. Skip if job is forced
Expand Down Expand Up @@ -473,7 +473,7 @@ private function notifyError(string $domain, string $errorMessage, int $attempt,
->setBody($body)
->setName('Appwrite Administrator')
->setVariables($emailVariables)
->setRecipient(App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS'))
->setRecipient(App::getEnv('_APP_EMAIL_CERTIFICATES'))
->trigger();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Appwrite/Platform/Workers/Webhooks.php
Expand Up @@ -104,7 +104,7 @@ private function execute(array $events, string $payload, Document $webhook, Docu
\curl_setopt($ch, CURLOPT_USERAGENT, \sprintf(
APP_USERAGENT,
App::getEnv('_APP_VERSION', 'UNKNOWN'),
App::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS', APP_EMAIL_SECURITY)
App::getEnv('_APP_EMAIL_SECURITY', APP_EMAIL_SECURITY)
));
\curl_setopt(
$ch,
Expand Down