Skip to main content

A quick way to deploy static projects to a fast, cheap, and reliable CDN.

Project description

trifold

A quick way to deploy static projects to a fast, cheap, and reliable CDN.

trifold deploys a directory of HTML/CSS/JS to a CDN.

create a bunny.net account

bunny.net is a CDN with great prices and an easy-to-use API. (The authors have no affiliation with the service.) For a few cents per GB you can host a static site using their storage & pull zones.

If you'd like to sign up with our affiliate link, when you pay to h;ost your site, we'll earn a commission at no extra cost to you!

If you'd prefer not to, you can sign up by visiting bunny.net.

Once you have an account, visit https://dash.bunny.net/account/api-key to obtain your API key.

To use the commands below you'll need to set the BUNNY_API_KEY environment variable:

$ export BUNNY_API_KEY=1234...         # replace with your key

usage

To get started, your project needs a trifold.toml.

Generate one with:

$ uvx trifold init

This will ask you a few questions, create the necessary remote resources, and write a trifold.toml file locally.

TODO: document questions

Note: The default behavior is to only serve data from North America, which costs $0.01/GB in bandwidth. Other regions are available at an additional cost, and can be configured via the web interface (CDN->General->Pricing & routing).

With a zone created, we're ready to publish, but it's always a good idea to look before you leap-- let's check the status:

$ uvx trifold status -v

This shows us the files that will be uploaded or deleted.

Run:

$ uvx trifold publish

After a few seconds, your files are uploaded to the CDN.

By default, for safety, this will only create or update files. If you'd like it to delete remote files that are no longer in your local directory add --delete.

This command will never modify your local files!

Now your site is hosted at your-zone-name.b-cdn.net!

If you'd like to add a custom domain, there's one more command to run.

Before you run this command, create a DNS CNAME or ALIAS record pointing your domain at your-zone-name.b-cdn.net.

Once that's done, wait 5-10 minutes for propagation, then:

$ uvx trifold domain-add example.com

This will configure an SSL certificate and force SSL.

why?

This project grew out of my frustration with services making their free tier less friendly to indie devs & students that just need a cheap & reliable place they can host things.

Instead of relying on a free service it is hopefully going to be more stable to rely on a paid service with a reasonable price point (and the ability to set billing limits).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trifold-0.2.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trifold-0.2.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file trifold-0.2.0.tar.gz.

File metadata

  • Download URL: trifold-0.2.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.22

File hashes

Hashes for trifold-0.2.0.tar.gz
Algorithm Hash digest
SHA256 61c1b728e2f2244ca089bf4d996217bee8f83c1db07be936c137f2eeaf5cc963
MD5 89b34a2b1b0029cb86ee0a0d291d21cf
BLAKE2b-256 3546f9e4087395c49c995077db11bfb9443f3bdf9f06ba50bfe48b87b8cd229b

See more details on using hashes here.

File details

Details for the file trifold-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: trifold-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.22

File hashes

Hashes for trifold-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9879365374910530ccf70f14e1c392772d5f10bd3cf5effd359f91c3f00b9a1
MD5 861751b4960a150c5d0c6533fd772dca
BLAKE2b-256 6236b0af2e3d5b3bbd18c43aac309b51cb5232faa5508db4c45bf4dbf5fe646e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page