{"id":15968766,"url":"https://github.com/simongray/el","last_synced_at":"2025-08-21T14:08:56.544Z","repository":{"id":78998532,"uuid":"482883501","full_name":"simongray/el","owner":"simongray","description":"Danish electricity price calendar.","archived":false,"fork":false,"pushed_at":"2023-06-25T06:10:27.000Z","size":24,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-15T23:05:59.130Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://el.simongray.dk","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simongray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-18T14:47:37.000Z","updated_at":"2022-10-07T11:39:05.000Z","dependencies_parsed_at":"2023-07-06T17:45:13.515Z","dependency_job_id":null,"html_url":"https://github.com/simongray/el","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simongray/el","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simongray%2Fel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simongray%2Fel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simongray%2Fel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simongray%2Fel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simongray","download_url":"https://codeload.github.com/simongray/el/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simongray%2Fel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271493232,"owners_count":24769117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-07T19:04:00.420Z","updated_at":"2025-08-21T14:08:56.518Z","avatar_url":"https://github.com/simongray.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Danish electricity calendar\nA personalised, auto-updating [iCalendar](https://en.wikipedia.org/wiki/ICalendar) of Danish electricity prices which you can subscribe to via a [compatible application](https://en.wikipedia.org/wiki/List_of_applications_with_iCalendar_support), e.g. Calendar on macOS.\n\nThe `dk.simongray.el.prices` namespace is a micro-library for sourcing the latest Danish electricity prices, while `dk.simongray.el.calendar` contains a small Pedestal web service exposing the calendar itself.\n\n## Setup\nCaddy must be installed, along with Clojure and a JVM of course.\n\nThe production system is compiled from source using [xcaddy](https://github.com/caddyserver/xcaddy) in order to allow rate-limiting, since Caddy doesn't provide this feature built in. My chosen rate limiting extension is the [one by RussellLuo](https://github.com/RussellLuo/caddy-ext/tree/master/ratelimit) as it was the simplest to implement. Compiling a custom Caddy binary requires both Go and xcaddy to be installed:\n\n```shell\nxcaddy build --with github.com/RussellLuo/caddy-ext/ratelimit\ncp ./caddy /usr/bin/caddy\n```\n\n### Development\nAssuming that the calendar web service is already running in a Clojure REPL:\n\n```shell\n# local reverse proxy\ncaddy run\n```\n\nApple's Calendar app won't like the fact that localhost has a subdomain (`el.localhost`), so the actual calendar subscription will fail for that reason. However, subscribing via `localhost:9876` can be used to verify that the service works as intended.\n\n### Production\nEither upload via SFTP or build an uberjar called `el.jar`. The uberjar is created by running the `ci` function in  `dev/src/build.clj`. This .jar file needs to be located in `/opt/el` on the server.\n\nTo save on server resources, it's probably best to build `el.jar` on the dev machine and upload it to the server. Running an uberjar (as opposed to running via `/usr/local/bin/clojure -Xserver`, which I did originally) is [much more performant](https://github.com/simongray/el/issues/6).\n\nCopy Systemd units and Caddyfile:\n\n```shell\n# from inside the `el` directory\nsh install.sh\n```\n\nSystemd setup:\n\n```shell\n# enable systemd units (just once)\nsystemctl enable el\nsystemctl enable caddy\n```\n\nStarting the system:\n\n```shell\n# start services (as needed)\nsystemctl start el\nsystemctl start caddy\n\n# ..or do a manual caddy run (debugging only)\nDOMAIN=simongray.dk caddy run\n```\n\n## See also\n* [Caddy systemd documentation](https://caddyserver.com/docs/running#unit-files).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimongray%2Fel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimongray%2Fel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimongray%2Fel/lists"}