mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Removed vhosts for ws and replaced cors with origins (#574)
* removed vhosts for ws and added replaced cors with origins * updated script
This commit is contained in:
parent
be3f297379
commit
1ab225c0e4
5 changed files with 17 additions and 25 deletions
|
|
@ -78,8 +78,7 @@ syncmode = "full"
|
||||||
# prefix = ""
|
# prefix = ""
|
||||||
# host = "localhost"
|
# host = "localhost"
|
||||||
# api = ["web3", "net"]
|
# api = ["web3", "net"]
|
||||||
# vhosts = ["*"]
|
# origins = ["*"]
|
||||||
# corsdomain = ["*"]
|
|
||||||
# [jsonrpc.graphql]
|
# [jsonrpc.graphql]
|
||||||
# enabled = false
|
# enabled = false
|
||||||
# port = 0
|
# port = 0
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,8 @@ The ```bor server``` command runs the Bor client.
|
||||||
|
|
||||||
- ```cache.preimages```: Enable recording the SHA3/keccak preimages of trie keys
|
- ```cache.preimages```: Enable recording the SHA3/keccak preimages of trie keys
|
||||||
|
|
||||||
|
- ```cache.triesinmemory```: Number of block states (tries) to keep in memory (default = 128)
|
||||||
|
|
||||||
- ```txlookuplimit```: Number of recent blocks to maintain transactions index for (default = about 56 days, 0 = entire chain)
|
- ```txlookuplimit```: Number of recent blocks to maintain transactions index for (default = about 56 days, 0 = entire chain)
|
||||||
|
|
||||||
### JsonRPC Options
|
### JsonRPC Options
|
||||||
|
|
@ -96,9 +98,7 @@ The ```bor server``` command runs the Bor client.
|
||||||
|
|
||||||
- ```http.vhosts```: Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.
|
- ```http.vhosts```: Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.
|
||||||
|
|
||||||
- ```ws.corsdomain```: Comma separated list of domains from which to accept cross origin requests (browser enforced)
|
- ```ws.origins```: Origins from which to accept websockets requests
|
||||||
|
|
||||||
- ```ws.vhosts```: Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.
|
|
||||||
|
|
||||||
- ```graphql.corsdomain```: Comma separated list of domains from which to accept cross origin requests (browser enforced)
|
- ```graphql.corsdomain```: Comma separated list of domains from which to accept cross origin requests (browser enforced)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -266,6 +266,9 @@ type APIConfig struct {
|
||||||
|
|
||||||
// Cors is the list of Cors endpoints
|
// Cors is the list of Cors endpoints
|
||||||
Cors []string `hcl:"corsdomain,optional" toml:"corsdomain,optional"`
|
Cors []string `hcl:"corsdomain,optional" toml:"corsdomain,optional"`
|
||||||
|
|
||||||
|
// Origins is the list of endpoints to accept requests from (only consumed for websockets)
|
||||||
|
Origins []string `hcl:"origins,optional" toml:"origins,optional"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GpoConfig struct {
|
type GpoConfig struct {
|
||||||
|
|
@ -473,8 +476,7 @@ func DefaultConfig() *Config {
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Host: "localhost",
|
Host: "localhost",
|
||||||
API: []string{"net", "web3"},
|
API: []string{"net", "web3"},
|
||||||
Cors: []string{"localhost"},
|
Origins: []string{"localhost"},
|
||||||
VHost: []string{"localhost"},
|
|
||||||
},
|
},
|
||||||
Graphql: &APIConfig{
|
Graphql: &APIConfig{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
|
|
@ -930,7 +932,7 @@ func (c *Config) buildNode() (*node.Config, error) {
|
||||||
HTTPVirtualHosts: c.JsonRPC.Http.VHost,
|
HTTPVirtualHosts: c.JsonRPC.Http.VHost,
|
||||||
HTTPPathPrefix: c.JsonRPC.Http.Prefix,
|
HTTPPathPrefix: c.JsonRPC.Http.Prefix,
|
||||||
WSModules: c.JsonRPC.Ws.API,
|
WSModules: c.JsonRPC.Ws.API,
|
||||||
WSOrigins: c.JsonRPC.Ws.Cors,
|
WSOrigins: c.JsonRPC.Ws.Origins,
|
||||||
WSPathPrefix: c.JsonRPC.Ws.Prefix,
|
WSPathPrefix: c.JsonRPC.Ws.Prefix,
|
||||||
GraphQLCors: c.JsonRPC.Graphql.Cors,
|
GraphQLCors: c.JsonRPC.Graphql.Cors,
|
||||||
GraphQLVirtualHosts: c.JsonRPC.Graphql.VHost,
|
GraphQLVirtualHosts: c.JsonRPC.Graphql.VHost,
|
||||||
|
|
|
||||||
|
|
@ -363,17 +363,10 @@ func (c *Command) Flags() *flagset.Flagset {
|
||||||
Group: "JsonRPC",
|
Group: "JsonRPC",
|
||||||
})
|
})
|
||||||
f.SliceStringFlag(&flagset.SliceStringFlag{
|
f.SliceStringFlag(&flagset.SliceStringFlag{
|
||||||
Name: "ws.corsdomain",
|
Name: "ws.origins",
|
||||||
Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced)",
|
Usage: "Origins from which to accept websockets requests",
|
||||||
Value: &c.cliConfig.JsonRPC.Ws.Cors,
|
Value: &c.cliConfig.JsonRPC.Ws.Origins,
|
||||||
Default: c.cliConfig.JsonRPC.Ws.Cors,
|
Default: c.cliConfig.JsonRPC.Ws.Origins,
|
||||||
Group: "JsonRPC",
|
|
||||||
})
|
|
||||||
f.SliceStringFlag(&flagset.SliceStringFlag{
|
|
||||||
Name: "ws.vhosts",
|
|
||||||
Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.",
|
|
||||||
Value: &c.cliConfig.JsonRPC.Ws.VHost,
|
|
||||||
Default: c.cliConfig.JsonRPC.Ws.VHost,
|
|
||||||
Group: "JsonRPC",
|
Group: "JsonRPC",
|
||||||
})
|
})
|
||||||
f.SliceStringFlag(&flagset.SliceStringFlag{
|
f.SliceStringFlag(&flagset.SliceStringFlag{
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ var flagMap = map[string][]string{
|
||||||
"override.arrowglacier": {"notABoolFlag", "No"},
|
"override.arrowglacier": {"notABoolFlag", "No"},
|
||||||
"override.terminaltotaldifficulty": {"notABoolFlag", "No"},
|
"override.terminaltotaldifficulty": {"notABoolFlag", "No"},
|
||||||
"verbosity": {"notABoolFlag", "YesFV"},
|
"verbosity": {"notABoolFlag", "YesFV"},
|
||||||
"ws.origins": {"notABoolFlag", "YesF"},
|
"ws.origins": {"notABoolFlag", "No"},
|
||||||
}
|
}
|
||||||
|
|
||||||
// map from cli flags to corresponding toml tags
|
// map from cli flags to corresponding toml tags
|
||||||
|
|
@ -150,8 +150,7 @@ var nameTagMap = map[string]string{
|
||||||
"ipcpath": "ipcpath",
|
"ipcpath": "ipcpath",
|
||||||
"1-corsdomain": "http.corsdomain",
|
"1-corsdomain": "http.corsdomain",
|
||||||
"1-vhosts": "http.vhosts",
|
"1-vhosts": "http.vhosts",
|
||||||
"2-corsdomain": "ws.corsdomain",
|
"origins": "ws.origins",
|
||||||
"2-vhosts": "ws.vhosts",
|
|
||||||
"3-corsdomain": "graphql.corsdomain",
|
"3-corsdomain": "graphql.corsdomain",
|
||||||
"3-vhosts": "graphql.vhosts",
|
"3-vhosts": "graphql.vhosts",
|
||||||
"1-enabled": "http",
|
"1-enabled": "http",
|
||||||
|
|
@ -226,9 +225,8 @@ var replacedFlagsMapFlagAndValue = map[string]map[string]map[string]string{
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var replacedFlagsMapFlag = map[string]string{
|
// Do not remove
|
||||||
"ws.origins": "ws.corsdomain",
|
var replacedFlagsMapFlag = map[string]string{}
|
||||||
}
|
|
||||||
|
|
||||||
var currentBoolFlags = []string{
|
var currentBoolFlags = []string{
|
||||||
"snapshot",
|
"snapshot",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue