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

[Req] Combine home share and root share? #61

Open
xiota opened this issue Jun 29, 2023 · 4 comments · May be fixed by #96
Open

[Req] Combine home share and root share? #61

xiota opened this issue Jun 29, 2023 · 4 comments · May be fixed by #96

Comments

@xiota
Copy link

xiota commented Jun 29, 2023

Description

Since both home share and root share both use the same bwrap --bind option, why not unify them and allow ~, $HOME, and other select variables ($XDG_*)?

@igo95862
Copy link
Owner

igo95862 commented Jun 29, 2023

Adding environ expansion it to existing options might break someone's setup if they already shared a folder with $ in the name. Maybe as a new option for root share?

Also just using $HOME is not enough to find home. Python will read /etc/passwd to find home.

@xiota
Copy link
Author

xiota commented Jun 29, 2023

Extending root share would effectively satisfy this request. This would also allow read-only shares in the home folder with portable instance folders.

$ in paths is normally pretty uncommon. But full variable expansion isn't necessary. Just the common ~, HOME, XDG_* at the beginning of the path would be sufficient.

Would also be useful to extend with following features:

  • Ability to create folders that don't already exist, including random/temp folders
  • Ability to map differently named folders
  • Delete the temp folder on exit

I believe some of the above are already provided by bwrap options. They would be useful to map commonly disposable locations, like ~/.cache/*, to newly created temporary folders in tmpfs, like /run/user/####.

I'm picturing a GUI that looks like a table, with entry fields and checkboxes:

   SRC          DST          RO   VE   TMP
X  __________   __________   []   []   []
X  __________   __________   []   []   []
X  __________   __________   []   []   []

Also just using $HOME is not enough to find home. Python will read /etc/passwd to find home.

If you allow full variable expansion, wouldn't os.path.expandvars take care of $HOME?

I'm fine with dropping ~ if checking for it makes code too convoluted.

@igo95862
Copy link
Owner

igo95862 commented Jul 1, 2023

Kind of reminds me of a volume system that docker/podman used. It has been already been discussed in #56 .

As for expanding variables for paths. Only as a new option. Backwards compatibility is very important.

@xiota
Copy link
Author

xiota commented Jul 1, 2023

As for expanding variables for paths. Only as a new option. Backwards compatibility is very important.

That would be fine with me.

Backwards compatibility is very important.

What about a new share system that stores paths in the toml as lists? As long as new options are added only to the end of the list, backwards compatibility can be maintained with future expansions. (Extra or missing options can be ignored.)

[map_share]
map_paths = [
    ["SRC", "DST", RO, VE, TMP, ETC],
]

@xiota xiota changed the title Combine home share and root share? [Req] Combine home share and root share? Sep 15, 2023
@xiota xiota linked a pull request Mar 5, 2024 that will close this issue
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 a pull request may close this issue.

2 participants