crypto-bug-hunters / bug-buster

🪲 Bug Buster, a bug bounty platform powered by Cartesi Rollups
https://x.com/BugBusterApp
Apache License 2.0
10 stars 10 forks source link

Add support to built-in bounties #97

Closed guidanoli closed 4 months ago

guidanoli commented 4 months ago

Closes #72

guidanoli commented 4 months ago

The first commits merely remove unused fields in the AppBounty struct:

Then, I made the CodeZipBinary field in the CreateAppBounty struct optional, because bounties now can be sent through inputs or be built-in, and so it doesn't make sense for this field to be required in the input JSON schema. In Golang, I had to make this field a pointer to a string to make it optional.

Then, I added a CodeZipPath field to the CreateAppBounty struct. I also made it optional, because we'd still like users to be able to upload new bounties. It does not make any validation on the path, because if the path is malformed or does not point to a .tar.xz file, then exploits for such a bounty will simply not work, which I think is perfectly acceptable.

Now, we need to edit the Dockefile and copy bounty files to some known location, for example, /bounties/lua-5.4.3-bounty_riscv64.tar.xz. I've also adjusted the front-end, to allow the bounty creator to choose between uploading a bounty file or passing the path of the built-in bounty, through a Tabs component.

image

image