-
Notifications
You must be signed in to change notification settings - Fork 432
add gh action deployment guide, custom domains guide, and overhaul docs landing page #1999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 16 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
d45ee53
initial commit of deployment guide
2color 66edf20
edit description
2color 3bf0198
Update docs/install/deploy-github-action.md
2color 2230c2d
Update docs/install/deploy-github-action.md
2color 856ae50
break off dnslink and custom domains into separate guide
2color a21e573
move guide to guides
2color a4e3f78
progress and edits
2color 31ea50a
edits and improvements
2color 14f368b
fix: typo
2color 24f7178
fix: broken urls
2color 63573cf
fix: typos
2color 8a6b170
fix: broken links
2color 067482a
Merge branch 'main' into add-website-guide
2color 2b396bb
small refinement
2color d3f6b68
fix: url to public utilities
2color 4dcb49e
Apply suggestions from code review
2color d40058d
Apply suggestions from code review
2color aceaf77
feat: add kubo and cluster versions to header
2color 32a24a4
refinement
2color 8b190a6
chore: add note about service worker gateway
2color 82d4ddb
Update docs/how-to/websites-on-ipfs/custom-domains.md
2color df25f24
update opener
2color b321563
add link to custom domains guide from dnslink
2color 4c72dbb
clean up sidebar
2color b9c8f22
refine custom domain page
2color 2340e88
remove broken link
2color b7e7caf
fix: typo
2color 408f2d1
Apply suggestions from code review
2color e2f3c33
add next.js tips to static site generators
2color 03300a3
refine wordpress section
2color 02f874c
fix: link
2color 3b2eb55
fix: typos
2color 18d2228
fix: linting rules
2color 208b13b
final edits
2color a0a515a
final polish
2color 9481811
more edits and fixes
2color eb51b25
typos
2color 8bf3247
fix: broken link
2color 60758ed
broken link
2color File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2color marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: Custom domains and DNSLink | ||
description: Guide on how to configure custom domains and DNSLink for your IPFS deployments. | ||
--- | ||
|
||
# Custom domains and DNSLink | ||
|
||
By default, when you deploy a static web application to IPFS, it will be addressed with a CID. Since CIDs are long and hard to remember, they're not very user-friendly, for example, `https://bafybeifhgtpm6kmbyqszbardceszvkv5rsi3dodtuufpcfskzggekcfl2y.ipfs.inbrowser.link/` or `https://bafybeifhgtpm6kmbyqszbardceszvkv5rsi3dodtuufpcfskzggekcfl2y.ipfs.dweb.link/`. | ||
|
||
To make your app easier to access, you can optionally configure a custom domain for your app, depending on how you want users to access your app. | ||
|
||
This guide will walk you through the process of configuring a custom domain for your app, and how to configure DNSLink to signal the CID for your app. | ||
|
||
### CID Signaling with DNSLink | ||
|
||
[DNSLink](../../concepts/dnslink.md) is a standard way to map human-readable domain names (DNS) to CIDs. For example, for the IPFS Docs, `docs.ipfs.tech`, the DNSLink record is a TXT record at `_dnslink.docs.ipfs.tech` with the value `dnslink=/ipfs/bafybeicv5tbyeahgm4pyskd2nverwsqxpiqloikqrufvof7vausglw6avm` (the CID will likely be different once you read this guide). | ||
|
||
The main benefit of DNSLink is that it allows users to determine the latest CID for a given domain name, while leaving it up to the user how to retrieve the deployment addressed by the CID. For example, a user might have a local IPFS node, and want to access the latest deployment of your app, they can do so by resolving the DNSLink record and fetching the content from their local node. `http://localhost:8080/ipns/docs.ipfs.tech` will serve the CID found in the DNSLink record. | ||
|
||
When a DNSLink record is present, any IPFS gateway (local or public) can take the DNS name and resolve it to the CID, and serve the content, for example, both `https://inbrowser.link/ipns/docs.ipfs.tech` and `https://dweb.link/ipns/docs.ipfs.tech` will serve the same site, albeit with different origins. | ||
|
||
If you run your own IPFS node, such as [IPFS Desktop](../../install/ipfs-desktop.md) or [Kubo](../../install/command-line.md), and load the site from a local gateway at `http://localhost:8080/ipns/docs.ipfs.tech`, you benefit from the resilience and censorship resistance of the IPFS network, because it's content addressed (addressed by CID) rather than being tied to a canonical origin. As long as there's at least one reachable provider for the CID, and use a trusted [DNS over HTTPS resolver](https://github.com/ipfs/kubo/blob/master/docs/config.md#dnsresolvers), you can access the site. | ||
|
||
Loading the site this way ties the website's cookies, storage, and Web API permissions to the [origin](https://developer.mozilla.org/en-US/docs/Glossary/Origin) of a specific gateway. When using public gateways, the user experience can vary depending on the gateway's origin, which may impact app functionality, including cookies, storage, and CORS access to external APIs. That is why a local gateway is advantageous, as it does not depend on external domains or origins. | ||
|
||
## Access via a custom domain | ||
|
||
In the previous section, we discussed how DNSLink can be used to signal the CID for a domain name, while leaving it up to the user how to retrieve the content, be it a local node, service worker gateway or any other [public recursive gateway](https://docs.ipfs.tech/concepts/ipfs-gateway/#recursive-vs-non-recursive-gateways). In this instance, the user provides the domain name as input, instead of the CID. | ||
|
||
To provide access to the app directly via the custom domain, you have the following options: | ||
|
||
1. Self-host both the IPFS provider (e.g. [Kubo](https://github.com/ipfs/kubo)) and the HTTP gateway (e.g. [Kubo](https://github.com/ipfs/kubo) or [Rainbow](https://github.com/ipfs/rainbow/)). Deploy an IPFS Gateway that supports DNSLink resolution and point the `CNAME`/`A` DNS record for your custom domain to it and update the `TXT` record on `_dnslink` subdomain to match CID of your website. Set up CI automation to update TXT record every time your CID changes. You will likely want to also configure TLS with a reverse proxy like Caddy or use a CDN like Cloudflare for TLS termination. | ||
2. Use a service like Fleek | ||
2color marked this conversation as resolved.
Show resolved
Hide resolved
|
||
3. Deploy the site to a web hosting service like Cloudflare/GitHub Pages, and point the CNAME/A record for your custom domain to it, essentially getting the benefits of both IPFS and traditional web hosting. | ||
2color marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Access via a custom domain is useful if you want to serve your app via a domain name that you own, for example, `app.example.com`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 maybe we need to rework
link-a-domain
to link/how-to/websites-on-ipfs/custom-domains
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, by reworking, do you mean:
link-a-domain
page and link from sidebar/how-to/websites-on-ipfs/custom-domains
link-a-domain
(most of it is outdated) into/how-to/websites-on-ipfs/custom-domains
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@2color yes, exactly. remove
link-a-domain
, incorporate things tocustom-domains
and add it to sidebar + link to it from the end of https://docs.ipfs.tech/concepts/dnslink/ as well.