GeoNode / geonode-project

A django template project for creating custom GeoNode projects.
http://geonode.org
77 stars 170 forks source link

Inconsistent locale in geonode container #464

Closed etj closed 10 months ago

etj commented 10 months ago

Within the docker container the locale settings are set this way

LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

and this may cause problems when geonode needs to deal with non-ascii characters (we got errors when an avatar had the jpg file containing a "ö".

We need to set a proper encoding.

etj commented 10 months ago

In a server we got:

geonode=# select * from avatar_avatar where user_id = 1089;
 id | primary |                     avatar                     |        date_uploaded         | user_id 
----+---------+------------------------------------------------+------------------------------+---------
 10 | t       | avatars/JohanXXXXXXXXXX/kuva_työhakemukset.jpg | 2022-10-12 09:28:20.74668+00 |    1089
(1 row)

This is how the file looked in the host (ok):

root@geonode-11:/srv/utu-geonode# ll /var/lib/docker/volumes/utugeonode-statics/_data/uploaded/avatars/JohanXXX
total 800
drwxr-xr-x  3 root root   4096 loka   12  2022 ./
drwxr-xr-x 13 root root   4096 helmi  18 12:21 ../
-rw-r--r--  1 root root 805437 loka   12  2022 kuva_työhakemukset.jpg
drwxr-xr-x  6 root root   4096 loka   12  2022 resized/
root@geonode-11:/srv/utu-geonode#

This is how the file looked in the container (broken):

root@596f4fc93a49:/usr/src/utu_geonode# ll /mnt/volumes/statics/uploaded/avatars/JohanXXX
total 800
drwxr-xr-x  3 root root   4096 Oct 12  2022  ./
drwxr-xr-x 13 root root   4096 Feb 18 10:21  ../
-rw-r--r--  1 root root 805437 Oct 12  2022 'kuva_ty'$'\303\266''hakemukset.jpg'
drwxr-xr-x  6 root root   4096 Oct 12  2022  resized/
root@596f4fc93a49:/usr/src/utu_geonode#