Skip to content

Commit 6d6cb17

Browse files
author
Cyril
committed
Improve README, fix a space in .env config
1 parent 74e7b79 commit 6d6cb17

File tree

2 files changed

+178
-8
lines changed

2 files changed

+178
-8
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ APP_SECRET=630dc0d699fd37e720aff268f75583ed
2727
# IMPORTANT: You MUST also configure your db driver and server_version in config/packages/doctrine.yaml
2828
DATABASE_URL=mysql://davis:davis@127.0.0.1:3306/davis
2929
###< doctrine/doctrine-bundle ###
30+
3031
# The admin password for the backend
3132
ADMIN_LOGIN=admin
3233
ADMIN_PASSWORD=test

README.md

Lines changed: 177 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,195 @@ A simple, fully translatable admin interface and frontend for `sabre/dav` based
55

66
# Requirements
77

8-
PHP > 7.1.3
8+
PHP > 7.1.3, MySQL (or MariaDB).
99

1010
# Installation
1111

12-
1. Retrieve the dependencies
12+
0. Clone this repository
1313

14-
composer install
14+
1. Retrieve the dependencies:
1515

16-
2. Migrate the database
16+
```
17+
composer install
18+
```
1719

18-
bin/console migrate
20+
2. At least put the correct credentials to your database in your `.env.local` file so you can easily migrate your database.
21+
22+
3. Migrate the database:
23+
24+
```
25+
bin/console migrate
26+
```
27+
28+
**Davis** can be used with a pre-existing MySQL database (_for instance, one previously managed by Baïkal_). The only missing table would be the `migrations` table, that you can recreate automatically when running the migrations.
29+
30+
> The migrations are not _exactly_ equivalent to those of Baïkal, and allow for a bit more room in columns.
31+
32+
## Configuration
33+
34+
Create your own `.env.local` file to change the necessary variables, if you plan on using `symfony/dotenv`.
35+
36+
> If your installation is behind a web server like Apache or Nginx, you can setup the env vars directly in your Apache or Nginx configuration (see below). Skip this part in this case.
37+
38+
a. The database url (_you should already have it configured since you migrated the database previously_)
39+
40+
```
41+
DATABASE_URL=mysql://db_user:db_pass@host:3306/db_name
42+
```
43+
44+
b. The admin password for the backend
45+
46+
```
47+
ADMIN_LOGIN=admin
48+
ADMIN_PASSWORD=test
49+
```
50+
51+
c. The auth Realm and method for HTTP auth
52+
53+
```
54+
AUTH_REALM=SabreDAV
55+
AUTH_METHOD=Digest # can be "Basic" or "Digest"
56+
```
57+
58+
d. The global flags to enable CalDAV, CardDAV and WebDAV
59+
60+
```
61+
CALDAV_ENABLED=true
62+
CARDDAV_ENABLED=true
63+
WEBDAV_ENABLED=false
64+
```
65+
66+
e. The email address that your invites are going to be sent from
67+
68+
```
69+
INVITE_FROM_ADDRESS=no-reply@example.org
70+
```
71+
72+
f. The paths for the WebDAV installation
73+
74+
> I recommend that you use absolute directories so you know exactly where your files reside.
75+
76+
```
77+
TMP_DIR='/tmp'
78+
PUBLIC_DIR='/public'
79+
```
80+
81+
# Access / Webserver
82+
83+
A simple status page is available on the root `/` of the server.
84+
85+
The administration interface is available at `/dashboard`. You need to login to use it (See `ADMIN_LOGIN` and `ADMIN_PASSWORD` env vars).
86+
87+
The main endpoint for CalDAV, WebDAV or CardDAV is at `/dav`.
88+
89+
### Example Apache 2.4 configuration
90+
91+
<VirtualHost *:80>
92+
ServerName dav.domain.tld
93+
94+
DocumentRoot /var/www/davis/public
95+
DirectoryIndex /index.php
96+
97+
<Directory /var/www/davis/public>
98+
AllowOverride None
99+
Order Allow,Deny
100+
Allow from All
101+
FallbackResource /index.php
102+
</Directory>
103+
104+
# Apache > 2.4.25, else remove this part
105+
<Directory /var/www/davis/public/bundles>
106+
FallbackResource disabled
107+
</Directory>
108+
109+
# Env vars (if you did not use .env.local)
110+
SetEnv APP_ENV prod
111+
SetEnv APP_SECRET <app-secret-id>
112+
SetEnv DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name"
113+
# ... etc
114+
</VirtualHost>
115+
116+
### Example Nginx configuration
117+
118+
server {
119+
server_name dav.domain.tld;
120+
root /var/www/davis/public;
121+
122+
location / {
123+
try_files $uri /index.php$is_args$args;
124+
}
125+
126+
location /bundles {
127+
try_files $uri =404;
128+
}
129+
130+
location ~ ^/index\.php(/|$) {
131+
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; # Change for your PHP version
132+
fastcgi_split_path_info ^(.+\.php)(/.*)$;
133+
include fastcgi_params;
134+
135+
# Env vars (if you did not use .env.local) fastcgi_param APP_ENV prod;
136+
fastcgi_param APP_SECRET <app-secret-id>;
137+
fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name";
138+
# ... etc ...
139+
140+
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
141+
fastcgi_param DOCUMENT_ROOT $realpath_root;
142+
internal;
143+
}
144+
145+
location ~ \.php$ {
146+
return 404;
147+
}
148+
}
149+
150+
More examples and information [here](https://symfony.com/doc/current/setup/web_server_configuration.html).
151+
152+
## Well-known redirections for CalDAV and CardDAV
153+
154+
Web-based protocols like CalDAV and CardDAV can be found using a discovery service. Some clients require that you implement a path prefix to point to the correct location for your service. See [here](https://en.wikipedia.org/wiki/List_of_/.well-known/_services_offered_by_webservers) for more info.
155+
156+
If you use Apache as your webserver, you can enable the redirections with:
157+
158+
RewriteEngine On
159+
RewriteRule ^\.well-known/carddav /dav/ [R=301,L]
160+
RewriteRule ^\.well-known/caldav /dav/ [R=301,L]
161+
162+
Make sure that `mod_rewrite` is enabled on your installation beforehand.
163+
164+
If you use Nginx, you can add this to your configuration:
165+
166+
location / {
167+
rewrite ^/.well-known/carddav /dav/ redirect;
168+
rewrite ^/.well-known/caldav /dav/ redirect;
169+
}
170+
171+
# Dockerized installation
172+
173+
A Dockerfile is available for you to compile the container.
174+
175+
We use `ssmtp` as a delivery service for a configured mailhost instead of using local delivery (_that should work out of the box_). You can ignore this or remove it from the Dockerfile if you want.
176+
177+
A `docker-compose.yml` file is also included as a minimal example setup.
19178

20179
# Development
21180

22-
If you change or add translations, you need to update the `messages` XLIFF file with :
181+
You can spin off a local PHP webserver with:
182+
183+
php -S localhost:8000 -t public
184+
185+
If you change or add translations, you need to update the `messages` XLIFF file with:
23186

24187
bin/console translation:update en --force --domain=messages+intl-icu
25188

26189
# Libraries used
27190

28-
- Bootstrap 4 (Licence : MIT)
191+
- Symfony 4 (Licence : MIT)
192+
- Sabre-io/dav (Licence : BSD-3-Clause)
193+
- Bootstrap 4 (Licence : MIT)
194+
195+
_This project does not use any pipeline for the assets since the frontend side is relatively simple, and based on Bootstrap._
196+
197+
# Licence
29198

30-
This project does not use any pipeline for the assets since the frontend side is relatively simple, and based on Bootstrap.
199+
This project is release under the MIT licence. See the LICENCE file

0 commit comments

Comments
 (0)