mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
review storage hook git part
This commit is contained in:
parent
6f2c1037d5
commit
4781b48a1c
1 changed files with 26 additions and 10 deletions
|
@ -578,14 +578,30 @@ authentication over 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:
|
||||
The repository must be initialized in the collection base directory
|
||||
of the user running `radicale` daemon.
|
||||
|
||||
```gitignore
|
||||
```bash
|
||||
## assuming "radicale" user is starting "radicale" service
|
||||
# change to user "radicale"
|
||||
su -l -s /bin/bash radicale
|
||||
|
||||
# change to collection base directory, assumed /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
|
||||
|
@ -598,16 +614,16 @@ 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.
|
||||
Log of `git` can be investigated using
|
||||
|
||||
When using the systemd unit file from the [Running as a service](#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:
|
||||
```bash
|
||||
git config user.name "radicale"
|
||||
git config user.email "radicale@example.com"
|
||||
su -l -s /bin/bash radicale
|
||||
cd /var/lib/radicale/collections
|
||||
git log
|
||||
```
|
||||
|
||||
In case of error messages in log, check SELinux status and related audit log and file/directory permissions.
|
||||
|
||||
## Documentation
|
||||
|
||||
### Configuration
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue