Give every app an address
With a default domain, every app gets a web address of its own as soon as you add it to a server that can use the domain. The address is the app's name under the domain: an app called Shop Front answers at shop-front.apps.example.com. Coresmith gets each address's certificate when the app goes live.
On Coresmith Cloud this is already done for you. Every app answers at its name under coresmith.app, like shop-front.coresmith.app.
Set the default domain
Owners and admins can set it.
- Open Settings, General.
- On Default domain for apps, choose Set a domain.
- Enter a domain you own, such as
apps.example.com, and choose Save.
Coresmith then checks each of your connected servers. Every server gets a row on the card: Ready when its apps can use the domain, or Not ready with what's missing and any record to add.
Point the domain at your servers
Do one of these.
- Let Coresmith add the records. If the domain's DNS is on Cloudflare, give Coresmith a Cloudflare token under Settings, General, Address, with Zone, DNS, Edit for the domain's zone. Coresmith then adds each app's record itself, pointed at the server the app runs on, and leaves records it didn't add alone. This works with any number of servers.
- Add a wildcard record. At your DNS provider, add an A record for
*.apps.example.compointing at your server's IPv4 address, and an AAAA record for its IPv6 address if it has one. The card shows the exact records with copy buttons. A wildcard reaches one server, so apps on your other servers need the Cloudflare token or domains of their own.
A server that takes visitors through Cloudflare needs the token, since its records go through the tunnel. Use the zone itself as the default domain, such as example.com. Cloudflare's free certificate covers names one level under the zone, so shop.example.com works, but shop.apps.example.com would show visitors a certificate error.
Which apps get an address
- Apps you add from now on get one straight away on a server marked Ready, even when you type a domain of your own. Your domain stays primary, and the default address answers beside it.
- Apps you added before get theirs at their next deploy.
- An app's address is always its name in lowercase, with hyphens for spaces, and without dots or other symbols. Two apps can't share one, so when you add or rename an app, Coresmith asks for another name if a different app already has that address, or if Cloudflare already has a record for it that Coresmith didn't add.
- An app whose name's address another app had first has no default address. Its Domains card says so. Rename the app to give it one.
The app's page lists the address on its Domains card, marked default, or primary when it's the app's only domain.
Rename an app
Renaming an app moves its address to the new name straight away, and the old address stops working. The Rename app box shows the new address as you type. If the app's APP_URL variable pointed at the old address, Coresmith changes it to the new one, ready for the next deploy.
If the app's server can't use the domain yet, the old address still goes, and the new one waits. Once the server can use it, the app gets the new address at its next deploy, or straight away when you choose Add the address on its Domains card. If you choose it too early, Coresmith says why it can't add the address yet.
Take an address off an app
On the app's Domains card, choose the remove button beside the address, then Remove. The app keeps its other domains, and Coresmith doesn't give the address back on its own. To bring it back, choose Add the address on the same card.
Change or turn off the default domain
Choose Change on the card to use another domain. Each app moves to the new domain at its next deploy.
Choose Turn off to stop giving out addresses. Apps keep theirs until their next deploy, and then lose them.
On Coresmith Cloud
Every app gets its name under coresmith.app, and there's nothing to set up. Every app on Coresmith Cloud shares that domain, so no two apps can have the same address there. Coresmith asks for another name if another app already has the address, or if the name could pass for Coresmith's own, such as admin or login. You can't add other coresmith.app names by hand, but you can add domains you own as usual. Add a domain.