73f0a6cbd0 doc: detail -rpccookieperms option (willcl-ark)
d2afa2690c test: add rpccookieperms test (willcl-ark)
f467aede78 init: add option for rpccookie permissions (willcl-ark)
7df03f1a92 util: add perm string helper functions (willcl-ark)
Pull request description:
This PR picks up #26088 by aureleoules which adds a bitcoind launch option `-rpccookieperms` to set the file permissions of the cookie generated by bitcoin core.
Example usage to make the generated cookie group-readable: `./src/bitcoind -rpccookieperms=group`.
Accepted values for `-rpccookieperms` are `[owner|group|all]`. We let `fs::perms` handle platform-specific permissions changes.
ACKs for top commit:
achow101:
ACK 73f0a6cbd0
ryanofsky:
Code review ACK 73f0a6cbd0. Main change since last review is no longer throwing a skip exception in the rpc test on windows, so other checks can run after it, and overall test result is passing, not skipped. Also were clarifying renames and documentation improvements.
tdb3:
cr ACK 73f0a6cbd0
Tree-SHA512: e800d59a44aca10e1c58ca69bf3fdde9f6ccf5eab4b7b962645af6d6bc0cfa3a357701e409c8c60d8d7744fcd33a91e77ada11790aa88cd7811ef60fab86ab11
argsman.AddArg("-rpcbind=<addr>[:port]","Bind to given address to listen for JSON-RPC connections. Do not expose the RPC server to untrusted networks such as the public internet! This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost)",ArgsManager::ALLOW_ANY|ArgsManager::NETWORK_ONLY,OptionsCategory::RPC);
argsman.AddArg("-rpcbind=<addr>[:port]","Bind to given address to listen for JSON-RPC connections. Do not expose the RPC server to untrusted networks such as the public internet! This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost)",ArgsManager::ALLOW_ANY|ArgsManager::NETWORK_ONLY,OptionsCategory::RPC);
argsman.AddArg("-rpcdoccheck",strprintf("Throw a non-fatal error at runtime if the documentation for an RPC is incorrect (default: %u)",DEFAULT_RPC_DOC_CHECK),ArgsManager::ALLOW_ANY|ArgsManager::DEBUG_ONLY,OptionsCategory::RPC);
argsman.AddArg("-rpcdoccheck",strprintf("Throw a non-fatal error at runtime if the documentation for an RPC is incorrect (default: %u)",DEFAULT_RPC_DOC_CHECK),ArgsManager::ALLOW_ANY|ArgsManager::DEBUG_ONLY,OptionsCategory::RPC);
argsman.AddArg("-rpccookiefile=<loc>","Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)",ArgsManager::ALLOW_ANY,OptionsCategory::RPC);
argsman.AddArg("-rpccookiefile=<loc>","Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)",ArgsManager::ALLOW_ANY,OptionsCategory::RPC);
argsman.AddArg("-rpccookieperms=<readable-by>",strprintf("Set permissions on the RPC auth cookie file so that it is readable by [owner|group|all] (default: owner [via umask 0077])"),ArgsManager::ALLOW_ANY,OptionsCategory::RPC);
argsman.AddArg("-rpcpassword=<pw>","Password for JSON-RPC connections",ArgsManager::ALLOW_ANY|ArgsManager::SENSITIVE,OptionsCategory::RPC);
argsman.AddArg("-rpcpassword=<pw>","Password for JSON-RPC connections",ArgsManager::ALLOW_ANY|ArgsManager::SENSITIVE,OptionsCategory::RPC);
argsman.AddArg("-rpcport=<port>",strprintf("Listen for JSON-RPC connections on <port> (default: %u, testnet: %u, signet: %u, regtest: %u)",defaultBaseParams->RPCPort(),testnetBaseParams->RPCPort(),signetBaseParams->RPCPort(),regtestBaseParams->RPCPort()),ArgsManager::ALLOW_ANY|ArgsManager::NETWORK_ONLY,OptionsCategory::RPC);
argsman.AddArg("-rpcport=<port>",strprintf("Listen for JSON-RPC connections on <port> (default: %u, testnet: %u, signet: %u, regtest: %u)",defaultBaseParams->RPCPort(),testnetBaseParams->RPCPort(),signetBaseParams->RPCPort(),regtestBaseParams->RPCPort()),ArgsManager::ALLOW_ANY|ArgsManager::NETWORK_ONLY,OptionsCategory::RPC);
argsman.AddArg("-rpcservertimeout=<n>",strprintf("Timeout during HTTP requests (default: %d)",DEFAULT_HTTP_SERVER_TIMEOUT),ArgsManager::ALLOW_ANY|ArgsManager::DEBUG_ONLY,OptionsCategory::RPC);
argsman.AddArg("-rpcservertimeout=<n>",strprintf("Timeout during HTTP requests (default: %d)",DEFAULT_HTTP_SERVER_TIMEOUT),ArgsManager::ALLOW_ANY|ArgsManager::DEBUG_ONLY,OptionsCategory::RPC);