From a0cfae968fee6e12516d216307c4f8d83600908a Mon Sep 17 00:00:00 2001 From: "Constantin P." <papizh.konstantin@demlabs.net> Date: Fri, 8 Dec 2023 07:37:19 +0000 Subject: [PATCH] Develop sync 12.07 --- .gitlab-ci.yml | 47 ++++++++++++++++++----- README.md | 47 +++++++++++------------ cellframe-sdk | 2 +- dap-sdk | 2 +- dist.linux/share/update.sh | 17 +++++++- dist/share/configs/cellframe-node.cfg.tpl | 9 ++++- os/debian/postinst | 3 ++ python-cellframe | 2 +- scripts.darwin/create_configs.sh | 5 +++ scripts/create_configs_from_tpl.sh | 4 +- sources/main_node_tool.c | 9 ++++- version.mk | 2 +- 12 files changed, 104 insertions(+), 45 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 48704515e..244f0f80b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,12 +19,6 @@ stages: stage: build timeout: 3 hours 30 minutes dependencies: [] - artifacts: - paths: - - build_*/*.deb - -.debug_build: - extends: .build rules: - if: $CI_COMMIT_REF_NAME =~ /-asan$/ variables: @@ -34,8 +28,13 @@ stages: DAP_UBSAN: "1" - if: $CI_COMMIT_REF_NAME =~ /-tsan$/ variables: - DAP_TSAN: "1" - + DAP_TSAN: "1" + - if: $CI_COMMIT_REF_NAME =~ /.*$/ + variables: + DUMMY_VAR_FOR_ALLOW_JOB: "1" + artifacts: + paths: + - build_*/*.deb .publish: extends: .ci-polygon @@ -74,7 +73,7 @@ macos-amd64: - build_*/*.pkg linux-amd64-debian-buster-dbg: - extends: .debug_build + extends: .build image: demlabs/amd64/debian-buster:linuxbuilder before_script: /opt/buildtools/prepare_environment.sh amd64-linux script: @@ -108,7 +107,7 @@ linux-amd64-debian-buster: - ./prod_build/build.sh --target linux release -DBUILD_WITH_PYTHON_ENV=ON -DBUILD_DIAGTOOL=ON - ./prod_build/pack.sh --target linux release - /opt/buildtools/deploy_files.sh pub_cellframe linux/cellframe-node/$CI_COMMIT_REF_NAME/ build_*/*.deb - - /opt/buildtools/deploy_files.sh pub_cellframe linux/cellframe-node/$CI_COMMIT_REF_NAME/ build_linux_release/*-amd64.deb --redirect-from linux/cellframe-node/latest-amd64 + - /opt/buildtools/deploy_files.sh pub_cellframe linux/cellframe-node/$CI_COMMIT_REF_NAME/ build_linux_release/*-amd64.deb --redirect-from linux/cellframe-node/$CI_COMMIT_REF_NAME/latest-amd64 - anybadge -l "node version" -v "$(source version.mk; echo "$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH")" -f node-version-badge.svg -c blue - /opt/buildtools/deploy_files.sh pub_cellframe linux/cellframe-node/$CI_COMMIT_REF_NAME/ ./node-version-badge.svg || true @@ -133,6 +132,34 @@ linux-arm64-debian-bullseye: - /opt/buildtools/deploy_files.sh pub_cellframe linux/cellframe-node/$CI_COMMIT_REF_NAME/ build_*/*.deb - /opt/buildtools/deploy_files.sh pub_cellframe linux/cellframe-node/$CI_COMMIT_REF_NAME/ build_*/*arm64*.deb --redirect-from linux/cellframe-node/$CI_COMMIT_REF_NAME/latest-arm64 --just-redirect +linux-armhf-debian-bullseye-гupdtr: + extends: .build + image: demlabs/arm32v7/debian-bullseye:linuxbuilder + + when: manual + allow_failure: true + + before_script: /opt/buildtools/prepare_environment.sh armhf-linux + script: + - ./prod_build/build.sh --target linux release -DADD_UPDATER=ON + - ./prod_build/pack.sh --target linux release + - /opt/buildtools/deploy_files.sh pub_cellframe linux/cellframe-node/$CI_COMMIT_REF_NAME/ build_*/*.deb + - /opt/buildtools/deploy_files.sh pub_cellframe linux/cellframe-node/$CI_COMMIT_REF_NAME/ build_*/*armhf*.deb --redirect-from linux/cellframe-node/$CI_COMMIT_REF_NAME/latest-armhf --just-redirect + +linux-arm64-debian-bullseye-updtr: + extends: .build + image: demlabs/arm64v8/debian-bullseye:linuxbuilder + before_script: /opt/buildtools/prepare_environment.sh arm64-linux + + when: manual + allow_failure: true + + script: + - ./prod_build/build.sh --target linux release -DADD_UPDATER=ON + - ./prod_build/pack.sh --target linux release + - /opt/buildtools/deploy_files.sh pub_cellframe linux/cellframe-node/$CI_COMMIT_REF_NAME/ build_*/*.deb + - /opt/buildtools/deploy_files.sh pub_cellframe linux/cellframe-node/$CI_COMMIT_REF_NAME/ build_*/*arm64*.deb --redirect-from linux/cellframe-node/$CI_COMMIT_REF_NAME/latest-arm64 --just-redirect + .dpublish: extends: .publish diff --git a/README.md b/README.md index 7c23b7dcd..08b6c1531 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ Set ```true``` if you want to connect your node with ```Backbone``` (Mainnet) ### How to configure VPN service share - +To share VPN service you must have a node with master role. #### Node base configuration Open ```/opt/cellframe-node/etc/cellframe-node.cfg``` with command ```sudo nano /opt/cellframe-node/etc/cellframe-node.cfg``` and find next section: @@ -156,28 +156,23 @@ Open ```/opt/cellframe-node/etc/cellframe-node.cfg``` with command ```sudo nano # VPN stream channel processing module [srv_vpn] # Turn to true if you want to share VPN service from you node -enabled=false -# List of loca security access groups. Built in: expats,admins,services,nobody,everybody +enabled=true +# List of local security access groups. Built in: expats,admins,services,nobody,everybody network_address=10.11.12.0 network_mask=255.255.255.0 -#pricelist=[kelvin-testnet:0.00001:KELT:3600:SEC:mywallet0,kelvin-testnet:0.00001:cETH:3600:SEC:mywallet1,private:1:WOOD:10:SEC:mywallet0] +net=KelVPN +wallet_addr= +receipt_sign_cert=my_awesome_cert ``` Turn ```enabled``` parameter to ```true``` thats enable VPN service on your node. Then, the next lines ```network_address``` and ```network_mask``` usually you don't need to touch. Default configuration reserves network addresses for 254 connections at one time, if you have more - change network mask to smth like ```255.255.0.0``` and network address to ```10.11.0.0``` thats gives you 4095 local addresses. -Thats important - all the addresses are local and used only inside virtual private network (VPN). For this address and mask also should be configured OS - should be present DNS server, switched on IP4 forwarding and configured NAT. Example of such configurations are below: -Next line ```pricelist``` if commented out it shares service for free. +Thats important - all the addresses are local and used only inside virtual private network (VPN). For this address and mask also should be configured OS - should be present DNS server, switched on IP4 forwarding and configured NAT. Example of such configurations are below. +The next line ```net``` sets the name of the network on which the service will be shared. +Line ```wallet_addr``` sets the address of the wallet to which the payment for the service sharing will be sent. +Line ```receipt_sign_cert``` sets the name of the certificate for signing receipts. Must match the master node certificate. #### Pricelist config -Pricelist line has list of values, splitted with ```:``` symbol. What it means lets see in example ```kelvin-testnet:0.00001:KELT:3600:SEC:mywallet0```: - -1. ```minkowski``` thats the chain network name where the price token issued -2. ```0.00001``` price per units. Important: not for one unit but for all the units, in our example - for 1 hour. -3. ```KELT``` token ticker thats will be used for payments -4. ```3600``` units number thats costs price `0.00001` -5. ```SEC``` unit type, could be ```SEC``` for seconds, ```DAY``` for days, ```MB``` for megabyte. IMPORTANT: if selected ```MB``` accounting would be not by time but by used traffic amount -6.```mywallet``` wallet name for payments accommodation, should be created before with ```cellframe-node-cli```. Used for signing conditioned transactions with receipts therefore they pass values to the selected wallet. - -You could enter any number of such prices +To set the price for VPN services, you need to create an order with the corresponding values. An example of creating an order will be presented below. If you do not create an order and enable VPN sharing the service will not start. To share service for free turn ```allow_free_srv``` parameter in ```[srv_vpn]``` section to ```true``` and create order with zero price. #### DNS server install @@ -274,24 +269,28 @@ Here is cell `0x0000000000000001` used by default until we haven't finished cell To say world that you have VPN service you need to place order. First lets see the market, what orders are already present: ``` -sudo /opt/cellframe-node/bin/cellframe-node-cli net_srv -net minkowski order find -srv_uid 0x0000000000000001 -direction sell +sudo /opt/cellframe-node/bin/cellframe-node-cli net_srv -net KelVPN order find -srv_uid 0x0000000000000001 -direction sell ``` It should print list if you've syncronized well before (should happens automatically by default) -Anyway, lets create our order, changing price in it and in ```cellframe-node.cfg``` if you see in list thats market changed and you need to change prices as well. +Anyway, lets create our order, changing price in it if you see in list thats market changed and you need to change prices as well. Here is exmaple based on our pricelist in previous examples: -```sudo /opt/cellframe-node/bin/cellframe-node-cli net_srv -net minkowski order create -direction sell -srv_uid 1 -srv_class PERM -price_unit 2 -price_token KELT -price 100``` +```sudo /opt/cellframe-node/bin/cellframe-node-cli net_srv -net KelVPN order create -direction sell -srv_uid 1 -price_unit SEC -price_token KEL -price 100 -units 3600 -node_addr 374C::CEB5::6740::D93B -cert my_awesome_cert -region Russia -continent Europe``` + +And then you just wait some for network synchronisation and your order will see everybody. Next restart your node. Provide the hash of your order to the network administrator so that your node appears in the clients list of servers. -And then you just wait some for network synchronisation and your order will see everybody. Description of arguments * ```-direction``` buy or sell, for VPN service publishing it must be ```sell``` * ```-srv_uid``` Service UID, for VPN service set ```1``` -* ```-price_unit``` Set 2 for Seconds, 1 for Megabytes +* ```-price_unit``` Set SEC for Seconds * ```-price_token``` Token ticker -* ```-price``` Price for one unit, price for one second in our example - -Important: if you set price in configs for units set, 3600 in our example - here you set price for your single one unit, for one second in example. +* ```-units``` The number of units in one portion of the service, in this example 3600 seconds +* ```-price``` Price for the number of units specified in the parameter -units. In this example 100 datoshi for 3600 seconds of service. To share VPN service for free set this field to 0. +* ```-node_addr``` Address of node +* ```-cert``` Certificate of master node +* ```-region``` The region in which the node is located +* ```-continent``` The continent in which the node is located More details about order operations you could find with call ```sudo /opt/cellframe-node/bin/cellframe-node-cli help net_srv``` More details about cellframe node commands in call ```sudo /opt/cellframe-node/bin/cellframe-node-cli help``` diff --git a/cellframe-sdk b/cellframe-sdk index 04e6bbb39..ee26e335f 160000 --- a/cellframe-sdk +++ b/cellframe-sdk @@ -1 +1 @@ -Subproject commit 04e6bbb395cf322016ce20fec8cf7880e511de69 +Subproject commit ee26e335f9f943b4bdad6f7dc638a9afee696253 diff --git a/dap-sdk b/dap-sdk index 9b5420ed7..79146c12e 160000 --- a/dap-sdk +++ b/dap-sdk @@ -1 +1 @@ -Subproject commit 9b5420ed778c805bd0ea1009be64a63d9375c63b +Subproject commit 79146c12e8a59a9fe77e6ae54997a70791f8f036 diff --git a/dist.linux/share/update.sh b/dist.linux/share/update.sh index ad9385f1b..e15f4fe87 100755 --- a/dist.linux/share/update.sh +++ b/dist.linux/share/update.sh @@ -1,7 +1,22 @@ #! /bin/bash set -e STORAGE_URL=https://pub.cellframe.net/linux/cellframe-node/master/updates -REGEXP="href=\"cellframe-node-([0-9].[0-9]-[0-9]+)-updtr-amd64.deb" + +MACHINE=$(uname -m) + +POSTFIX="amd64" + +if [[ $MACHINE = "aarch64" ]]; then + POSTFIX="arm64" +fi +if [[ $MACHINE = "armv7l" ]]; then + POSTFIX="armhf" +fi + +REGEXP="href=\"cellframe-node-([0-9].[0-9]-[0-9]+)-updtr-${POSTFIX}.deb" + +echo "Looking for regexp: $REGEXP" + INSTALLED_VERSION=$(dpkg -l | awk '$2=="cellframe-node" { print $3 }') echo "Cellframe-node installed: $INSTALLED_VERSION" diff --git a/dist/share/configs/cellframe-node.cfg.tpl b/dist/share/configs/cellframe-node.cfg.tpl index 519ed0cc8..c27e07214 100644 --- a/dist/share/configs/cellframe-node.cfg.tpl +++ b/dist/share/configs/cellframe-node.cfg.tpl @@ -106,7 +106,12 @@ 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 -pricelist=[cellframe-testnet:100:KELT:3600:SEC:mywallet0] +# The network on which the service operates +#net=KelVPN +# Wallet address for transferring payment for the service. +#wallet_addr= +# The name of the certificate for signing receipts. Must match the master node certificate. +#receipt_sign_cert= # Console interface server [conserver] @@ -132,7 +137,7 @@ wallets_path={PREFIX}/var/lib/wallet ca_folders=[{PREFIX}/var/lib/ca,{PREFIX}/share/ca] [global_db] -driver=mdbx +driver={DB_DRIVER} path={PREFIX}/var/lib/global_db #debug_more=true diff --git a/os/debian/postinst b/os/debian/postinst index b6a874d84..b2ca9596c 100755 --- a/os/debian/postinst +++ b/os/debian/postinst @@ -71,6 +71,9 @@ sed -i "s/{NOTIFY_SRV_ADDR}/$RET/g" $DAP_CFG || true db_get cellframe-node/notify_srv_port || true sed -i "s/{NOTIFY_SRV_PORT}/$RET/g" $DAP_CFG || true +#set db driver to mdbx for debian +sed -i "s/{DB_DRIVER}/mdbx/g" $DAP_CFG || true + # Init subzero NET_NAME="subzero" diff --git a/python-cellframe b/python-cellframe index e56031f6c..1a88015f9 160000 --- a/python-cellframe +++ b/python-cellframe @@ -1 +1 @@ -Subproject commit e56031f6c59e26277cf933f6e26c50d6d7041a25 +Subproject commit 1a88015f9df8271718e0c4a2f243242d7b31e5a6 diff --git a/scripts.darwin/create_configs.sh b/scripts.darwin/create_configs.sh index a3eea5758..b6a923ae7 100755 --- a/scripts.darwin/create_configs.sh +++ b/scripts.darwin/create_configs.sh @@ -47,8 +47,13 @@ export DAP_KELVPN_MINKOWSKI_ROLE=full export DAP_MILEENA_ENABLED=false export DAP_MILEENA_ROLE=full +export DAP_DB_DRIVER=sqlite + echo "Init configs with prefix " $DAP_PREFIX echo $(pwd) echo $(env) ${DAP_INST_DIR}/Contents/Resources/create_configs_from_tpl.sh + +DAP_CFG="$DAP_PREFIX/etc/$DAP_APP_NAME.cfg" +sed -i .old "s/driver=mdbx/driver=${DAP_DB_DRIVER}/g" $DAP_CFG || true \ No newline at end of file diff --git a/scripts/create_configs_from_tpl.sh b/scripts/create_configs_from_tpl.sh index 61c9beab4..c016d300e 100755 --- a/scripts/create_configs_from_tpl.sh +++ b/scripts/create_configs_from_tpl.sh @@ -22,11 +22,10 @@ fi [ "$DAP_SERVER_ADDR" ] || DAP_SERVER_ADDR="0.0.0.0" [ "$NOTIFY_SRV_ADDR" ] || NOTIFY_SRV_ADDR="127.0.0.1" [ "$NOTIFY_SRV_PORT" ] || NOTIFY_SRV_PORT="8080" +[ "$DAP_DB_DRIVER" ] || DAP_DB_DRIVER="mdbx" DAP_CFG_TPL="$DAP_PREFIX/share/configs/$DAP_APP_NAME.cfg.tpl" - - # Init node config if [ ! -e "$DAP_CFG" ]; then DAP_CFG="$DAP_PREFIX/etc/$DAP_APP_NAME.cfg" @@ -47,6 +46,7 @@ sed -i .old "s/{SERVER_ADDR}/$DAP_SERVER_ADDR/g" $DAP_CFG || true sed -i .old "s/{NOTIFY_SRV_ADDR}/$NOTIFY_SRV_ADDR/g" $DAP_CFG || true sed -i .old "s/{NOTIFY_SRV_PORT}/$NOTIFY_SRV_PORT/g" $DAP_CFG || true sed -i .old "s/{PREFIX}/$DAP_PREFIX_TPL/g" $DAP_CFG || true +sed -i .old "s/{DB_DRIVER}/$DAP_DB_DRIVER/g" $DAP_CFG || true rm $DAP_CFG.old # Init chains diff --git a/sources/main_node_tool.c b/sources/main_node_tool.c index c929f5929..c9bb0a73c 100644 --- a/sources/main_node_tool.c +++ b/sources/main_node_tool.c @@ -283,9 +283,9 @@ static int s_cert_create(int argc, const char **argv) { // // Check unsupported tesla algorithm // - if (dap_strcmp (argv[4],"sig_tesla") == 0) + if((dap_strcmp (argv[4],"sig_tesla") == 0)||(dap_strcmp (argv[4],"sig_picnic") == 0)) { - log_it( L_ERROR, "Tesla algorithm is not supported, please, use another variant"); + log_it( L_ERROR, "Tesla and Picnic algorithms are not supported, please, use another variant"); exit(-600); } @@ -461,6 +461,11 @@ static int s_init( int argc, const char **argv ) #elif DAP_OS_UNIX g_sys_dir_path = dap_strdup_printf("/opt/%s", dap_get_appname()); #endif + if (dap_common_init(dap_get_appname(), NULL, NULL) != 0) { + printf("Fatal Error: Can't init common functions module"); + return -2; + } + dap_log_level_set(L_ERROR); char l_config_dir[MAX_PATH] = {'\0'}; sprintf(l_config_dir, "%s/etc", g_sys_dir_path); dap_config_init(l_config_dir); diff --git a/version.mk b/version.mk index 7083acd69..59ef1f05b 100644 --- a/version.mk +++ b/version.mk @@ -1,3 +1,3 @@ VERSION_MAJOR=5 VERSION_MINOR=3 -VERSION_PATCH=25 +VERSION_PATCH=27 -- GitLab