1
0

codespace.config.php 872 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. $codespaceName = getenv('CODESPACE_NAME');
  7. $codespaceDomain = getenv('GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN');
  8. $CONFIG = [
  9. 'mail_from_address' => 'no-reply',
  10. 'mail_smtpmode' => 'smtp',
  11. 'mail_sendmailmode' => 'smtp',
  12. 'mail_domain' => 'example.com',
  13. 'mail_smtphost' => 'localhost',
  14. 'mail_smtpport' => '1025',
  15. 'memcache.local' => '\OC\Memcache\APCu',
  16. ];
  17. if(is_string($codespaceName) && !empty($codespaceName) && is_string($codespaceDomain) && !empty($codespaceDomain)) {
  18. $host = $codespaceName . '-80.' . $codespaceDomain;
  19. $CONFIG['overwritehost'] = $host;
  20. $CONFIG['overwrite.cli.url'] = 'https://' . $host;
  21. $CONFIG['overwriteprotocol'] = 'https';
  22. $CONFIG['trusted_domains'] = [ $host ];
  23. }