Skip to content

Commit f5beabc

Browse files
committed
LPD-18031: Add documentation because we migrate from *.localhost to *.test
As we're updating our development environment to Ubuntu 24.04, the *.localhost domains are resolved differently, which caused oAuth to break. To solve this, we migrate our local domains to *.test.
1 parent 439f8f5 commit f5beabc

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
The Docker Compose file in this repository contains an instance of
88
[Traefik](https://traefik.io/) for development purposes. It allows you to access
99
microservices through your browser using a hostname (such as
10-
`accounts.leviy.localhost`) and to run multiple microservices at the same time
10+
`accounts.leviy.test`) and to run multiple microservices at the same time
1111
without port binding conflicts.
1212

1313
## Getting started
@@ -16,7 +16,7 @@ without port binding conflicts.
1616

1717
- [Docker](https://docs.docker.com/install/)
1818
- [Docker Compose](https://docs.docker.com/compose/)
19-
- A DNS resolver that resolves any hostname ending in ".localhost" to 127.0.0.1 (see [instructions](docs/dns.md))
19+
- A DNS resolver that resolves any hostname ending in ".test" to 127.0.0.1 (see [instructions](docs/dns.md))
2020

2121
### Installation
2222

@@ -51,7 +51,7 @@ services:
5151
- workspace
5252
- default
5353
labels:
54-
traefik.frontend.rule: Host:subdomain.leviy.localhost
54+
traefik.frontend.rule: Host:subdomain.leviy.test
5555
traefik.enable: 'true'
5656

5757
networks:
@@ -67,5 +67,5 @@ Non-web services (such as databases, etc.) should only be linked to the
6767

6868
When started, Traefik will automatically detect this service and start routing
6969
traffic to it.
70-
To see it in action simply open `http://subdomain.leviy.localhost` in a
70+
To see it in action simply open `http://subdomain.leviy.test` in a
7171
browser.

docs/dns.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,37 @@ host you need to configure your DNS to resolve all hostnames ending on
88

99
## Linux (Ubuntu)
1010

11-
On Ubuntu 18.04 no action is required, because [systemd-resolved](https://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html)
12-
already resolves hostnames ending on ".localhost" to 127.0.0.1 and ::1.
11+
On Ubuntu 20.04 you have to manually add lines to the /etc/hosts file for all domains that
12+
you want to resolve locally:
1313

14-
If for some reason resolving is not working on Ubuntu, make sure that the
15-
symlink `/etc/resolv.conf` is pointing to `/run/systemd/resolve/stub-resolv.conf`:
16-
17-
```bash
18-
ll /etc/resolv.conf
14+
```
15+
127.0.0.1 dashboard.leviy.test
16+
127.0.0.1 files.leviy.test
17+
127.0.0.1 accounts.leviy.test
1918
```
2019

21-
If this doesn't point to `/run/systemd/resolve/stub-resolv.conf`, overwrite the
22-
symbolic link:
20+
On Ubuntu 24.04 you can use the `systemd-resolve` to resolve all domains ending on ".test" to 127.0.0.1.
2321

24-
```bash
25-
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
26-
```
22+
(work in progress, will add additional instructions as soon as we updated to Ubuntu 24.04)
2723

2824
## macOS High Sierra
2925

3026
On macOS the same can be achieved by installing dnsmasq and configuring it to
31-
route all traffic for ".localhost" to 127.0.0.1:
27+
route all traffic for ".test" to 127.0.0.1:
3228

3329
```bash
3430
brew install dnsmasq
3531

3632
mkdir -pv $(brew --prefix)/etc/
37-
echo 'address=/.localhost/127.0.0.1' >> $(brew --prefix)/etc/dnsmasq.conf
33+
echo 'address=/.test/127.0.0.1' >> $(brew --prefix)/etc/dnsmasq.conf
3834
echo 'port=53' >> $(brew --prefix)/etc/dnsmasq.conf
3935

4036
sudo brew services start dnsmasq
4137

4238
sudo mkdir -v /etc/resolver
4339
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/localhost'
4440

45-
ping dashboard.leviy.localhost
41+
ping dashboard.leviy.test
4642
```
4743

4844
[Source](https://medium.com/@kharysharpe/automatic-local-domains-setting-up-dnsmasq-for-macos-high-sierra-using-homebrew-caf767157e43)

0 commit comments

Comments
 (0)