This is ultimately going to be running as a CronJob on a k8s cluster, so need to look at building a container image.
assigned to @btasker
mentioned in commit 865c3e608cee804d6bfe1f81315c3ffe1cfcc97d
Commit: 865c3e608cee804d6bfe1f81315c3ffe1cfcc97d Author: B Tasker Date: 2024-08-11T09:16:36.000+01:00
feat: create Dockerfile (utilities/auto-blog-link-preserver#9)
mentioned in commit c43a9f36f120e2b6e8e92be6fc6b34e710941c23
Commit: c43a9f36f120e2b6e8e92be6fc6b34e710941c23 Author: B Tasker Date: 2024-08-11T09:13:37.000+01:00
feat: allow feeds.json location to be specified by env var (utilities/auto-blog-link-preserver#9)
This is in preparation for containerisation
The command to run looks like this
docker run \ -it \ --rm \ -v "$PWD/feeds.json":/app/feeds.json \ -v "$PWD/hashes":/hashdir \ -e LINKWARDEN_URL="https://$DOMAIN" \ -e LINKWARDEN_TOKEN="$LINKWARDEN_TOKEN" \ -e LINKWARDEN_TAGS="SiteLinks,anti-link-rot" \ -e LINKWARDEN_COLLECTION_NAME="Site Links" \ test
If, for some reason, we wanted to put feeds.json somewhere else, we map it into that location and then set FEEDS_FILE accordinly:
feeds.json
FEEDS_FILE
docker run \ -it \ --rm \ -v "$PWD/feeds.json":/somewhere/random/feeds.json \ -e FEEDS_FILE=/somewhere/random/feeds.json \ -v "$PWD/hashes":/hashdir \ -e LINKWARDEN_URL="https://$DOMAIN" \ -e LINKWARDEN_TOKEN="$LINKWARDEN_TOKEN" \ -e LINKWARDEN_TAGS="SiteLinks,anti-link-rot" \ -e LINKWARDEN_COLLECTION_NAME="Site Links" \ test
Just for the sake of completeness, the hashdir location can also be changed via env var.
A command changing the location of both that and the feeds file might look like this
docker run \ -it \ --rm \ -v "$PWD/feeds.json":/somewhere/random/feeds.json \ -e FEEDS_FILE=/somewhere/random/feeds.json \ -e HASH_DIR="/mnt/hashdir" \ -v "$PWD/hashes":/mnt/hashdir \ -e LINKWARDEN_URL="https://$DOMAIN" \ -e LINKWARDEN_TOKEN="$LINKWARDEN_TOKEN" \ -e LINKWARDEN_TAGS="SiteLinks,anti-link-rot" \ -e LINKWARDEN_COLLECTION_NAME="Site Links" \ ghcr.io/bentasker/auto-blog-link-preserver:0.1
Activity
10-Aug-24 23:14
assigned to @btasker
11-Aug-24 08:16
mentioned in commit 865c3e608cee804d6bfe1f81315c3ffe1cfcc97d
Message
feat: create Dockerfile (utilities/auto-blog-link-preserver#9)
11-Aug-24 08:16
mentioned in commit c43a9f36f120e2b6e8e92be6fc6b34e710941c23
Message
feat: allow feeds.json location to be specified by env var (utilities/auto-blog-link-preserver#9)
This is in preparation for containerisation
11-Aug-24 08:18
The command to run looks like this
If, for some reason, we wanted to put
feeds.json
somewhere else, we map it into that location and then setFEEDS_FILE
accordinly:12-Aug-24 07:30
Just for the sake of completeness, the hashdir location can also be changed via env var.
A command changing the location of both that and the feeds file might look like this