Use reserved TLD for default dev hostname

See https://jdebp.eu/FGA/dns-use-domain-names-that-you-own.html.
This commit is contained in:
Franz Liedke 2020-09-27 22:55:46 +02:00
parent ce9093ab5d
commit 63745b73aa
3 changed files with 14 additions and 14 deletions

View File

@ -44,7 +44,7 @@ class FileDataProvider implements DataProviderInterface
// Define configuration variables // Define configuration variables
$this->debug = $configuration['debug'] ?? false; $this->debug = $configuration['debug'] ?? false;
$this->baseUrl = $configuration['baseUrl'] ?? 'http://flarum.local'; $this->baseUrl = $configuration['baseUrl'] ?? 'http://flarum.localhost';
$this->databaseConfiguration = $configuration['databaseConfiguration'] ?? []; $this->databaseConfiguration = $configuration['databaseConfiguration'] ?? [];
$this->adminUser = $configuration['adminUser'] ?? []; $this->adminUser = $configuration['adminUser'] ?? [];
$this->settings = $configuration['settings'] ?? []; $this->settings = $configuration['settings'] ?? [];

View File

@ -69,7 +69,7 @@ class UserDataProvider implements DataProviderInterface
private function getBaseUrl(): BaseUrl private function getBaseUrl(): BaseUrl
{ {
$baseUrl = $this->ask('Base URL (Default: http://flarum.local):', 'http://flarum.local'); $baseUrl = $this->ask('Base URL (Default: http://flarum.localhost):', 'http://flarum.localhost');
return $this->baseUrl = BaseUrl::fromString($baseUrl); return $this->baseUrl = BaseUrl::fromString($baseUrl);
} }

View File

@ -28,27 +28,27 @@ class ConfigTest extends TestCase
public function it_wraps_base_url_in_value_object() public function it_wraps_base_url_in_value_object()
{ {
$config = new Config([ $config = new Config([
'url' => 'https://flarum.local/myforum/', 'url' => 'https://flarum.localhost/myforum/',
]); ]);
$url = $config->url(); $url = $config->url();
$this->assertEquals('https', $url->getScheme()); $this->assertEquals('https', $url->getScheme());
$this->assertEquals('/myforum', $url->getPath()); // Note that trailing slashes are removed $this->assertEquals('/myforum', $url->getPath()); // Note that trailing slashes are removed
$this->assertEquals('https://flarum.local/myforum', (string) $url); $this->assertEquals('https://flarum.localhost/myforum', (string) $url);
} }
/** @test */ /** @test */
public function it_has_a_helper_for_debug_mode() public function it_has_a_helper_for_debug_mode()
{ {
$config = new Config([ $config = new Config([
'url' => 'https://flarum.local', 'url' => 'https://flarum.localhost',
'debug' => false, 'debug' => false,
]); ]);
$this->assertFalse($config->inDebugMode()); $this->assertFalse($config->inDebugMode());
$config = new Config([ $config = new Config([
'url' => 'https://flarum.local', 'url' => 'https://flarum.localhost',
'debug' => true, 'debug' => true,
]); ]);
@ -59,7 +59,7 @@ class ConfigTest extends TestCase
public function it_turns_off_debug_mode_by_default() public function it_turns_off_debug_mode_by_default()
{ {
$config = new Config([ $config = new Config([
'url' => 'https://flarum.local', 'url' => 'https://flarum.localhost',
]); ]);
$this->assertFalse($config->inDebugMode()); $this->assertFalse($config->inDebugMode());
@ -69,14 +69,14 @@ class ConfigTest extends TestCase
public function it_has_a_helper_for_maintenance_mode() public function it_has_a_helper_for_maintenance_mode()
{ {
$config = new Config([ $config = new Config([
'url' => 'https://flarum.local', 'url' => 'https://flarum.localhost',
'offline' => false, 'offline' => false,
]); ]);
$this->assertFalse($config->inMaintenanceMode()); $this->assertFalse($config->inMaintenanceMode());
$config = new Config([ $config = new Config([
'url' => 'https://flarum.local', 'url' => 'https://flarum.localhost',
'offline' => true, 'offline' => true,
]); ]);
@ -87,7 +87,7 @@ class ConfigTest extends TestCase
public function it_turns_off_maintenance_mode_by_default() public function it_turns_off_maintenance_mode_by_default()
{ {
$config = new Config([ $config = new Config([
'url' => 'https://flarum.local', 'url' => 'https://flarum.localhost',
]); ]);
$this->assertFalse($config->inMaintenanceMode()); $this->assertFalse($config->inMaintenanceMode());
@ -97,7 +97,7 @@ class ConfigTest extends TestCase
public function it_exposes_additional_keys_via_array_access() public function it_exposes_additional_keys_via_array_access()
{ {
$config = new Config([ $config = new Config([
'url' => 'https://flarum.local', 'url' => 'https://flarum.localhost',
'custom_a' => 'b', 'custom_a' => 'b',
]); ]);
@ -108,7 +108,7 @@ class ConfigTest extends TestCase
public function it_exposes_nested_keys_via_dot_syntax() public function it_exposes_nested_keys_via_dot_syntax()
{ {
$config = new Config([ $config = new Config([
'url' => 'https://flarum.local', 'url' => 'https://flarum.localhost',
'nested' => [ 'nested' => [
'first' => '1', 'first' => '1',
'second' => '2', 'second' => '2',
@ -123,7 +123,7 @@ class ConfigTest extends TestCase
public function it_does_not_allow_mutation_via_array_access() public function it_does_not_allow_mutation_via_array_access()
{ {
$config = new Config([ $config = new Config([
'url' => 'https://flarum.local', 'url' => 'https://flarum.localhost',
'custom_a' => 'b', 'custom_a' => 'b',
]); ]);
@ -140,7 +140,7 @@ class ConfigTest extends TestCase
public function it_does_not_allow_removal_via_array_access() public function it_does_not_allow_removal_via_array_access()
{ {
$config = new Config([ $config = new Config([
'url' => 'https://flarum.local', 'url' => 'https://flarum.localhost',
'custom_a' => 'b', 'custom_a' => 'b',
]); ]);