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

Drop root privileges for celery worker #3272

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

svenseeberg
Copy link
Member

Short description

The run.sh is running with root privileges. However, celery does not need those.

Proposed changes

  • Drop root privileges before executing the celery worker
  • add additional celery temp files to gitignore

Side effects

  • none

Resolved issues

Fixes: https://chat.tuerantuer.org/digitalfabrik/pl/qcemkcp5aid8dnhes6obwtiooo


Pull Request Review Guidelines

@svenseeberg svenseeberg marked this pull request as ready for review December 6, 2024 12:23
Copy link
Member

@david-venhoff david-venhoff left a comment

Choose a reason for hiding this comment

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

Thanks a lot, this fixes the warning for me :)

celerybeat-schedule
celerybeat-schedule.db
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
celerybeat-schedule.db
celerybeat-schedule.dat

Copy link
Contributor

Choose a reason for hiding this comment

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

celerybeat-schedule.db is apparently also a thing 😅

celerybeat-schedule
celerybeat-schedule.db
Copy link
Contributor

Choose a reason for hiding this comment

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

celerybeat-schedule.db is apparently also a thing 😅

@@ -47,7 +47,7 @@ done
listen_for_devserver &

# Run Celery worker process
celery -A integreat_cms.integreat_celery worker -l INFO -B --concurrency=1 &
deescalate_privileges celery -A integreat_cms.integreat_celery worker -l INFO -B --concurrency=1 &
Copy link
Contributor

Choose a reason for hiding this comment

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

This is more a question than a comment, but: are we dependent on celery for the dev env? Because as far as I can tell, I can still do everything I normally would in the CMS when commenting out this line. I get that background workers won't be available, but will this crash the dev server, or just lead to errors in the logs?

If it is "optional", I would love the option to set an environment variable to skip starting celery (and thus not need redis installed).

If it is mandatory, I think the docs should mention that redis is also a mandatory prerequisite to running the dev server.

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.

3 participants