From d52903c983870c32cd49d9cb7ab084905f71d941 Mon Sep 17 00:00:00 2001 From: "Shweta Palande (shwpalan)" Date: Mon, 3 Jan 2022 19:23:55 +0530 Subject: [PATCH 01/44] update mission to run on LL2.0 --- meraki-mission-3/mission_captive_portal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index a50c5d2..242c8da 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -27,6 +27,7 @@ import os import sys from pprint import pprint +from waitress import serve import requests from flask import Flask, json, redirect, render_template, request @@ -165,6 +166,7 @@ def get_click(): host = request.host_url base_grant_url = request.args.get('base_grant_url') + base_grant_url = base_grant_url.replace("http://","https://") user_continue_url = request.args.get('user_continue_url') node_mac = request.args.get('node_mac') client_ip = request.args.get('client_ip') @@ -280,4 +282,5 @@ def parse_cli_args(argv): set_splash_page_settings(network_id, captive_portal_base_url) # Start the External Captive Portal web server - app.run(host="0.0.0.0", port=5004, debug=False) + # app.run(host="0.0.0.0", port=5004, debug=False) + serve(app, host='0.0.0.0', port=5004, url_scheme='https') \ No newline at end of file From b1cc3703dd9fe65ef544393be76a83c2c4e45beb Mon Sep 17 00:00:00 2001 From: "Shweta Palande (shwpalan)" Date: Mon, 3 Jan 2022 21:30:23 +0530 Subject: [PATCH 02/44] update mxfirewall to v1 --- meraki-mission-1/mxfirewallcontrol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-mission-1/mxfirewallcontrol.py b/meraki-mission-1/mxfirewallcontrol.py index 0546c9c..e600e98 100644 --- a/meraki-mission-1/mxfirewallcontrol.py +++ b/meraki-mission-1/mxfirewallcontrol.py @@ -39,7 +39,7 @@ teamsapi = WebexTeamsAPI(access_token=env_user.WT_ACCESS_TOKEN) # MERAKI BASE URL -base_url = "https://api.meraki.com/api/v0" +base_url = "https://api.meraki.com/api/v1" def getnetworklist(): orgs = "" From 1a4049545f4f842eb0fccc9fae5d87bf62c4a256 Mon Sep 17 00:00:00 2001 From: "Shweta Palande (shwpalan)" Date: Wed, 5 Jan 2022 18:44:16 +0530 Subject: [PATCH 03/44] update mqtt script with v1 API --- meraki-mv-sense/mv_mqtt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meraki-mv-sense/mv_mqtt.py b/meraki-mv-sense/mv_mqtt.py index ca4eedb..50849b0 100644 --- a/meraki-mv-sense/mv_mqtt.py +++ b/meraki-mv-sense/mv_mqtt.py @@ -114,7 +114,7 @@ def collect_zone_information(topic, payload): def notify(serial_number): # Get video link - url = "https://api.meraki.com/api/v0/networks/{1}/cameras/{0}/snapshot".format(serial_number, NETWORK_ID) + url = "https://api.meraki.com/api/v1/devices/{0}/camera/generateSnapshot".format(serial_number) # current timestamp # ts = str(time.time()).split(".")[0] + "000" @@ -162,7 +162,7 @@ def get_network_id(network_wh): try: # MISSION TODO orgs = requests.get( - "https://api.meraki.com/api/v0/organizations", + "https://api.meraki.com/api/v1/organizations", headers={ "X-Cisco-Meraki-API-Key": env_user.MERAKI_API_KEY, } @@ -182,7 +182,7 @@ def get_network_id(network_wh): try: # MISSION TODO networks = requests.get( - "https://api.meraki.com/api/v0/organizations/"+org["id"]+"/networks", + "https://api.meraki.com/api/v1/organizations/"+org["id"]+"/networks", headers={ "X-Cisco-Meraki-API-Key": env_user.MERAKI_API_KEY, }) From 68b1d3d5a6ef58aa9f02f2c0e6058392042bae92 Mon Sep 17 00:00:00 2001 From: "Shweta Palande (shwpalan)" Date: Wed, 12 Jan 2022 17:17:49 +0530 Subject: [PATCH 04/44] update webhook path to be able to run in postman and LL2.0 container --- .../merakicloudsimulator/webhooksimulator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meraki_cloud_simulator/merakicloudsimulator/webhooksimulator.py b/meraki_cloud_simulator/merakicloudsimulator/webhooksimulator.py index eeaf374..8f8c473 100755 --- a/meraki_cloud_simulator/merakicloudsimulator/webhooksimulator.py +++ b/meraki_cloud_simulator/merakicloudsimulator/webhooksimulator.py @@ -49,13 +49,13 @@ def generate_fake_http_server_id(): # Flask micro-webservice API/URI endpoints -@merakicloudsimulator.route("/networks//webhooks/httpServers", methods=["GET"]) +@merakicloudsimulator.route("/api/v1/networks//webhooks/httpServers", methods=["GET"]) def get_http_servers(network_id): """Simulate getting httpServers configurations.""" print(f"Getting httpServers for {network_id}.") return jsonify(http_servers) -@merakicloudsimulator.route("/networks//webhooks/httpServers", methods=["POST"]) +@merakicloudsimulator.route("/api/v1/networks//webhooks/httpServers", methods=["POST"]) def post_httpServers(network_id): """Simulate setting httpServers configurations.""" print(f"Settings updated for network {network_id}.") @@ -70,7 +70,7 @@ def post_httpServers(network_id): abort(400) -@merakicloudsimulator.route("/networks//alerts/settings", +@merakicloudsimulator.route("/api/v1/networks//alerts/settings", methods=["GET"], ) def get_alert_settings(network_id): @@ -78,7 +78,7 @@ def get_alert_settings(network_id): print(f"Getting alertSettings for {network_id}.") return jsonify(alert_settings) -@merakicloudsimulator.route("/networks//alerts/settings", +@merakicloudsimulator.route("/api/v1/networks//alerts/settings", methods=["PUT"], ) def put_alert_settings(network_id): From fba7fb8d0523a36126e1a0fb14bf17a5b7c2ad14 Mon Sep 17 00:00:00 2001 From: "Shweta Palande (shwpalan)" Date: Mon, 17 Jan 2022 19:12:43 +0530 Subject: [PATCH 05/44] commenting out debug print statements --- .../merakicloudsimulator/webhooksimulator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meraki_cloud_simulator/merakicloudsimulator/webhooksimulator.py b/meraki_cloud_simulator/merakicloudsimulator/webhooksimulator.py index 8f8c473..a573c40 100755 --- a/meraki_cloud_simulator/merakicloudsimulator/webhooksimulator.py +++ b/meraki_cloud_simulator/merakicloudsimulator/webhooksimulator.py @@ -16,14 +16,14 @@ def post_webhook_alerts(): while True: - print("in big while") + #print("in big while") global stop_post_thread if stop_post_thread: - print("breaking while") + #print("breaking while") break for alert in alert_settings["alerts"]: if stop_post_thread: - print("breaking for loop") + #print("breaking for loop") break if alert["enabled"] == True: alert_message = alert_messages[alert["type"]] From d921d79c9e8d47095eccbaf42eabbe110d874389 Mon Sep 17 00:00:00 2001 From: "Shweta Palande (shwpalan)" Date: Thu, 20 Jan 2022 19:04:51 +0530 Subject: [PATCH 06/44] adding python sdk file --- meraki-python-sdk/meraki_python_sdk_lab.py | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 meraki-python-sdk/meraki_python_sdk_lab.py diff --git a/meraki-python-sdk/meraki_python_sdk_lab.py b/meraki-python-sdk/meraki_python_sdk_lab.py new file mode 100644 index 0000000..f8ff82d --- /dev/null +++ b/meraki-python-sdk/meraki_python_sdk_lab.py @@ -0,0 +1,48 @@ +import meraki +import json +from pprint import pprint + +# Configuration parameters and credentials for MERAKI +API_KEY = '6bec40cf957de430a6f1f2baa056b99a4fac9ea0' + +client = meraki.DashboardAPI(api_key=API_KEY) +params={} + + +orgs = "" +try: + orgs = client.organizations.getOrganizations() + pprint(orgs) +except Exception as e: + pprint(e) + +params["organization_id"] = "" +networks = "" +if orgs != "": + for org in orgs: + if org["name"] == "DevNet Sandbox": + params["organization_id"] = org["id"] + pprint(params["organization_id"]) + +if params["organization_id"] != "": + try: + networks = client.organizations.getOrganizationNetworks(params["organization_id"]) + pprint(networks) + except Exception as e: + pprint(e) + +# Now get a list of devices for that network +network_id = "" +devices = "" +if networks != "": + for network in networks: + if network["name"] == "DevNet Sandbox ALWAYS ON": + network_id = network["id"] + pprint(network_id) + +if network_id != "": + try: + devices = client.networks.getNetworkDevices(network_id) + pprint(devices) + except Exception as e: + pprint(e) \ No newline at end of file From dd11141b1d9fa297b989a3efefdacc3e701836bf Mon Sep 17 00:00:00 2001 From: "Shweta Palande (shwpalan)" Date: Thu, 20 Jan 2022 19:33:39 +0530 Subject: [PATCH 07/44] add meraki sdk v1.15.0 to requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 9b88e98..07d71ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ paho-mqtt==1.5.1 requests==2.25.1 requests-toolbelt==0.9.1 webexteamssdk==1.6 +meraki==1.15.0 \ No newline at end of file From f0aff67009e781929564dde03edd27ce983f5c25 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Tue, 15 Feb 2022 11:39:20 -0500 Subject: [PATCH 08/44] Update webhookreceiver.py --- meraki-mission-2/webhookreceiver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-mission-2/webhookreceiver.py b/meraki-mission-2/webhookreceiver.py index 4abfb56..4b4abbf 100644 --- a/meraki-mission-2/webhookreceiver.py +++ b/meraki-mission-2/webhookreceiver.py @@ -40,7 +40,7 @@ teamsapi = WebexTeamsAPI(access_token=env_user.WT_ACCESS_TOKEN) # MERAKI BASE URL -base_url = "http://localhost:5001" +base_url = "http://localhost:5001/api/v1" # Flask App app = Flask(__name__) From b5599136f36356c187b85079bfa059d8eeb7a732 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Tue, 15 Feb 2022 11:40:11 -0500 Subject: [PATCH 09/44] Update mission_captive_portal.py --- meraki-mission-3/mission_captive_portal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index 242c8da..1682350 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -44,7 +44,7 @@ # Module Variables -base_url = "http://localhost:5001" # Using lab simulator +base_url = "http://localhost:5001/api/v1" # Using lab simulator captive_portal_base_url = "http://localhost:5004" base_grant_url = "" user_continue_url = "" @@ -283,4 +283,4 @@ def parse_cli_args(argv): # Start the External Captive Portal web server # app.run(host="0.0.0.0", port=5004, debug=False) - serve(app, host='0.0.0.0', port=5004, url_scheme='https') \ No newline at end of file + serve(app, host='0.0.0.0', port=5004, url_scheme='https') From 5fdbba3d48c8e0f4725c5248f91679e0254356cf Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Tue, 15 Feb 2022 11:42:02 -0500 Subject: [PATCH 10/44] Update meraki_sample_captive_portal.py --- .../meraki_sample_captive_portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki_cloud_simulator/meraki-sample-captive-portal/meraki_sample_captive_portal.py b/meraki_cloud_simulator/meraki-sample-captive-portal/meraki_sample_captive_portal.py index da7f0eb..ea90364 100644 --- a/meraki_cloud_simulator/meraki-sample-captive-portal/meraki_sample_captive_portal.py +++ b/meraki_cloud_simulator/meraki-sample-captive-portal/meraki_sample_captive_portal.py @@ -40,7 +40,7 @@ ## If using docker-compose # base_url = "http://meraki_cloud_simulator:5001" # Using lab simulator ## If using stand alone -base_url = "http://localhost:5001" +base_url = "http://localhost:5001/api/v1" captive_portal_base_url = "http://localhost:5004" base_grant_url = "" user_continue_url = "" From abf4b03e22689188e8a5d3d481360110326372da Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Tue, 15 Feb 2022 11:43:09 -0500 Subject: [PATCH 11/44] Update meraki_sample_webhook_receiver.py --- .../meraki_sample_webhook_receiver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki_cloud_simulator/meraki-sample-webhook-receiver/meraki_sample_webhook_receiver.py b/meraki_cloud_simulator/meraki-sample-webhook-receiver/meraki_sample_webhook_receiver.py index 0f476ca..1001851 100644 --- a/meraki_cloud_simulator/meraki-sample-webhook-receiver/meraki_sample_webhook_receiver.py +++ b/meraki_cloud_simulator/meraki-sample-webhook-receiver/meraki_sample_webhook_receiver.py @@ -36,7 +36,7 @@ # MERAKI BASE URL # if running in docker-compose base_url = "http://meraki_cloud_simulator:5001" # if running seperately -base_url = "http://localhost:5001" +base_url = "http://localhost:5001/api/v1" # Flask App app = Flask(__name__) From 48fcb668c3b3ea1c027ad104d7d3f8c3d88de8b6 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Tue, 15 Feb 2022 11:44:25 -0500 Subject: [PATCH 12/44] Update excapsimulator.py --- .../merakicloudsimulator/excapsimulator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py index 6372b1b..447bb1d 100755 --- a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py +++ b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py @@ -24,7 +24,7 @@ def random_byte(): # Flask micro-webservice API/URI endpoints -@merakicloudsimulator.route("/networks//wireless/ssids/", methods=["PUT"]) +@merakicloudsimulator.route("/api/v1/networks//wireless/ssids/", methods=["PUT"]) def put_ssid(network_id, ssid_id): """Simulate setting SSID configurations.""" print(f"Settings updated for network {network_id} ssid {ssid_id}.") @@ -32,7 +32,7 @@ def put_ssid(network_id, ssid_id): @merakicloudsimulator.route( - "/networks//wireless/ssids//splash/settings", + "/api/v1/networks//wireless/ssids//splash/settings", methods=["PUT"], ) def put_splash(network_id, ssid_id): @@ -41,7 +41,7 @@ def put_splash(network_id, ssid_id): return jsonify(request.json) -@merakicloudsimulator.route("/networks//splashLoginAttempts", methods=["GET"]) +@merakicloudsimulator.route("/api/v1/networks//splashLoginAttempts", methods=["GET"]) def get_splash_logins(network_id): """Get list of Splash Page logins.""" # We aren't associating specific logins with a network ID From c8b2a39d746a76f1facc755d7180f29cbe0c28ac Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Tue, 15 Feb 2022 11:46:55 -0500 Subject: [PATCH 13/44] Update meraki_cloud_simulator.py --- meraki_cloud_simulator/meraki_cloud_simulator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meraki_cloud_simulator/meraki_cloud_simulator.py b/meraki_cloud_simulator/meraki_cloud_simulator.py index acf8ab4..7961673 100644 --- a/meraki_cloud_simulator/meraki_cloud_simulator.py +++ b/meraki_cloud_simulator/meraki_cloud_simulator.py @@ -14,13 +14,13 @@ def meraki_simulator_go(): return render_template("index.html") # Flask micro-webservice API/URI endpoints -@merakicloudsimulator.route("/organizations", methods=["GET"]) +@merakicloudsimulator.route("/api/v1/organizations", methods=["GET"]) def get_org_id(): """Get a list of simulated organizations.""" return jsonify(ORGANIZATIONS) -@merakicloudsimulator.route("/organizations//networks", methods=["GET"]) +@merakicloudsimulator.route("/api/v1/organizations//networks", methods=["GET"]) def get_networks(organization_id): """Get the list of networks for an organization.""" organization_networks = NETWORKS.get(organization_id) @@ -39,4 +39,4 @@ def get_networks(organization_id): ) # Start the web server - merakicloudsimulator.run(host=WEB_SERVER_BIND_IP, port=WEB_SERVER_BIND_PORT, threaded=True, debug=False) \ No newline at end of file + merakicloudsimulator.run(host=WEB_SERVER_BIND_IP, port=WEB_SERVER_BIND_PORT, threaded=True, debug=False) From f2e747949c3d1e46b85af14a010b406f65d27fb3 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 11:02:17 -0500 Subject: [PATCH 14/44] updating template to accept API entered values --- .../merakicloudsimulator/templates/excap.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meraki_cloud_simulator/merakicloudsimulator/templates/excap.html b/meraki_cloud_simulator/merakicloudsimulator/templates/excap.html index dfe3f9f..6a4a427 100644 --- a/meraki_cloud_simulator/merakicloudsimulator/templates/excap.html +++ b/meraki_cloud_simulator/merakicloudsimulator/templates/excap.html @@ -17,10 +17,10 @@
-

Meraki Captive Portal Simulator

+

Meraki Captive Portal Simulator

- Enter Captive Portal URL:

- Enter Post Authorization URL:

+ Enter Captive Portal URL:

+ Enter Post Authorization URL:

From 93c27cdfd13edd2e1afd64f43c51729e58efc023 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 11:04:35 -0500 Subject: [PATCH 15/44] updating sim to match api body for splash settings and allow api to set necessary values --- .../merakicloudsimulator/excapsimulator.py | 38 +++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py index 447bb1d..6fe56bd 100755 --- a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py +++ b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py @@ -36,9 +36,35 @@ def put_ssid(network_id, ssid_id): methods=["PUT"], ) def put_splash(network_id, ssid_id): + global captive_portal_url + global user_continue_url """Simulate setting Splash Page configurations.""" print(f"Splash settings updated for network {network_id} ssid {ssid_id}.") - return jsonify(request.json) + new_settings = request.json + new_settings_keys = new_settings.keys() + print(new_settings_keys) + + if "splashPage" in new_settings_keys and "splashUrl" in new_settings_keys and "redirectUrl" in new_settings_keys: + captive_portal_url = new_settings["splashUrl"] + base_grant_url = request.host_url + "splash/grant" + user_continue_url = new_settings["redirectUrl"] + node_mac = generate_fake_mac() + client_ip = request.remote_addr + client_mac = generate_fake_mac() + splash_click_time = datetime.utcnow().isoformat() + full_url = ( + captive_portal_url + + "?base_grant_url=" + base_grant_url + + "&user_continue_url=" + user_continue_url + + "&node_mac=" + node_mac + + "&client_ip=" + client_ip + + "&client_mac=" + client_mac + ) + print(captive_portal_url) + print(user_continue_url) + return jsonify(new_settings) + else: + abort(400) @merakicloudsimulator.route("/api/v1/networks//splashLoginAttempts", methods=["GET"]) @@ -51,14 +77,20 @@ def get_splash_logins(network_id): @merakicloudsimulator.route("/excap", methods=["GET"]) def excap_go(): + global captive_portal_url + global user_continue_url """Process GET requests to the /excap URI; render the index.html page.""" - return render_template("excap.html") + print(captive_portal_url) + print(user_continue_url) + return render_template("excap.html", captive_portal_url = captive_portal_url, user_continue_url = user_continue_url) @merakicloudsimulator.route("/connecttowifi", methods=["POST"]) def connect_to_wifi(): """Save captive portal details; redirect to the External Captive Portal.""" - + global captive_portal_url + global user_continue_url + captive_portal_url = request.form["captive_portal_url"] base_grant_url = request.host_url + "splash/grant" user_continue_url = request.form["user_continue_url"] From 69415b209dbfcf16b6211e51ee87619e95a0c560 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 11:20:12 -0500 Subject: [PATCH 16/44] updating to be able to run locally and in LL2.0 --- meraki-mission-3/mission_captive_portal.py | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index 1682350..950693b 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -42,10 +42,9 @@ sys.path.insert(0, project_root) import env_user # noqa - # Module Variables -base_url = "http://localhost:5001/api/v1" # Using lab simulator -captive_portal_base_url = "http://localhost:5004" +base_url = f"{os.environ['DEVENV_APP_8080_URL']}/api/v1}" # Using lab simulator +captive_portal_base_url = f"{os.environ['DEVENV_APP_8080_URL']}" base_grant_url = "" user_continue_url = "" success_url = "" @@ -112,9 +111,11 @@ def set_splash_page_settings(network_id, captive_portal_base_url): "Content-Type": "application/json", }, json={ - "splashPage": "Click-through splash page", - "splashUrl": captive_portal_base_url + '/click', - "useCustomUrl": True + "splashPage": "Click-through splash page", + "splashUrl": captive_portal_base_url + '/click', + "useSplashUrl": True, + "redirectUrl" : "https://developer.cisco.com/meraki", + "useRedirectUrl": True }, ) # END MISSION SECTION @@ -163,15 +164,13 @@ def get_click(): global base_grant_url global user_continue_url global success_url - - host = request.host_url + base_grant_url = request.args.get('base_grant_url') - base_grant_url = base_grant_url.replace("http://","https://") user_continue_url = request.args.get('user_continue_url') node_mac = request.args.get('node_mac') client_ip = request.args.get('client_ip') client_mac = request.args.get('client_mac') - success_url = host + "success" + success_url = captive_portal_base_url + "success" return render_template( "click.html", @@ -282,5 +281,5 @@ def parse_cli_args(argv): set_splash_page_settings(network_id, captive_portal_base_url) # Start the External Captive Portal web server - # app.run(host="0.0.0.0", port=5004, debug=False) - serve(app, host='0.0.0.0', port=5004, url_scheme='https') + app.run(host="0.0.0.0", port=5004, debug=False) + #serve(app, host='0.0.0.0', port=5004, url_scheme='https') From 3d3d84c1f79bca3b6ea86491f234e1b7c764fd9d Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 11:25:21 -0500 Subject: [PATCH 17/44] update for excap to run locally and in ll2.0 --- meraki-captive-portal/external_captive_portal.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/meraki-captive-portal/external_captive_portal.py b/meraki-captive-portal/external_captive_portal.py index 1d46333..e37d16d 100755 --- a/meraki-captive-portal/external_captive_portal.py +++ b/meraki-captive-portal/external_captive_portal.py @@ -3,6 +3,7 @@ from flask import Flask, redirect, render_template, request from waitress import serve +import os # Module Variables @@ -21,7 +22,11 @@ def get_click(): global user_continue_url global success_url - host = request.host_url + if os.environ['DEVENV_APP_8080_URL'] is not None: + host = os.environ['DEVENV_APP_8080_URL'] + else: + host = request.host_url + base_grant_url = request.args.get('base_grant_url') user_continue_url = request.args.get('user_continue_url') node_mac = request.args.get('node_mac') @@ -29,9 +34,6 @@ def get_click(): client_mac = request.args.get('client_mac') success_url = host + "success" - if base_grant_url != None and base_grant_url.startswith('http://'): - base_grant_url = base_grant_url.replace("http://", "https://", 1) #hack to run excap in LL2.0 - return render_template( "click.html", client_ip=client_ip, @@ -62,6 +64,6 @@ def get_success(): # If this script is the main script being executed, start the web server. if __name__ == "__main__": - # app.run(host="0.0.0.0", port=5004, debug=True) - serve(app, host='0.0.0.0', port=5004, url_scheme='https') + app.run(host="0.0.0.0", port=5004, debug=True) + #serve(app, host='0.0.0.0', port=5004, url_scheme='https') From 63130da6ec8ed02eb7b9eb99386957d76051e3ca Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 11:27:41 -0500 Subject: [PATCH 18/44] upating to work locally and in LL2.0 --- .../merakicloudsimulator/excapsimulator.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py index 6fe56bd..49dc63a 100755 --- a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py +++ b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py @@ -43,10 +43,16 @@ def put_splash(network_id, ssid_id): new_settings = request.json new_settings_keys = new_settings.keys() print(new_settings_keys) + + + if os.environ['DEVENV_APP_8080_URL'] is not None: + host = os.environ['DEVENV_APP_8080_URL'] + else: + host = request.host_url if "splashPage" in new_settings_keys and "splashUrl" in new_settings_keys and "redirectUrl" in new_settings_keys: captive_portal_url = new_settings["splashUrl"] - base_grant_url = request.host_url + "splash/grant" + base_grant_url = host + "splash/grant" user_continue_url = new_settings["redirectUrl"] node_mac = generate_fake_mac() client_ip = request.remote_addr @@ -91,8 +97,13 @@ def connect_to_wifi(): global captive_portal_url global user_continue_url + if os.environ['DEVENV_APP_8080_URL'] is not None: + host = os.environ['DEVENV_APP_8080_URL'] + else: + host = request.host_url + captive_portal_url = request.form["captive_portal_url"] - base_grant_url = request.host_url + "splash/grant" + base_grant_url = host + "splash/grant" user_continue_url = request.form["user_continue_url"] node_mac = generate_fake_mac() client_ip = request.remote_addr From db73db7d0ab5c6098d296106bc7f0bdd2044de1e Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 11:39:04 -0500 Subject: [PATCH 19/44] fix host value --- meraki-captive-portal/external_captive_portal.py | 1 + 1 file changed, 1 insertion(+) diff --git a/meraki-captive-portal/external_captive_portal.py b/meraki-captive-portal/external_captive_portal.py index e37d16d..66922a7 100755 --- a/meraki-captive-portal/external_captive_portal.py +++ b/meraki-captive-portal/external_captive_portal.py @@ -26,6 +26,7 @@ def get_click(): host = os.environ['DEVENV_APP_8080_URL'] else: host = request.host_url + host = replace("https", "http") base_grant_url = request.args.get('base_grant_url') user_continue_url = request.args.get('user_continue_url') From 0454baeee4a275bbf593f72c387dbd2749a27b0d Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 11:41:17 -0500 Subject: [PATCH 20/44] fix to run locally and in ll2.0 --- meraki-mission-3/mission_captive_portal.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index 950693b..c33ac34 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -43,8 +43,14 @@ import env_user # noqa # Module Variables -base_url = f"{os.environ['DEVENV_APP_8080_URL']}/api/v1}" # Using lab simulator -captive_portal_base_url = f"{os.environ['DEVENV_APP_8080_URL']}" +if os.environ['DEVENV_APP_8080_URL'] is not None: + host = os.environ['DEVENV_APP_8080_URL'] +else: + host = request.host_url + host = replace("https", "http") + +base_url = f"{host}/api/v1}" # Using lab simulator +captive_portal_base_url = f"{host}" base_grant_url = "" user_continue_url = "" success_url = "" From e828cf116789edd10357f258dd64be02f0d0ccac Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 11:45:32 -0500 Subject: [PATCH 21/44] fix --- meraki-captive-portal/external_captive_portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-captive-portal/external_captive_portal.py b/meraki-captive-portal/external_captive_portal.py index 66922a7..8316486 100755 --- a/meraki-captive-portal/external_captive_portal.py +++ b/meraki-captive-portal/external_captive_portal.py @@ -26,7 +26,7 @@ def get_click(): host = os.environ['DEVENV_APP_8080_URL'] else: host = request.host_url - host = replace("https", "http") + host = host.replace("https", "http") base_grant_url = request.args.get('base_grant_url') user_continue_url = request.args.get('user_continue_url') From 10e2bcbd24c464e60ac5e0ecafec2cb25d3522d2 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 11:45:51 -0500 Subject: [PATCH 22/44] Update mission_captive_portal.py --- meraki-mission-3/mission_captive_portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index c33ac34..cfc0887 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -47,7 +47,7 @@ host = os.environ['DEVENV_APP_8080_URL'] else: host = request.host_url - host = replace("https", "http") + host = host.replace("https", "http") base_url = f"{host}/api/v1}" # Using lab simulator captive_portal_base_url = f"{host}" From a67698d140b6706857899917200fc5e08b73306c Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 11:46:52 -0500 Subject: [PATCH 23/44] Update excapsimulator.py --- meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py index 49dc63a..bf927d3 100755 --- a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py +++ b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py @@ -49,6 +49,7 @@ def put_splash(network_id, ssid_id): host = os.environ['DEVENV_APP_8080_URL'] else: host = request.host_url + host = host.replace('https', 'http') if "splashPage" in new_settings_keys and "splashUrl" in new_settings_keys and "redirectUrl" in new_settings_keys: captive_portal_url = new_settings["splashUrl"] @@ -101,6 +102,7 @@ def connect_to_wifi(): host = os.environ['DEVENV_APP_8080_URL'] else: host = request.host_url + host = host.replace('https', 'http') captive_portal_url = request.form["captive_portal_url"] base_grant_url = host + "splash/grant" From 84339bb52f048e0afdc6c3368835496bc8712c42 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 11:55:06 -0500 Subject: [PATCH 24/44] Update excapsimulator.py --- meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py index bf927d3..15f9c10 100755 --- a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py +++ b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py @@ -4,6 +4,7 @@ import random import requests from datetime import datetime +import os # Module Variables captive_portal_url = "" From 679ac2e8654927438c05c79c18fe105022a4b93a Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 11:57:12 -0500 Subject: [PATCH 25/44] Update excapsimulator.py --- .../merakicloudsimulator/excapsimulator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py index 15f9c10..c1f74de 100755 --- a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py +++ b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py @@ -99,11 +99,11 @@ def connect_to_wifi(): global captive_portal_url global user_continue_url - if os.environ['DEVENV_APP_8080_URL'] is not None: - host = os.environ['DEVENV_APP_8080_URL'] - else: + if os.environ['DEVENV_APP_8080_URL'] is None: host = request.host_url host = host.replace('https', 'http') + else: + host = os.environ['DEVENV_APP_8080_URL'] captive_portal_url = request.form["captive_portal_url"] base_grant_url = host + "splash/grant" From 6d0b6e711d8e497276fcf94880a15ebc0eac1349 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:01:07 -0500 Subject: [PATCH 26/44] Update excapsimulator.py --- .../merakicloudsimulator/excapsimulator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py index c1f74de..ad75916 100755 --- a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py +++ b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py @@ -46,11 +46,11 @@ def put_splash(network_id, ssid_id): print(new_settings_keys) - if os.environ['DEVENV_APP_8080_URL'] is not None: - host = os.environ['DEVENV_APP_8080_URL'] - else: + if 'DEVENV_APP_8080_URL' not in os.environ: host = request.host_url host = host.replace('https', 'http') + else: + host = os.environ['DEVENV_APP_8080_URL' if "splashPage" in new_settings_keys and "splashUrl" in new_settings_keys and "redirectUrl" in new_settings_keys: captive_portal_url = new_settings["splashUrl"] @@ -99,7 +99,7 @@ def connect_to_wifi(): global captive_portal_url global user_continue_url - if os.environ['DEVENV_APP_8080_URL'] is None: + if 'DEVENV_APP_8080_URL' not in os.environ: host = request.host_url host = host.replace('https', 'http') else: From 7d09087b8d17d3b225fc88e8e891ecfe6d0cc83f Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:01:48 -0500 Subject: [PATCH 27/44] Update mission_captive_portal.py --- meraki-mission-3/mission_captive_portal.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index cfc0887..7d05de7 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -43,11 +43,11 @@ import env_user # noqa # Module Variables -if os.environ['DEVENV_APP_8080_URL'] is not None: - host = os.environ['DEVENV_APP_8080_URL'] -else: +if 'DEVENV_APP_8080_URL' not in os.environ: host = request.host_url - host = host.replace("https", "http") + host = host.replace('https', 'http') +else: + host = os.environ['DEVENV_APP_8080_URL' base_url = f"{host}/api/v1}" # Using lab simulator captive_portal_base_url = f"{host}" From eb9ac016cb2b76efd35816e09308b7ae86deb9ce Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:02:18 -0500 Subject: [PATCH 28/44] Update external_captive_portal.py --- meraki-captive-portal/external_captive_portal.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meraki-captive-portal/external_captive_portal.py b/meraki-captive-portal/external_captive_portal.py index 8316486..6d55b54 100755 --- a/meraki-captive-portal/external_captive_portal.py +++ b/meraki-captive-portal/external_captive_portal.py @@ -22,11 +22,11 @@ def get_click(): global user_continue_url global success_url - if os.environ['DEVENV_APP_8080_URL'] is not None: - host = os.environ['DEVENV_APP_8080_URL'] - else: + if 'DEVENV_APP_8080_URL' not in os.environ: host = request.host_url - host = host.replace("https", "http") + host = host.replace('https', 'http') + else: + host = os.environ['DEVENV_APP_8080_URL' base_grant_url = request.args.get('base_grant_url') user_continue_url = request.args.get('user_continue_url') From e4a0b112d86d584c67f7939c9f5411a0f1e2c42d Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:04:03 -0500 Subject: [PATCH 29/44] Update excapsimulator.py --- .../merakicloudsimulator/excapsimulator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py index ad75916..64503b1 100755 --- a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py +++ b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py @@ -50,8 +50,9 @@ def put_splash(network_id, ssid_id): host = request.host_url host = host.replace('https', 'http') else: - host = os.environ['DEVENV_APP_8080_URL' - + host = os.environ['DEVENV_APP_8080_URL'] + + if "splashPage" in new_settings_keys and "splashUrl" in new_settings_keys and "redirectUrl" in new_settings_keys: captive_portal_url = new_settings["splashUrl"] base_grant_url = host + "splash/grant" From 2b4025690bea1d07969a902d2971c2cdba6e05fa Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:04:51 -0500 Subject: [PATCH 30/44] Update external_captive_portal.py --- meraki-captive-portal/external_captive_portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-captive-portal/external_captive_portal.py b/meraki-captive-portal/external_captive_portal.py index 6d55b54..d9cc03c 100755 --- a/meraki-captive-portal/external_captive_portal.py +++ b/meraki-captive-portal/external_captive_portal.py @@ -26,7 +26,7 @@ def get_click(): host = request.host_url host = host.replace('https', 'http') else: - host = os.environ['DEVENV_APP_8080_URL' + host = os.environ['DEVENV_APP_8080_URL'] base_grant_url = request.args.get('base_grant_url') user_continue_url = request.args.get('user_continue_url') From 81a486e54cab24486fc7b9d3151dd96abbccd30b Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:05:12 -0500 Subject: [PATCH 31/44] Update mission_captive_portal.py --- meraki-mission-3/mission_captive_portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index 7d05de7..c205f24 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -47,7 +47,7 @@ host = request.host_url host = host.replace('https', 'http') else: - host = os.environ['DEVENV_APP_8080_URL' + host = os.environ['DEVENV_APP_8080_URL'] base_url = f"{host}/api/v1}" # Using lab simulator captive_portal_base_url = f"{host}" From 74e642bf767bdeddaf24dbadc02380d7f487d111 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:12:24 -0500 Subject: [PATCH 32/44] Update mission_captive_portal.py --- meraki-mission-3/mission_captive_portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index c205f24..0dc9d09 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -49,7 +49,7 @@ else: host = os.environ['DEVENV_APP_8080_URL'] -base_url = f"{host}/api/v1}" # Using lab simulator +base_url = f"{host}/api/v1" # Using lab simulator captive_portal_base_url = f"{host}" base_grant_url = "" user_continue_url = "" From 6f105927c5f9cf569a3b1f5223c2f9c6af47bf3a Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:15:01 -0500 Subject: [PATCH 33/44] Update mission_captive_portal.py --- meraki-mission-3/mission_captive_portal.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index 0dc9d09..b249e63 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -44,8 +44,7 @@ # Module Variables if 'DEVENV_APP_8080_URL' not in os.environ: - host = request.host_url - host = host.replace('https', 'http') + host = "http://localhost:5004" else: host = os.environ['DEVENV_APP_8080_URL'] From 451a717b227a6698c61fa0a27b8a0d455c544583 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:20:40 -0500 Subject: [PATCH 34/44] Update mission_captive_portal.py --- meraki-mission-3/mission_captive_portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index b249e63..d2338bc 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -44,7 +44,7 @@ # Module Variables if 'DEVENV_APP_8080_URL' not in os.environ: - host = "http://localhost:5004" + host = "http://localhost:8080" else: host = os.environ['DEVENV_APP_8080_URL'] From bd84ee0b8e9cb54e6c1ad878ae1cc452392cb0d3 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:22:07 -0500 Subject: [PATCH 35/44] Update mission_captive_portal.py --- meraki-mission-3/mission_captive_portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index d2338bc..f38090b 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -175,7 +175,7 @@ def get_click(): node_mac = request.args.get('node_mac') client_ip = request.args.get('client_ip') client_mac = request.args.get('client_mac') - success_url = captive_portal_base_url + "success" + success_url = captive_portal_base_url + "/success" return render_template( "click.html", From 459e238fb9801c3fa96c4495e33b0a2a77bffc91 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:44:01 -0500 Subject: [PATCH 36/44] Update external_captive_portal.py --- meraki-captive-portal/external_captive_portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-captive-portal/external_captive_portal.py b/meraki-captive-portal/external_captive_portal.py index d9cc03c..6fa9694 100755 --- a/meraki-captive-portal/external_captive_portal.py +++ b/meraki-captive-portal/external_captive_portal.py @@ -26,7 +26,7 @@ def get_click(): host = request.host_url host = host.replace('https', 'http') else: - host = os.environ['DEVENV_APP_8080_URL'] + host = f"{os.environ['DEVENV_APP_8080_URL']}/" base_grant_url = request.args.get('base_grant_url') user_continue_url = request.args.get('user_continue_url') From d433673a5eda7225521a8c7506f0769c201fca2a Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:45:07 -0500 Subject: [PATCH 37/44] Update mission_captive_portal.py --- meraki-mission-3/mission_captive_portal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index f38090b..427ded8 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -44,9 +44,9 @@ # Module Variables if 'DEVENV_APP_8080_URL' not in os.environ: - host = "http://localhost:8080" + host = "http://localhost:8080/" else: - host = os.environ['DEVENV_APP_8080_URL'] + host = f"{os.environ['DEVENV_APP_8080_URL']}/" base_url = f"{host}/api/v1" # Using lab simulator captive_portal_base_url = f"{host}" From 807b4c717eaf0a8e1d5b811a7a8884a2978aa047 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:53:03 -0500 Subject: [PATCH 38/44] Update mission_captive_portal.py --- meraki-mission-3/mission_captive_portal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index 427ded8..6549c80 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -44,9 +44,9 @@ # Module Variables if 'DEVENV_APP_8080_URL' not in os.environ: - host = "http://localhost:8080/" + host = "http://localhost:8080" else: - host = f"{os.environ['DEVENV_APP_8080_URL']}/" + host = {os.environ['DEVENV_APP_8080_URL']} base_url = f"{host}/api/v1" # Using lab simulator captive_portal_base_url = f"{host}" From c539cdaa7b1e10b15c23aba73f0c158540ed9fea Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:53:51 -0500 Subject: [PATCH 39/44] Update external_captive_portal.py --- meraki-captive-portal/external_captive_portal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meraki-captive-portal/external_captive_portal.py b/meraki-captive-portal/external_captive_portal.py index 6fa9694..88e0290 100755 --- a/meraki-captive-portal/external_captive_portal.py +++ b/meraki-captive-portal/external_captive_portal.py @@ -26,14 +26,14 @@ def get_click(): host = request.host_url host = host.replace('https', 'http') else: - host = f"{os.environ['DEVENV_APP_8080_URL']}/" + host = os.environ['DEVENV_APP_8080_URL'] base_grant_url = request.args.get('base_grant_url') user_continue_url = request.args.get('user_continue_url') node_mac = request.args.get('node_mac') client_ip = request.args.get('client_ip') client_mac = request.args.get('client_mac') - success_url = host + "success" + success_url = host + "/success" return render_template( "click.html", From ef0a0af3c6290eead19b5191f5e6407e3df1c008 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 12:54:41 -0500 Subject: [PATCH 40/44] Update excapsimulator.py --- meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py index 64503b1..0cec4f0 100755 --- a/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py +++ b/meraki_cloud_simulator/merakicloudsimulator/excapsimulator.py @@ -55,7 +55,7 @@ def put_splash(network_id, ssid_id): if "splashPage" in new_settings_keys and "splashUrl" in new_settings_keys and "redirectUrl" in new_settings_keys: captive_portal_url = new_settings["splashUrl"] - base_grant_url = host + "splash/grant" + base_grant_url = host + "/splash/grant" user_continue_url = new_settings["redirectUrl"] node_mac = generate_fake_mac() client_ip = request.remote_addr @@ -107,7 +107,7 @@ def connect_to_wifi(): host = os.environ['DEVENV_APP_8080_URL'] captive_portal_url = request.form["captive_portal_url"] - base_grant_url = host + "splash/grant" + base_grant_url = host + "/splash/grant" user_continue_url = request.form["user_continue_url"] node_mac = generate_fake_mac() client_ip = request.remote_addr From 97872c44565e3bf082eb472494eef3675e561d72 Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Thu, 17 Feb 2022 14:09:26 -0500 Subject: [PATCH 41/44] Update mission_captive_portal.py --- meraki-mission-3/mission_captive_portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-mission-3/mission_captive_portal.py b/meraki-mission-3/mission_captive_portal.py index 6549c80..f38090b 100644 --- a/meraki-mission-3/mission_captive_portal.py +++ b/meraki-mission-3/mission_captive_portal.py @@ -46,7 +46,7 @@ if 'DEVENV_APP_8080_URL' not in os.environ: host = "http://localhost:8080" else: - host = {os.environ['DEVENV_APP_8080_URL']} + host = os.environ['DEVENV_APP_8080_URL'] base_url = f"{host}/api/v1" # Using lab simulator captive_portal_base_url = f"{host}" From 1d3dc4161d02919e51a810143363a828d6e83ecc Mon Sep 17 00:00:00 2001 From: Matthew DeNapoli Date: Mon, 11 Apr 2022 17:36:05 -0400 Subject: [PATCH 42/44] Update sample.js --- meraki-location-scanning-python/static/sample.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/meraki-location-scanning-python/static/sample.js b/meraki-location-scanning-python/static/sample.js index a0656dd..9c64ea5 100644 --- a/meraki-location-scanning-python/static/sample.js +++ b/meraki-location-scanning-python/static/sample.js @@ -8,11 +8,10 @@ allMarkers = [], // The markers when we are in "View All" mode lastMac = "", // The last requested MAC to follow infoWindow = new google.maps.InfoWindow(), // The marker tooltip - markerImage = new google.maps.Marker({ - icon: { - size: new google.maps.Size(15, 15), - origin: new google.maps.Point(0, 0), - anchor: new google.maps.Point(4.5, 4.5)}}); + markerImage = new google.maps.MarkerImage('/static/blue_circle.png', + new google.maps.Size(15, 15), + new google.maps.Point(0, 0), + new google.maps.Point(4.5, 4.5)); MerakiOverlay.prototype = new google.maps.OverlayView(); From 2e1a9aa0c9dacc4918de89766899f177dbd5d89d Mon Sep 17 00:00:00 2001 From: shweta-palande <59979483+shweta-palande@users.noreply.github.com> Date: Fri, 13 May 2022 15:32:09 +0530 Subject: [PATCH 43/44] replace marker URL Replacing blue_circle.png file with an image URL of a beach flag to denote moving clients. --- meraki-location-scanning-python/static/sample.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-location-scanning-python/static/sample.js b/meraki-location-scanning-python/static/sample.js index 9c64ea5..7f387d2 100644 --- a/meraki-location-scanning-python/static/sample.js +++ b/meraki-location-scanning-python/static/sample.js @@ -8,7 +8,7 @@ allMarkers = [], // The markers when we are in "View All" mode lastMac = "", // The last requested MAC to follow infoWindow = new google.maps.InfoWindow(), // The marker tooltip - markerImage = new google.maps.MarkerImage('/static/blue_circle.png', + markerImage = new google.maps.MarkerImage('https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png', new google.maps.Size(15, 15), new google.maps.Point(0, 0), new google.maps.Point(4.5, 4.5)); From e0283f82dcd1267072f82d597d913b0f5e72bd34 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 3 Jun 2022 09:57:06 -0400 Subject: [PATCH 44/44] beachflag doesn't work in LL2.0: reverting to blue circle --- meraki-location-scanning-python/static/sample.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meraki-location-scanning-python/static/sample.js b/meraki-location-scanning-python/static/sample.js index 7f387d2..ef0838a 100644 --- a/meraki-location-scanning-python/static/sample.js +++ b/meraki-location-scanning-python/static/sample.js @@ -8,7 +8,7 @@ allMarkers = [], // The markers when we are in "View All" mode lastMac = "", // The last requested MAC to follow infoWindow = new google.maps.InfoWindow(), // The marker tooltip - markerImage = new google.maps.MarkerImage('https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png', + markerImage = new google.maps.MarkerImage('/5002/static/blue_circle.png', new google.maps.Size(15, 15), new google.maps.Point(0, 0), new google.maps.Point(4.5, 4.5));