diff --git a/Dockerfile b/Dockerfile index 91c7c04..731a8f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,8 +32,8 @@ RUN --mount=type=bind,source=src,target=src \ --mount=type=cache,target=/usr/src/openlan-cgw/target \ --mount=type=cache,target=/usr/local/cargo/git/db \ --mount=type=cache,target=/usr/local/cargo/registry \ - RUSTFLAGS="-g -C symbol-mangling-version=v0" cargo build --target x86_64-unknown-linux-gnu && \ - cp target/x86_64-unknown-linux-gnu/debug/ucentral-cgw /usr/local/bin + cargo build --target x86_64-unknown-linux-gnu --release && \ + cp target/x86_64-unknown-linux-gnu/release/ucentral-cgw /usr/local/bin CMD ["echo", "CGW build finished successfully!"] diff --git a/run_cgw.sh b/run_cgw.sh index c37a424..15f3d75 100755 --- a/run_cgw.sh +++ b/run_cgw.sh @@ -111,7 +111,7 @@ docker run \ -e CGW_DB_PASSWORD \ -e CGW_REDIS_HOST \ -e CGW_REDIS_PORT \ - -e CGW_FEATURE_TOPOMAP_DISABLE \ + -e CGW_FEATURE_TOPOMAP_ENABLE \ -e CGW_METRICS_PORT \ -e CGW_ALLOW_CERT_MISMATCH \ -d -t --network=host --name $2 $1 ucentral-cgw diff --git a/src/main.rs b/src/main.rs index 55d4b47..a50a710 100644 --- a/src/main.rs +++ b/src/main.rs @@ -95,7 +95,7 @@ const CGW_DEFAULT_REDIS_HOST: &str = "localhost"; const CGW_DEFAULT_REDIS_PORT: u16 = 6379; const CGW_DEFAULT_ALLOW_CERT_MISMATCH: &str = "no"; const CGW_DEFAULT_METRICS_PORT: u16 = 8080; -const CGW_DEFAULT_TOPOMAP_STATE: bool = true; +const CGW_DEFAULT_TOPOMAP_STATE: bool = false; /// CGW server pub struct AppArgs { @@ -397,8 +397,8 @@ impl AppArgs { Err(_) => CGW_DEFAULT_METRICS_PORT, }; - let feature_topomap_enabled: bool = match env::var("CGW_FEATURE_TOPOMAP_DISABLE") { - Ok(_) => false, + let feature_topomap_enabled: bool = match env::var("CGW_FEATURE_TOPOMAP_ENABLE") { + Ok(_) => true, Err(_) => CGW_DEFAULT_TOPOMAP_STATE, }; @@ -637,8 +637,8 @@ async fn main() -> Result<()> { // Configure logger setup_logger(args.log_level); - if !args.feature_topomap_enabled { - warn!("CGW_FEATURE_TOPOMAP_DISABLE is set, TOPO MAP feature will be disabled (realtime events / state processing)"); + if args.feature_topomap_enabled { + warn!("CGW_FEATURE_TOPOMAP_ENABLE is set, TOPO MAP feature (unstable) will be enabled (realtime events / state processing) - heavy performance drop with high number of devices connected could be observed"); } info!( diff --git a/utils/client_simulator/src/utils.py b/utils/client_simulator/src/utils.py index c6f44f4..ee1f5fc 100644 --- a/utils/client_simulator/src/utils.py +++ b/utils/client_simulator/src/utils.py @@ -64,7 +64,7 @@ def parse_args(): parser.add_argument("-c", "--client-certs-path", metavar="PATH", default="./certs/client", help="path to client certificates directory") - parser.add_argument("-C", "--no-cert-check", type=bool, action='store_true', + parser.add_argument("-C", "--no-cert-check", action='store_true', default=False, help="do not check certificate") parser.add_argument("-t", "--msg-interval", metavar="SECONDS", type=int, @@ -78,13 +78,17 @@ def parse_args(): parsed_args = parser.parse_args() + no_cert_check = False + if parsed_args.no_cert_check is not None: + no_cert_check = True + args = Args(number_of_connections=parsed_args.number_of_connections, masks=parsed_args.mac_mask, ca_path=parsed_args.ca_cert, cert_path=parsed_args.client_certs_path, msg_interval=parsed_args.msg_interval, msg_size=parse_msg_size(parsed_args.payload_size), - check_certs=not parsed_args.no_cert_check, + check_cert=not no_cert_check, wait_for_sig=parsed_args.wait_for_signal) if len(args.masks) == 0: diff --git a/utils/kafka_producer/src/cli_parser.py b/utils/kafka_producer/src/cli_parser.py index 4e64884..8b387d7 100644 --- a/utils/kafka_producer/src/cli_parser.py +++ b/utils/kafka_producer/src/cli_parser.py @@ -44,8 +44,8 @@ def parse_args(): help="remove mac addrs from a group") parser.add_argument("-T", "--topic", default="CnC", help="kafka topic (default: \"CnC\")") - parser.add_argument("-s", "--bootstrap-server", metavar="ADDRESS", default="172.20.10.136:9092", - help="kafka address (default: \"172.20.10.136:9092\")") + parser.add_argument("-s", "--bootstrap-server", metavar="ADDRESS", default="127.0.0.1:9092", + help="kafka address (default: \"127.0.0.1:9092\")") parser.add_argument("-m", "--send-message", metavar="JSON", type=str, help="this message will be sent down from the GW to all devices " "specified in the --send-to-mac")