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

Allow relocating media root #939

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

Conversation

jmerdich
Copy link

@jmerdich jmerdich commented May 1, 2024

When self hosting, I make backups of the data I cannot recreate-- a lesson I learned the hard way. Right now, all user files (eg. time lapses) are stored under the hardcoded path <gitrepo>/backend/static_build/media which is intermingled with the source. I want to back up the user files and database, but not the source (it's easy to re-clone it and recreate the containers).

The database can already be redirected to a different file with an environment variable for expert users. This trivial change adds a similar MEDIA_ROOT env var for expert users so that all uploaded files can go to a different place if desired.

When self hosting, I make backups of the data I cannot recreate-- a lesson I learned the hard way.  Right now, all user files (eg. time lapses) are stored under the hardcoded path `<gitrepo>/backend/static_build/media` which is intermingled with the source. I want to back up the user files and database, but not the source (it's easy to re-clone it and recreate the containers).

The database can already be redirected to a different file with an environment variable for expert users. This trivial change adds a similar MEDIA_ROOT env var for expert users so that all uploaded files can go to a different place if desired.
@kennethjiang
Copy link
Contributor

I thought I have commented on this PR but apparently I haven't...

I think I understand why you want to make media root customizable. But do you think your problem can be solved by linking ./backend/static_build/media to a folder of your choice?

The reason why I proposed this alternative is it's not obvious to a lot of people that MEDIA_ROOT should be the path in the container, which is different from the one on the host. I feel that having this configurable will only confuse most self-hosted users, and result in a lot of questions about "why is my server failing now after I have changed MEDIA_ROOT?"

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.

2 participants