• Matthew Slipper's avatar
    go/proxyd: Add support for env vars in the config · 73484138
    Matthew Slipper authored
    Certain config parameters can now be read from the environment if environment variables as provided as config values. The following parameters can be read from the environment:
    
    - `backends.*.rpc_url`
    - `backends.*.ws_url`
    - `backends.*.password`
    - `authentication.*`
    
    Example backend config:
    
    ```toml
    [backends]
    [backends.from_env]
    rpc_url = "$SECRET_RPC_URL"
    ws_url = "$SECRET_WS_URL"
    ```
    
    Example authentication config. Note the additional double quotes around the secret key:
    
    ```toml
    [authentication]
    "$SECRET_AUTH_KEY" = "auth_key_alias"
    ```
    
    Env vars can be escaped with two backslashes (`\\`). We have to use two backslashes because it's also the escape character in TOML.
    
    Env vars defined in the config but not defined in the actual environment will result in an error that prevents `proxyd` from starting.
    
    Metadata:
    
    - Fixes: ENG-1728
    73484138
Name
Last commit
Last update
.changeset Loading commit data...
.github Loading commit data...
.husky Loading commit data...
.vscode Loading commit data...
go Loading commit data...
integration-tests Loading commit data...
l2geth Loading commit data...
ops Loading commit data...
packages Loading commit data...
patches Loading commit data...
specs Loading commit data...
.dockerignore Loading commit data...
.editorconfig Loading commit data...
.eslintrc.js Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
.nvmrc Loading commit data...
.prettierrc.js Loading commit data...
.prettierrc.json Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
lerna.json Loading commit data...
package.json Loading commit data...
tsconfig.build.json Loading commit data...
tsconfig.json Loading commit data...
yarn.lock Loading commit data...