[GH-ISSUE #783] Add copy command to Filesystem category in profile #530

Closed
opened 2026-05-05 06:03:38 -06:00 by gitea-mirror · 11 comments
Owner

Originally created by @graywolf on GitHub (Sep 15, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/783

I'm using browser with private ~/.firejails/palemoon. It would be nice to have ability to copy config files into that home automatically.

private ~/.firejails/palemoon
copy ~/.vim ~/.vim
copy ~/.vimrc ~/.vimrc
copy ~/.gvimrc ~/.gvimrc
Originally created by @graywolf on GitHub (Sep 15, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/783 I'm using browser with `private ~/.firejails/palemoon`. It would be nice to have ability to copy config files into that home automatically. ``` private ~/.firejails/palemoon copy ~/.vim ~/.vim copy ~/.vimrc ~/.vimrc copy ~/.gvimrc ~/.gvimrc ```
gitea-mirror 2026-05-05 06:03:38 -06:00
Author
Owner

@manevich commented on GitHub (Sep 15, 2016):

Maybe --private-home that brought back in 0.9.42 is what you need?

<!-- gh-comment-id:247477722 --> @manevich commented on GitHub (Sep 15, 2016): Maybe `--private-home` that brought back in 0.9.42 is what you need?
Author
Owner

@chiraag-nataraj commented on GitHub (Sep 15, 2016):

Yup, that's exactly what --private-home is for. Also, though, you can use --whitelist to only keep certain files and directories, --blacklist to hide certain files and directories, or, if the config files are unique to that application, you can give that application its own home directory and use --private=/path/to/dir. I used to use --private=, but realized --whitelist worked better for my purposes.

<!-- gh-comment-id:247484506 --> @chiraag-nataraj commented on GitHub (Sep 15, 2016): Yup, that's exactly what `--private-home` is for. Also, though, you can use `--whitelist` to only keep certain files and directories, `--blacklist` to hide certain files and directories, or, if the config files are unique to that application, you can give that application its own home directory and use `--private=/path/to/dir`. I used to use `--private=`, but realized `--whitelist` worked better for my purposes.
Author
Owner

@graywolf commented on GitHub (Sep 15, 2016):

All modifications are discarded when the sandbox is closed.

That means that all changes are thrown away right? Than it's not what I need.. or can I combine it like this?

private ~/.firejails/palemoon
private-home ~/.vim,~/.vimrc,~/.gvimrc

@chiraag-nataraj I tried to use whitelist but it doesn't seem to propage the whitelisted files inside private :/

<!-- gh-comment-id:247485063 --> @graywolf commented on GitHub (Sep 15, 2016): > All modifications are discarded when the sandbox is closed. That means that all changes are thrown away right? Than it's not what I need.. or can I combine it like this? ``` private ~/.firejails/palemoon private-home ~/.vim,~/.vimrc,~/.gvimrc ``` @chiraag-nataraj I tried to use `whitelist` but it doesn't seem to propage the whitelisted files inside `private` :/
Author
Owner

@manevich commented on GitHub (Sep 15, 2016):

Why no to copy all vim configs into ~/.firejails/palemoon then?

<!-- gh-comment-id:247486670 --> @manevich commented on GitHub (Sep 15, 2016): Why no to copy all vim configs into `~/.firejails/palemoon` then?
Author
Owner

@chiraag-nataraj commented on GitHub (Sep 16, 2016):

@graywolf I think you can only use one or the other between whitelist and private, since whitelist mounts a tmpfs on top of your home and private mounts the specified directory on top of home. You can't use them both!

What exactly is in ~/.firejails/palemoon? Why not just move palemoon's config files back to your main home directory, whitelist whatever configs you need, and whitelist a directory for file transfer (~/Downloads is a useful one)?

<!-- gh-comment-id:247487846 --> @chiraag-nataraj commented on GitHub (Sep 16, 2016): @graywolf I think you can only use one or the other between `whitelist` and `private`, since `whitelist` mounts a `tmpfs` on top of your home and `private` mounts the specified directory on top of home. You can't use them both! What exactly is in `~/.firejails/palemoon`? Why not just move palemoon's config files back to your main home directory, whitelist whatever configs you need, and whitelist a directory for file transfer (`~/Downloads` is a useful one)?
Author
Owner

@graywolf commented on GitHub (Sep 16, 2016):

~/.firejails/palemoon is just home directory with palemoon user profile in it. I'm using three different profiles (home/work/etc..) so it seemed easiest to just have separate virtual homes for each one.

Hm I guess, I've kinda just migrated my setup from docker to firejail, so like this it was easiest, but that should probably work. Will try it.

<!-- gh-comment-id:247492923 --> @graywolf commented on GitHub (Sep 16, 2016): `~/.firejails/palemoon` is just home directory with palemoon user profile in it. I'm using three different profiles (home/work/etc..) so it seemed easiest to just have separate virtual homes for each one. Hm I guess, I've kinda just migrated my setup from docker to firejail, so like this it was easiest, but that should probably work. Will try it.
Author
Owner

@graywolf commented on GitHub (Sep 16, 2016):

Seems to work fine :) but still, copy command would be nice.

<!-- gh-comment-id:247494278 --> @graywolf commented on GitHub (Sep 16, 2016): Seems to work fine :) but still, copy command would be nice.
Author
Owner

@graywolf commented on GitHub (Sep 16, 2016):

@manevich mainly to prevent maintance overhead. if I copied it manually, I would have original and 3 copies. and I woudl have to remember to update them all :/

<!-- gh-comment-id:247499479 --> @graywolf commented on GitHub (Sep 16, 2016): @manevich mainly to prevent maintance overhead. if I copied it manually, I would have original and 3 copies. and I woudl have to remember to update them all :/
Author
Owner

@chiraag-nataraj commented on GitHub (Sep 16, 2016):

@graywolf @manevich Instead of copying, you can do hardlinks (which work well with individual files) or bind-mounts (which work well with directories). I used to do this before switching to whitelisting - I had a setup script that ran at login that bind-mounted a couple of directories (had to provide password of course).

<!-- gh-comment-id:247508183 --> @chiraag-nataraj commented on GitHub (Sep 16, 2016): @graywolf @manevich Instead of copying, you can do hardlinks (which work well with individual files) or bind-mounts (which work well with directories). I used to do this before switching to whitelisting - I had a setup script that ran at login that bind-mounted a couple of directories (had to provide password of course).
Author
Owner

@netblue30 commented on GitHub (Sep 16, 2016):

The easiest way is to build a small script to start your program:

#/bin/bash

cp -a .vim ~/.firejails/palemoon/.
cp -a .vimrc ~/.firejails/palemoon/.
cp -a .gvimrc ~/.firejails/palemoon/.
firejail --private=~/.firejails/palemoon palemoon
<!-- gh-comment-id:247590699 --> @netblue30 commented on GitHub (Sep 16, 2016): The easiest way is to build a small script to start your program: ``` #/bin/bash cp -a .vim ~/.firejails/palemoon/. cp -a .vimrc ~/.firejails/palemoon/. cp -a .gvimrc ~/.firejails/palemoon/. firejail --private=~/.firejails/palemoon palemoon ```
Author
Owner

@graywolf commented on GitHub (Sep 19, 2016):

I guess :) still, would be nice to be able to keep just the symlink ln -s /usr/bin/firejail /usr/local/bin/palemoon without a need to make a script there. But if you think this doesn't belong into firejail just close it.

<!-- gh-comment-id:248131173 --> @graywolf commented on GitHub (Sep 19, 2016): I guess :) still, would be nice to be able to keep just the symlink `ln -s /usr/bin/firejail /usr/local/bin/palemoon` without a need to make a script there. But if you think this doesn't belong into firejail just close it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#530
No description provided.