hamstar / Braincase

A personal knowledge base system for expansion of the mind in a virtual space.
4 stars 1 forks source link

Git hook could obliterate data in /home #300

Open hamstar opened 11 years ago

hamstar commented 11 years ago

It has occured to me that changes in files in the users home dir may be overwritten when a user pushes to the repository.

For this reason all the dynamic content should be removed from the git repository. Things like logs etc.

Currently in the repository (as of SHA: e5c8c90a)

drwxr-xr-x 8 root root 4096 Oct 31 23:47 .
drwx------ 6 root root 4096 Oct 31 23:47 ..
drwxr-xr-x 3 root root 4096 Oct 31 23:47 Backup
-rw-r--r-- 1 root root  220 Oct 31 23:47 .bash_logout
-rw-r--r-- 1 root root 3184 Oct 31 23:47 .bashrc
drwxr-xr-x 2 root root 4096 Oct 31 23:47 .braincase
drwxr-xr-x 3 root root 4096 Oct 31 23:47 .dokuwiki
drwxr-xr-x 8 root root 4096 Oct 31 23:47 .git
-rw-r--r-- 1 root root   34 Oct 31 23:47 .gitconfig
-rw-r--r-- 1 root root   18 Oct 31 23:47 .gitignore
drwxr-xr-x 2 root root 4096 Oct 31 23:47 logs
-rw-r--r-- 1 root root    3 Oct 31 23:47 memories.list
-rw-r--r-- 1 root root  675 Oct 31 23:47 .profile
drwxr-xr-x 2 root root 4096 Oct 31 23:47 public_html

The other option is of course to somehow have the files syncing to the repository from the users home drive.

hamstar commented 11 years ago

I would also advise adding the following to the .gitignore file:

Backup/.tmp
logs
.braincase
memories.list
.dokuwiki

That would leave a filelist like:

drwxr-xr-x 3 root root 4096 Oct 31 23:47 Backup
-rw-r--r-- 1 root root  220 Oct 31 23:47 .bash_logout
-rw-r--r-- 1 root root 3184 Oct 31 23:47 .bashrc
-rw-r--r-- 1 root root   34 Oct 31 23:47 .gitconfig
-rw-r--r-- 1 root root   18 Oct 31 23:47 .gitignore
-rw-r--r-- 1 root root  675 Oct 31 23:47 .profile
drwxr-xr-x 2 root root 4096 Oct 31 23:47 public_html

Which contains stuff that the user can edit manually in their repo without risk of overwriting changes made by the system (because the system won't be modifying that stuff.