Coder Social home page Coder Social logo

jm-lemmi / ical-relay Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 2.0 1.37 MB

Relay ical urls and edit them on the fly with different modules.

License: GNU General Public License v3.0

Go 61.60% HTML 30.99% Shell 0.19% Dockerfile 0.32% CSS 0.87% JavaScript 6.04%
calendar ical relay

ical-relay's Introduction

Julian Lemmerich

  • 🏫 I study Cyber Security at DHBW-Mannheim.
  • 🏢 Working at Cirosec in Heilbronn.
  • 👨🏼‍💻 Hacking at DU4L CTF Team.
  • 📫 [email protected]

ical-relay's People

Contributors

anasailon avatar frereit avatar hook-hawkins avatar jm-lemmi avatar nilsfast avatar nkxxll avatar realsocius avatar robske110 avatar tayhm avatar thor77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ical-relay's Issues

Use `AddVEvent`

Convert to using AddVEvent, after time-parsing has been merged to upstream

This gets rid of the whole loop for copying the items and may also get rid of the restriction in elements to copy from #8

func (calendar *Calendar) AddVEvent(e *VEvent)

Fix from #23 removes elements that should not be removed

ranging over array while removing is not good. removes elements that should not be removed

ical-relay/handlers.go

Lines 62 to 86 in ae2052c

for i, component := range calendar.Components {
// this is a hack to get around the fact that the ical library doesn't provide a way to remove an event
switch component.(type) {
case *ics.VEvent:
event := component.(*ics.VEvent)
// extract summary and time from original event
summary := event.GetProperty(ics.ComponentPropertySummary).Value
date, _ := event.GetStartAt()
id := event.Id()
// check if one of the profiles regex's matches summary
if date.After(profile.From) && profile.Until.After(date) {
for _, excludeRe := range profile.RegEx {
if excludeRe.MatchString(summary) || excludeRe.MatchString(id) {
// remove event from calendar
remove(calendar.Components, i)
excludedEvents++
requestLogger.Debugf("Excluding event '%s' with id %s\n", summary, id)
continue
}
}
}
default:
continue
}
}

This regards both v0.4.1 and v1.0.0-dev1

Package for distribution

  • docker image
  • deb, rpm
  • linux binary

Since there are no dependencies and no complicated install, this should not be very hard

Google and MS compatibility mode

If possible. They have both implemented similar features in a proprietary way. It should be possible to translate between those as good as possible. Not everything can be done.

WebUI

  • Setting up E-Mail reminders #34
  • Finding public calendars JM-Lemmi/ical-relay-frontend#1
  • Viewing calendar preview
  • Generating customized URLs #44

CalDAV/DAVx5 Endpoint

Subtask of #37.

Kann es möglicherweise ersetzen, oder es ist eine übertriebene Schnapsidee...

Hier erstmal Ideen sammeln.

Send E-Mail Invites for calendar entries

To circumvent Outlooks limitation of not importing into the main calendar, the server could send E-Mails with the calendar entries as ics, which would then appear in the Main calendar.

Fix GH-Actions

Publish with the correct tags on every commit in main as well as in dev

Frontend Rendering the Calendar

Idea: Render the initial week on the server, fetching the rest of the ical with javascript, so that the current week is instantly available but requests are kept to a minimum.

Admin API

  • add/remove module to profile
  • replace whole config

Clone organizer, uuid and attendee to new calendar entry

ical-relay/handlers.go

Lines 103 to 108 in df6fc05

// exclude organizer, uuid, attendee property due to broken escaping
for _, property := range event.Properties {
if (property.IANAToken != string(ics.ComponentPropertyOrganizer)) && (property.IANAToken != string(ics.ComponentPropertyUniqueId) && (property.IANAToken != string(ics.ComponentPropertyAttendee))) {
newEvent.Properties = append(newEvent.Properties, property)
}
}

Restructure different edit modes

Instead of having to combine multiple filters with multiple profiles chained in a row, the system should accept an "array" of modifiers. Each modifier then has a "mode" and additional arguments that mode needs. An example configuration should look like this:

profiles:
   abc:
      url: "https://example.com/calendar.ics"
      passid: true
      modifiers:
      - mode: regex
        regex: "testentry"
        from: "2021-12-02T00:00:00Z"
        until: "2021-12-31T00:00:00Z"
      - mode: delete-id
        id: "testidacb@calendar"
      - mode: add
        url: "https://othersource.com/othercalendar.ics"
      - mode: deduplicate
      - mode: delete
        from: "2019-01-01T00:00:00Z"
        until: "2019-12-31T23:59:59Z"

this would enable more modularity for different filtering methods as well as faster processing times.

[Module] Immutable Past

Instead of using the workaround just have a bool config for each profile, that enables immutable past. This should also be less prone to errors.

edit-Modules panic when non-existent property is edited

at least this is the bug, I think.

config

profiles:
  # TINF21CS1 output
  dhbwtinf21cs1:
    source: "http://vorlesungsplan.dhbw-mannheim.de/ical.php?uid=8321001"
    modules:
    - name: "edit-byid"
      id: "[email protected]"
      new-location: "Online"
      new-description: "Link folgt"
      overwrite: "false"

log

time="2022-04-20T11:43:08Z" level=info msg="New Request!" client=141.72.155.39 profile=dhbwtinf21cs1
time="2022-04-20T11:43:08Z" level=debug msg="Requested Module: delete-timeframe"
time="2022-04-20T11:43:08Z" level=debug msg="No after time given. Using time 0.\n"
time="2022-04-20T11:43:08Z" level=debug msg="Deleting events between 0001-01-01T00:00:00Z and 2022-04-20T11:43:08Z\n"
time="2022-04-20T11:43:08Z" level=debug msg="Excluding event with id [email protected]\n"
time="2022-04-20T11:43:08Z" level=debug msg="Excluding event with id [email protected]\n"
[...]
time="2022-04-20T11:43:08Z" level=debug msg="Requested Module: delete-bysummary-regex"
time="2022-04-20T11:43:08Z" level=debug msg="Unknown component type ignored: *ics.VTimezone\n"
time="2022-04-20T11:43:08Z" level=debug msg="Requested Module: delete-byid"
time="2022-04-20T11:43:08Z" level=debug msg="Excluding event with id [email protected]\n"
time="2022-04-20T11:43:08Z" level=debug msg="Requested Module: delete-byid"
time="2022-04-20T11:43:08Z" level=debug msg="Excluding event with id [email protected]\n"
time="2022-04-20T11:43:08Z" level=debug msg="Requested Module: edit-byid"
time="2022-04-20T11:43:08Z" level=debug msg="Changing event with id [email protected]"
2022/04/20 11:43:08 http: panic serving 172.18.0.13:38352: runtime error: invalid memory address or nil pointer dereference
goroutine 23 [running]:
net/http.(*conn).serve.func1()
        /usr/local/go/src/net/http/server.go:1825 +0xbf
panic({0x7e3ea0, 0xb38320})
        /usr/local/go/src/runtime/panic.go:844 +0x258
main.moduleEditId(0xc00038e210, 0xc000178090?)
        /app/modules.go:349 +0x1160
main.callModule(...)
        /app/modules.go:33
main.profileHandler({0x8f1800?, 0xc0003ffc00?}, 0xc00023a800)
        /app/handlers.go:76 +0xada
net/http.HandlerFunc.ServeHTTP(0xc00023a700?, {0x8f1800?, 0xc0003ffc00?}, 0x0?)
        /usr/local/go/src/net/http/server.go:2084 +0x2f
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0002120c0, {0x8f1800, 0xc0003ffc00}, 0xc00023a600)
        /go/pkg/mod/github.com/gorilla/[email protected]/mux.go:210 +0x1cf
net/http.serverHandler.ServeHTTP({0xc000343e00?}, {0x8f1800, 0xc0003ffc00}, 0xc00023a600)
        /usr/local/go/src/net/http/server.go:2916 +0x43b
net/http.(*conn).serve(0xc000294fa0, {0x8f1ab8, 0xc000179140})
        /usr/local/go/src/net/http/server.go:1966 +0x5d7
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:3071 +0x4db
^C

Public API

Used by #45

  • Enable Mail Notifications #34
  • List "Public" Calendars JM-Lemmi/ical-relay-frontend#1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.