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

Editing language files and permissions on the languages/ dir #790

Open
hyanwong opened this issue Apr 15, 2024 · 2 comments
Open

Editing language files and permissions on the languages/ dir #790

hyanwong opened this issue Apr 15, 2024 · 2 comments
Labels
background refactor Low-priority refactoring to do whilst touching code anyway

Comments

@hyanwong
Copy link
Member

@lentinj wrote in #778 (comment)

We should probably chown all the OZtree/languages/* files to www when we run grunt?
No, we should be disabling the language re-generation, and putting it behind another config option. It only serves to slow beta down, and having python-writable python files which are executed on each request is an obvious chink in our armour. We also set ourselves up for merge conflicts.

Previously we have allowed logged-in users with certain privileges to edit the language files. I think that's useful, but I agree that we should probably lock down the "auto-create" option for anonymous visitors. I'm not sure we do this, though?

@hyanwong hyanwong changed the title Language files and the the languages/ dir Editing language files and permissions on the languages/ dir Apr 15, 2024
@lentinj
Copy link
Collaborator

lentinj commented Apr 15, 2024

We don't, and that's definitely worth adding:

OZtree/models/db.py

Lines 44 to 45 in 0e513c9

# Allow translators to add new languages e.g. on the test (beta) site, but not on prod
T.is_writable = is_testing

Agreed, being able to use the translation machinery we get for free is a good thing. I'm still somewhat nervous about languages being writable by default in an installation though.

Maybe is_writable = is_testing and logged_in and languages_directory_writable, and we ~manually tweak the permissions for beta?

@hyanwong
Copy link
Member Author

Ah yes, I think we only allowed editing of languages on beta, now I come to think of it. This seems like a good compromise.

@hyanwong hyanwong added the background refactor Low-priority refactoring to do whilst touching code anyway label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
background refactor Low-priority refactoring to do whilst touching code anyway
Projects
None yet
Development

No branches or pull requests

2 participants