GithubHelp home page GithubHelp logo

mariow / icsprivacy Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 29 KB

Anonymize all events marked as "private" in an ICS feed and re-publish the resulting feed (AWS Lambda + S3)

License: GNU General Public License v3.0

Python 100.00%

icsprivacy's Introduction

ICSprivacy

Yet another script to filter an ICS feed and remove all details from events marked as "private". I know, there's lots of existing scripts but I found none that really scratched my itch (the usual excuse).

The script is designed to run as an AWS lambda function that regularly pulls a calendar feed via HTTP (e.g. from Google calendar), removes all details from events marked as private ("CLASS:PRIVATE") and republishes the resulting feed to an S3 bucket. Entries older than 365 days are removed.

Prerequisites

  • python
  • URL of your calendar feed that needs to by anonymized (e.g. Google)
  • AWS account with an S3 bucket set up

Setup

  • Setup virtual env: python3 -m venv .
  • Activate venv: ```source bin/activate'''
  • Install requirements: pip install -r requirements.txt
  • Package up the code:
    • cd lib/python*/site-packages/
    • zip -r9 ../../../lambda_package.zip .
    • cd ../../../
    • zip -g lambda_package.zip filter_ics.py
  • Set up lambda function:
    • Create a new lambda function with the option "author from scratch". Choose a helpful name and select the python runtime that matches your local setup (ls lib/ ;), create a new role and note the name of that role
    • upload lambda_package.zip
    • under General configuration set the timeout to a much higher value than the default 3s; I use 2 minutes which is usually way too much
    • under Configuration > Environment variables set the following fields to configure the script:
      • BUCKET_NAME: name of the target bucket where the filtered calendar feed should be uploaded
      • OUTPUT_KEY: filename of the resulting, filtered calendar feed
      • SOURCE_URL: URL of the input feed that needs to be anonymized
      • (optional) PRIVATE_SUMMARY: text that should replace the title of anonymized events (Default: "private event")
      • (optional) PRIVATE_DESC: text that should replace the description of anonymized events (Default: "private event - details removed")
    • add a trigger to run the script periodically (e.g. Amazon Eventbridge "rate 1h" to run in hourly)
    • in IAM modify that role to have access to your target S3 bucket

icsprivacy's People

Contributors

mariow avatar

Watchers

 avatar

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.