Page MenuHomePhabricator

Create a TLD with 127.0.0.1 routing of subdomains for example/distribution (Fixes Quickstatements)
Closed, ResolvedPublic

Description

Problem: As follow-up to trying to solve the issues with Quickstatements OAuth in the example configuration WBS (https://phabricator.wikimedia.org/T349806#9426634) it seems clear that we need an address which can be accessed both inside of the Docker network and on the host machine for this to work. As "localhost"-based addresses are loopbacks within the Docker container, not an address to the host, so that is not an option.

Proposed solutions: The options for creating an address that can be equally used both within the containers and on the host machine are as follows:

  1. A local top-level domain (TLD) served by running a DNS server locally either within the Docker compose setup, or on the host machine directly. dnsmasq is an open source DNS server commonly used for this purpose, with several healthy Docker. images available. Direct host configuration of a DNS server would require the user to make direct edits to their /etc/hosts file, or to configure a local running DNS server, which we want to provide guidance for.
  1. A subdomain (* or multiple subdomains) on a public TLD registered to route to the loopback address of 127.0.0.1. This is something we could fairly readily provide and would provide the additional benefit of consistency in the installation, making both use and support/documentation of the example simpler and consistent between users.

Implementing addresses locally routable on both the Docker network and on the host machine would have the additional benefit of further decoupling our test suite from being Docker specific.

* A subdomain registered for each of the WBS services (e.g. wikibase.wbs-local.net, etc) along with a Docker compose running nginx instance for reverse proxying to the ports could be the best case. However a single 127.0.0.1 routed public TLD subdomain is an adequate first step which solves the Quickstatements OAuth issues while providing consistency in routing inside and outside the Docker network.

* Helpful notes from Adam: https://phabricator.wikimedia.org/T315916

Event Timeline

The TLD "wbsuite.io" is available. For the example setup this would make local services addressable as http://wikibase.wbsuite.io, http://quickstatements.wbsuite.io, etc

NOTE: Option 1 above proves to NOT be a viable option for our Example configuration as there is no way to introduce a local DNS server on the host running in Docker without modifying the /etc/resolv.conf file (or similar) on the host. Requiring or automatising changes to the host environment are assumed out-of-scope for the project (or at least the Example Docker configuration).

The # 2 solution chosen is to add a reverse-proxy to our example Docker compose setup and related documentation for configuring it.

Work completed in https://github.com/wmde/wikibase-release-pipeline/pull/562 (depends on https://github.com/wmde/wikibase-release-pipeline/pull/563), but cannot be merged until we have made decisions and take action on this ticket and update the example config on that branch to reflect the URLs we choose.

Related Quickstatements Docker image changes are in this PR, but are not strictly required to fix the issue in Example: https://github.com/wmde/wikibase-release-pipeline/pull/564

lojo_wmde renamed this task from Create a TLD with 127.0.0.1 routing of subdomains for example/distribution to Create a TLD with 127.0.0.1 routing of subdomains for example/distribution (Fixes Quickstatements).Dec 29 2023, 11:36 AM
lojo_wmde changed the task status from Open to In Progress.
lojo_wmde moved this task from Inbox to Sprint-∞ on the Wikibase Suite Team board.
lojo_wmde moved this task from Sprint Backlog to Doing on the Wikibase Suite Team (Sprint-∞) board.
lojo_wmde claimed this task.
lojo_wmde moved this task from Doing to Done on the Wikibase Suite Team (Sprint-∞) board.