Skip to content

feat(site): one legal entity per domain - #53

Merged
mjfelis merged 1 commit into
mainfrom
feat/site-entities
Sep 28, 2026
Merged

mjfelis merged 1 commit into
mainfrom
feat/site-entities

Conversation

@mjfelis

@mjfelis mjfelis commented Sep 28, 2026

Copy link
Copy Markdown
Member

Summary

The same site answers on two domains, and the domain now decides the legal entity shown:

Domain Legal entity Registration Address
mobiera.com Mobiera SAS (unchanged) NIT 900662462-4 Cra 13A 86A-42, Bogotá D.C., Colombia
mobiera.io Mobiera Norte SA Registro Mercantil, folio número 812363 World Trade Center 200-B, Suite 214, Calle 53 Este, Marbella, Panama City, Panama

How

  • app/lib/entity.ts is the single definition of both entities (name, registration, address, city, data-protection law, canonical origin).
  • proxy.ts picks the site from the request (x-mobiera-site, then forwarded-host headers, then Host; any header naming mobiera.com wins, because that domain arrives through a reverse proxy) and rewrites to the internal path /<site>/<locale>/.... Pages stay prerendered, once per site and language. Visitors never see the site segment. The response header x-mobiera-site reports the choice.
  • Message files name the entity through [[tokens]] ([[legalName]], [[legalRegistration]], [[legalAddress]], [[legalCity]], [[siteDomain]], ...) resolved per site when messages load, so no copy is duplicated.
  • Follows the domain: footer, contact page, privacy policy (controller, law, answer delay), consent line, company page registered office, example credential holder, structured data, canonical and hreflang links, sitemap, robots.txt, RSS feed, social image, contact emails (subject, footer, a "Site" row in the inquiry).
  • The social image becomes a route (/og-image, /es/og-image): the file convention published the internal path.

To check before merging

  1. The reverse proxy must identify mobiera.com. After deploy: curl -sI https://www.mobiera.com/ | grep -i x-mobiera-site must answer com. If it answers io, add RequestHeader set X-Mobiera-Site "com" to the Apache vhost (see docs/configuration.md). Until then mobiera.com visitors would see the Panama entity.
  2. Assumptions recorded in spec/facts.yaml for confirmation: the mobiera.io privacy policy cites Panamanian Law 81 of 2019 with a 10 business day answer; history copy on mobiera.io says "Mobiera was founded in Bogotá in 2012" while the timeline keeps "Mobiera SAS incorporated in Bogotá"; the footer copyright keeps 2012.
  3. SITE_URL is no longer read by the app (build args and chart value are now inert and can be removed later).

Verified

Type-check, 11 unit tests (host detection, tokens), full build, and the standalone server driven with Host headers: both entities in English and Spanish on every affected page, canonical and hreflang per domain, sitemap, robots and feed per domain, locale redirect, 404s, 410s, Hugo redirects, internal paths answering 404, contact API. A real browser per domain confirmed no hydration errors and that client-side navigation keeps the entity.

mobiera.com keeps Mobiera SAS (Colombia); mobiera.io now shows Mobiera Norte
SA (Panama): name, Mercantile Registry folio, address, city, data-protection
law, canonical origin.

The proxy picks the site from the request headers and rewrites to the
internal path /<site>/<locale>/..., so every page stays prerendered, once per
site and language. app/lib/entity.ts is the single definition of both
entities. Message files name the entity through [[tokens]] resolved per site
when messages load. Footer, contact and privacy pages, structured data,
canonical and hreflang links, sitemap, robots.txt, the RSS feed, the social
image and the contact emails follow the domain. The response carries
x-mobiera-site for verification.

The social image becomes a route (/og-image) because the file convention
published the internal path.
@mjfelis
mjfelis merged commit 90bcae8 into main Sep 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant