a personal web server, one line of config to add a reverse proxy entry

About daemon


daemon

a web server system made of separate processes focused on a reverse proxy server that is configured automatically over RPC (or one line of config for pre-existing servers). It also has a launcher program that can run your (go) servers in a minimal chroot under a separated user.

It's especially good if you want to write go servers and share one URL between them easily with automatic TLS support.

Features

  • 🔀 Run many backend web servers and securely share a single TLS protected domain name (via reverse proxy)
  • 🧑‍💻 Read the logs of each server streaming real time to the dashboard which also lets you reload the config file and restart servers
  • 🔛 Launch backend servers isolated in a minimal chroot as unprivileged users, configured in a simple textproto file
  • 🤖 Backends automatically register their paths on the domain via gRPC (there's also support for servers that can't send the RPCs) and receive a port assignment and get their TLS certificate signed by the portal Certificate Authority
  • 📚 There's a client library to do all this in one function call, and a tools library full of helpful functions for writing a go webserver
  • 👾 Install as one binary that runs each server, or as individual binaries

Quick Start

Make sure you have go installed then

  1. Install it with go install ask.systems/daemon@latest
    • This will leave the binary at ~/go/bin/daemon by default
    • I like to configure my $GOPATH/bin to be in my $PATH
  2. Run daemon spawn (or use ~/go/bin/daemon if it isn't in your $PATH)
    • This will run spawn which will print logs and write an example config.pbtxt in the current directory
    • It will run portal and the dashboard, prompt for a dashboard login password, and then print the address of the dashboard at the end.
    • Note: since this doesn't include getting an officially recognized TLS certificate, portal will generate a new self-signed certificate which you will have to accept warnings about in your browser.

You can then edit the config file which has comments about how it works. You can add an instance of host to try out hosting a static website (there's an example in the file commented out).

More Info

Check out the Github README this page is a cropped version of it.

The go documentation has more info about the tools library and client API if you want to make your own go servers that automatically register with the reverse proxy.

Read more
Filters

Recent Activity

Just published v0.6.6 yay! I'm excited about the logging changes, I was wanting accurate download size logging for a while and having the useragent is nice too. Also better support for TLS backends is always good, we want to encrypt everything.

I'm glad I waited because I realized I had updated the dependencies in a way that I didn't like that raised the minimum go compiler version. Now I have a nice script to do it next time.

Hopefully next release will be more features instead of bug fixes.

I started messing around with this again on this break after not coding for a while and got super into it. It started with accidentally finding a go issue about a potential bug I realized I had in my code and I wanted to fix.

I made several things more robust with detecting backend TLS support and made lots of improvements to the logging. I'm excited about accurately logging bytes served so I can tell how much bandwidth different pages are taking. I even ended up doing some windows specific platform code improvements.

There's even more, I'll do a new version soon, I just need to run it for 24 hours or so to make sure all the changes are working well. Can't take back a tag once it's in goproxy!

I've been working on this for several years off and on while I used it; it wasn't very well defined what it would be for a long time. I'm excited that it has come together into a neat package and it's finally ready to share with others.

I spent a good amount of time working to make it nice for newcomers. I'd love to hear if you try it out and what parts are confusing or didn't work when you tried to set it up.

I have a friend who has beta tested it for a while now and I have been running it for years so it should be relatively bug free but please let me know if there are problems of course.