diff --git a/.gitmodules b/.gitmodules index dcac5fba3b30e5c561be87920eed2177945dfccd..f8507c5701f846483bb94febae70684475d3b162 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,8 +5,8 @@ [submodule "python-cellframe"] path = python-cellframe url = ../python-cellframe.git - branch = master + branch = testing [submodule "cellframe-sdk"] path = cellframe-sdk url = ../cellframe-sdk.git - branch = master + branch = testing diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bc7794306fab7c87f1e2673134529762b16f32d..c445bad4f88ae68089edb6da9d13529a6feab2b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_C_STANDARD 11) # Predefine project SET( CPACK_PACKAGE_NAME "${PROJECT_NAME}") -SET( CPACK_PACKAGE_VERSION_MAJOR 3) -SET( CPACK_PACKAGE_VERSION_MINOR 6) -SET( CPACK_PACKAGE_VERSION_PATCH 2) +SET( CPACK_PACKAGE_VERSION_MAJOR 4) +SET( CPACK_PACKAGE_VERSION_MINOR 0) +SET( CPACK_PACKAGE_VERSION_PATCH 39) # init CellFrame SDK diff --git a/cellframe-sdk b/cellframe-sdk index 139a298a2ec138a687513f09bf24650df58cc13f..4bf1e72cc2cd23a288475a5bc352b65468a18f81 160000 --- a/cellframe-sdk +++ b/cellframe-sdk @@ -1 +1 @@ -Subproject commit 139a298a2ec138a687513f09bf24650df58cc13f +Subproject commit 4bf1e72cc2cd23a288475a5bc352b65468a18f81 diff --git a/dist/share/configs/cellframe-node.cfg.tpl b/dist/share/configs/cellframe-node.cfg.tpl index c1bb32634c98521b67005a838a373fb5510bc98b..aad44a337c9e609cf0cfc120f96bb55a6b1a3817 100755 --- a/dist/share/configs/cellframe-node.cfg.tpl +++ b/dist/share/configs/cellframe-node.cfg.tpl @@ -20,7 +20,7 @@ bugreport_url_enabled=false # Builtin DNS server [dns_server] enabled=false -bootstrap_balancer=true +bootstrap_balancer=false [srv] order_signed_only=false @@ -55,6 +55,9 @@ registration_open=true # Turn to true if you want to share VPN service from you node enabled=false geoip_enabled=false + +# Switch on debug_more to true if you want to see info about any packet passed through +debug_more=false # List of loca security access groups. Built in: expats,admins,services,nobody,everybody network_address=10.11.12.0 network_mask=255.255.255.0 diff --git a/prod_build/linux/debian/scripts/deploy.sh b/prod_build/linux/debian/scripts/deploy.sh index 7a91b3cea353557f016747014ca05c431af9ca5f..64d02ccd29c8993f5cadd9fb5ea33cc8c9f9abb2 100755 --- a/prod_build/linux/debian/scripts/deploy.sh +++ b/prod_build/linux/debian/scripts/deploy.sh @@ -28,7 +28,9 @@ for pkgfile in $PKGFILES; do CODENAME=$(echo $pkgname | rev | cut -d '-' -f1 | rev) cp -r ../prod_build/general/essentials/weblink-latest ../prod_build/general/essentials/$pkgname_weblink sed -i "/document/s/cellframe.*deb/$pkgname_public$MOD.deb/" ../prod_build/general/essentials/$pkgname_weblink/index.php - if [[ $(echo $CI_COMMIT_REF_NAME | grep "master\|^release") ]]; then + if [[ $(echo $CI_COMMIT_REF_NAME | grep "master\|^release") != "" ]]; then + echo "REF_NAME is $CI_COMMIT_REF_NAME" + ssh -i $CELLFRAME_REPO_KEY "$CELLFRAME_FILESERVER_CREDS" "mkdir -p $CELLFRAME_FILESERVER_PATH/$SUBDIR" scp -i $CELLFRAME_REPO_KEY $wd/$PACKAGE_PATH/$pkgname$MOD.deb "$CELLFRAME_FILESERVER_CREDS:$CELLFRAME_FILESERVER_PATH/$SUBDIR/$pkgname_public$MOD.deb" scp -r -i $CELLFRAME_REPO_KEY ../prod_build/general/essentials/$pkgname_weblink "$CELLFRAME_FILESERVER_CREDS:$CELLFRAME_FILESERVER_PATH/$SUBDIR/" if [[ $CI_COMMIT_REF_NAME == "master" ]]; then diff --git a/python-cellframe b/python-cellframe index c5fce4f8d55f9b956fcc1e9b05ccf2459f604c86..d2d1011c82454a886c3e66b0580ae65c89540076 160000 --- a/python-cellframe +++ b/python-cellframe @@ -1 +1 @@ -Subproject commit c5fce4f8d55f9b956fcc1e9b05ccf2459f604c86 +Subproject commit d2d1011c82454a886c3e66b0580ae65c89540076 diff --git a/sources/main.c b/sources/main.c index 2fe6e2113436b4ab28ffa609a64b2d80dc4b1a4a..ad3f32163f1c3b5d740ebe54f75af12266b3bde1 100755 --- a/sources/main.c +++ b/sources/main.c @@ -104,13 +104,12 @@ #include "dap_chain_net_srv_stake.h" #include "dap_common.h" -#include "dap_client_remote.h" +#include "dap_events_socket.h" #include "dap_client.h" #include "dap_http_client.h" //#include "dap_http_client_simple.h" #include "dap_http_simple.h" #include "dap_process_manager.h" -#include "dap_traffic_track.h" #include "dap_defines.h" #include "dap_file_utils.h" @@ -222,22 +221,25 @@ int main( int argc, const char **argv ) l_thread_cnt = si.dwNumberOfProcessors; #endif } - - bServerEnabled = dap_config_get_item_bool_default( g_config, "server", "enabled", false ); - - log_it ( L_DEBUG,"config server->enabled = \"%u\" ", bServerEnabled ); - - if ( bServerEnabled && dap_server_init(l_thread_cnt) != 0 ) { - log_it( L_CRITICAL, "Can't init socket server module" ); - return -4; - } + if ( dap_enc_init() != 0 ){ + log_it( L_CRITICAL, "Can't init encryption module" ); + return -56; + } // New event loop init dap_events_init( 0, 0 ); dap_events_t *l_events = dap_events_new( ); dap_events_start( l_events ); - dap_client_init(); + bServerEnabled = dap_config_get_item_bool_default( g_config, "server", "enabled", false ); + + log_it ( L_DEBUG,"config server->enabled = \"%u\" ", bServerEnabled ); + + if ( bServerEnabled && dap_server_init() != 0 ) { + log_it( L_CRITICAL, "Can't init socket server module" ); + return -4; + } + if ( dap_http_init() != 0 ) { log_it( L_CRITICAL, "Can't init http server module" ); @@ -248,11 +250,28 @@ int main( int argc, const char **argv ) log_it( L_CRITICAL, "Can't init http server module" ); return -55; } + if ( dap_http_simple_module_init() != 0 ) { + log_it(L_CRITICAL,"Can't init http simple module"); + return -9; + } + + if ( enc_http_init() != 0 ) { + log_it( L_CRITICAL, "Can't init encryption http session storage module" ); + return -81; + } + + if ( dap_stream_init(dap_config_get_item_bool_default(g_config,"general","debug_dump_stream_headers",false)) != 0 ) { + log_it( L_CRITICAL, "Can't init stream server module" ); + return -82; + } + + if ( dap_stream_ctl_init(DAP_ENC_KEY_TYPE_OAES, 32) != 0 ){ + log_it( L_CRITICAL, "Can't init stream control module" ); + return -83; + } + + dap_client_init(); - if ( dap_enc_init() != 0 ){ - log_it( L_CRITICAL, "Can't init encryption module" ); - return -56; - } if ( dap_chain_global_db_init(g_config) ) { log_it( L_CRITICAL, "Can't init global db module" ); @@ -344,26 +363,6 @@ int main( int argc, const char **argv ) } } - if ( enc_http_init() != 0 ) { - log_it( L_CRITICAL, "Can't init encryption http session storage module" ); - return -81; - } - - if ( dap_stream_init(dap_config_get_item_bool_default(g_config,"general","debug_dump_stream_headers",false)) != 0 ) { - log_it( L_CRITICAL, "Can't init stream server module" ); - return -82; - } - - if ( dap_stream_ctl_init(DAP_ENC_KEY_TYPE_OAES, 32) != 0 ){ - log_it( L_CRITICAL, "Can't init stream control module" ); - return -83; - } - - if ( dap_http_simple_module_init() != 0 ) { - log_it(L_CRITICAL,"Can't init http simple module"); - return -9; - } - if ( dap_chain_node_cli_init(g_config) ) { log_it( L_CRITICAL, "Can't init server for console" ); return -11; @@ -384,10 +383,8 @@ int main( int argc, const char **argv ) } #endif - if (dap_chain_node_mempool_init()) { - log_it( L_CRITICAL, "Can't init automatic mempool processing" ); - return -13; - } + log_it(L_INFO, "Automatic mempool processing %s", + dap_chain_node_mempool_autoproc_init() ? "enabled" : "disabled"); save_process_pid_in_file(s_pid_file_path); @@ -396,7 +393,7 @@ int main( int argc, const char **argv ) int32_t l_port = dap_config_get_item_int32(g_config, "server", "listen_port_tcp"); if( l_port > 0 ) { - l_server = dap_server_listen((dap_config_get_item_str(g_config, "server", "listen_address")), + l_server = dap_server_new(l_events, (dap_config_get_item_str(g_config, "server", "listen_address")), (uint16_t) l_port, DAP_SERVER_TCP ); } else @@ -479,15 +476,8 @@ int main( int argc, const char **argv ) dap_chain_plugins_init(g_config); #endif - if (bServerEnabled) { - // Endless loop for server's requests processing - rc = dap_server_loop(l_server); - // After loop exit actions - log_it( rc ? L_CRITICAL : L_NOTICE, "Server loop stopped with return code %d", rc ); - } else { - dap_events_wait(l_events); - } - + rc = dap_events_wait(l_events); + log_it( rc ? L_CRITICAL : L_NOTICE, "Server loop stopped with return code %d", rc ); // Deinit modules //failure: @@ -502,7 +492,7 @@ int main( int argc, const char **argv ) dap_http_deinit(); if (bServerEnabled) dap_server_deinit(); dap_enc_ks_deinit(); - dap_chain_node_mempool_deinit(); + dap_chain_node_mempool_autoproc_deinit(); dap_chain_net_srv_xchange_deinit(); dap_chain_net_srv_stake_deinit();