8

I'm trying to store a Firefox profile in git. I've configured it to use a proxy and I want to be able to pull the profile back up when I check the code out again.

As far as I can tell from the documentation there's a Cache folder and an Offline Cache folder that probably shouldn't be included because they are just cached folders, and not any thing of significance to retaining the proxy settings to be used when the Firefox profile is loaded.

Is there anything else in the profile folder that isn't worth including in the commit, because it has nothing to do with:

  1. Preventing the profile from being loaded.
  2. Preventing the proxy settings from being loaded on the next checkout

I've tried adding the following:

# Ignore FF Cache
ProxyProfileFF/cache2/**
ProxyProfileFF/OfflineCache/**
ProxyProfileFF/jumpListCache/**
ProxyProfileFF/startupCache/**
ProxyProfileFF/saved-telemetry-pings/**

# Ignore vim temp files
*~
leeand00
  • 25,510
  • 39
  • 140
  • 297
  • @Confiqure How do you mean? I'm not looking for opinions, I'm looking for which directories actually mean something and which directories are just garbage that do not need to be stored in the repository. – leeand00 Jul 20 '16 at 12:49
  • 1
    How does one determine stuff that "just isn't worth keeping?" – Dylan Wheeler Jul 20 '16 at 12:49
  • @Confiqure Is that better? Have I clarified "just isn't worth keeping"? – leeand00 Jul 20 '16 at 12:53
  • 1
    For reference, [this article on support.mozilla.org tells you what the different files are for](https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data). – Stefan Feb 23 '21 at 08:55

2 Answers2

4

Here is my .gitignore file:

( that stored in the profile folder ) i.e.

/Users/me/Library/Application Support/Firefox/Profiles/9j5n99pf.default

here is a link to the gist as well

cookies.sqlite
cookies.sqlite-wal
favicons.sqlite-wal
logins.json
places.sqlite-wal
prefs.js
storage/
datareporting/
webappsstore.sqlite
webappsstore.sqlite-wal
weave/
addonStartup.json.lz4
favicons.sqlite
permissions.sqlite
places.sqlite
protections.sqlite
search.json.mozlz4
serviceworker.txt
sessionCheckpoints.json
SiteSecurityServiceState.txt
storage-sync.sqlite
storage.sqlite
bookmarkbackups
saved-telemetry-pings
sessionstore.jsonlz4
addons.json
AlternateServices.txt
content-prefs.sqlite
extensions.json
formhistory.sqlite
xulstore.json
skywinder
  • 21,291
  • 15
  • 93
  • 123
  • It seems that you choose to not backup a lot of things. For example, ignoring `logins.json` means saved passwords are not backup. – weakish Jan 21 '20 at 01:57
  • 1
    A security note following up on @weakish: I guess it is a bad idea to just add `logins.json`, `key4.db`, `cookies.sqlite` (any other?) to a (public) git repo since your passwords / login credentials are stored there unencrypted. Always encrypt them using e.g. [`transcrypt`](https://github.com/elasticdog/transcrypt). Even better, don't add this files to your backup. Even better still, use a dedicated password database interfaced with firefox, e.g. KeepassXC with the official browser plugin. – Stefan Feb 14 '22 at 10:38
  • I assume that the git repo is private. And git repos can be encrypted too, e.g. with git-crypt. – weakish Feb 14 '22 at 12:11
3

I prefer the "better safe then sorry approach".

That is exclude everything and only add files really needed, based on https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data. Moreover I don't add files from which I know / think that they store login credentials / passwords (those are marked with NEVER STORE THEM UNENCRYPTED).

Here is the relevant part of my .gitignore,

# ## exclude everything and only allow specific files
*
!.gitignore

# ###################################
# ## FIREFOX
# ##  based on https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data
!profiles.ini
!installs.ini
#
# ## profiles
!Profiles/
!Profiles/*/
#
# ##  bookmarks, downloads & browsing history
!Profiles/*/places.sqlite
#!Profiles/*/favicons.sqlite
!Profiles/*/bookmarkbackups/
!Profiles/*/bookmarkbackups/*
#
# ##  site-specific preferences
!Profiles/*/permissions.sqlite
!Profiles/*/content-prefs.sqlite
#
# ##  search engins
#!Profiles/*/search.json.mozlz4
#
# ##  personal dictionary
!Profiles/*/persdict.dat
#
# ##  autocompelte history
#!Profiles/*/formhistory.sqlite
#
# ##  cookies & passwords
# ##   NEVER STORE THEM UNENCRYPTED
#!Profiles/*/key4.db
#!Profiles/*/logins.json
#!Profiles/*/cookies.sqlite
#
# ##  DOM storage
# ##   NEVER STORE THEM UNENCRYPTED?
#!Profiles/*/webappsstore.sqlite
#!Profiles/*/chromeappsstore.sqlite
#
# ##  Extensions
!Profiles/*/extension*
!Profiles/*/extensions/*
#
# ##  security certificate settings
#!Profiles/*/cert9.db
#
# ##  security device settings
#!Profiles/*/pkcs11.txt
#
# ##  download actions
#!Profiles/*/handlers.json
#
# ##  stored sessions
#!Profiles/*/sessionstore.jsonlz4
#
# ##  toolbar customization
#!Profiles/*/xulstore.json
#
# ##  user preferences
!Profiles/*/prefs.js
!Profiles/*/user.js
#
# ##  containers
!Profiles/*/containers.json
Stefan
  • 1,697
  • 15
  • 31