Publish Website
Register as Publisher
Register a trial publisher account on Distributed Press using your email:
dpress registerYou will be prompted for your name and email. Note: currently, only one site per email is allowed.
OR Set Your Authentication Token Manually
Obtain your authToken from your Distributed Press API administrator and set it using:
dpress set-auth-tokenYou will be prompted to enter your authentication token.
Create Your Site
Once registered, create a new site by specifying the domain name and whether it should be public:
dpress create-sitePublish Your Site
To upload and publish static content to the DP site from a specified directory:
dpress publish ./folder_hereDNS Setup
To use a custom domain for your Distributed Press site, you'll need to set up a DNS record to point to the Distributed Press infrastructure.
Using Distributed Press Infrastructure
- If you wish to use the official Distributed Press instance for your HTTPS traffic, contact the Distributed Press team.
- Alternatively, refer to the documentation for self-hosting (opens in a new tab) for guidance on running your own infrastructure.
CNAME Record
| Type | Name | Value |
|---|---|---|
| CNAME | <your-site> | api.distributed.press. |
- Replace `your-site`` with your domain or subdomain name.
- Ensure that the trailing dot
.is included inapi.distributed.press.as required.
_dnslink Record
To make your site accessible through Distributed Press, set an NS Record to delegate DNSLink lookups to Distributed Press.
| Type | Name | Value |
|---|---|---|
| NS | _dnslink.your.domain | api.distributed.press. |
- This eliminates the need to manually set TXT records.
- contact the Distributed Press team for assistance if needed.
Example
If your site links include:
"ipfs": {
"dnslink": "/ipns/k51qzi5uqu5djj6yo1nne5r2oomxgroy3tezhgupvx0v2jlbighfah1k028sc1/"
},
"hyper": {
"dnslink": "/hyper/t685fd3snbadhqkss8spcgz454p95ap77kdfjafotsxfhhrhuqio/"
}You only need to configure the NS Record as shown above. DNSLink propagation will handle IPFS and Hyper links automatically.
After DNS propagation, users will be able to access the site at example.com over IPFS and Hyper.
- ipns://example.com
- hyper://example.com
SSL Requirements
To use your custom domain, ensure that your domain has a valid HTTPS certificate. Most DNS providers offer free certificate generation via Let's Encrypt (opens in a new tab) or similar services.
Clone an Existing Site
Clone a website by creating a static copy from its HTTP URL:
dpress clone <site-id>Configuration
The CLI uses a configuration file named .dprc to store API URLs, authentication tokens, keypairs, and actor information. The configuration file follows the format expected by the rc module (opens in a new tab), which loads configuration options in a flexible way.
Your .dprc file should look like this:
{
"dpApiUrl": "https://api.distributed.press/v1",
"socialInboxUrl": "https://social.distributed.press/v1",
"authToken": "<your-auth-token>",
"domain": "<your-site-domain>",
}dpApiUrl: The base URL for the Distributed Press API.socialInboxUrl: The base URL for the Social Inbox.authToken: Your authentication token for API access.domain: Your custom domain for the site, e.g., example.com.
Ensure that your .dprc file is not committed to version control to keep your credentials secure.
Commands
register
Description:
Register a trial publisher account with Distributed Press:
Usage:
dpress registerset-auth-token
Description:
Set your authentication token for API access.
Usage:
dpress set-auth-tokenPrompt:
- Enter your authentication token.
create-site
Description:
Create a new site by specifying the domain name and whether it should be public
Usage:
dpress create-sitePrompt:
- Enter your site domain: e.g.,
example.com - Is your site public? (Yes/No)
publish-site
Description:
Upload and publish static content to the DP site from a specified directory:
Usage:
dpress publish ./folder_hereclone
Description:
Clone a website by creating a static copy from its HTTP URL:
Usage:
dpress clone <site-id>