Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leandromoreira/edge-computing-resty
a simple edge computing platform using nginx, lua and rails
https://github.com/leandromoreira/edge-computing-resty
docker docker-compose edge-computing hackathon lua luajit nginx nginx-lua
Last synced: 12 days ago
JSON representation
a simple edge computing platform using nginx, lua and rails
- Host: GitHub
- URL: https://github.com/leandromoreira/edge-computing-resty
- Owner: leandromoreira
- License: bsd-3-clause
- Created: 2021-05-13T14:19:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-30T13:34:09.000Z (almost 2 years ago)
- Last Synced: 2024-12-03T05:41:21.961Z (23 days ago)
- Topics: docker, docker-compose, edge-computing, hackathon, lua, luajit, nginx, nginx-lua
- Language: Ruby
- Homepage:
- Size: 420 KB
- Stars: 24
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> **Warning**
> There's a more robust and complete solution available called [lua-resty-dynacode](https://github.com/leandromoreira/lua-resty-dynacode#quick-start)# 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
```bash
# 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:
```lua
local token = ngx.var.arg_token or ngx.var.cookie_superstitionif token ~= 'token' then
return ngx.exit(ngx.HTTP_FORBIDDEN)
else
ngx.header['Set-Cookie'] = {'superstition=token'}
end
```![A CMS print screen](/cms.jpg "A CMS print screen")
```bash
# 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](https://github.com/Kong/kong-lua-sandbox) 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