diff --git a/master.html b/master.html index a4f9003d..756cd16a 100644 --- a/master.html +++ b/master.html @@ -740,27 +740,48 @@ HTTP.
This tutorial describes how to keep track of all changes to calendars and address books with git (or any other version control system).
-The repository must be initialized by running git init
-in the file system folder. Internal files of Radicale can be excluded by
-creating the file .gitignore
with the following
-content:
.Radicale.cache
-.Radicale.lock
-.Radicale.tmp-*
+The repository must be initialized in the collection base directory
+of the user running radicale
daemon.
## assuming "radicale" user is starting "radicale" service
+# change to user "radicale"
+su -l -s /bin/bash radicale
+
+# change to collection base directory defined in [storage] -> filesystem_folder
+# assumed here /var/lib/radicale/collections
+cd /var/lib/radicale/collections
+
+# initialize git repository
+git init
+
+# set user and e-mail, here minimum example
+git config user.name "$USER"
+git config user.email "$USER@$HOSTNAME"
+
+# define ignore of cache/lock/tmp files
+cat <<'END' >.gitignore
+.Radicale.cache
+.Radicale.lock
+.Radicale.tmp-*
+END
The configuration option hook
in the
storage
section must be set to the following command:
git add -A && (git diff --cached --quiet || git commit -m "Changes by \"%(user)s\"")
The command gets executed after every change to the storage and commits the changes into the git repository.
-For the hook to not cause errors either git user -details need to be set and match the owner of the collections directory -or the repository needs to be marked as safe.
-When using the systemd unit file from the Running as a service section this
-cannot be done via a .gitconfig
file in
-the users home directory, as Radicale won't have read permissions!
In /var/lib/radicale/collections/.git
run:
git config user.name "radicale"
-git config user.email "radicale@example.com"
Log of git
can be investigated using
su -l -s /bin/bash radicale
+cd /var/lib/radicale/collections
+git log
In case of problems, make sure you run radicale with
+--debug
switch and inspect the log output. For more
+information, please visit [section on logging.]({{ site.baseurl
+}}/logging/) .
Reason for problems can be
+Command that is run after changes to storage. Take a look at the Versioning with Git tutorial for an example.
Default:
+Supported placeholders:
+%(user)
: logged-in userCommand will be executed with base directory defined in
+filesystem_folder
(see above)
config
: Contains the code for managing configuration
and loading settings from files.
ìtem
: Internal representation of address book and
-calendar entries. Based on VObject.
log
: The logger for Radicale based on the default
Python logging module.
rights
: This module is used by Radicale to manage