{"id":16407448,"url":"https://github.com/leandromoreira/edge-computing-resty","last_synced_at":"2025-10-04T01:31:38.462Z","repository":{"id":84626567,"uuid":"367071788","full_name":"leandromoreira/edge-computing-resty","owner":"leandromoreira","description":"a simple edge computing platform using nginx, lua and rails","archived":false,"fork":false,"pushed_at":"2022-12-30T13:34:09.000Z","size":430,"stargazers_count":24,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-13T22:42:43.963Z","etag":null,"topics":["docker","docker-compose","edge-computing","hackathon","lua","luajit","nginx","nginx-lua"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leandromoreira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-13T14:19:22.000Z","updated_at":"2023-12-18T08:42:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"3c65859e-ad24-4bca-a1d9-5e8ede1de5d6","html_url":"https://github.com/leandromoreira/edge-computing-resty","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandromoreira%2Fedge-computing-resty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandromoreira%2Fedge-computing-resty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandromoreira%2Fedge-computing-resty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leandromoreira%2Fedge-computing-resty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leandromoreira","download_url":"https://codeload.github.com/leandromoreira/edge-computing-resty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235208949,"owners_count":18953003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","edge-computing","hackathon","lua","luajit","nginx","nginx-lua"],"created_at":"2024-10-11T06:13:57.255Z","updated_at":"2025-10-04T01:31:32.820Z","avatar_url":"https://github.com/leandromoreira.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **Warning**\n\u003e There's a more robust and complete solution available called [lua-resty-dynacode](https://github.com/leandromoreira/lua-resty-dynacode#quick-start)\n\n# Edge computing resty\n\nDuring 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.\n\n## Demo\n\nhttps://user-images.githubusercontent.com/55913/118967200-ce974e00-b940-11eb-89ab-d4366e360dc9.mp4\n\n## Quick start\n\n```bash\n\n# running all the systems\nmake run\n# open another tab - simulating a live colorbar live hls signal\nmake broadcast_tvshow\n\n# you can check the streaming manifest content\nhttp http://localhost:8080/hls/colorbar.m3u8\n````\n\nGo to http://localhost:3000/ and create a simple lua code to ensure a super secret token scheme:\n\n```lua\nlocal token = ngx.var.arg_token or ngx.var.cookie_superstition\n\nif token ~= 'token' then\n  return ngx.exit(ngx.HTTP_FORBIDDEN)\nelse\n  ngx.header['Set-Cookie'] = {'superstition=token'}\nend\n```\n\n![A CMS print screen](/cms.jpg \"A CMS print screen\")\n\n```bash\n# if you try to fetch the token again, the server will reply with a 403\nhttp http://localhost:8080/hls/colorbar.m3u8\n\n# but if you pass the super token, then it's going to work fine :)\nhttp http://localhost:8080/hls/colorbar.m3u8?token=token\n```\n\n# Future work\n\n* Federated functions\n  * maybe using the domain to shard and sum with a global domain *\n* Some form of lua sandboxing \n  * 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?!\n* Provide a API hook for authentication\n* Publish it as a rock\n* Add measurements\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleandromoreira%2Fedge-computing-resty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleandromoreira%2Fedge-computing-resty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleandromoreira%2Fedge-computing-resty/lists"}