mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-18 16:58:27 -04:00
Support pulling mod by manifest hash
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
These files are used by Linuxserver build processes to handle mods in our images. Not for end-user consumption.
|
These files are used by Linuxserver build processes to handle mods in our images. Not for end-user consumption.
|
||||||
|
|
||||||
|
* **31.12.24:** - Support pulling mods using manifest hash.
|
||||||
* **22.12.24:** - Add modcache support.
|
* **22.12.24:** - Add modcache support.
|
||||||
* **26.06.24:** - Add RO and User handlers.
|
* **26.06.24:** - Add RO and User handlers.
|
||||||
* **10.06.24:** - Move lsiown to its own file. Remove support for legacy v2 and hybrid mods.
|
* **10.06.24:** - Move lsiown to its own file. Remove support for legacy v2 and hybrid mods.
|
||||||
|
|||||||
+11
-6
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
# Version 3
|
# Version 3
|
||||||
# 2022-09-25 - Initial Release
|
# 2022-09-25 - Initial Release
|
||||||
MOD_SCRIPT_VER="3.20241223"
|
MOD_SCRIPT_VER="3.20241231"
|
||||||
|
|
||||||
# Define custom folder paths
|
# Define custom folder paths
|
||||||
SCRIPTS_DIR="/custom-cont-init.d"
|
SCRIPTS_DIR="/custom-cont-init.d"
|
||||||
@@ -298,15 +298,20 @@ run_mods() {
|
|||||||
ENDPOINT="${DOCKER_MOD%%:*}"
|
ENDPOINT="${DOCKER_MOD%%:*}"
|
||||||
USERNAME="${DOCKER_MOD%%/*}"
|
USERNAME="${DOCKER_MOD%%/*}"
|
||||||
REPO="${ENDPOINT#*/}"
|
REPO="${ENDPOINT#*/}"
|
||||||
TAG="${DOCKER_MOD#*:}"
|
FULLTAG="${DOCKER_MOD#*:}"
|
||||||
|
TAG="${FULLTAG%@*}"
|
||||||
|
TAGSHA="${DOCKER_MOD#*@}"
|
||||||
|
if [[ ! "${TAGSHA}" =~ sha256 ]]; then
|
||||||
|
unset TAGSHA
|
||||||
|
fi
|
||||||
if [[ "${TAG}" == "${DOCKER_MOD}" ]]; then
|
if [[ "${TAG}" == "${DOCKER_MOD}" ]]; then
|
||||||
TAG="latest"
|
TAG="latest"
|
||||||
fi
|
fi
|
||||||
FILENAME="${USERNAME}.${REPO}.${TAG}"
|
FILENAME="${USERNAME}.${REPO}.${TAG}${TAGSHA:+.${TAGSHA#*:}}"
|
||||||
MANIFEST_URL="https://${REGISTRY}/v2/${ENDPOINT}/manifests"
|
MANIFEST_URL="https://${REGISTRY}/v2/${ENDPOINT}/manifests"
|
||||||
BLOB_URL="https://${REGISTRY}/v2/${ENDPOINT}/blobs/"
|
BLOB_URL="https://${REGISTRY}/v2/${ENDPOINT}/blobs/"
|
||||||
MOD_UA="Mozilla/5.0 (Linux $(uname -m)) linuxserver.io ${REGISTRY}/${ENDPOINT}:${TAG}"
|
MOD_UA="Mozilla/5.0 (Linux $(uname -m)) linuxserver.io ${REGISTRY}/${ENDPOINT}:${TAG}${TAGSHA:+@$TAGSHA}"
|
||||||
write_mod_debug "Registry='${REGISTRY}', Repository='${USERNAME}', Image='${ENDPOINT}', Tag='${TAG}'"
|
write_mod_debug "Registry='${REGISTRY}', Repository='${USERNAME}', Image='${ENDPOINT}', Tag='${TAG}', TagSHA='${TAGSHA:-N/A}'"
|
||||||
case "${REGISTRY}" in
|
case "${REGISTRY}" in
|
||||||
"lscr.io") AUTH_URL="https://ghcr.io/token?scope=repository%3A${USERNAME}%2F${REPO}%3Apull";;
|
"lscr.io") AUTH_URL="https://ghcr.io/token?scope=repository%3A${USERNAME}%2F${REPO}%3Apull";;
|
||||||
"ghcr.io") AUTH_URL="https://ghcr.io/token?scope=repository%3A${USERNAME}%2F${REPO}%3Apull";;
|
"ghcr.io") AUTH_URL="https://ghcr.io/token?scope=repository%3A${USERNAME}%2F${REPO}%3Apull";;
|
||||||
@@ -360,7 +365,7 @@ run_mods() {
|
|||||||
MOD_OFFLINE="true"
|
MOD_OFFLINE="true"
|
||||||
else
|
else
|
||||||
# Determine first and only layer of image
|
# Determine first and only layer of image
|
||||||
SHALAYER=$(get_blob_sha "${TOKEN}" "${MANIFEST_URL}" "${TAG}" "${ARCH:--amd64}")
|
SHALAYER=$(get_blob_sha "${TOKEN}" "${MANIFEST_URL}" "${TAGSHA:-$TAG}" "${ARCH:--amd64}")
|
||||||
if [[ $? -eq 1 ]]; then
|
if [[ $? -eq 1 ]]; then
|
||||||
write_mod_error "No manifest available for arch ${ARCH:--amd64}, cannot fetch mod"
|
write_mod_error "No manifest available for arch ${ARCH:--amd64}, cannot fetch mod"
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user