glondu / belenios

Verifiable online voting system. This is a mirror of https://gitlab.inria.fr/belenios/belenios
https://www.belenios.org
GNU Affero General Public License v3.0
130 stars 21 forks source link

Allow customizing the displayed logos #36

Open albanbruder opened 3 years ago

albanbruder commented 3 years ago

For branding purposes it would be nice to have the option to change the logos displayed in the booth (left and right).

Example: belenios-with-custom-logos

Currently we are use a kind of hacky solution to ahive this: We define custom properties in the election description using JSON

{
    "description":"Wahl der Fachschaftsrats M // Election of the Student Council M",
    "logos":{
        "left":"https://m18.uni-weimar.de/files/2018/03/M_Logo_mitText-640x503.png",
        "right":"https://m18.uni-weimar.de/files/2018/03/StuKo_Logo.png"
    }
}

and than replace the default logos using a view lines of JavaScript.

One example for a native solution: belenios-custom-logos-admin

Thanks for the great work!

glondu commented 3 years ago

I am uneasy about this.

Allowing users to load images from third party servers would allow that third party (which could be the election administrator) to record IP addresses of visitors. This remark may be irrelevant in your case since you set up your own server and you may restrict who can act as an election administrator, but it is not the case of our public instance which, at the moment, and to the best of my knowledge, does not expose IP addresses of visitors. I am also wondering what would be the interaction with our own data privacy policy.

We could put images directly into the election.json, you could say. To that, I'll object that, on our own instance, we definitely do not want people to put arbitrary images on what looks like our website. But adding the feature as optional might be worth considering.

albanbruder commented 3 years ago

I see your point.

That is exactly why we did not include the images directly (in the browser), but rather used a proxy to protect the IP address of the visitor. One could even cache the images after the election was opened so that the fingerprints can be verified during the election.

I guess another option would be to allow the election administrator to select the logos from a set of pictures (defined by the server administrator). In such a case organizations hosting their own Belenios instance could upload their logos and wouldn't have to worry about malicious content.

hwellmann commented 3 years ago

A note on this: I tried replacing the logo file by a custom logo in my local build. Of course my logo differs in width and height from the official one, so I didn't expect it to look perfect...

But I was suprised to see the logo displayed in different sizes on different pages, due to different styling. Maybe there's a way to factor out a header template shared by all web pages.

glondu commented 1 year ago

Technically, there are indeed several HTML templates (in 1.20):

  1. the "old" template, used in server-generated pages (inherited from Helios)
  2. the "new" template, more responsive, used in server-generated pages interacting with the new booth
  3. the "old" booth (v1)
  4. the "new" booth (v2)

I've recently removed (1) and started using (2) everywhere in server-generated pages. I think (3) will probably stay until the old booth is removed altogether. (4) uses different technology and will probably stay there for a long time (most likely until it is removed in favor of a booth v3).

Concerning the original request: it occurred to me that setting the logo for a whole instance could be done simply at the reverse proxy level (when one is used), with no changes to Belenios itself. @albanbruder Maybe this is enough for your use case?