Skip to content

feat: Implement friendly domains#400

Open
adamspofford-dfinity wants to merge 4 commits intomainfrom
spofford/friendly-domains
Open

feat: Implement friendly domains#400
adamspofford-dfinity wants to merge 4 commits intomainfrom
spofford/friendly-domains

Conversation

@adamspofford-dfinity
Copy link
Contributor

No description provided.

@adamspofford-dfinity adamspofford-dfinity requested a review from a team as a code owner March 3, 2026 15:24
@raymondk
Copy link
Contributor

raymondk commented Mar 4, 2026

Noticed that:

networks:
  - name: local
    mode: managed
    gateway: 
      domains:
        - mydomain.com

Will come back with a random port instead of the default fixed port.

Seems to be set here: https://github.com/dfinity/icp-cli/blob/main/crates/icp/src/network/mod.rs#L120

};

// Friendly domains are available for managed networks where we write custom-domains.txt
let has_friendly = matches!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is assuming that all network launchers and all docker images are going to support the custom domains which is not a safe assumption to make IMO.

I think we can simplify this and continue printing the <canister>.<localhost>:<port> url because it is more likely to be correct.

It would be documented that some network can use the friendly names - maybe it can even be printed when the network starts if this network will support friendly names.

Copy link
Contributor Author

@adamspofford-dfinity adamspofford-dfinity Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to narrow it to 'is it native and is the version latest' for now, I want to keep the feature advertised to users and this should be enough following the auto-update PR. The launcher notifying the CLI whether it is supported seems like a good idea.

let domain = gateway_domain(http_gateway_url);
let mut candid_url = canister_gateway_url(http_gateway_url, ui_id, None);
if domain.is_some() {
candid_url.set_query(Some(&format!("id={canister_id}")));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a side note - could be interesting to create a friendly name for the candid ui canister too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree but would rather keep it out of this PR.

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.

3 participants