Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fixes #160] Bug: Error in tasks.py when initiating GeoNode container #161

Merged

Conversation

mwallschlaeger
Copy link
Contributor

Description

ref #160 fixes bug, while initiating geonode inside tasks.py. Fixing bugs in datastore creation and changing default geoserver admin password.

Type of Change

Please select the relevant option:

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Other (please describe)

Related Issue

If there is an existing issue related to this pull request, please reference it here.

closes #160

Checklist

Please ensure that your pull request meets the following requirements:

  • The pull request is limited to one type (docs, feature, bug fix, etc.)
  • The pull request is as small as possible. Consider opening multiple pull requests instead of one large one.
  • The feature or bug fix has been discussed and documented in an issue beforehand.

Additional Notes

Any additional information or context regarding the pull request can be provided here.

Thank you for creating this pull request

@mwallschlaeger mwallschlaeger added this to the release 1.1.0 milestone Mar 7, 2024
@mwallschlaeger mwallschlaeger self-assigned this Mar 7, 2024
@AlexGacon
Copy link
Collaborator

Looks good to me

@@ -147,7 +147,7 @@ Helm Chart for Geonode. Supported versions: Geonode: 4.1.3, Geoserver: 2.23.0, p
| geoserver.resources.limits.memory | string | `"4Gi"` | limits memory as in resource.limits.memory (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
| geoserver.resources.requests.cpu | int | `1` | requested cpu as in resource.requests.cpu (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
| geoserver.resources.requests.memory | string | `"1Gi"` | requested memory as in resource.requests.memory (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
| geoserver.secret.admin_password | string | `"geoserver"` | geoserver admin password |
| geoserver.secret.admin_password | string | `"geoserver"` | geoserver admin password only gets only changed when the previous username/password combination is the default one (admin/geoserver) |
Copy link
Member

Choose a reason for hiding this comment

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

To be picky here: there is also GEOSERVER_FACTORY_PASSWORD. IMO, the naming could be better here, because this setting can be seen (more or less) as currently set password when you want to set a new GeoServer admin password.

If we want to limit this configuration to-be-set-once (as documented) I am fine with it, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This thing got a new spin now. The password now gets changed by the Geserver entrypoint.sh, which wasn't working before because of the missing envvar: FORCE_REINIT. Therefor i removed the code to set the password from the geonode-k8s/tasks.py.

Further I added the factory_admin_password variable and gave some documentation on how to use it

Copy link
Member

Choose a reason for hiding this comment

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

Do you want to stick with the factory_ part? To me it is actually the currently set password (initial or not) which can be used to set a new password. However, it is also very valid to keep naming in sync with the upstream.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would stick to the naming as it is used in the official image

Copy link

gitguardian bot commented Mar 7, 2024

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
Once a secret has been leaked into a git repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@mwallschlaeger mwallschlaeger requested review from ridoo and removed request for matthesrieke March 7, 2024 10:49
@@ -19,3 +19,4 @@ data:
DATABASE_PORT: "{{ include "database_port" . }}"
GEONODE_GEODATABASE: {{ .Values.postgres.geodata_databasename_and_username | quote }}
GEONODE_GEODATABASE_SCHEMA: {{ .Values.postgres.schema | quote }}
FORCE_REINIT: 'true'
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if you really want to reconfigure GeoServer always .. TBH I do not know how geonode-k8s handles that flag on the other containers. It is used in the entrypoint.sh of geonode/celery containers at least.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ridoo for geoserver I don't think its a big deal. atm it only updates the password of the geoserver admin and updates the timestamp of the .lock file. And for celery its kind of the same, updating fixtures, updating the timestamp of the .lock file and updating the geonode admin password if it has changed.

In my opinion, except the .lock update everything is required at each pod start anyway, or at least dosn't destroys anything. Building a switch arround this variable would bring another layer of complexity into this chart. What i could image is to add an values.yaml parameter which is enabled by default but can be disabled like:

geonode:
  force_reinit: true

geoserver:
  force_reinit: true

Copy link
Member

Choose a reason for hiding this comment

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

Completely fine with me 👍

@ridoo ridoo self-requested a review March 7, 2024 13:54
@ridoo
Copy link
Member

ridoo commented Mar 7, 2024

Accidentally re-requested review .. you can just ignore it

@mwallschlaeger
Copy link
Contributor Author

ignore readthedocs check for now. this will work as soon as PR #163 is merged

@ridoo ridoo merged commit 8843d65 into main Mar 8, 2024
3 checks passed
@ridoo ridoo deleted the issue_#160_Bug_Error_in_tasks.py_when_initiating_GeoNode_container branch March 8, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Error in tasks.py when initiating GeoNode container
3 participants