Domains and basic auth
Hostnames on an app, their routing and certificate settings, and the edge password gate.
A domain is a hostname routed to one app, or to one service and path of it. certProvider picks how it gets HTTPS: letsencrypt, cloudflare (proxied, a self-signed certificate that Cloudflare's Full mode accepts), custom (an uploaded certificate that covers the name, see Custom certificates) or none.
Basic auth is a separate grant, manage_basic_auth. A login applies to every domain of the app within seconds, no redeploy.
Domains
domains
Any signed-in principal. Returns [Domain!].
Domains in the active team, primary first. Optionally filtered to one project.
| Argument | Type | Description |
|---|---|---|
appId | String |
query {
domains(appId: "prj_9f1c2ab7d3e4f5a6") {
id
name
status
ssl
primary
}
}addDomain
Needs manage_domains. Returns Domain.
Attach a hostname to an app. config sets the routing (port, service, path prefix, www redirect) and the certificate provider; omit it for the defaults.
| Argument | Type | Description |
|---|---|---|
appId | String! | |
config | DomainConfigInput | |
config.certProvider | CertProvider | One of cloudflare, custom, letsencrypt, none. |
config.corsOrigins | [String!] | |
config.entrypoint | DomainEntrypoint | One of web, websecure. |
config.middlewares | [String!] | |
config.pathPrefix | String | |
config.port | Int | |
config.proxied | Boolean | Another proxy answers for it. In a domain connected for automatic DNS, Deplo makes its record with Cloudflare's proxy on; omitted, DNS only. |
config.securityHeaders | Boolean | Omitted means on. |
config.service | String | |
config.stripPrefix | Boolean | |
config.tunnel | Boolean | Serve it through a Cloudflare Tunnel. Needs a domain connected for automatic DNS that covers this name; certProvider, entrypoint, proxied and www are then ignored. |
config.www | DomainWwwRedirect | One of none, toCounterpart, toThis. |
name | String! |
mutation {
addDomain(appId: "prj_9f1c2ab7d3e4f5a6", name: "shop.example.com", config: { port: 3000, www: toThis }) {
id
name
status
ssl
}
}updateDomain
Needs manage_domains. Returns Domain.
Apply a full edit to a domain and return the updated domain (reloaded).
| Argument | Type | Description |
|---|---|---|
id | String! | |
patch | DomainPatchInput! | |
patch.certProvider | CertProvider | One of cloudflare, custom, letsencrypt, none. |
patch.corsOrigins | [String!] | |
patch.entrypoint | DomainEntrypoint | One of web, websecure. |
patch.middlewares | [String!] | |
patch.name | String | |
patch.pathPrefix | String | |
patch.port | Int | |
patch.proxied | Boolean | Another proxy answers for it. When Deplo made its record in Cloudflare, that record's proxy follows: on, or DNS only straight to the server. |
patch.securityHeaders | Boolean | |
patch.service | String | |
patch.stripPrefix | Boolean | |
patch.tunnel | Boolean | Serve it through the server's Cloudflare Tunnel, or point it back at the server. Only for a domain whose record Deplo made. |
patch.www | DomainWwwRedirect | One of none, toCounterpart, toThis. |
mutation {
updateDomain(
id: "dom_9f1c2ab7d3e4f5a6"
patch: { pathPrefix: "/api", stripPrefix: true }
) {
id
name
status
ssl
primary
}
}setPrimaryDomain
Needs manage_domains. Returns Boolean.
Make this domain its app's primary (canonical) host. Returns true.
| Argument | Type | Description |
|---|---|---|
id | String! |
mutation {
setPrimaryDomain(id: "dom_9f1c2ab7d3e4f5a6")
}verifyDomain
Needs manage_domains. Returns Domain.
Re-check the domain's DNS and (re)issue its certificate. A check that finds the host proxied through Cloudflare moves a certificate-less domain onto letsencrypt; one already proxied is matched to Cloudflare's SSL mode.
| Argument | Type | Description |
|---|---|---|
id | String! |
mutation {
verifyDomain(id: "dom_9f1c2ab7d3e4f5a6") {
id
name
status
ssl
primary
}
}removeDomain
Needs manage_domains. Returns Boolean.
Remove the domain so it stops routing. Returns true.
| Argument | Type | Description |
|---|---|---|
id | String! |
mutation {
removeDomain(id: "dom_9f1c2ab7d3e4f5a6")
}dismissImportedDomains
Needs manage_domains. Returns Boolean.
Stop telling this app that its addresses changed when it was imported: clears importedFrom on every one of its domains. Per app on purpose - a migration brings over many, and one blanket dismissal would hide the fact on every app nobody has looked at yet.
| Argument | Type | Description |
|---|---|---|
appId | String! |
mutation {
dismissImportedDomains(appId: "prj_9f1c2ab7d3e4f5a6")
}Automatic DNS
dnsProviders
Any signed-in principal. Returns [DnsProvider!].
The DNS provider accounts the caller connected.
query {
dnsProviders {
id
createdAt
provider
shared
}
}dnsProviderTeamChoices
Any signed-in principal. Returns [DnsProviderTeam!].
The teams the caller may connect a DNS provider to: where they hold manage_domains.
query {
dnsProviderTeamChoices {
id
slug
name
}
}autoDnsZones
Any signed-in principal. Returns [AutoDnsZone!].
Domains whose names get their DNS created automatically when the caller adds them in the active team: their own, and ones shared with the team.
query {
autoDnsZones {
provider
zoneName
}
}checkDnsProvider
Any signed-in principal. Returns DnsProviderCheck.
Check that an API token reaches this domain at the provider, without saving anything.
| Argument | Type | Description |
|---|---|---|
apiToken | String! | |
provider | DnsProviderKind! | One of cloudflare. |
zone | String! |
mutation {
checkDnsProvider(apiToken: "apiToken", provider: cloudflare, zone: "zone") {
tunnels
zoneName
}
}saveDnsProvider
Any signed-in principal. Returns DnsProvider.
Connect a domain for automatic DNS in the given teams, or replace the token of one the caller already connected.
| Argument | Type | Description |
|---|---|---|
apiToken | String! | |
provider | DnsProviderKind! | One of cloudflare. |
shared | Boolean! | |
teamIds | [String!]! | |
zone | String! |
mutation {
saveDnsProvider(
apiToken: "apiToken"
provider: cloudflare
shared: true
teamIds: [["team_9f1c2ab7d3e4f5a6"]]
zone: "zone"
) {
id
createdAt
provider
shared
}
}updateDnsProvider
Any signed-in principal. Returns DnsProvider.
Change which teams may use a connected domain, who in them, and, when apiToken is given, the API token it uses.
| Argument | Type | Description |
|---|---|---|
apiToken | String | |
id | String! | |
shared | Boolean! | |
teamIds | [String!]! |
mutation {
updateDnsProvider(
id: "id_9f1c2ab7d3e4f5a6"
shared: true
teamIds: [["team_9f1c2ab7d3e4f5a6"]]
) {
id
createdAt
provider
shared
}
}removeDnsProvider
Any signed-in principal. Returns String.
Disconnect a domain from automatic DNS: its token is forgotten and its Cloudflare Tunnel connectors stop. Its tunnels and records stay, so connecting the same domain again serves them at once. Returns what Deplo could not stop, or null.
| Argument | Type | Description |
|---|---|---|
id | String! |
mutation {
removeDnsProvider(id: "id_9f1c2ab7d3e4f5a6")
}Custom certificates
An instance admin uploads a certificate once; Deplo installs it on every server that serves a name it covers over HTTPS. Each one is shared with all teams or some, and a team without it cannot add a name it covers. The private key is write-only. certificateForHostname is the one read a team member has: names and dates of the certificate its domain would be served with.
certificates
Instance admin only. Returns [Certificate!].
Every TLS certificate an instance admin uploaded, oldest first.
query {
certificates {
id
allTeams
domains
expired
}
}certificateForHostname
Any signed-in principal. Returns HostnameCertificate.
The uploaded certificate a domain of the active team with this name would be served with, or null when none shared with the team covers it.
| Argument | Type | Description |
|---|---|---|
name | String! |
query {
certificateForHostname(name: "shop") {
domains
expiresInDays
notAfter
subject
}
}addCertificate
Instance admin only. Returns [Certificate!].
Upload a TLS certificate. The pair is checked first: a key that does not match, or a certificate already expired, is refused. One whose every name it covers is replaced, and keeps its teams unless access says otherwise. Deplo then installs it on the servers that need it, which restarts their proxy for a moment. Returns the whole list.
| Argument | Type | Description |
|---|---|---|
access | CertificateAccessInput | |
access.allTeams | Boolean! | |
access.teamIds | [String!]! | |
input | CertificateInput! | |
input.certificate | String! | The certificate in PEM form. Paste the FULL chain: the certificate followed by any intermediates, which browsers need. |
input.privateKey | String! | The matching private key in PEM form, without a passphrase. It is stored encrypted and is never readable afterwards. |
mutation {
addCertificate(
input: { certificate: "certificate", privateKey: "privateKey" }
) {
id
allTeams
domains
expired
}
}setCertificateTeams
Instance admin only. Returns [Certificate!].
Choose which teams may use a certificate. Refused, naming them, when a team still has domains it serves. Returns the whole list.
| Argument | Type | Description |
|---|---|---|
access | CertificateAccessInput! | |
access.allTeams | Boolean! | |
access.teamIds | [String!]! | |
id | String! |
mutation {
setCertificateTeams(
access: { allTeams: true, teamIds: [["team_9f1c2ab7d3e4f5a6"]] }
id: "tlscert_9f1c2ab7d3e4f5a6"
) {
id
allTeams
domains
expired
}
}removeCertificate
Instance admin only. Returns [Certificate!].
Delete an uploaded certificate. Refused, naming them, while domains still use it. Returns the whole list.
| Argument | Type | Description |
|---|---|---|
id | String! |
mutation {
removeCertificate(id: "tlscert_9f1c2ab7d3e4f5a6") {
id
allTeams
domains
expired
}
}Basic auth
basicAuthUsers
Any signed-in principal. Returns [BasicAuthUser!].
Basic-auth users of an app, alphabetical by username (requires manage_domains).
| Argument | Type | Description |
|---|---|---|
appId | String! |
query {
basicAuthUsers(appId: "prj_9f1c2ab7d3e4f5a6") {
id
username
}
}addBasicAuthUser
Needs manage_basic_auth. Returns BasicAuthUser.
Add a basic-auth user to an app. The login is required on every one of its domains within seconds - the routing is re-applied to the running container, no redeploy needed.
| Argument | Type | Description |
|---|---|---|
appId | String! | |
password | String! | |
username | String! |
mutation {
addBasicAuthUser(
appId: "prj_9f1c2ab7d3e4f5a6"
password: "correct-horse-battery-staple"
username: "ada"
) {
id
username
}
}updateBasicAuthUserPassword
Needs manage_basic_auth. Returns BasicAuthUser.
Change a basic-auth user's password. The new password is live on every domain of the app within seconds (the old one stops working).
| Argument | Type | Description |
|---|---|---|
id | String! | |
password | String! |
mutation {
updateBasicAuthUserPassword(
id: "user_9f1c2ab7d3e4f5a6"
password: "correct-horse-battery-staple"
) {
id
username
}
}revealBasicAuthPassword
Needs manage_basic_auth. Returns String.
Reveal one credential's password. A basic-auth login is handed to a person, so whoever may change it may also read it back, otherwise the only answer to "what is the password?" is to reset it and lock everyone out. A mutation, not a query, so it is never cached or prefetched.
| Argument | Type | Description |
|---|---|---|
id | String! |
mutation {
revealBasicAuthPassword(id: "bau_9f1c2ab7d3e4f5a6")
}removeBasicAuthUser
Needs manage_basic_auth. Returns Boolean.
Remove a basic-auth user, so its login stops working within seconds. Removing the last one drops the login prompt entirely. Returns true.
| Argument | Type | Description |
|---|---|---|
id | String! |
mutation {
removeBasicAuthUser(id: "user_9f1c2ab7d3e4f5a6")
}See also
Did this page help you?