]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix devcontainer url 35146/head
authorRobin Windey <ro.windey@gmail.com>
Mon, 14 Nov 2022 10:40:42 +0000 (10:40 +0000)
committerGitHub <noreply@github.com>
Mon, 14 Nov 2022 15:40:04 +0000 (15:40 +0000)
See also:
* https://github.com/community/community/discussions/5104#discussioncomment-2217052
* https://docs.github.com/en/codespaces/developing-in-codespaces/default-environment-variables-for-your-codespace#list-of-default-environment-variables

.devcontainer/codespace.config.php

index 2818a760edbf8ca367d9fbb053c30779922d8c0e..5d883c3c9dfdb41c4968d9e13cf9e1ac34f8bcef 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
-$cloudEnvironmentId = getenv('CLOUDENV_ENVIRONMENT_ID');
+$codespaceName = getenv('CODESPACE_NAME');
+$codespaceDomain = getenv('GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN');
 
 $CONFIG = [
     'mail_from_address' => 'no-reply',
@@ -12,7 +13,7 @@ $CONFIG = [
     'memcache.local' => '\OC\Memcache\APCu',
 ];
 
-if($cloudEnvironmentId !== true) {
-    $CONFIG['overwritehost'] = $cloudEnvironmentId . '-80.apps.codespaces.githubusercontent.com';
+if(is_string($codespaceName) && !empty($codespaceName) && is_string($codespaceDomain) && !empty($codespaceDomain)) {
+    $CONFIG['overwritehost'] = $codespaceName . '-80.' . $codespaceDomain;
     $CONFIG['overwriteprotocol'] = 'https';
 }