Skip to content

Add read DEFAULT_MAX_UPLOAD_SIZE from environment#14143

Open
EHJ-52n wants to merge 1 commit intoGeoNode:masterfrom
52North:fix/read-default-max-upload-size-from-environment
Open

Add read DEFAULT_MAX_UPLOAD_SIZE from environment#14143
EHJ-52n wants to merge 1 commit intoGeoNode:masterfrom
52North:fix/read-default-max-upload-size-from-environment

Conversation

@EHJ-52n
Copy link
Copy Markdown
Contributor

@EHJ-52n EHJ-52n commented Apr 15, 2026

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

For all pull requests:

  • Confirm you have read the contribution guidelines
  • You have sent a Contribution Licence Agreement (CLA) as necessary (not required for small changes, e.g., fixing typos in the documentation)
  • Make sure the first PR targets the master branch, eventual backports will be managed later. This can be ignored if the PR is fixing an issue that only happens in a specific branch, but not in newer ones.

The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):

  • There is a ticket in https://github.com/GeoNode/geonode/issues describing the issue/improvement/feature (a notable exemption is, changes not visible to end-users)
  • The issue connected to the PR must have Labels and Milestone assigned
  • PR for bug fixes and small new features are presented as a single commit
  • PR title must be in the form "[Fixes #<issue_number>] Title of the PR"
  • New unit tests have been added covering the changes, unless there is an explanation on why the tests are not necessary/implemented

Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.

@cla-bot cla-bot Bot added the cla-signed CLA Bot: community license agreement signed label Apr 15, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies geonode/settings.py to allow the DEFAULT_MAX_UPLOAD_SIZE to be configured via an environment variable. Feedback was provided to improve the readability of the default value using a calculation and to enhance robustness when handling empty environment variables.

Comment thread geonode/settings.py Outdated
EHJ-52n added a commit to 52North/igb_geonode-blueprint that referenced this pull request Apr 15, 2026
@giohappy giohappy self-requested a review April 16, 2026 07:50
Copy link
Copy Markdown
Contributor

@giohappy giohappy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EHJ-52n fine to me. You're aware that this variable is only used once, the first time GeoNode is initialised.

@EHJ-52n
Copy link
Copy Markdown
Contributor Author

EHJ-52n commented Apr 16, 2026

Yes, but why?

Should we state this fact somewhere? In the settings.py itself, or maybe add it to the .env.sample next to DEFAULT_MAX_PARALLEL_UPLOADS_PER_USER?

@giohappy
Copy link
Copy Markdown
Contributor

Yes, but why?

The unusual behaviour is due to the fact that the upload limits are stored in the DB to allow their management from the Django Admin. Allowing a dynamic configuration from the environment could potentially lead to conflicting settings.

https://docs.geonode.org/en/5.0.x/admin/upload-size-limits/index.html

I agree that this should be clarified, either in the code or the docs, or both.
NOTE: We're transitioning to mkdocs documentation, stored directly inside the GeoNode repo. The migration is not complete yet, but new docs or enhancements should go there first.

@EHJ-52n EHJ-52n force-pushed the fix/read-default-max-upload-size-from-environment branch from 94ca636 to 0e26b31 Compare April 20, 2026 10:22
@EHJ-52n
Copy link
Copy Markdown
Contributor Author

EHJ-52n commented Apr 20, 2026

It is already documented in the help topic „Upload Size Limits“, which is not anchored in the TOC and in the environment variables topic below GeoNode Settings → Settings, which is anchored in the TOC.

I added some comments to the settings.py and stashed all commits in this PR via force-push.

Do you want me to add the same content to the sample.env?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed CLA Bot: community license agreement signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants