SkybuDocs

Ferdigheter · Domener

Put an app on its own domain

Add a custom domain such as www.example.no to an app, give the user the DNS records to create, verify it and follow it until it serves over HTTPS.

skill://domains/custom-domainAgenter leser den med resources/read eller skills_read. Den er skrevet på engelsk, for agentene.

Every app answers on its own address under skybu.app. A custom domain adds a name the user owns. The user proves control with a TXT record and points the name at the app; Skybu then gets a certificate and serves the app on it. You add and verify the domain; the user creates the DNS records at their DNS provider.

In short

  1. get_app or list_projects to find the app's id.
  2. add_domain with the hostname. It returns the TXT record and where to point the name.
  3. Give the user both records and wait until they say they are in place.
  4. verify_domain. Then follow it with list_app_domains until the status is active.

Step 1: add the domain

{ "name": "add_domain", "arguments": { "appId": "<app id>", "hostname": "www.example.no" } }

Send the hostname only: no https://, no path. Skybu lowercases it and refuses:

CodeWhy
invalid_domainNot a hostname (letters, digits and hyphens, at most 253 characters).
domain_ip_addressAn IP address.
domain_wildcard*.example.no. Add each hostname on its own.
domain_reservedA name under skybu.app, skybu.no or another name Skybu uses, or a special-use name such as .local or .internal.
domain_takenAnother app on Skybu already has it.
domain_limit_reachedThe app has 5 custom domains, the most it can have.

The answer has the domain's id, its status (pending), a txt record and a target.

Step 2: the DNS records

Two records, both made by the user at their DNS provider.

Prove control. A TXT record named _skybu-challenge.<domain> with the value from txt.value:

_skybu-challenge.www.example.no  TXT  "skybu-…"

Send the traffic to the app. What to create depends on target.apex:

  • apex: false (a subdomain such as www.example.no or app.firma.no): a CNAME to target.cname, the app's own address.

    www.example.no  CNAME  <app>.<org>.skybu.app
  • apex: true (a bare domain such as example.no or ola.priv.no): it cannot have a CNAME. Tell the user to point it at target.cname with ALIAS, ANAME or CNAME flattening if their DNS provider has one of these, so it follows Skybu if its addresses change. Only if the provider has none, create A records for every address in target.addresses, and update them if Skybu's addresses change. Suggesting the www name instead is often simpler.

Skybu does not serve IPv6; AAAA records pointing elsewhere are flagged as not Skybu's.

Step 3: verify

Once the user says the TXT record is in place:

{ "name": "verify_domain", "arguments": { "domainId": "<domain id>" } }

Verification checks only the TXT record. If it is missing or wrong, the call fails with domain_verification_failed and says which: no TXT record at the name, a record without this domain's value, or a DNS lookup that failed (try again in a minute). DNS changes can take a few minutes; wait and verify again. The domain stays pending with the reason in error.

On success the domain is verified, and Skybu requests a certificate. The certificate is issued only once the name points at the app, so the CNAME (or ALIAS, or A records) must be in place too.

Step 4: follow it

{ "name": "list_app_domains", "arguments": { "appId": "<app id>" } }

list_domains lists the domains of every app in the organisation.

StatusMeaning
pendingWaiting for the TXT record. Run verify_domain once it exists.
verifiedControl proven. Skybu is requesting the certificate.
issuedThe certificate is there; the domain is being set up on the gateway.
activeServing the app over HTTPS. url is the https:// address. Plain HTTP redirects to HTTPS.
failedThe certificate authority refused. error has its reason. Fix the cause (usually the name does not point at the app yet), then verify_domain again to retry.

Each domain also has routing: Skybu checks what the name points to every minute until the domain is active, every half hour after, and on every verify_domain. null means fine; otherwise routing.problem is one of:

ProblemTell the user
no_recordNothing points the name at Skybu yet. Create the CNAME (or ALIAS).
a_recordsA subdomain uses A records instead of the CNAME. It works now, but stops working if Skybu's addresses change. Replace them with the CNAME.
elsewhereThe name points to routing.addresses, which are not Skybu's. Replace those records, or visitors reach another server.
missingA bare domain on A records lacks one of Skybu's addresses (routing.addresses). Add it, or use ALIAS.

On a domain that is already verified, issued or active, verify_domain only checks the routing again: a quick way to clear a warning the user has fixed.

Things to know

  • Leave the TXT record in place after verification. Verifying a failed domain checks it again.
  • remove_domain takes the domain off the app at once and deletes its certificate. Confirm with the user first; the app keeps its skybu.app address.
  • A members-only app (skill://access/members-only-apps) asks for sign-in on its custom domains too.
  • Every step is in the organisation's audit log.
  • The CLI has the same: skybu domain add <app> <hostname>, skybu domain verify <hostname>, skybu domain list, skybu domain delete <hostname>. In the dashboard it is the app's Domains tab.