Skip to content

Commit

Permalink
add option to disable the config link on map
Browse files Browse the repository at this point in the history
This simply removes the UI element, it doesn't solve the issue that a user to
whom you make the map available might just change the port used in their web
browser and access the feeder home page that way.

Fixes: #179

Signed-off-by: Dirk Hohndel <[email protected]>
  • Loading branch information
dirkhh committed Apr 29, 2024
1 parent fee5029 commit 6391ca9
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
1 change: 1 addition & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Changes since v2.0.0 include:
- add an option to remove the config link from the map
- change the file name extension of backups from .zip to .backup
- disable docker healthcheck for all containers (hopefully improve MLAT on pi3)
- add micro feeder status info to index and stage2 settings page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ def setup_app_ports(self):
# ok, we don't have them explicitly set, so let's set them up
# with the app defaults
self._d.env_by_tags("webport").value = 1099
self._d.env_by_tags("tar1090_image_config_link").value = "http:https://HOSTNAME:1099/"
self._d.env_by_tags("tar1090port").value = 1090
self._d.env_by_tags("uatport").value = 1091
self._d.env_by_tags("piamapport").value = 1092
Expand Down Expand Up @@ -1325,6 +1326,10 @@ def update(self):
return render_template("/waitandredirect.html")
if key == "secure_image":
self.set_secure_image()
if key == "no_config_link":
self._d.env_by_tags("tar1090_image_config_link").value = ""
if key == "allow_config_link":
self._d.env_by_tags("tar1090_image_config_link").value = f"http:https://HOSTNAME:{self._d.env_by_tags('webport').value}/"
if key.startswith("update_feeder_aps"):
channel = key.rsplit("_", 1)[-1]
if channel == "branch":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,45 @@ <h5 class="mt-3">Secure feeder system</h5>
</div>
</form>
</div>
{% if env_value_by_tag('tar1090_image_config_link') != '' %}
<div class="col-12 col-lg-6">
<h5 class="mt-3">Don't show config link on map page</h5>
<form method="POST" onsubmit="show_spinner(); return true;">
<div class="row align-items-center">
<div class="col-8">
<label for="no_config_link">If you want to share ONLY the map / statistics with others, but don't want to show
them the link to the adsb.im feeder image home page (which allows them to change the configuration), you can
disable it here. Please note that the user still can simply access that page by changing the port that they
access your feeder on from {{ env_value_by_tag('tar1090port') }} to {{ env_value_by_tag('webport') }},
unless you filter this out through some firewall settings (which isn't something this image supports).
</label>
</div>
<div class="col-4">
<button type="submit" class="btn btn-primary mx-auto w-100" name="no_config_link" value="go">Update
Settings</button>
</div>
</div>
</form>
</div>
{% else %}
<div class="col-12 col-lg-6">
<h5 class="mt-3">Show config link on map page</h5>
<form method="POST" onsubmit="show_spinner(); return true;">
<div class="row align-items-center">
<div class="col-8">
<label for="no_config_link">Reenable the link to the adsb.im feeder image home page on the map page.
Please make sure that both the map port {{ env_value_by_tag('tar1090port') }} and the feeder UI port
{{ env_value_by_tag('webport') }} are accessible to users.
</label>
</div>
<div class="col-4">
<button type="submit" class="btn btn-primary mx-auto w-100" name="allow_config_link" value="go">Update
Settings</button>
</div>
</div>
</form>
</div>
{% endif %}
<div class="col-12 col-lg-6 {% if is_enabled('secure_image') %} d-none {% endif %}">
<h5 class="mt-3">Shutdown/Reboot</h5>
<form method="POST">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ services:
- TAR1090_ENABLE_ACTUALRANGE=${AF_FALSE_ON_STAGE2:-true}
- TAR1090_USEROUTEAPI=${FEEDER_TAR1090_USEROUTEAPI}
- TAR1090_ROUTEAPIURL="https://adsb.im/api/0/routeset"
- TAR1090_IMAGE_CONFIG_LINK="http:https://HOSTNAME:${AF_WEBPORT}/"
- TAR1090_IMAGE_CONFIG_LINK="${FEEDER_TAR1090_IMAGE_CONFIG_LINK}"
- TAR1090_IMAGE_CONFIG_TEXT="ADS-B Feeder Image Configuration"
# options for the µImage:
- TAR1090_ENABLE_AC_DB=${FEEDER_ENABLE_AC_DB:-true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ services:
- TAR1090_RANGERINGSCOLORS='#1A237E','#0D47A1','#42A5F5','#64B5F6'
- TAR1090_USEROUTEAPI=${FEEDER_TAR1090_USEROUTEAPI}
- TAR1090_ROUTEAPIURL="https://adsb.im/api/0/routeset"
- TAR1090_IMAGE_CONFIG_LINK="http:https://HOSTNAME:${AF_WEBPORT}/"
- TAR1090_IMAGE_CONFIG_LINK="${FEEDER_TAR1090_IMAGE_CONFIG_LINK}"
- TAR1090_IMAGE_CONFIG_TEXT="ADS-B Feeder Image Configuration"
- TAR1090_ENABLE_AC_DB=true
# --------------------------------------------------
Expand Down

0 comments on commit 6391ca9

Please sign in to comment.