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

[FEAT]: /usr/ is not a good default for data directory root. Change to more sane alternative. #167

Open
RlndVt opened this issue Jan 1, 2024 · 8 comments

Comments

@RlndVt
Copy link

RlndVt commented Jan 1, 2024

Feature Description

As currently implemented here a.o.:

From Wikipedia:

Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications. Should be shareable and read-only.[9][10]

As an example, immutable operating systems have /usr/ implemented as a readonly fs.

I would suggest providing /root/cosmos-server as the default root data directory.

@azukaar
Copy link
Owner

azukaar commented Jan 3, 2024

Hello! And thanks for the suggestion
A subfolder of /root does not work as an alternative as container in the market do not run as root
I dont think there is any "good" folder that matches the desciprtion of a multi-user data folder hence why I jsut settled on /usr

@RlndVt
Copy link
Author

RlndVt commented Jan 3, 2024

Files in /root don't have to be owned by root. Docker (basically root) can create a folder a chown it to whatever is appropriate.

/root is 'just' the home-dir of the root user. Seems reasonable to me to have a sub-folder for cosmos-server (runs as root) nested there for the volume mounts.

@azukaar
Copy link
Owner

azukaar commented Jan 3, 2024

I understand that but I meant to say that ideallogically it does not make more sense

  • there isa fundamental issue with users having to traverse non-listable directories to access all their data (since this is a pretty important folder with potentially all your data)
    I used /usr so it wouldnt be in the / but CasaOS for example solved this by simply having /DATA in /

@RlndVt
Copy link
Author

RlndVt commented Jan 3, 2024

I like that your trying to keep / clean.

I see your point about having users be able to access their data. On my fedora system I can't access /root as my normal user. However:

  1. Being able to run docker means that you have had sudo powers (or similar) and should be able to use that to access /root (and/or change /root's permissions to do so.)
  2. The files that containers create may also be non-traversable. (A container might run as non-root, but limit permissions to files or folders so only the owner(&group) may access; whilst not being the uid/gid of the(/any) user.) This kind of makes it a moot point because you'll need root equivalent rights anyway.

Yet if not under /root, perhaps under /media or /mnt... consider docker volume binds equivalent to 'removable media such as CD-ROMs' or 'temporarily mounted filesystems'. (Not too big a stretch of the imagination.)

@azukaar
Copy link
Owner

azukaar commented Jan 3, 2024

  1. yes because you are sudo'd , so you can run docker, but you can't sudo everything, ex. you would lose TAB completion in your terminal
  2. 99% of the time the files belong to your non-root user (at least in the Cosmos market;'s container) there are very few exceptions. Keep in minds those files might also be your photos, videos, musics, etc... so keeping them easily accessible is important

I agree that /usr is not ideal

/mnt /media are no go because they trigger special behaviour in Linux counting them as removable media (ex. proposing the user to unmount them etc..)

@sethleedy
Copy link

Could you create your own directory on / ?

@azukaar
Copy link
Owner

azukaar commented Jan 14, 2024

Could you create your own directory on / ?

That is probably the best alternative

@chewara
Copy link

chewara commented Feb 12, 2024

i recommend /opt

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

No branches or pull requests

4 participants