TruthGate Publishing

The Domains tab in the navigation menu is where TruthGate becomes more than a secure IPFS gateway — it becomes your publishing powerhouse.


Adding Domains

You can add your own domains (Web2 and Web3).

  • TruthGate can automatically issue trusted SSL certificates via Let’s Encrypt.
  • If you’re using Cloudflare for SSL and CDN caching (highly recommended), simply disable the auto-SSL option in TruthGate.
    • TruthGate will still issue a local SSL cert.
    • On Cloudflare, set the proxy SSL mode to “Full” and it will connect just fine.

To connect domains:

  • Add a DNS A record → point to your server’s IPv4
  • Add a DNS AAAA record → point to your server’s IPv6

Built-in IPNS + TGP

When publishing, TruthGate automatically uses IPNS with the TruthGate Pointer Protocol (TGP).

  • Normal IPNS is notoriously slow.
  • TruthGate + TGP make IPNS lightning fast and legally cleaner.

For maximum performance, configure a Wildcard Host in Settings → General:

  1. Create DNS records:
    • A and AAAA records for *.ipns → point to your TruthGate IPs.
    • Example: *.ipns.truthgate.io
  2. In TruthGate, set your Wildcard Host to ipns.truthgate.io
  3. (Optional but recommended) Enable TruthGate Managed SSL.

Save your settings, and now every domain you publish will have a dedicated, super-fast IPNS domain automatically linked.


Drag-and-Drop Publishing

When you click Publish, you’ll see this upload interface:

Simply:

  1. Build your static site (e.g., a Blazor or React app).
  2. Drag and drop your wwwroot folder into the upload box.

TruthGate will handle the IPFS/IPNS deployment for you. 🎉

Uploads are limited by browser constraints (file count & total size). For huge deployments (tens of thousands of files, or very large builds), use the Publish API instead.

Publishing via API

TruthGate exposes a special API for large deployments:

text
POST https://YOUR_IP/api/truthgate/v1/admin/publish

Here's a Powershell script I personally use to upload my site:

powershell
$apiKey = "Your_Key"
$domain = "Your_Domain"
$UserIP = "Your_IP"
$root  = "Full_Path_To_wwwroot"

$files = Get-ChildItem $root -File -Recurse

$url    = "https://$UserIP/api/truthgate/v1/admin/$domain/publish"

$args = @(
  "-k", "-X", "POST",
  $url,
  "-H", "X-API-Key: $apiKey"
)

foreach ($f in $files) {
  # compute path relative to $root and force forward slashes
  $rel = $f.FullName.Substring($root.Length).TrimStart('\','/').Replace('\','/')
  # IMPORTANT: we attach the file from the full path, but we override the transmitted filename
  $args += @("-F", "files[]=@$($f.FullName);filename=$rel")
}

# fire!
curl.exe @args

This will publish every file in your wwwroot folder to your domain.


Backup & Import

After your first publish, you’ll see a Backup button.
This generates a secure file containing your IPNS key + peer identity.

⚠️ Important notes:

  • This is not a backup of your site’s files — only the IPNS identity.
  • If you lose this key, there is no recovery.
  • Store it in a safe, encrypted vault.

TruthGate will prompt you to password-protect the backup for safety.

If needed, you can later use the Import button to restore a backed-up domain.


Redundancy & Best Practices

Want redundancy? Deploy multiple TruthGate nodes:

  • Use the IPNS pinning feature to replicate your published domain across multiple nodes.
  • This increases availability and improves site performance.

However:

  • Always choose one primary TruthGate for publishing.
  • Secondary nodes should only pin, not publish, to avoid conflicts.

Public Domain API (read-only)

TruthGate exposes two anonymous (no auth required) endpoints under your domain to help apps, tools, and checkers discover the current deploy CIDs and IPNS status for a published site.

Base path:https://YOUR_DOMAIN/api/truthgate/v1
Endpoints
MethodPathWhat it returns
GET/GetDomainCidThe site’s current root CID in v1 (base32) and v0 (base58btc)
GET/GetDomainIpnsIPNS metadata for this domain + TGP (TruthGate Pointer) status
These endpoints infer the domain from the Host header (i.e., the domain you call them on). No query/body params needed.
Call them on the actual site domain you published (or its configured IPNS host), not the raw server IP.

GET /GetDomainCid

Returns the latest deploy’s resolved site CID (folder CID of /production/sites/<leaf>), normalized to both versions.

Request

text
GET https://YOUR_DOMAIN/api/truthgate/v1/GetDomainCid

Sample response

json
{
  "domain": "yourdomain.com",
  "cidV0": "QmExampleBase58Btc...",
  "cidV1": "bafybeiexamplebase32..."
}

Notes

  • Tries exact and lowercased leaf names in MFS:
    • /production/sites/<leaf>
    • /production/sites/<leaf-lower>
  • Formats both CIDv1 (base32) and CIDv0 (base58btc) for maximum compatibility.

Errors

  • 400{"error":"No host header present in request"} or {"error":"Invalid host"}
  • 404{"error":"site not found","searched":["/production/sites/<leaf>","/production/sites/<leaf-lower>"]}

GET /GetDomainIpns

Returns IPNS + TGP info for the domain as configured in TruthGate.

Request

text
GET https://YOUR_DOMAIN/api/truthgate/v1/GetDomainIpns

Sample response

json
{
  "domain": "yourdomain.com",
  "ipnsPeerId": "k51qzi5uqu5d...",
  "tgpCid": "bafybeiexampletgp...",
  "currentCid": "bafybeicurrentpointer...",
  "lastPublishedCid": "bafybeilastpublished...",
}

Fields

  • ipnsPeerId – The key’s PeerID (k51...). If the key name exists but the PeerID isn’t known, TruthGate will attempt to resolve it.
  • tgpCid – The current CID of the TGP folder.
  • currentCid – The active target CID from tgp.json (the one clients should load).
  • lastPublishedCid – The most recent site root CID your domain published (from config).

Errors

  • 400{"error":"No host header present in request"} or {"error":"Invalid host"}
  • 404{"error":"Domain not found in config"}
TGP status is cached briefly for speed; after a publish, values may take a moment to reflect. GetDomainCid uses a no-cache stat for the site folder then formats the CID.

Practical examples

Fetch the current deploy CIDs

bash
curl -s https://YOUR_DOMAIN/api/truthgate/v1/GetDomainCid | jq

Fetch IPNS + TGP info

bash
curl -s https://YOUR_DOMAIN/api/truthgate/v1/GetDomainIpns | jq

In a browser
You can also just visit the endpoints directly (handy for external monitors or a quick sanity check).

Personally I utilize these calls to easily check if the current user is utilizing Web3 and if their current version is out of date or not. I've done tricks like that on multiple sites before, but I wanted TruthGate to have this capability to make my life easier moving forward!


Security model
These endpoints are marked AllowAnonymous and are intended to be public, read-only metadata. They reveal no private keys, only deployment pointers (CIDs, IPNS PeerID, TGP status).
Extremely aggressive caching occurs with these API calls to prevent abuse.

When to use which
  • Use GetDomainCid when you need the current site folder CID in both v0/v1 formats (e.g., for gateway URLs, debugging, or CID-aware clients).
  • Use GetDomainIpns when you need the IPNS identity and TGP pointer info (e.g., to confirm the active pointer currentCid, or to script cross-node pinning).

Compression Notes

When publishing your site, many compilers will also generate pre-compressed files like:

  • .gz (Gzip)
  • .br (Brotli)

⚠️ Do not publish these to IPFS.

IPFS in Web3 mode cannot directly serve pre-compressed assets — and uploading them just wastes space.

TruthGate automatically handles compressing and serving your files efficiently. That means:

  • You publish the raw files (.html, .css, .js, images, etc.)
  • TruthGate delivers them compressed on-the-fly
  • You save storage space and bandwidth
Keep your build clean, let TruthGate handle compression for you.

Caching & Update Delays

TruthGate is designed with very aggressive caching to maximize speed and reduce unnecessary strain on your node. This means that after you make changes or publish new content, updates may not appear immediately.

In most cases, updates propagate quickly, but depending on your environment, caches may take 30 minutes or more to refresh before the latest content is visible. This is normal behavior and not a bug.

If you need to bypass caching instantly, you can clear your local browser cache or use a direct IPFS/IPNS resolution to confirm that the new content has been published correctly.

If you really need an instant update. After the IPNS update occurs (usually happens after 1-2 minutes after a publish), just go ahead and run a restart on the TruthGate service.


Final Thoughts

With the Domains page, you can now:

  • Bind Web2 domains directly to your decentralized IPFS/IPNS sites
  • Serve as your own personal edge gateway
  • Gain redundancy, archiving, and true Web3 presence

Welcome to Web3, powered by TruthGate. 🚀


Support "TruthGate"

TruthGate is an open-source project built to make decentralized hosting secure, simple, and actually usable.

Every line of code, every guide, and every improvement is powered by independent work and passion.

If you find TruthGate useful, you can help keep development alive and growing by supporting the project below.



You can also support TruthGate by helping to pin and preserve the following important IPNS addresses:

  • TruthGate Website – The official website for TruthGate.

    k51qzi5uqu5dgo40x3jd83hrm6gnugqvrop5cgixztlnfklko8mm9dihm7yk80
  • IPFS Redirect – A decentralized redirect service used in TruthGate, hosted at ipfs-redirect.unstoppable and ipfsredirect.com.

    k51qzi5uqu5dhbigu9mydyrgfmsbmyokff915scf5hv975z209qad9rhmkgssq

Every gesture, big or small, lets me dedicate more time to making decentralized hosting better. Thank you.