openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
657 stars 385 forks source link

Remove app specific stuff from the config #2622

Open hangy opened 4 years ago

hangy commented 4 years ago

The nginx config for off contains 4 country specific links to a French donation page https://github.com/openfoodfacts/openfoodfacts-server/blob/cb03bcc799f3e9fa2218cf3bfcc009ddbdce0e4d/conf/nginx/sites-available/off#L111-L114 and a link to the worldwide English donation page https://github.com/openfoodfacts/openfoodfacts-server/blob/cb03bcc799f3e9fa2218cf3bfcc009ddbdce0e4d/conf/nginx/sites-available/off#L115, and also contains a bunch of language/country(?) specific location directives https://github.com/openfoodfacts/openfoodfacts-server/blob/cb03bcc799f3e9fa2218cf3bfcc009ddbdce0e4d/conf/nginx/sites-available/off#L211-L264 for donation pages

Additionally, the redirects are not even synced for several domains, as seen here https://github.com/openfoodfacts/openfoodfacts-server/blob/cb03bcc799f3e9fa2218cf3bfcc009ddbdce0e4d/conf/nginx/sites-available/off#L362-L363 https://github.com/openfoodfacts/openfoodfacts-server/blob/cb03bcc799f3e9fa2218cf3bfcc009ddbdce0e4d/conf/nginx/sites-available/off#L542-L543

In my opinion, the nginx configuration is a really bad place to put this configuration for several reasons

  1. It's not consistent with the rest of the application: Internationalized links are stored in .po files or based on some filename throughout ProductOpener, and ProductOpener is the one instance that should be responsible to dispatch between those files.
  2. ProductOpener used to be the one source responsible to display HTML files of the /html directory in the git repository - inconsistent behaviour
  3. Why would the don subdomain be used for the French donne URL instead of the English donate page?
  4. Why would a single country need four different links for donation pages/URLs?!
  5. If this is purely for promotional purposes, a separate URL shortener (ie. host it in Docker!) might be a better option.
  6. We support over 100 languages and nearly 300 countries. If we acted fairly, we'd need a separate subdomain for every countries and/or languages donation page. I don't need to explain that this would be a madness to configure?
  7. Generally speaking, there's no real advantage to a URL donnez.openfoodfacts.org instead of fr.openfoodfacts.org/donate (or fr.openfoodfacts.org/donnez if you must). If a shorter URL is required, an actual URL shortener could be used instead.
teolemon commented 4 years ago

Basically, we've tried handing over responsability of translating links to translators, but the current system is very error prone, and we pedaled back. Also, URLs are forever. Thus the more centralized solution.

There's a proposal to solve URLs in static content, which would be a lifechanger for me, and improve the feeling of localisation by enabling stable, translated urls in a reliable way (and we could extend that to common.pot). https://github.com/openfoodfacts/openfoodfacts-server/issues/1818

github-actions[bot] commented 4 years ago

Stale issue message