Server config by passing config files, remove create2 verification #1232
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows users to modify the default Sourcify server config by passing config files under
services/server/config
. The default config is set atdefault.js
. Production and staging configsproduction.js
andstaging.js
respectively (must set upNODE_ENV=production
orstaging
). These only override the given fields in this config.Similar to
.env
, it is possible to create aconfig/local.js
file, which is ignored, to set up a local development environment.Environment variables are still passed via
.env
, for which a template is given at.env.dev
. However this PR removes the env vars that can be public config values. This means most of the public env vars are now configs, with the exception of theIPFS_GATEWAY
which is used at thelib-sourcify
to assemble a contract. This, in the future can be a config passed to thelib-sourcify
constructor and a LibSourcify instance created by the server. For now this is left, and also theIPFS_API
variable is kept to keep IPFS vars together..env
varsMoves to config:
Removes:
Create2
We wanted to remove the CREATE2 verification feature as it's not being used, spam prone (can spam by giving arbitrary salt), and the spam prevention compicates the code. While cleaning up
.env
and removing theAUTH0
I also decided to remove the CREATE2 related code.Misc
ForbiddenError
andUnauthorizedError
as these were used in create2 endpoint authenticaitonTODO:
View in Huly HI-556