Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare v3.0.5 to develop #143

Merged
merged 29 commits into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ec710db
Update fc & chainbase to support boost 1.7
Oct 22, 2019
6073b62
Correct cpu_usage calculation when more than one signature
Aug 27, 2019
6bb2e88
Use calculation that avoids possible negative values
Aug 27, 2019
7370bd8
Use new reflect_init tag to indicate reflector_init() should be called
Feb 20, 2019
bcea2f1
Update for boost-1-70-0
May 6, 2019
f41b34d
remove bnet_plugin
Apr 16, 2019
ab570a0
Move json::to_string to http thread pool
Mar 7, 2019
e03c624
Add get_supported_apis rpc api
Jan 8, 2019
8ce1d34
Remove redundant macro
Jan 12, 2019
27c3ff8
Exclude get_supported_apis itself from result
Jan 12, 2019
89c991c
Revert ability to customize name of http_plugin options
Jan 14, 2019
fe3e957
Remove queued HTTP handler registration
Jan 30, 2019
55f38cb
Move json::to_string processing to http thread pool
Mar 7, 2019
05228d9
update to boost 1.7
Oct 25, 2019
c2e10cc
update build script for ubuntu
Oct 25, 2019
e8f3c31
update more build scripts
Oct 29, 2019
43cf809
update chainbase
Oct 30, 2019
db4d977
fix http_plugin; emit lib;
Nov 22, 2019
00922a7
emit new lib to a separate channel.
Nov 25, 2019
d4a2d7a
Downgrade chainbase
Frank-AFN Feb 4, 2020
3f74e5c
Downgrade cmake to 4.0 and change Dockerfile
Frank-AFN Feb 5, 2020
061784f
rename eosbuilder in docker file
Frank-AFN Feb 5, 2020
1943333
Merge pull request #139 from boscore/develop
Thaipanda Feb 12, 2020
5ac5f0d
Remove chainbase env check
Frank-AFN Feb 12, 2020
e53180d
Modify dockerfile
Frank-AFN Feb 12, 2020
34bf0b5
Merge pull request #141 from eosiosg/update-boost-downgrade-chainbase
Thaipanda Feb 12, 2020
e075d24
adjust for boscore/builder v2.0.4
Thaipanda Feb 12, 2020
67fbc95
prepare to release v3.0.5
Thaipanda Feb 13, 2020
6ab5c6e
update the document. Using technology to create a trusted business ec…
Thaipanda Feb 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert ability to customize name of http_plugin options
Once upon a time it was thought we may change the http_plugin option names per application. For example, nodeos would be http-server-address but keosd would be keosd-http-server-address. Ultimately this was not done, so remove this code to make the http option code simple again

(cherry picked from commit 401848a)
  • Loading branch information
vince authored and VincentOCL committed Oct 25, 2019
commit 89c991c515f2eaa2b8560196aeccd140c4173d0a
33 changes: 10 additions & 23 deletions plugins/http_plugin/http_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,6 @@ namespace eosio {
bool validate_host;
set<string> valid_hosts;

string unix_socket_path_option_name = "unix-socket-path";
string http_server_address_option_name = "http-server-address";
string https_server_address_option_name = "https-server-address";

bool host_port_is_valid( const std::string& header_host_port, const string& endpoint_local_host_port ) {
return !validate_host || header_host_port == endpoint_local_host_port || valid_hosts.find(header_host_port) != valid_hosts.end();
}
Expand Down Expand Up @@ -328,14 +324,6 @@ namespace eosio {
valid_hosts.emplace(host + ":" + port);
valid_hosts.emplace(host + ":" + resolved_port_str);
}

void mangle_option_names() {
if(current_http_plugin_defaults.address_config_prefix.empty())
return;
unix_socket_path_option_name.insert(0, current_http_plugin_defaults.address_config_prefix+"-");
http_server_address_option_name.insert(0, current_http_plugin_defaults.address_config_prefix+"-");
https_server_address_option_name.insert(0, current_http_plugin_defaults.address_config_prefix+"-");
}
};

template<>
Expand All @@ -347,23 +335,22 @@ namespace eosio {
http_plugin::~http_plugin(){}

void http_plugin::set_program_options(options_description&, options_description& cfg) {
my->mangle_option_names();
if(current_http_plugin_defaults.default_unix_socket_path.length())
cfg.add_options()
(my->unix_socket_path_option_name.c_str(), bpo::value<string>()->default_value(current_http_plugin_defaults.default_unix_socket_path),
("unix-socket-path", bpo::value<string>()->default_value(current_http_plugin_defaults.default_unix_socket_path),
"The filename (relative to data-dir) to create a unix socket for HTTP RPC; set blank to disable.");

if(current_http_plugin_defaults.default_http_port)
cfg.add_options()
(my->http_server_address_option_name.c_str(), bpo::value<string>()->default_value("127.0.0.1:" + std::to_string(current_http_plugin_defaults.default_http_port)),
("http-server-address", bpo::value<string>()->default_value("127.0.0.1:" + std::to_string(current_http_plugin_defaults.default_http_port)),
"The local IP and port to listen for incoming http connections; set blank to disable.");
else
cfg.add_options()
(my->http_server_address_option_name.c_str(), bpo::value<string>(),
("http-server-address", bpo::value<string>(),
"The local IP and port to listen for incoming http connections; leave blank to disable.");

cfg.add_options()
(my->https_server_address_option_name.c_str(), bpo::value<string>(),
("https-server-address", bpo::value<string>(),
"The local IP and port to listen for incoming https connections; leave blank to disable.")

("https-certificate-chain-file", bpo::value<string>(),
Expand Down Expand Up @@ -412,8 +399,8 @@ namespace eosio {
}

tcp::resolver resolver( app().get_io_service());
if( options.count( my->http_server_address_option_name ) && options.at( my->http_server_address_option_name ).as<string>().length()) {
string lipstr = options.at( my->http_server_address_option_name ).as<string>();
if( options.count( "http-server-address" ) && options.at( "http-server-address" ).as<string>().length()) {
string lipstr = options.at( "http-server-address" ).as<string>();
string host = lipstr.substr( 0, lipstr.find( ':' ));
string port = lipstr.substr( host.size() + 1, lipstr.size());
tcp::resolver::query query( tcp::v4(), host.c_str(), port.c_str());
Expand All @@ -431,14 +418,14 @@ namespace eosio {
}
}

if( options.count( my->unix_socket_path_option_name ) && !options.at( my->unix_socket_path_option_name ).as<string>().empty()) {
boost::filesystem::path sock_path = options.at(my->unix_socket_path_option_name).as<string>();
if( options.count( "unix-socket-path" ) && !options.at( "unix-socket-path" ).as<string>().empty()) {
boost::filesystem::path sock_path = options.at("unix-socket-path").as<string>();
if (sock_path.is_relative())
sock_path = app().data_dir() / sock_path;
my->unix_endpoint = asio::local::stream_protocol::endpoint(sock_path.string());
}

if( options.count( my->https_server_address_option_name ) && options.at( my->https_server_address_option_name ).as<string>().length()) {
if( options.count( "https-server-address" ) && options.at( "https-server-address" ).as<string>().length()) {
if( !options.count( "https-certificate-chain-file" ) ||
options.at( "https-certificate-chain-file" ).as<string>().empty()) {
elog( "https-certificate-chain-file is required for HTTPS" );
Expand All @@ -450,7 +437,7 @@ namespace eosio {
return;
}

string lipstr = options.at( my->https_server_address_option_name ).as<string>();
string lipstr = options.at( "https-server-address" ).as<string>();
string host = lipstr.substr( 0, lipstr.find( ':' ));
string port = lipstr.substr( host.size() + 1, lipstr.size());
tcp::resolver::query query( tcp::v4(), host.c_str(), port.c_str());
Expand Down
3 changes: 0 additions & 3 deletions plugins/http_plugin/include/eosio/http_plugin/http_plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ namespace eosio {
using api_description = std::map<string, url_handler>;

struct http_plugin_defaults {
//If not empty, this string is prepended on to the various configuration
// items for setting listen addresses
string address_config_prefix;
//If empty, unix socket support will be completely disabled. If not empty,
// unix socket support is enabled with the given default path (treated relative
// to the datadir)
Expand Down
1 change: 0 additions & 1 deletion programs/keosd/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ int main(int argc, char** argv)
app().set_default_data_dir(home / "eosio-wallet");
app().set_default_config_dir(home / "eosio-wallet");
http_plugin::set_defaults({
.address_config_prefix = "",
.default_unix_socket_path = keosd::config::key_store_executable_name + ".sock",
.default_http_port = 0
});
Expand Down
1 change: 0 additions & 1 deletion programs/nodeos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ int main(int argc, char** argv)
app().set_default_data_dir(root / "eosio/nodeos/data" );
app().set_default_config_dir(root / "eosio/nodeos/config" );
http_plugin::set_defaults({
.address_config_prefix = "",
.default_unix_socket_path = "",
.default_http_port = 8888
});
Expand Down