open-web-calendar

GPL-2.0 License

Stars
0

Open Web Calendar

Try it out

Python: 3.7, 3.8, 3.9, 3.10

There are several commercial solutions which allow embedding of calendars into my website. I only have a link to an ICS file and want to show a nice-looking calendar on my site. Browser-only calendars usually have the problem that many ICS files can not be accessed (such as ownCloud/nextCloud in my case). I also want to be in control over who knows the people who visit the site and not pass everything to Google. This is a solution in my case which I share with the world. You are free to use it or deploy your own, modify or share it. It works offline and in company networks, too.

Features

  • Embedded calendar
  • Choice of time zone
  • ICS link, best multiple
  • month/week as a view
  • name, time of event, link?
  • showing the time span
  • styling of choice (icon, color, font, ...)

Deployment

You can deploy the app using Heroku. There is a free plan.

Heroku uses gunicorn to run the server, see the Procfile.

Environment Variables - Configutation

These environment variables can be used to configure the service:

  • APP_DEBUG default true, values true or false, always false in the Docker container
    Set the debug flag for the app.
  • PORT default 5000, default 80 in the Docker container
    The port that the service is running on.
  • WORKERS default 4 only for the Docker container
    The number of parallel workers to handle requests.
  • CACHE_REQUESTED_URLS_FOR_SECONDS default 600
    Seconds to cache the calendar files that get downloaded to reduce bandwidth and delay.

Docker

To build the container yourself type the command

docker build --tag niccokunzmann/open-web-calendar .

You can also use the existing image.

docker run -d --rm -p 5000:80 niccokunzmann/open-web-calendar

Then, you should see your service running at http://localhost:5000.

Docker Compose

Using pre build dockerhub image with docker-compose

version: '3'
services:
  open-web-calendar:
    image: niccokunzmann/open-web-calendar
    ports:
      - '80:80'
    environment:
      - WORKERS=4
    restart: unless-stopped

To deploy the open-web-calendar with docker-compose, do the following steps:

  1. Copy the docker-compose.yml file to the directory from where you want to run the container.
  2. If needed change port mapping and environment variables.
  3. Type docker-compose up -d to start the container.
  4. The container will be pulled automatically from dockerhub and then starts.

Update prebuild image with Docker Compose

If you want to update your image with the latest version from dockerhub type docker-compose pull

Note: You need to start the container after pulling again in order for the update to apply (docker-compose up -d)

Vercel

You can create a fork of this repository which automatically deploys to Vercel:

Deploy

Alternatively you can create a one off deploy by cloning this repository and running npx vercel at the root.

Research

Hosts

Sources/Libs

Search Terms

calendar ics service, ics calendar to html, open source calendar view ical, python Ical, calendar viewer website for ics, open source calendar website, embed calendar into website

Software Components

Development

  1. Optional: Install virtualenv and Python3 and create a virtual environment.
    virtualenv -p python3 ENV
    source ENV/bin/activate
    
  2. Install the packages.
    pip install -r requirements.txt
    
  3. Start the app.
    python3 app.py
    

For the configuration of the app through environment variables, see the app.json file.

Running Tests

To run the tests, we use tox. tox tests all different Python versions which we want to be compatible to.

pip install tox

Run all tests:

tox

Run a specific Python version:

tox -e py39

Updating Dependencies

We use pip-compile to guarantee a tested deployment by fixing all the dependencies to a specific version.

You can update the packages to the latest version:

rm requirements.txt test-requirements.txt
pip install --upgrade pip-tools -r requirements.in -r test-requirements.in
pip-compile -o requirements.txt requirements.in
pip-compile -o test-requirements.txt test-requirements.in

And run the tests:

tox

Changelog

Related Work