fix(fdroid): missing jq, cron errors

This commit is contained in:
ange 2024-02-05 17:08:26 +01:00
parent b4c9f173bd
commit 37c7a4dfcc
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
8 changed files with 10 additions and 16 deletions

View File

@ -1,8 +1,8 @@
BASE_URL=fdroid.
EMAIL=
REPO_NAME=fdroid
CRON_APP_UPDATE='0 0 * * 1'
REPO_NAME=
CRON_APP_UPDATE='0 0 * * *'
PUID=1000
PGID=1000

View File

@ -3,6 +3,7 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends \
cron \
fdroidserver \
jq \
&& rm -rf /var/lib/apt/lists/*
COPY entrypoint.sh /docker-entrypoint.d/99-entrypoint.sh
COPY scripts/ /usr/local/bin/

View File

@ -23,7 +23,7 @@ services:
- PGID
volumes:
- ./repo/:/repo/
- ./apks.txt:/:ro
- ./apks.txt:/apks.txt:ro
networks:
- nginx

View File

@ -11,6 +11,6 @@
get_apks.sh
echo "$CRON_APP_UPDATE root get_apks.sh" > /etc/cron.d/get_new_apks
echo "$CRON_APP_UPDATE /usr/local/bin/get_apks.sh >> /var/log/cron.log 2>&1" | crontab -
/etc/init.d/cron start

View File

@ -1,5 +0,0 @@
#!/bin/bash -e
docker run --rm -v "$PWD/repo/:/repo/" \
'registry.gitlab.com/fdroid/docker-executable-fdroidserver:master' \
init -v

View File

@ -19,12 +19,10 @@ function get_links() {
done
}
LINKS="$(get_links apks.txt)"
LINKS="$(get_links /apks.txt)"
(cd /repo/
xargs -n1 -P8 curl -LO <<< "$LINKS"
fdroid update -c
)
(cd /repo/repo/ && xargs -n1 -P8 curl -LOC- <<< "$LINKS")
(cd /repo/ && fdroid update -c)
if [ -n "$PUID" ]; then
chown -R "$PUID:$PGID" /repo/

View File

@ -7,7 +7,7 @@ function get_urls() {
local repo="$1"
curl -sSL "$API/repos/$repo/releases/latest" | \
jq -r ".assets.[] | select(.content_type == $CONTENT_TYPE) | .browser_download_url"
jq -r ".assets | select(.[].content_type == $CONTENT_TYPE) | .[].browser_download_url"
}
function get_repo_name_from_url() {

View File

@ -6,7 +6,7 @@ function get_urls() {
local repo="$1"
curl -L "$API/projects/$repo/releases" | \
jq -r '.[0].assets.links.[] | select(.name | test(".apk$")) | .url'
jq -r '.[0].assets.links | select(.[].name | test(".apk$")) | .[].url'
}
function get_repo_name_from_url() {