{"id":24355108,"url":"https://github.com/ferib/luaexample","last_synced_at":"2025-04-10T02:28:03.662Z","repository":{"id":98991599,"uuid":"581274260","full_name":"ferib/LuaExample","owner":"ferib","description":"Lua Obfuscator example using REST API","archived":false,"fork":false,"pushed_at":"2024-08-21T13:30:39.000Z","size":11,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T03:53:25.296Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ferib.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-12-22T18:28:09.000Z","updated_at":"2024-08-21T13:30:43.000Z","dependencies_parsed_at":"2025-01-18T17:34:59.058Z","dependency_job_id":null,"html_url":"https://github.com/ferib/LuaExample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferib%2FLuaExample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferib%2FLuaExample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferib%2FLuaExample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferib%2FLuaExample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ferib","download_url":"https://codeload.github.com/ferib/LuaExample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248143898,"owners_count":21054841,"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":[],"created_at":"2025-01-18T17:29:06.955Z","updated_at":"2025-04-10T02:28:03.642Z","avatar_url":"https://github.com/ferib.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lua Obfuscator REST API Example\n\n[LuaObfuscator.com](https://luaobfuscator.com) is a neat online Lua obfuscation platform that comes with some basic yet powerful obfuscation techniques. They do offer a REST API which is what this example project is all about. This repository demonstrates how to integrate the REST API into a GitHub repository using GitHub Actions.\n\n# 👀 Demo\n\nTo automate the obfuscation of the `src/loader.lua` file using the `config/loader.json` I used a few basic Unix utils in a bash script. The results can be found on [this GitHub Actions page](https://github.com/ferib/LuaExample/actions).\n\n# 📝 Setup\nTo get started, you will need to create a new workflow file and populate it as follows:\n\nGive it a name and define when it should trigger.\n\n```yml\nname: Publish Lua (obfuscated)\n\non:\n  push:\n    branches: [ master, actions ]\n```\n\nNext, add a job and specify a target platform. For our use case, we will stick with just ubuntu-latest.\n\n```yml\n    jobs:\n    build:\n\n        runs-on: ubuntu-latest\n```\n\nNext, we will need to add a few steps, starting with `actions/checkout@v3` to access our git files\n\n```yml\n    steps:\n      - uses: actions/checkout@v3\n```\n\nTo install our dependencies, we will be using `curl` for the HTTP requests and `jq` to handle the JSON formatting.\n\n```yml\n      # make sure its installed?\n      - name: Install dependencies\n        run: |\n            sudo apt-get install jq curl -y\n```\n\nFinally, we have come to the juicy part where we perform the REST API calls and process the response. The below snippet will grab the `src/loader.lua` file and applies the `config/loader.json` as its configuration.\n\n```yml\n      # Obfuscate src/loader.lua \u003e public/loader.lua\n      - name: LuaObfuscator REST API\n        shell: bash {0}\n        run: |\n            mkdir public\n            curl -X POST https://luaobfuscator.com/api/obfuscator/newscript \\\n            -H \"Content-type: application/json\" \\\n            -H \"apikey: test\" \\\n            --data-binary \"@src/loader.lua\" \\\n            | curl -X POST https://luaobfuscator.com/api/obfuscator/obfuscate \\\n            -H \"Content-type: application/json\" \\\n            -H \"apikey: test\" \\\n            --data \"@config/loader.json\" \\\n            -H \"sessionId: $(grep -o -P '(?\u003c=\"sessionId\":\").*(?=\"})')\" \\\n            | jq -r \".code\" \\\n            \u003e public/loader.lua\n```\n\nLast but not least, we need to create an artifact of our files as we can download them once our container is destroyed. Do so using `actions/upload-artifact@v1`.\n\n```yml\n      # publish public/loader.lua\n      - name: Create artifact\n        uses: actions/upload-artifact@v1\n        with:\n          name: release_protected\n          path: public/\n```\n\n# 🧪 Example\nThe complete version of the above script can be found at [.github/workflows/luaobfuscator.yml](.github/workflows/luaobfuscator.yml)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferib%2Fluaexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fferib%2Fluaexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferib%2Fluaexample/lists"}