mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
refactor: use single adapter
This commit is contained in:
1 parent
3a9ba8a6ad
commit
98984a8085
7 files changed
+43
-71
No files matched your search
@@ -21,8 +21,6 @@ if (\file_exists(__DIR__ . '/../vendor/autoload.php')) {
|
||||
use Ahc\Jwt\JWT;
|
||||
use Ahc\Jwt\JWTException;
|
||||
use Appwrite\Auth\Auth;
|
||||
use Appwrite\Certificates\Adapter\LetsEncrypt;
|
||||
use Appwrite\Certificates\AdapterProvider;
|
||||
use Appwrite\Event\Audit;
|
||||
use Appwrite\Event\Build;
|
||||
use Appwrite\Event\Certificate;
|
||||
@@ -1533,19 +1531,6 @@ App::setResource('cache', function (Group $pools) {
|
||||
return new Cache(new Sharding($adapters));
|
||||
}, ['pools']);
|
||||
|
||||
App::setResource('letsEncryptCertificateAdapter', function () {
|
||||
$email = System::getEnv('_APP_EMAIL_CERTIFICATES', System::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS'));
|
||||
if (empty($email)) {
|
||||
throw new Exception('You must set a valid security email address (_APP_EMAIL_CERTIFICATES) to issue a LetsEncrypt SSL certificate.');
|
||||
}
|
||||
|
||||
return new LetsEncrypt($email);
|
||||
});
|
||||
|
||||
App::setResource('adapterForCertificates', function ($letsEncrypt) {
|
||||
return new AdapterProvider(fn (string $domain) => $letsEncrypt);
|
||||
}, ['letsEncryptCertificateAdapter']);
|
||||
|
||||
App::setResource('deviceForLocal', function () {
|
||||
return new Local();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user