-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
365 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "webDavExample", | ||
"description": "A simple vibe.d server application.", | ||
"copyright": "Copyright © 2015, Szabo Bogdan", | ||
"authors": ["Szabo Bogdan"], | ||
"dependencies": { | ||
"vibe-d": "~>0.7.19", | ||
"vibe-dav": { | ||
"version": "~>0.2.0", | ||
"path": "../.." | ||
} | ||
}, | ||
|
||
"versions": ["VibeDefaultMain"], | ||
"targetType": "executable" | ||
} |
41 changes: 41 additions & 0 deletions
41
examples/webDav/public/calendar/admin/personal/6837CB82-AE37-4E57-9C89-D39D62BBBC01.ics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
PRODID:-//Apple Inc.//Mac OS X 10.10.3//EN | ||
CALSCALE:GREGORIAN | ||
BEGIN:VTIMEZONE | ||
TZID:Europe/Stockholm | ||
BEGIN:DAYLIGHT | ||
TZOFFSETFROM:+0100 | ||
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU | ||
DTSTART:19810329T020000 | ||
TZNAME:CEST | ||
TZOFFSETTO:+0200 | ||
END:DAYLIGHT | ||
BEGIN:STANDARD | ||
TZOFFSETFROM:+0200 | ||
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU | ||
DTSTART:19961027T030000 | ||
TZNAME:CET | ||
TZOFFSETTO:+0100 | ||
END:STANDARD | ||
END:VTIMEZONE | ||
BEGIN:VEVENT | ||
TRANSP:OPAQUE | ||
DTEND;TZID=Europe/Stockholm:20150408T170000 | ||
PRIORITY:0 | ||
UID:6837CB82-AE37-4E57-9C89-D39D62BBBC01 | ||
DTSTAMP:20150407T131647Z | ||
X-YAHOO-USER-STATUS:BUSY | ||
X-YAHOO-USER-STATUS:BUSY | ||
STATUS:CONFIRMED | ||
SEQUENCE:0 | ||
CLASS:PUBLIC | ||
X-YAHOO-YID:szabobogdan | ||
X-YAHOO-YID:szabobogdan | ||
X-YAHOO-EVENT-STATUS:BUSY | ||
X-YAHOO-EVENT-STATUS:BUSY | ||
SUMMARY:test event | ||
DTSTART;TZID=Europe/Stockholm:20150407T160000 | ||
CREATED:20150407T131647Z | ||
END:VEVENT | ||
END:VCALENDAR |
32 changes: 32 additions & 0 deletions
32
examples/webDav/public/calendar/admin/personal/7B508AD5-FE51-4C7B-8E21-0104F5412923.ics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
BEGIN:VCALENDAR | ||
VERSION:2.0 | ||
PRODID:-//Apple Inc.//Mac OS X 10.10.3//EN | ||
CALSCALE:GREGORIAN | ||
BEGIN:VTIMEZONE | ||
TZID:Europe/Stockholm | ||
BEGIN:DAYLIGHT | ||
TZOFFSETFROM:+0100 | ||
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU | ||
DTSTART:19810329T020000 | ||
TZNAME:CEST | ||
TZOFFSETTO:+0200 | ||
END:DAYLIGHT | ||
BEGIN:STANDARD | ||
TZOFFSETFROM:+0200 | ||
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU | ||
DTSTART:19961027T030000 | ||
TZNAME:CET | ||
TZOFFSETTO:+0100 | ||
END:STANDARD | ||
END:VTIMEZONE | ||
BEGIN:VEVENT | ||
CREATED:20150407T194949Z | ||
UID:7B508AD5-FE51-4C7B-8E21-0104F5412923 | ||
DTEND;TZID=Europe/Stockholm:20150422T100000 | ||
TRANSP:OPAQUE | ||
SUMMARY:cucu | ||
DTSTART;TZID=Europe/Stockholm:20150422T090000 | ||
DTSTAMP:20150407T194949Z | ||
SEQUENCE:0 | ||
END:VEVENT | ||
END:VCALENDAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
BEGIN:VCALENDAR | ||
METHOD:PUBLISH | ||
VERSION:2.0 | ||
X-WR-CALNAME:Home | ||
X-WR-CALDESC: | ||
X-APPLE-CALENDAR-COLOR:#1BADF8 | ||
X-WR-TIMEZONE:Europe/Bucharest | ||
CALSCALE:GREGORIAN | ||
BEGIN:VTIMEZONE | ||
TZID:Europe/Bucharest | ||
BEGIN:DAYLIGHT | ||
TZOFFSETFROM:+0200 | ||
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU | ||
DTSTART:19970330T030000 | ||
TZNAME:EEST | ||
TZOFFSETTO:+0300 | ||
END:DAYLIGHT | ||
BEGIN:STANDARD | ||
TZOFFSETFROM:+0300 | ||
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU | ||
DTSTART:19971026T040000 | ||
TZNAME:EET | ||
TZOFFSETTO:+0200 | ||
END:STANDARD | ||
END:VTIMEZONE | ||
BEGIN:VEVENT | ||
CREATED:20140214T081455Z | ||
UID:489F8C95-B5B3-49E3-BA4D-0CE0F820E022 | ||
DTEND;TZID=Europe/Bucharest:20140214T120000 | ||
TRANSP:OPAQUE | ||
SUMMARY:New Event | ||
DTSTART;TZID=Europe/Bucharest:20140214T110000 | ||
DTSTAMP:20140214T081455Z | ||
SEQUENCE:1 | ||
END:VEVENT | ||
BEGIN:VEVENT | ||
CREATED:20140912T181025Z | ||
UID:BAF9FA4C-C758-4E73-87C2-847A879AC884 | ||
DTEND;TZID=Europe/Bucharest:20200724T130000 | ||
TRANSP:OPAQUE | ||
SUMMARY:New Event | ||
DTSTART;TZID=Europe/Bucharest:20200724T120000 | ||
DTSTAMP:20140911T200404Z | ||
LAST-MODIFIED:20140131T143908Z | ||
SEQUENCE:0 | ||
END:VEVENT | ||
BEGIN:VEVENT | ||
CREATED:20140912T181025Z | ||
UID:349C7C65-CD2F-44B6-8467-FF9C22F58832 | ||
RRULE:FREQ=WEEKLY;COUNT=1 | ||
DTEND;TZID=Europe/Bucharest:20140212T130000 | ||
TRANSP:OPAQUE | ||
SUMMARY:New Event | ||
DTSTART;TZID=Europe/Bucharest:20140212T120000 | ||
DTSTAMP:20140911T200404Z | ||
LAST-MODIFIED:20140201T082515Z | ||
SEQUENCE:0 | ||
BEGIN:VALARM | ||
X-WR-ALARMUID:95787692-6F0A-48A3-B4FE-B4C4CB0540F7 | ||
UID:95787692-6F0A-48A3-B4FE-B4C4CB0540F7 | ||
TRIGGER:-PT30M | ||
DESCRIPTION:Event reminder | ||
ACTION:DISPLAY | ||
END:VALARM | ||
END:VEVENT | ||
BEGIN:VEVENT | ||
CREATED:20140912T181025Z | ||
UID:8FC79E15-43C5-409A-B541-4DD21F2E9C89 | ||
DTEND;TZID=Europe/Bucharest:20131230T130000 | ||
TRANSP:OPAQUE | ||
SUMMARY:Eveniment nou | ||
DTSTART;TZID=Europe/Bucharest:20131230T120000 | ||
DTSTAMP:20140911T200404Z | ||
LAST-MODIFIED:20140131T124833Z | ||
SEQUENCE:0 | ||
END:VEVENT | ||
END:VCALENDAR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello world! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* Authors: Szabo Bogdan <szabobogdan@yahoo.com> | ||
* Date: 2 13, 2015 | ||
* License: Subject to the terms of the MIT license, as written in the included LICENSE.txt file. | ||
* Copyright: Public Domain | ||
*/ | ||
import vibe.core.file; | ||
import vibe.core.log; | ||
import vibe.inet.message; | ||
import vibe.inet.mimetypes; | ||
import vibe.http.router : URLRouter; | ||
import vibe.http.server; | ||
import vibe.http.fileserver; | ||
import vibe.http.auth.basic_auth; | ||
|
||
import vibedav.filedav; | ||
import vibedav.caldav; | ||
import vibedav.user; | ||
import vibedav.prop; | ||
import vibedav.userhome; | ||
|
||
import core.time; | ||
import std.conv : to; | ||
import std.stdio; | ||
import std.file; | ||
import std.path; | ||
import std.digest.md; | ||
import std.datetime; | ||
import std.functional : toDelegate; | ||
|
||
bool checkPassword(string user, string password) | ||
{ | ||
return user == "admin" && password == "secret"; | ||
} | ||
|
||
shared static this() | ||
{ | ||
writeln("Starting WebDav server."); | ||
|
||
auto router = new URLRouter; | ||
|
||
// now any request is matched and checked for authentication: | ||
router.any("/calendar/*", performBasicAuth("Site Realm", toDelegate(&checkPassword))); | ||
|
||
auto userConnection = new BaseCalDavUserCollection; | ||
|
||
alias factory = FileDavResourceFactory!( | ||
"calendar", "public/calendar", | ||
"", FileDavCollection, FileDavResource, | ||
":user/", FileDavCollection, FileDavResource, | ||
":user/inbox", FileDavCollection, FileDavResource, | ||
":user/outbox", FileDavCollection, FileDavResource, | ||
":user/personal", FileDavCalendarCollection, FileDavCalendarResource | ||
); | ||
|
||
router.serveFileDav!("/files/", "public/files/")(userConnection); | ||
router.serveFileDav!factory(userConnection); | ||
|
||
auto settings = new HTTPServerSettings; | ||
settings.port = 8080; | ||
settings.bindAddresses = ["::1", "127.0.0.1"]; | ||
listenHTTP(settings, router); | ||
} |
Oops, something went wrong.