This service tries to deliver the latest raw content of a single file gist.
The reasons to create this service were
- compensate delays of the github API
- host JSON LD files as gists having their own URI in the JSON body (impossible when the raw_url depends on the latest commit)
- cache requests in order to reduce load on the github API and your rate limits
This service is ment to run behind an Nginx proxy: proxy_pass http://127.0.0.1:2000;
-
clone this repository
git clone https://github.com/seigedigital/strollgistid
-
run
npm install
-
configure the few options in
config.json
(andindex.js
?) -
run
npm start
ornode index.js
URI schema: {Your BaseURL}/{github Userame}/{gist ID}
Use this schema as id in your JSON-LD gists.
Request this service with header X-SV-CACHE-UPDATE: TRUE
in order to initiate a cache update. It is necessary to do this once from your writing application once after you updated the gist. A gist is automatically pulled only if there is no cached version of it available yet.
curl -H 'X-SV-CACHE-UPDATE: TRUE' {Your BaseURL}/{github Userame}/{gist ID}
Otherwise get cached results which are much faster.
For the application strollview-editor revalidation is ensured by saving a stroll from the editor (which always makes use of the header mentioned above.)
After cloning run the following in the root directory of this repository
DOCKER_BUILDKIT=1 docker-compose build
You can use docker-compose
to also start NGinx, this will also build the service image if required.
docker-compose up
or if you want to run as a demon
docker-compose up -d
You can update docker-env
to pass your setting to the service containers.
You can also use Helm to install the service to Kubernetes:
helm upgrade --install -n strollgistid --set "service.frontendURL=stollgistid.example.com" --set "GITHUB_USER=" --set "GITHUB_PAT=" strollgistid deployment/helm/
Just set the following parameters:
- service.frontendURL - The hostname which the service should listen to
- GITHUB_USER - A GitHub username to be used for GitHub API requests
- GITHUB_PAT - A GitHub personal access token (PAT) to be used for GitHub API requests
Additionally you can set ssl.issuer to reference your Issues
or ClusterIssuer
to be able to generate SSL certificates, it's defaulting to letsencrypt
.