Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hosting

Deploy GitHub repos onto this Linux server. Each project gets a local folder, an optional .env, its own port, and an optional domain through Caddy (auto HTTPS).

The dashboard listens on localhost only (127.0.0.1:8787). Public traffic goes through Caddy to each project’s port.

Use

SSH tunnel to open the dashboard from your laptop:

ssh -L 8787:127.0.0.1:8787 USER@THIS_SERVER

Then open http://127.0.0.1:8787

Or use the CLI on the server:

hosting add landing --repo https://github.com/org/site.git --type static --domain example.com
hosting env landing --set < .env
hosting deploy landing
hosting logs landing
hosting list

Supported project types:

  • staticnpm install, optional npm run build, serve dist / out / build (or index.html at the repo root)
  • nodenpm install, optional build, then a long-lived process with PORT set

Submit clones the repo. Deploy is a separate step (pull, build, start).

Layout

/home/luoxi23vr/hosting-data/
  projects/<name>/
    repo/     # git clone
    .env      # edited in the dashboard; copied into repo on deploy
    logs/     # deploy.log, runtime.log
  hosting.json
  caddy/Caddyfile   # copied to /etc/caddy/Caddyfile on change

Private repos: paste a GitHub personal access token on the project.

DNS: point the domain at this server; Hosting reloads Caddy. Optional Let’s Encrypt email is in Settings.

Run

npm install
npm run build
npm start                 # or: hosting serve

systemd unit: deploy/hosting.service

sudo cp deploy/hosting.service /etc/systemd/system/hosting.service
sudo systemctl daemon-reload
sudo systemctl enable --now hosting

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages