diff --git a/access_systems.txt b/access_systems.txt index b3e5e0b..fcafbd1 100644 --- a/access_systems.txt +++ b/access_systems.txt @@ -1,20 +1,31 @@ { +# Shortcut used in SMS message 'XYZ':{ + # Mode of transfer, this case, message transfer 'mode':'msg_xfer', + # Name of the server/network 'network_name':'My HBlink Server', - 'url':'http://example.net/api', + # URL to the dashboard of the server/network + 'url':'http://example.net/', + # Username and password given to you by network operator 'user':'test_name', 'password':'passw0rd' }, - 'APP':{ + # Shortcut used in SMS message + 'BBD':{ + # Mode for application, operates differently than msg_xfer 'mode':'app', - 'app_name':'Test app', + # Name of external application + 'app_name':'Bulletin Board', + # Endpoint URL of API 'url':'http://localhost:8080/post', + # Website for users to get info + 'website':'http://hbl.ink', }, 'ABC':{ 'mode':'msg_xfer', 'network_name':'Regional HBlink Network 1', - 'url':'http://localhost:8092/api', + 'url':'http://localhost:8092/', 'user':'test_name', 'password':'passw0rd' } diff --git a/authorized_users.txt b/authorized_users.txt index 5e300b7..92fa1b6 100644 --- a/authorized_users.txt +++ b/authorized_users.txt @@ -1,5 +1,7 @@ +# This file contains the access credentials of other servers/networks that can +# send messages to this server. { - 'XYZ':{ + 'DEF':{ 'mode':'msg_xfer', 'user':'test_name', 'password':'passw0rd' diff --git a/full_bridge-SAMPLE.cfg b/full_bridge-SAMPLE.cfg index cdac205..70d34d8 100644 --- a/full_bridge-SAMPLE.cfg +++ b/full_bridge-SAMPLE.cfg @@ -151,7 +151,7 @@ APRS_STATIC_REPORT_INTERVAL: 15 APRS_STATIC_MESSAGE:Connected to HBLink # The email gateway settingns below are OPTIONAL. They are NOT REQUIRED if you don't want -http://www.aprs-is.net/javAPRSFilter.aspx# to enable the email gateway. Leave as is to disable. +# http://www.aprs-is.net/javAPRSFilter.aspx# to enable the email gateway. Leave as is to disable. EMAIL_SENDER: test@example.org EMAIL_PASSWORD: letmein SMTP_SERVER: smtp.gmail.com @@ -170,6 +170,12 @@ USER_SETTINGS_FILE: /path/to/user_settings.txt # API settings # Authorized Apps file - data used for the dashboard API +# Authorized Tokens File - location of file to store token for app requests, can be left as default +# Authorized Users File - Stores login data for other servers to send messages +# Access Systems File - Contains data for external applications or other networks/servers +# that this server can access. +# My API Name - Short abbreviation, must match other users access files. +# Server name - can be different than dashboard title, used to identify this network/server USE_API: True AUTHORIZED_APPS_FILE: /path/to/authorized_apps.py AUTHORIZED_TOKENS_FILE: /tmp/hblink_auth_tokens.txt diff --git a/scripts/dashboard/dashboard.py b/scripts/dashboard/dashboard.py index 941ed0c..4fa9efa 100644 --- a/scripts/dashboard/dashboard.py +++ b/scripts/dashboard/dashboard.py @@ -203,7 +203,7 @@ def user_setting_write(dmr_id, input_ssid, input_icon, input_comment, input_aprs def index(): value = Markup('The HTML String') #return get_data() - return render_template('index.html', title = dashboard_title, logo = logo, emergency = check_emergency()) + return render_template('index.html', title = dashboard_title, logo = logo, emergency = check_emergency(), api = use_api) @app.route('/bulletin_board') def dash_bb(): return get_bb_data() @@ -215,11 +215,11 @@ def dash_loc(): @app.route('/help/') def help(): #return get_data() - return render_template('help.html', title = dashboard_title, logo = logo, description = description, data_call_type = data_call_type, data_call_id = data_call_id, aprs_ssid = aprs_ssid) + return render_template('help.html', title = dashboard_title, logo = logo, description = description, api = use_api, data_call_type = data_call_type, data_call_id = data_call_id, aprs_ssid = aprs_ssid) @app.route('/about/') def about(): #return get_data() - return render_template('about.html', title = dashboard_title, logo = logo, contact_name = contact_name, contact_call = contact_call, contact_email = contact_email, contact_website = contact_website) + return render_template('about.html', title = dashboard_title, logo = logo, contact_name = contact_name, api = use_api, contact_call = contact_call, contact_email = contact_email, contact_website = contact_website) @app.route('/external_apps') def external_apps(): @@ -244,7 +244,7 @@ def external_apps(): ''' content = '''

 

- + External applications and other HBLink networks that can be accessed via SMS from this gateway:

External Networks/Servers

@@ -283,7 +283,7 @@ def external_apps():

 

''' ## content = 'yo' - return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(content)) + return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(content), api = use_api) @app.route('/view_map') def view_map(): @@ -459,7 +459,7 @@ def view_map(): @app.route('/map/') def map(): - return render_template('map.html', title = dashboard_title, logo = logo) + return render_template('map.html', title = dashboard_title, logo = logo, api = use_api) @app.route('/user', methods = ['GET', 'POST']) def user_settings(): @@ -651,7 +651,7 @@ def user_settings():

''' - return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(user_result)) + return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(user_result), api = use_api) @app.route('/mailbox') def mailbox(): @@ -727,7 +727,7 @@ def mailbox():

 

""" - return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(mail_content)) + return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(mail_content), api = use_api) @app.route('/bulletin_rss.xml') @@ -791,7 +791,7 @@ def mail_rss(): def api(api_mode=None): if request.method == 'GET': api_content = '

API Enabled: ' + str(use_api) + '

' - return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(api_content)) + return render_template('generic.html', title = dashboard_title, logo = logo, content = Markup(api_content), api = use_api) if use_api == 'True' or use_api == "true": access_systems = ast.literal_eval(os.popen('cat ' + access_systems_file).read()) authorized_users = ast.literal_eval(os.popen('cat ' + authorized_users_file).read()) diff --git a/scripts/dashboard/templates/footer.html b/scripts/dashboard/templates/footer.html index 722c511..362d899 100644 --- a/scripts/dashboard/templates/footer.html +++ b/scripts/dashboard/templates/footer.html @@ -1,5 +1,5 @@

-
Dashboard created by KF7EEL - https://github.com/kf7eel/hblink3
HBLink created by N0MJS.
HBLink GitHub page
This is branch: gps
+
Dashboard created by KF7EEL - https://github.com/kf7eel/hblink3
HBLink created by N0MJS.
HBLink GitHub page
This is branch: sms_dev
diff --git a/scripts/dashboard/templates/header.html b/scripts/dashboard/templates/header.html index 820086e..81dfd41 100644 --- a/scripts/dashboard/templates/header.html +++ b/scripts/dashboard/templates/header.html @@ -8,6 +8,9 @@
+{% if api %} + +{% endif %}