Home
Softono

Edge Computing Resty

Open source BSD-3-Clause Ruby
24
Stars
0
Forks
0
Issues
2
Watchers
3 years
Last Commit

 About Edge Computing Resty

a simple edge computing platform using nginx, lua and rails

Platforms

Web Self-hosted Docker

Languages

Ruby

Links

Need Help Installing Edge Computing Resty?

We provide expert installation service for this software. Our team will install, configure, and secure Edge Computing Resty on your server. plans start at just $30.

Edge Computing Resty

View on GitHub

Warning There's a more robust and complete solution available called lua-resty-dynacode

Edge computing resty

During our hackday, we created a simple edge computing platform using nginx, lua and rails. The ideas is to inject lua code into a running nginx through a CMS.

Demo

https://user-images.githubusercontent.com/55913/118967200-ce974e00-b940-11eb-89ab-d4366e360dc9.mp4

Quick start


# running all the systems
make run
# open another tab - simulating a live colorbar live hls signal
make broadcast_tvshow

# you can check the streaming manifest content
http http://localhost:8080/hls/colorbar.m3u8

Go to http://localhost:3000/ and create a simple lua code to ensure a super secret token scheme:

local token = ngx.var.arg_token or ngx.var.cookie_superstition

if token ~= 'token' then
  return ngx.exit(ngx.HTTP_FORBIDDEN)
else
  ngx.header['Set-Cookie'] = {'superstition=token'}
end

A CMS print screen

# if you try to fetch the token again, the server will reply with a 403
http http://localhost:8080/hls/colorbar.m3u8

# but if you pass the super token, then it's going to work fine :)
http http://localhost:8080/hls/colorbar.m3u8?token=token

Future work

  • Federated functions
    • maybe using the domain to shard and sum with a global domain *
  • Some form of lua sandboxing
    • since luajit can't enforce quota, one might use the admin phase to run the code and mesure the time, check syntax, security?!
  • Provide a API hook for authentication
  • Publish it as a rock
  • Add measurements