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

Make permissions requirements clear for gunicorn user #3013

Closed
Tracked by #3022
mathemancer opened this issue Jul 9, 2023 · 2 comments · Fixed by #3029
Closed
Tracked by #3022

Make permissions requirements clear for gunicorn user #3013

mathemancer opened this issue Jul 9, 2023 · 2 comments · Fixed by #3029
Labels
good first issue Everything in "Help wanted", PLUS being relatively easy and straightforward to implement. help wanted Community contributors can implement this ready Ready for implementation type: enhancement New feature or request work: documentation Improvements or additions to documentation
Milestone

Comments

@mathemancer
Copy link
Contributor

Problem

As seen in #3002 , a user can correctly follow our docs to build from scratch, but end up with an unusable system since there is not step specifying that the gunicorn user needs to be able to write to some subdirectories under the root directory of their Mathesar system. In particular:

  • Gunicorn needs to write to the .media directory to create files when accepting uploaded TSVs etc.
  • Gunicorn needs to read from the static directory (I think; someone should double-check my theory on that).

Proposed solution

Add a step or two in the documentation for building from scratch to either chown or chmod the directories appropriately.

Additional context

#3002

@mathemancer mathemancer added work: documentation Improvements or additions to documentation type: enhancement New feature or request good first issue Everything in "Help wanted", PLUS being relatively easy and straightforward to implement. help wanted Community contributors can implement this ready Ready for implementation labels Jul 9, 2023
@rajatvijay rajatvijay added this to the Backlog milestone Jul 10, 2023
@deka014
Copy link
Contributor

deka014 commented Jul 11, 2023

Hey, I have installed Mathesar locally from scratch using the docs and reproduced the same bug. Apparently, to import files user gunicorn needs permission to upload/write the csv to ~/mathesar/.media/anonymous$ folder.

I have two solutions :

  1. Chmod : Giving write permission to every other users to .media/ folders without changing current ownership
    Using - chmod 777 -R .media/ which results in drwxrwxrwx 3 deep deep 4096 Jul 11 18:52 .media
  2. Chown : Changing ownership of the .media folders to gunicorn, Using - chown -R gunicorn:gunicorn ./media which results in drwxrwxr-x 3 gunicorn gunicorn 4096 Jul 11 18:52 .media

Please let me know which one i should proceed with, i will make the changes accordingly. Thanks 👨‍💻

@kgodey
Copy link
Contributor

kgodey commented Jul 11, 2023

@deka014 I'd recommend using the solution @mathemancer suggested in #3002 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Everything in "Help wanted", PLUS being relatively easy and straightforward to implement. help wanted Community contributors can implement this ready Ready for implementation type: enhancement New feature or request work: documentation Improvements or additions to documentation
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants