Skip to content

carltheperson/rust-one-binary-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust-one-binary-POC

This is the reference code for this blog post, where I describe packing multiple services into one Rust binary.

Building the frontend

# In frontend/
npm install
npm run build

Note: My special svelte.config.js and vite.config.ts files to have the static stuff work well.

Testing SSL using pebble

Get yourself pebble from https://github.com/letsencrypt/pebble

You should save test/certs/pebble.minica.pem in this repo location as pebble.minica.pem (to be brought into the binary).

You can now run:

# From inside pebble/ dir (that you cloned with git)
./pebble -config pebble-config.json -strict=false

Then you can simply do:

cargo run # Brings in ./pebble.minica.pem

Tip 1: I found it easier to use the pebble binary directly, but I know you can also use Docker.

Tip 2: Current pebble version gives you an error (error: Order(Acme(Json(Error("unknown variant dns-account-01, expected one of http-01, dns-01, tls-alpn-01", line: 27, column: 33))))) with rustls-acme. I used pebble v2.5.1 to get around this.

Make Firefox trust this stuff

Get the cert from https://127.0.0.1:15000/roots/0.

Convert to .crt:

openssl x509 -in FILE_IN -out FILE_OUT

Go to Settings > Privacy & Security > Certificates > View Certificates > Import, then select and add your certificate.

About

Reference for a blog post about multiple services in one Rust binary

Resources

License

Stars

Watchers

Forks

Contributors