Skip to content

Commit 6f68102

Browse files
[Fixes #236]: "Feature: Improve upload limits configuration" (#242)
1 parent aa1d97c commit 6f68102

File tree

4 files changed

+83
-69
lines changed

4 files changed

+83
-69
lines changed

charts/geonode/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,25 @@ Helm Chart for Geonode. Supported versions: Geonode: 4.4.0, Geoserver: 2.24.4-v1
5151
| geonode.general.display.wms_link | bool | `true` | DISPLAY_WMS_LINKS If set to False direct WMS link to GeoServer is hidden. |
5252
| geonode.general.externalDomain | string | `"geonode"` | external ingress hostname |
5353
| geonode.general.externalScheme | string | `"http"` | external ingress schema. If set to 'https', make sure to configure TLS either by configuring tls certificate or using cert-manager. Available options: (http|https) |
54+
| geonode.general.extraEnvVars | object | `{}` | extraEnvVars can be used to add geonode environment variable configuration from https://docs.geonode.org/en/master/basic/settings/index.html which are not available in the helm chart. Where the key is the env-var name comming from the geonode docs. |
5455
| geonode.general.force_reinit | bool | `true` | set force reinit true so that changing passwords etc. in Values.yaml will take effect after restarting the pod this on the other hand will increase pod initializing time, only change if you know what you are doing |
5556
| geonode.general.freetext_keywords_readonly | bool | `false` | FREETEXT_KEYWORDS_READONLY Make Free-Text Keywords writable from users. Or read-only when set to False. |
5657
| geonode.general.geonode_project | string | `"geonode"` | the name of the geonode project used (keep geonode for base image) |
57-
| geonode.general.max_document_size | int | `10` | max upload document size in MB |
5858
| geonode.general.ogc_request_backoff_factor | float | `0.3` | OGC_REQUEST_BACKOFF_FACTOR |
5959
| geonode.general.ogc_request_max_retries | int | `1` | OGC_REQUEST_MAX_RETRIES |
6060
| geonode.general.ogc_request_pool_connections | int | `10` | OGC_REQUEST_POOL_CONNECTIONS |
6161
| geonode.general.ogc_request_pool_maxsize | int | `10` | OGC_REQUEST_POOL_MAXSIZE |
6262
| geonode.general.ogc_request_timeout | int | `600` | OGC_REQUEST_TIMEOUT |
6363
| geonode.general.publishing.admin_moderate_uploads | bool | `false` | ADMIN_MODERATE_UPLOADS When this variable is set to True, every uploaded resource must be approved before becoming visible to the public users. Until a resource is in PENDING APPROVAL state, only the superusers, owner and group members can access it, unless specific edit permissions have been set for other users or groups. A Group Manager can approve the resource, but he cannot publish it whenever the setting RESOURCE_PUBLISHING is set to True. Otherwise, if RESOURCE_PUBLISHING (helm: resource_publishing_by_staff) is set to False, the resource becomes accessible as soon as it is approved. |
6464
| geonode.general.publishing.resource_publishing_by_staff | bool | `false` | RESOURCE_PUBLISHING By default, the GeoNode application allows GeoNode staff members to publish/unpublish resources. By default, resources are published when created. When this setting is set to True the staff members will be able to unpublish a resource (and eventually publish it back). |
65+
| geonode.general.session_expired_control_enabled | string | `"True"` | SESSION_EXPIRED_CONTROL_ENABLED (https://docs.geonode.org/en/master/basic/settings/index.html#session-expired-control-enabled) By enabling this variable, a new middleware geonode.security.middleware.SessionControlMiddleware will be added to the MIDDLEWARE_CLASSES. The class will check every request to GeoNode and it will force a log out whenever one of the following conditions occurs:: Whether the uploaded resources should be public by default. |
6566
| geonode.general.settings_additions | string | `""` | add additional settings to the settings py. This code will be appended to the end of the geonode settings.py |
6667
| geonode.general.settings_module | string | `"geonode.settings"` | the settings module to load |
67-
| geonode.haystack.enabled | bool | `false` | enable hystack |
68-
| geonode.haystack.engine_index_name | string | `"haystack"` | hystack index name |
69-
| geonode.haystack.engine_url | string | `"http://elasticsearch:9200/"` | hystack url |
70-
| geonode.haystack.search_results_per_page | string | `"200"` | hystack results per page |
68+
| geonode.general.upload.anonymous_download_permission | string | `"True"` | DEFAULT_ANONYMOUS_DOWNLOAD_PERMISSION (https://docs.geonode.org/en/master/basic/settings/index.html#default-anonymous-download-permission) Whether the uploaded resources should downloadable by default. |
69+
| geonode.general.upload.anonymous_view_permission | string | `"True"` | DEFAULT_ANONYMOUS_VIEW_PERMISSION (https://docs.geonode.org/en/master/basic/settings/index.html#default-anonymous-view-permission) Whether the uploaded resources should be public by default. |
70+
| geonode.general.upload.document_size | int | `60` | max upload document size in MB |
71+
| geonode.general.upload.max_parallel_uploads_per_user | int | `10` | DEFAULT_MAX_PARALLEL_UPLOADS_PER_USER (https://docs.geonode.org/en/master/basic/settings/index.html#default-max-parallel-uploads-per-user) Default: 5 When uploading datasets, this value limits the number os parallel uploads. The parallelism limit is set during installation using the value of this variable. After installation, only an user with administrative rights can change it. These limits can be changed in the admin panel or accessing by api. |
72+
| geonode.general.upload.size | string | `"2097152000"` | DEFAULT_MAX_UPLOAD_SIZE (https://docs.geonode.org/en/master/basic/settings/index.html#default-max-upload-size) Important: This value must be syncronized with nginx.maxClientBodySize Default: 2097152000 (2000 MB in bytes) (104857600 = 100 MB) When uploading datasets or uploading documents, the total size of the uploaded files is verified. The size limits are set during installation using the value of this variable. After installation, only an user with administrative rights can change it. These limits can be changed in the admin panel or accessing by api. |
7173
| geonode.image.name | string | `"geonode/geonode"` | used geonode image |
7274
| geonode.image.tag | string | `"4.4.1"` | tag of used geonode image |
7375
| geonode.imagePullPolicy | string | `"IfNotPresent"` | image pull policy |
@@ -99,14 +101,10 @@ Helm Chart for Geonode. Supported versions: Geonode: 4.4.0, Geoserver: 2.24.4-v1
99101
| geonode.mail.tls | bool | `true` | activate tls for geonode mail (only tls or ssl can be true not both) |
100102
| geonode.mail.use_ssl | bool | `false` | enable ssl for geonode mail (only tls or ssl can be true not both) |
101103
| geonode.memcached.backend | string | `"django.core.cache.backends.memcached.PyLibMCCache"` | memcached backend to use if geonode ">=4.3.0" use django.core.cache.backends.memcached.PyLibMCCache before use django.core.cache.backends.memcached.MemcachedCache |
102-
| geonode.memcached.enabled | bool | `true` | enable memcache, this will spawn one or more seperate memcache container(s) and configure django geonode repsectivly. Dynamic caching (see https://docs.djangoproject.com/en/4.0/topics/cache/) |
104+
| geonode.memcached.enabled | bool | `true` | enable memcache, this will spawn one or more seperate memcache container(s) |
105+
| geonode.memcached.enabled_geonode | bool | `false` | set the MEMCAHED_ENABLED env var for GeoNode (django). Dynamic caching (see https://docs.djangoproject.com/en/4.0/topics/cache/) |
103106
| geonode.memcached.lock_expire | string | `"3600"` | memcached lock expire time |
104107
| geonode.memcached.lock_timeout | string | `"10"` | memcached lock timeout |
105-
| geonode.monitoring.centralized_dashboard_enabled | bool | `false` | |
106-
| geonode.monitoring.data_tls | int | `365` | |
107-
| geonode.monitoring.enabled | bool | `false` | |
108-
| geonode.monitoring.user_analytics_enabled | bool | `true` | |
109-
| geonode.monitoring.user_analytics_gzip | bool | `true` | |
110108
| geonode.persistant.storageSize | string | `"10Gi"` | size of persistant geonode storage |
111109
| geonode.replicaCount | int | `1` | number of geonode replicas (! not working properly yet) |
112110
| geonode.resources.limits.cpu | int | `2` | limit cpu as in resource.requests.cpu (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
@@ -180,11 +178,13 @@ Helm Chart for Geonode. Supported versions: Geonode: 4.4.0, Geoserver: 2.24.4-v1
180178
| nginx.container_name | string | `"nginx"` | nginx container name |
181179
| nginx.external_cors.domain | string | `""` | Target domain for CORS |
182180
| nginx.external_cors.enabled | bool | `false` | Add Access-Control-Allow-Origin directive to allow integration from an external domain |
181+
| nginx.geoServerMaxClientBodySize | string | `"10G"` | maximum upload size for geoserver in nginx configuration. Changes here may also require changes in geoserver configuration of the individual services (WFS, ...) |
182+
| nginx.geonodeMaxClientBodySize | string | `nil` | max file upload size for geonode upload. Only set this value if it should be different from geonode.general.upload.size. to use e.g. if geonode.general.upload.document_size > geonode.general.upload.size |
183183
| nginx.image.name | string | `"nginx"` | nginx docker image |
184184
| nginx.image.tag | string | `"1.25"` | nginx docker image tag |
185185
| nginx.imagePullPolicy | string | `"IfNotPresent"` | nginx image pull policy |
186186
| nginx.imagePullSecret | string | `""` | pull secret to use for nginx image |
187-
| nginx.maxClientBodySize | string | `"2G"` | max file upload size |
187+
| nginx.pycswMaxClientBodySize | string | `"10M"` | maximum upload size for pycsw server in nginx configuration. Only used if `.Values.pycsw.enabled: true`. |
188188
| nginx.replicaCount | int | `1` | nginx container replicas |
189189
| nginx.resources.limits.cpu | string | `"800m"` | limit cpu as in resource.requests.cpu (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
190190
| nginx.resources.limits.memory | string | `"1Gi"` | limits memory as in resource.limits.memory (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
@@ -247,4 +247,4 @@ Helm Chart for Geonode. Supported versions: Geonode: 4.4.0, Geoserver: 2.24.4-v1
247247
| rabbitmq.requests.memory | string | `"1Gi"` | requested memory as in resource.requests.memory (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
248248

249249
----------------------------------------------
250-
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
250+
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)

charts/geonode/templates/geonode/geonode-env.yaml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ data:
1616

1717
CLIENT_RESULTS_LIMIT: '25'
1818
C_FORCE_ROOT: '1'
19-
MAX_DOCUMENT_SIZE: {{ .Values.geonode.general.max_document_size | quote }}
19+
MAX_DOCUMENT_SIZE: {{ .Values.geonode.general.upload.document_size | quote }}
2020
API_LIMIT_PER_PAGE: {{ .Values.geonode.general.api_limit_per_page | quote }}
2121
# GeoNode APIs
2222
API_LOCKDOWN: 'False'
@@ -74,11 +74,11 @@ data:
7474
LOCKDOWN_GEONODE: {{ .Values.geonode.accesscontrol.lockdown | quote }}
7575
CORS_ORIGIN_ALLOW_ALL: 'True'
7676
X_FRAME_OPTIONS: ALLOW-FROM ALL
77-
SESSION_EXPIRED_CONTROL_ENABLED: 'True'
78-
DEFAULT_ANONYMOUS_VIEW_PERMISSION: 'True'
79-
DEFAULT_ANONYMOUS_DOWNLOAD_PERMISSION: 'True'
80-
DEFAULT_MAX_PARALLEL_UPLOADS_PER_USER: '100'
81-
DEFAULT_MAX_UPLOAD_SIZE: '5368709120'
77+
SESSION_EXPIRED_CONTROL_ENABLED: {{ .Values.geonode.general.session_expired_control_enabled | quote }}
78+
DEFAULT_ANONYMOUS_VIEW_PERMISSION: {{ .Values.geonode.general.upload.anonymous_view_permission | quote }}
79+
DEFAULT_ANONYMOUS_DOWNLOAD_PERMISSION: {{ .Values.geonode.general.upload.anonymous_download_permission | quote }}
80+
DEFAULT_MAX_PARALLEL_UPLOADS_PER_USER: {{ .Values.geonode.general.upload.max_parallel_uploads_per_user | quote }}
81+
DEFAULT_MAX_UPLOAD_SIZE: {{ .Values.geonode.general.upload.size | quote }}
8282

8383
# Users Registration
8484
ACCOUNT_OPEN_SIGNUP: {{ include "boolean2str" .Values.geonode.register.open_signup | quote }}
@@ -128,26 +128,12 @@ data:
128128
TIME_ENABLED: 'True'
129129
MOSAIC_ENABLED: 'False'
130130

131-
HAYSTACK_SEARCH: {{ include "boolean2str" .Values.geonode.haystack.enabled | quote }}
132-
HAYSTACK_ENGINE_URL: {{ .Values.geonode.haystack.engine_url | quote }}
133-
HAYSTACK_ENGINE_INDEX_NAME: {{ .Values.geonode.haystack.engine_index_name | quote }}
134-
HAYSTACK_SEARCH_RESULTS_PER_PAGE: {{ .Values.geonode.haystack.search_results_per_page | quote }}
135-
136131
MEMCACHED_ENABLED: {{ include "boolean2str" .Values.geonode.memcached.enabled_geonode | quote }}
137132
MEMCACHED_BACKEND: {{ .Values.geonode.memcached.backend | quote }}
138133
MEMCACHED_LOCATION: {{ .Release.Name }}-memcached
139134
MEMCACHED_LOCK_EXPIRE: {{ .Values.geonode.memcached.lock_expire | quote }}
140135
MEMCACHED_LOCK_TIMEOUT: {{ .Values.geonode.memcached.lock_timeout | quote }}
141136

142-
# Monitoring
143-
MONITORING_ENABLED: {{ include "boolean2str" .Values.geonode.monitoring.enabled | quote }}
144-
MONITORING_DATA_TTL: {{ .Values.geonode.monitoring.data_tls | quote }}
145-
USER_ANALYTICS_ENABLED: {{ include "boolean2str" .Values.geonode.monitoring.user_analytics_enabled | quote }}
146-
USER_ANALYTICS_GZIP: {{ include "boolean2str" .Values.geonode.monitoring.user_analytics_gzip | quote }}
147-
CENTRALIZED_DASHBOARD_ENABLED: {{ include "boolean2str" .Values.geonode.monitoring.centralized_dashboard_enabled | quote }}
148-
MONITORING_SERVICE_NAME: {{ .Release.Name }}-monitoring
149-
MONITORING_HOST_NAME: {{ .Release.Name }}-monitoring
150-
151137
# Other Options/Contribs
152138
MODIFY_TOPICCATEGORY: 'True'
153139
AVATAR_GRAVATAR_SSL: 'True'
@@ -187,3 +173,8 @@ data:
187173
GEONODE_GEODATABASE: {{ .Values.postgres.geodata_databasename_and_username | quote }}
188174
GEONODE_DATABASE_SCHEMA: {{ .Values.postgres.schema }}
189175
GEONODE_GEODATABASE_SCHEMA: {{ .Values.postgres.schema }}
176+
177+
# import all settings from values.geonode.general.extraEnvVars
178+
{{- if .Values.geonode.general.extraEnvVars }}
179+
{{- toYaml .Values.geonode.general.extraEnvVars | nindent 2 }}
180+
{{- end }}

charts/geonode/templates/nginx/nginx-conf.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ data:
5555
# GeoNode
5656
location /static/ {
5757
alias /mnt/volumes/statics/static/;
58-
client_max_body_size {{ .Values.nginx.maxClientBodySize }};
59-
6058
location ~* \.(?:html|js|jpg|jpeg|gif|png|css|tgz|gz|rar|bz2|doc|pdf|ppt|tar|wav|bmp|ttf|rtf|swf|ico|flv|txt|woff|woff2|svg|xml)$ {
6159
gzip_static always;
6260
expires 30d;
@@ -68,7 +66,11 @@ data:
6866
6967
# GeoNode Upload
7068
location /uploaded/ {
71-
client_max_body_size {{ .Values.nginx.maxClientBodySize }};
69+
{{ if .Values.nginx.geonodeMaxClientBodySize }}
70+
client_max_body_size {{ .Values.nginx.geonodeMaxClientBodySize }};
71+
{{ else }}
72+
client_max_body_size {{ .Values.geonode.general.upload.size }};
73+
{{ end }}
7274

7375
alias /mnt/volumes/statics/uploaded/;
7476
location ~* \.(?:html|js|jpg|jpeg|gif|png|css|tgz|gz|rar|bz2|doc|pdf|ppt|tar|wav|bmp|ttf|rtf|swf|ico|flv|txt|woff|woff2|svg|xml)$ {
@@ -110,7 +112,7 @@ data:
110112
{{if (eq .Values.geonode.ingress.enabled false) }}
111113
# GeoServer
112114
location /geoserver {
113-
client_max_body_size {{ .Values.nginx.maxClientBodySize }};
115+
client_max_body_size {{ .Values.nginx.geoServerMaxClientBodySize }};
114116

115117
{{- if .Values.nginx.external_cors.enabled }}
116118
proxy_set_header Access-Control-Allow-Origin {{ .Values.nginx.external_cors.domain }};
@@ -125,7 +127,7 @@ data:
125127
{{ if .Values.pycsw.enabled }}
126128
# external PYCSW forward
127129
location {{ .Values.pycsw.endpoint }} {
128-
client_max_body_size {{ .Values.nginx.maxClientBodySize }};
130+
client_max_body_size {{ .Values.nginx.pycswMaxClientBodySize }};
129131

130132
# compression
131133
gzip on;
@@ -148,8 +150,11 @@ data:
148150
{{ end }}
149151
{{ end }}
150152
location / {
151-
client_max_body_size {{ .Values.nginx.maxClientBodySize }};
152-
153+
{{ if .Values.nginx.geonodeMaxClientBodySize }}
154+
client_max_body_size {{ .Values.nginx.geonodeMaxClientBodySize }};
155+
{{ else }}
156+
client_max_body_size {{ .Values.geonode.general.upload.size }};
157+
{{ end }}
153158
# FIXME: Work around /proxy sometimes using a mix of public/internal URL to geonode...
154159
rewrite_log on;
155160
#rewrite ^/proxy/(.*)url=http?://{{ .Values.geonode.general.externalDomain }}(:\d+)?/geoserver(.*) /proxy/$1url=http://geoserver:{{ .Values.geoserver.port }}$3 last;

0 commit comments

Comments
 (0)