Skip to content

Commit

Permalink
Merge pull request #277 from CybercentreCanada/hotfix/discover
Browse files Browse the repository at this point in the history
Don't add you own site to the app list
  • Loading branch information
cccs-sgaron authored Sep 24, 2021
2 parents 2f16676 + 1f09a6d commit 760cfd8
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions assemblyline_ui/helper/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@ def get_apps_list():
if resp.ok:
data = resp.json()
for app in data['applications']['application']:
apps['apps'].append(
{
"alt": app['instance'][0]['metadata']['alternateText'],
"name": app['name'],
"img_d": app['instance'][0]['metadata']['imageDark'],
"img_l": app['instance'][0]['metadata']['imageLight'],
"route": app['instance'][0]['hostName'],
"classification": app['instance'][0]['metadata']['classification']
}
)
try:
url = app['instance'][0]['hostName']

if config.ui.fqdn not in url:
apps['apps'].append(
{
"alt": app['instance'][0]['metadata']['alternateText'],
"name": app['name'],
"img_d": app['instance'][0]['metadata']['imageDark'],
"img_l": app['instance'][0]['metadata']['imageLight'],
"route": url,
"classification": app['instance'][0]['metadata']['classification']
}
)
except Exception:
logger.exception(f'Failed to parse get app: {str(app)}')
else:
logger.warning(f'Invalid response from server for apps discovery: {config.ui.discover_url}')
except Exception:
Expand Down

0 comments on commit 760cfd8

Please sign in to comment.