Skip to content
Question boxy with Rust
Rust JavaScript CSS HTML Dockerfile
Branch: master
Clone or download
BlueCocoa updated screenshot
Signed-off-by: Cocoa <>
Latest commit cb6595b Dec 30, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
conf added `web_root` to configuration Dec 30, 2019
src get a specific question Dec 30, 2019
web.example added sign in/sign out button Dec 30, 2019
.dockerignore added .dockerignore Dec 29, 2019
.gitignore ignore web/* Dec 30, 2019
Cargo.toml initial version of boxy server side Dec 29, 2019
Dockerfile relocated configuration file Dec 29, 2019
LICENSE updated and added LICENSE Dec 30, 2019
docker-compose.yml added sign in/sign out button Dec 30, 2019
screenshot.png updated screenshot Dec 30, 2019


Question box with Rust

My question box

You may refer to my blog post for more detials~



With docker-compose

With docker-compose, it should be super easy.

cp conf/config.example.json conf/boxy.json
cp -rf web.exmaple web
docker-compose up -d

Port 5534 is exposed, and you can use nginx or Apache as proxy. And I opt for nginx, so code below is my configuration

server {
  if ($host = {
    return 301 https://$host$request_uri;
  } # managed by Certbot

  listen 80;
  listen [::]:80;
  return 404; # managed by Certbot

server {
  listen 443 ssl http2; # managed by Certbot
  listen [::]:443 ssl http2; # managed by Certbot
  server_name; # managed by Certbot

  ssl_certificate /etc/letsencrypt/live/; # managed by Certbot
  ssl_certificate_key /etc/letsencrypt/live/; # managed by Certbot
  include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  ssl_session_cache shared:TLS:2m;
  ssl_buffer_size 4k;

  add_header Strict-Transport-Security "max-age=31536000";

  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;

    proxy_pass http://localhost:5534;
    proxy_redirect off;

With my own MongoDB

And it's not hard if you prefer to use your own MongoDB server

First copy the example configuration file to conf/boxy.json

cp conf/config.example.json conf/boxy.json
cp -rf web.exmaple web

Then edit conf/boxy.json with your favorite editor. You need to specify mongodb_url, mongodb_db, mongodb_username and mongodb_password

docker build -t boxy .
docker run -d \
  --restart=always \
  -p 5534:5534 \
  -v "`pwd`/conf:/etc/boxy" \
  -v "`pwd`/web:/web" \

Customize Webpage

If you want to customize the webpage, then you may edit your web page in some directory, e.g, /var/www/boxy.

And now, if you are using Docker, then just map /var/www/boxy/ to /web

If you are going to run this as a standalone application, you need to set web_root in boxy.json to /var/www/boxy/.


You may refer to my blog post for API details. I'm currently too sleepy to copy those here.


This project uses many other projects on GitHub or on the internet, without them this project can be done, but it will take literally forever XD. Massive thanks to them.



There are some crates that directly used in this project, but actucally there are plenty more crates behind these.

bson = "0.14"
crossbeam-channel = "0"
ctrlc = "3"
futures = "0.1"
hmac = "0.7"
hyper = "0.12"
lazy_static = "1.4"
mongodb = "0.9"
regex = "1"
serde_json = "1.0"
serde = "1"
sha2 = "0.8"
You can’t perform that action at this time.