gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source
https://gno.land/
Other
841 stars 342 forks source link

Clarify allowed files and extensions when adding a package #2421

Open deelawn opened 1 week ago

deelawn commented 1 week ago

Description

Filtering exists for files uploaded when a new package is added. These filters are a combination of conditionals and regular expressions that exist in multiple places. The definition of filenames and extensions that are allowed should be better defined, unified, and put into a single location.

Here are the three locations I've found thus far: https://github.com/gnolang/gno/blob/31a5f2ea63ab1f069201bfa7ad35e9eada8ec6d9/gnovm/pkg/gnolang/nodes.go#L1110-L1117 https://github.com/gnolang/gno/blob/31a5f2ea63ab1f069201bfa7ad35e9eada8ec6d9/tm2/pkg/std/memfile.go#L42-L46 https://github.com/gnolang/gno/blob/31a5f2ea63ab1f069201bfa7ad35e9eada8ec6d9/gno.land/pkg/gnoweb/gnoweb.go#L114-L117

Then there is also the addition of the license constant added as a temporary fix for exposing a LICENSE file via gnoweb: https://github.com/gnolang/gno/blob/289785be49eb2c9736d5efebcbf049afac9694cc/tm2/pkg/std/memfile.go#L107-L109