Skip to content

Commit

Permalink
Merge branch 'niccokunzmann:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
vmario89 authored Jan 20, 2025
2 parents 97ba89a + 24d0190 commit b230c6f
Show file tree
Hide file tree
Showing 117 changed files with 5,057 additions and 1,571 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@7ca345011ac4304463197fac0e56eab1bc7e6af0
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,4 @@ site/
linkchecker-out.html
/scheduler
/screenshots
open_web_calendar/screenshots/
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ SPDX-License-Identifier: CC-BY-SA-4.0

[![Open Web Calendar](https://open-web-calendar.quelltext.eu/assets/img/logo/github-social-preview.svg)][web]

[![](https://badge.fury.io/py/open-web-calendar.svg)](https://pypi.org/project/open-web-calendar/)
[![](https://img.shields.io/pypi/pyversions/open-web-calendar)](https://pypi.org/project/open-web-calendar)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/niccokunzmann/open-web-calendar/run-tests.yml?logo=github)](https://github.com/niccokunzmann/open-web-calendar/actions)
![](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)

Expand All @@ -14,9 +16,6 @@ You might want to:
- [Contribute!](https://open-web-calendar.quelltext.eu/contributing/)
- [Read the documentation][docs]


Python: 3.9, 3.10, 3.11, 3.12

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
Expand Down
6 changes: 3 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ When an security update is made, it is released with the [latest version](../cha

## Reporting a Vulnerability

If you find a security vulnerability, please report it to the developer
[@niccokunzmann](https://github.com/niccokunzmann/) or
open an issue if you think it is a minor thread.
If you find a security vulnerability,
please [report the vulnerability here](https://github.com/niccokunzmann/open-web-calendar/security/) or reach out to
[@niccokunzmann](https://github.com/niccokunzmann/).
7 changes: 6 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Open Web Calendar",
"description": "Embed a web calendar into your own website.",
"repository": "https://github.com/niccokunzmann/open-web-calendar",
"website": "https://github.com/niccokunzmann/open-web-calendar",
"website": "https://open-web-calendar.quelltext.eu/",
"success_url": "/",
"env": {
"APP_DEBUG": {
Expand All @@ -19,6 +19,11 @@
"description": "How many workers should run in parallel to work on requests.",
"value": "4",
"required": true
},
"OWC_SPECIFICATION": {
"description": "JSON or YAML content to alter the specification of all calendars.",
"value": "{}",
"required": false
}
},
"image": "heroku/python",
Expand Down
26 changes: 13 additions & 13 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ babel==2.16.0
# mkdocs-material
beautifulsoup4==4.12.3
# via mkdocs-meta-descriptions-plugin
cachecontrol[filecache]==0.14.1
cachecontrol[filecache]==0.14.2
# via mkdocs-rss-plugin
cairocffi==1.7.1
# via cairosvg
cairosvg==2.7.1
# via mkdocs-material
certifi==2024.8.30
certifi==2024.12.14
# via requests
cffi==1.17.1
# via cairocffi
charset-normalizer==3.4.0
charset-normalizer==3.4.1
# via requests
click==8.1.7
click==8.1.8
# via mkdocs
colorama==0.4.6
# via mkdocs-material
Expand All @@ -37,9 +37,9 @@ filelock==3.16.1
# via cachecontrol
ghp-import==2.1.0
# via mkdocs
gitdb==4.0.11
gitdb==4.0.12
# via gitpython
gitpython==3.1.43
gitpython==3.1.44
# via
# mkdocs-git-revision-date-localized-plugin
# mkdocs-rss-plugin
Expand All @@ -51,7 +51,7 @@ idna==3.10
# via requests
importlib-metadata-argparse-version==2.0.1
# via mdpo
jinja2==3.1.4
jinja2==3.1.5
# via
# mkdocs
# mkdocs-macros-plugin
Expand Down Expand Up @@ -93,7 +93,7 @@ mkdocs-macros-plugin==1.3.7
# via -r docs-requirements.in
mkdocs-markdownextradata-plugin==0.2.6
# via -r docs-requirements.in
mkdocs-material[imaging]==9.5.47
mkdocs-material[imaging]==9.5.50
# via -r docs-requirements.in
mkdocs-material-extensions==1.3.1
# via mkdocs-material
Expand All @@ -103,7 +103,7 @@ mkdocs-mdpo-plugin @ git+https://github.com/niccokunzmann/mkdocs-mdpo-plugin.git
# via -r docs-requirements.in
mkdocs-meta-descriptions-plugin==3.0.0
# via -r docs-requirements.in
mkdocs-rss-plugin==1.17.0
mkdocs-rss-plugin==1.17.1
# via -r docs-requirements.in
msgpack==1.1.0
# via cachecontrol
Expand All @@ -128,11 +128,11 @@ polib==1.2.0
# via mdpo
pycparser==2.22
# via cffi
pygments==2.18.0
pygments==2.19.1
# via mkdocs-material
pymd4c==1.3.0
# via mdpo
pymdown-extensions==10.12
pymdown-extensions==10.14
# via
# mkdocs-material
# mkdocs-meta-descriptions-plugin
Expand Down Expand Up @@ -161,7 +161,7 @@ requests==2.32.3
# mkdocs-rss-plugin
six==1.17.0
# via python-dateutil
smmap==5.0.1
smmap==5.0.2
# via gitdb
soupsieve==2.6
# via beautifulsoup4
Expand All @@ -173,7 +173,7 @@ tinycss2==1.4.0
# via
# cairosvg
# cssselect2
urllib3==2.2.3
urllib3==2.3.0
# via requests
watchdog==6.0.0
# via mkdocs
Expand Down
1 change: 1 addition & 0 deletions docs/assets/default_specification.yml
21 changes: 17 additions & 4 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ This is a history of changes in the stable version of the Open Web Calendar.
These correspond to the [tags]({{link.tags}}).
The latest version might not be released, yet.

## v1.44

## v1.43

- Update dependencies
- Improve Belarusian translation by Yauhen, Ukrainian by Максим Горпиніч, Esperanto by phlostically
- Update Security Policy
- Add a way to choose the map, see [Issue 23](https://github.com/niccokunzmann/open-web-calendar/issues/23)
- [Update DHTMLX Scheduler] to v7.2.1
- Introduce, test and document the `OWC_SPECIFICATION` environment variable.

[Update DHTMLX Scheduler]: https://docs.dhtmlx.com/scheduler/what_s_new.html

## v1.42

- Improve gunicorn, PyPI and service documentation
Expand All @@ -21,7 +34,7 @@ The latest version might not be released, yet.
- Update Italian translation by albanobattistella, German by Nicco Kunzmann, Korean by Paimon (JeaHoon Cha), Ukrainian by Максим Горпиніч, Spanish by gallegonovato
- Fix UI test failures due to race condition when clicking a link
- Improve load times for static files
- Update DHTMLX Scheduler to v7.1.3
- [Update DHTMLX Scheduler] to v7.1.3

## v1.41

Expand All @@ -36,9 +49,9 @@ The latest version might not be released, yet.
- Support `webcal://` links
- Provide docker releases with proper tag release information
- Add choice: Choose the language of the viewer
- Update DHTMLX Scheduler to v7.1.1
- [Update DHTMLX Scheduler] to v7.1.1
- Update examples to work with DHTMLX Scheduler v7.1.1
- Add script to automatically update DHTMLX Scheduler
- Add script to automatically [Update DHTMLX Scheduler]
- Update dependencies
- Deprecate Python 3.8
- Add Chinese (Traditional Han script) and Korean
Expand Down Expand Up @@ -270,7 +283,7 @@ The latest version might not be released, yet.

## v1.5

- add link to [Contributing Section](#contributing) in about page
- add link to [Contributing Section](../contributing) in about page
- make event clickable even if there is a tool tip window
- [@MrKoga](https://github.com/MrKoga) [donated][github-sponsors] to the project! Thanks!

Expand Down
76 changes: 46 additions & 30 deletions docs/dev/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,47 +73,63 @@ you have several options:
}
```


## Adding Parameters

If you add a new parameter as a developer,

- Add the parameter with a default value to the [default_specification]
- Add an implementation, depending on its use in the `app.py` or the templates
of the JavaScript files.
The specification is already available in all of them to use.
- Add tests in [features/configure-the-calendar.feature]({{link.code}}/features/configure-the-calendar.feature) to check that the calendar responds to the feature.
- Add tests in [features/edit-the-calendar.feature]({{link.code}}/features/edit-the-calendar.feature) to make sure that the parameter can be used when a calendar is edited.

## Compiling the Specification

You can change the calendar behavior and looks with parameters.
If the same parameter is specified in different places, the earlier place listed below has the highest precedence.
These are the places to specify parameters:

1. **Query parameters**
All parameters to the calendar url are put into the specification.
The query parameters have the highest precedence.
Examples:
### Query parameters

All parameters to the calendar url are put into the specification.
The query parameters have the highest precedence.

Examples:

```txt
index.html?language=de
calendar.html?title=CALENDAR
```

2. **specification_url**
If you specify this query parameter, the editor configuration is loaded from
this url, too.
Query parameters are still more important than what is written
in this file.
The source format can be YAML or JSON.
Examples:
### specification_url

If you specify this query parameter, the editor configuration is loaded from this url, too.
Query parameters are still more important than what is written in this file.
The source format can be YAML or JSON.

Examples:

calendar.html?specification_url=https://github.com/niccokunzmann/open-web-calendar/raw/master/default_specification.yml
calendar.html?specification_url=https://github.com/niccokunzmann/open-web-calendar/raw/master/default_specification.yml

3. **[default_specification]**
This file contains the default parameters.
They must not be hard-coded in the source code. All of them are there.
Query parameters and the `specification_url` override these values.
### open_web_calendar.app.DEFAULT_SPECIFICATION

This is intended for developers and Python-internal.

```python
from open_web_calendar.app import DEFAULT_SPECIFICATION
DEFAULT_SPECIFICATION['title'] = 'calendar'
```

### OWC_SPECIFICATION

This is an optional environment variable.
Please read more about it in the [Server Configuration](../../host/configure#owc_specification).

### [default_specification]

This file contains the default parameters.
They must not be hard-coded in the source code.
All parameters are listed and documented there so this file can be used for reference.
Do not modify this file, instead use the `OWC_SPECIFICATION` environment variable.

## Adding Parameters

If you add a new parameter as a developer:

- Add the parameter with a default value to the [default_specification]
- Add an implementation, depending on its use in the `app.py` or the templates
of the JavaScript files.
The specification is already available in all of them to use.
- Add tests in [features/configure-the-calendar.feature]({{link.code}}/features/configure-the-calendar.feature) to check that the calendar responds to the feature.
- Add tests in [features/edit-the-calendar.feature]({{link.code}}/features/edit-the-calendar.feature) to make sure that the parameter can be used when a calendar is edited.

## Specification in the Calendar

Expand Down
43 changes: 35 additions & 8 deletions docs/host/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ You can choose to

## Configuring the Default Calendar

The configuration of all calendars is rooted in the [default_specification.yml].
The configuration of all calendars is rooted in the [default_specification].
All those values can be changed through a copy of this file hosted on the web
through the calendar parameter `specification_url`.
Each parameter should be documented in [default_specification.yml].
Each parameter should be documented in [default_specification].

If you modify the default specification, you modify **all calendars** that are hosted at your instance.
To modify **all calendars** hosted on your instance, use the [OWC_SPECIFICATION] environment variable.
Calendars still override some values for their configuration.
Those which they do not override are affected.
Those which they do not override are affected by the default specification.
Not all values are exposed to the configuration page to be changed.
Those values can still be changed in the [default_specification.yml] and the query parameters.
Those values can still be changed in the `specification_url` and the query parameters.

You might want to change the following values.

Expand Down Expand Up @@ -65,10 +65,11 @@ You can link to the one of this project.
### More Values

There are loads more values that can be changed.
Please refer to the [default_specification.yml].
Please refer to the [default_specification].
These values are all documented.
Please use the [OWC_SPECIFICATION] environment variable to change them.

[default_specification.yml]: https://github.com/niccokunzmann/open-web-calendar/blob/master/open_web_calendar/default_specification.yml
[default_specification]: ../../assets/default_specification.yml
[privacy-policy]: ../privacy-policy

See also:
Expand Down Expand Up @@ -108,6 +109,33 @@ Examples:

- Serve on HTTP port: `PORT=80`

### OWC_SPECIFICATION

[OWC_SPECIFICATION]: #owc_specification

`OWC_SPECIFICATION` is an optional environment variable.

- It can be a **path** to a file containing valid YAML or JSON.
- It can be a **string** containing valid YAML or JSON.

Setting `OWC_SPECIFICATION` allows you to replace default values for all calendars.

!!! note

New versions of the Open Web Calendar can add new configuration parameters.
Placing your changes in this variable instead of changing the `default_specification` file
will ensure that you do not break the Open Web Calendar in a future version.

In following example, the title for all calendars that do not set their own title will be changed.

```sh
OWC_SPECIFICATION='{"title": "calendar"}' gunicorn open_web_calendar:app
```

See also:

- [OWC_SPECIFICATION in the API](../../dev/api#owc_specification)

### WORKERS

default `4`, only for the Docker container
Expand All @@ -128,7 +156,6 @@ Examples:

- Refresh fast: `CACHE_REQUESTED_URLS_FOR_SECONDS=10`


### APP_DEBUG

default `true`, values `true` or `false`, always `false` in the Docker container
Expand Down
Loading

0 comments on commit b230c6f

Please sign in to comment.