Skip to content

Static service tool using Deno, Ngrok, Certbot and Cloudflare

Notifications You must be signed in to change notification settings

danzlarkin/spstic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Static service tool using Deno (esbuild & live-reloading), Ngrok, Certbot and Cloudflare

Overview

  • Deno is used to create a static file server (including esbuild & live-reloading)
  • Ngrok is used to tunnel this server to any specified domain
  • Certbot is used to issue a TLS/SSL certificate for the specified domain
  • Cloudflare is used for DNS service

Requirements

You must first have Deno, Ngrok and Certbot installed on your device.

It is also required that you use Cloudflare as your DNS for your domain.

You'll need to have a certbot-dns-cloudflare installed as a plugin for Certbot.

A wildcard domain (e.g. *.example.io) needs to be added to your Ngrok domains and the corresponding CNAME to your Cloudflare DNS records before usage.

Getting Started

Download this respository, and run the following script in your terminal:

./setup.sh

The setup script will guide you through the setup process.

Usage

Once setup, spstic can be ran via terminal in any directory to spin up a static service

  # The command `spstic`, `spastic` or `static` can be used from terminal

  # Deploy a static service from this directory
  spstic

  # Deploy a static service from this directory on the specfied subdomain (e.g. xyz123)
  spstic --subdomain=[subdomain]

  # Deploy a static service from this directory on the specfied port (e.g. 8080)
  spstic --port=[port]

  # Deploy a static service from this directory without Certbot or Ngrok
  spstic --local

  # Configure the credentials
  spstic --configure

  # Show the help
  spstic --help

Any required TLS/SSL certificates will be generated and uploaded.

The web address for your service will be displayed in the terminal.

Any JavaScript/JSX files will be minified and transpiled as ES Modules with esbuild.

Any changes made to files in your directory will be live-reloaded.

License

MIT

Copyright (c) 2022-present, Daniel Larkin

About

Static service tool using Deno, Ngrok, Certbot and Cloudflare

Resources

Stars

Watchers

Forks

Packages

No packages published