Permalink
Browse files

Trick adblockers to show Piwik logo

  • Loading branch information...
loomchild committed Jan 13, 2018
1 parent c53c90a commit d33a0d2f7040085e471456302363fb7e01447b42
Showing with 6 additions and 1 deletion.
  1. +3 −1 puffin/core/applications.py
  2. +3 −0 puffin/gui/view.py
@@ -44,7 +44,9 @@ def __init__(self, application_id):
self.description = re.sub(r'([a-z0-9]+(/[a-z0-9-_]+)*\.(png|jpg))', '/media/' + application_id + r'/\1', self.description)
self.compose = os.path.join(self.path, "docker-compose.yml")
self.logo = os.path.join(self.application_id, "logo.png")
# add prefix to trick ad blockers
self.logo = 'image-' + os.path.join(self.application_id, "logo.png")
compose_data = {}
with open(self.compose) as compose_file:
View
@@ -102,6 +102,9 @@ def apps():
def media(path):
if not path[-3:] in ("png", "jpg"):
raise Exception("Unsupported media file format")
if path.startswith('image-'):
path = path[6:]
print(path)
return flask.send_from_directory(applications.APPLICATION_HOME, path)
@app.route('/application/<application_id>/settings.html', methods=['GET', 'POST'])

0 comments on commit d33a0d2

Please sign in to comment.