geovisio 2.8.0__py3-none-any.whl → 2.8.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. geovisio/__init__.py +16 -3
  2. geovisio/config_app.py +0 -1
  3. geovisio/translations/br/LC_MESSAGES/messages.mo +0 -0
  4. geovisio/translations/br/LC_MESSAGES/messages.po +762 -0
  5. geovisio/translations/da/LC_MESSAGES/messages.mo +0 -0
  6. geovisio/translations/da/LC_MESSAGES/messages.po +10 -1
  7. geovisio/translations/de/LC_MESSAGES/messages.mo +0 -0
  8. geovisio/translations/de/LC_MESSAGES/messages.po +10 -1
  9. geovisio/translations/en/LC_MESSAGES/messages.mo +0 -0
  10. geovisio/translations/en/LC_MESSAGES/messages.po +9 -7
  11. geovisio/translations/eo/LC_MESSAGES/messages.mo +0 -0
  12. geovisio/translations/eo/LC_MESSAGES/messages.po +67 -1
  13. geovisio/translations/es/LC_MESSAGES/messages.mo +0 -0
  14. geovisio/translations/es/LC_MESSAGES/messages.po +4 -3
  15. geovisio/translations/fr/LC_MESSAGES/messages.mo +0 -0
  16. geovisio/translations/fr/LC_MESSAGES/messages.po +30 -4
  17. geovisio/translations/hu/LC_MESSAGES/messages.mo +0 -0
  18. geovisio/translations/hu/LC_MESSAGES/messages.po +4 -3
  19. geovisio/translations/it/LC_MESSAGES/messages.mo +0 -0
  20. geovisio/translations/it/LC_MESSAGES/messages.po +10 -1
  21. geovisio/translations/ja/LC_MESSAGES/messages.mo +0 -0
  22. geovisio/translations/ja/LC_MESSAGES/messages.po +242 -154
  23. geovisio/translations/pl/LC_MESSAGES/messages.mo +0 -0
  24. geovisio/translations/pl/LC_MESSAGES/messages.po +4 -3
  25. geovisio/utils/loggers.py +14 -0
  26. geovisio/utils/params.py +7 -4
  27. geovisio/utils/upload_set.py +24 -10
  28. geovisio/utils/website.py +3 -0
  29. geovisio/web/auth.py +3 -2
  30. geovisio/web/docs.py +3 -14
  31. geovisio/web/upload_set.py +98 -10
  32. geovisio/web/users.py +31 -4
  33. {geovisio-2.8.0.dist-info → geovisio-2.8.1.dist-info}/METADATA +4 -3
  34. {geovisio-2.8.0.dist-info → geovisio-2.8.1.dist-info}/RECORD +36 -33
  35. {geovisio-2.8.0.dist-info → geovisio-2.8.1.dist-info}/WHEEL +1 -1
  36. {geovisio-2.8.0.dist-info → geovisio-2.8.1.dist-info/licenses}/LICENSE +0 -0
geovisio/__init__.py CHANGED
@@ -1,9 +1,9 @@
1
1
  """GeoVisio API - Main"""
2
2
 
3
- __version__ = "2.8.0"
3
+ __version__ = "2.8.1"
4
4
 
5
5
  import os
6
- from flask import Flask, jsonify, stream_template, send_from_directory, redirect, request
6
+ from flask import Flask, jsonify, stream_template, send_from_directory, redirect, request, url_for
7
7
  from flask.cli import with_appcontext
8
8
  from flask_cors import CORS
9
9
  from flask_compress import Compress
@@ -106,7 +106,9 @@ def create_app(test_config=None, app=None):
106
106
  # https://flask.palletsprojects.com/en/2.2.x/deploying/proxy_fix/
107
107
  from werkzeug.middleware.proxy_fix import ProxyFix
108
108
 
109
- app.wsgi_app = ProxyFix(app.wsgi_app, x_for=nb_proxies, x_proto=nb_proxies, x_host=nb_proxies, x_prefix=nb_proxies)
109
+ app.wsgi_app = ProxyFix(
110
+ app.wsgi_app, x_for=nb_proxies, x_proto=nb_proxies, x_host=nb_proxies, x_prefix=nb_proxies, x_port=nb_proxies
111
+ )
110
112
 
111
113
  # store the background processor in the app context
112
114
  app.background_processor = runner_pictures.PictureBackgroundProcessor(app)
@@ -185,6 +187,17 @@ def create_app(test_config=None, app=None):
185
187
  def favicon():
186
188
  return redirect("/static/img/favicon.ico")
187
189
 
190
+ @app.route("/api/debug_headers")
191
+ def debug_headers():
192
+ """Endpoint handy when setting a new instance to check if all the headers are set correctly,
193
+ and especially the X-Forwarded-* header that needs to be set by the proxies in order for the API to correctly build internal urls.
194
+
195
+ The headers are only printed to the console, so it's only for the instance administrator that has access to those logs.
196
+ """
197
+ logging.info(request.headers)
198
+
199
+ return jsonify({"test_url": url_for("index", _external=True)}), 200
200
+
188
201
  # Errors
189
202
  @app.errorhandler(errors.InvalidAPIUsage)
190
203
  def invalid_api_usage(e):
geovisio/config_app.py CHANGED
@@ -38,7 +38,6 @@ class DefaultConfig:
38
38
  DB_CHECK_SCHEMA = True # If True check the database schema, and do not start the api if not up to date
39
39
  API_PICTURES_LICENSE_SPDX_ID = None
40
40
  API_PICTURES_LICENSE_URL = None
41
- API_WEBSITE_URL = None # URL to the website, used to generate links to the website. If not set, the API will presume the website runs from the same url.
42
41
  DEBUG_PICTURES_SKIP_FS_CHECKS_WITH_PUBLIC_URL = False
43
42
  SESSION_COOKIE_HTTPONLY = False
44
43
  PICTURE_PROCESS_REFRESH_CRON = (