Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
more docu
Browse files Browse the repository at this point in the history
  • Loading branch information
CubicrootXYZ committed Dec 22, 2024
1 parent 5967d2b commit f37bf79
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,21 @@ Set the following environment variables:
* `HUB_API_BASE_URL`: Base URL of the hubs API - usually is mentioned in the [hub repo](https://git.cccv.de/hub/hub)
* `HUB_API_SESSION`: Session token from your user account at the hub (the value of the session cookie)
* `TOKEN`: the token required to query the iCal file
* `LISTEN_ADDR`: address the webserver will listen on - most likely `127.0.0.1:80`
* `LISTEN_ADDR`: address the webserver will listen on - most likely `127.0.0.1:80` or `0.0.0.0:80`

## Docker Compose

Example compose file:

```yaml
services:
c3hub-to-ical:
image: cubicrootxyz/c3hub-to-ical:beta
user: "0:0"
environment:
- 'HUB_API_BASE_URL=https://example.com/congress/2024'
- 'HUB_API_SESSION=xxx'
- 'TOKEN=yyy'
# Take care to expose this port in some way.
- 'LISTEN_ADDR=0.0.0.0:8000'
```
2 changes: 2 additions & 0 deletions internal/api/service.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package api

import (
"log/slog"
"net/http"

"github.com/Cubicroots-Playground/c3hub-to-ical/internal/c3hub"
Expand All @@ -24,6 +25,7 @@ func New(conf Config, hubService c3hub.Service) Service {
}

func (service *service) Run() error {
slog.Info("listening on " + service.conf.ListenAddr)
http.HandleFunc("/ical", service.MySchedule)
return http.ListenAndServe(service.conf.ListenAddr, nil)
}

0 comments on commit f37bf79

Please sign in to comment.