From 8ed0915241df90040448d906ab806cddde255b33 Mon Sep 17 00:00:00 2001 From: Opnxng Date: Wed, 27 Dec 2023 14:57:19 +0800 Subject: [PATCH] Replaced Libreddit with Redlib --- .gitea/workflows/libreddit.yaml | 73 ------------------------------ README.md | 2 +- copy/libreddit.base.html | 80 --------------------------------- 3 files changed, 1 insertion(+), 154 deletions(-) delete mode 100644 .gitea/workflows/libreddit.yaml delete mode 100644 copy/libreddit.base.html diff --git a/.gitea/workflows/libreddit.yaml b/.gitea/workflows/libreddit.yaml deleted file mode 100644 index 099b6c4..0000000 --- a/.gitea/workflows/libreddit.yaml +++ /dev/null @@ -1,73 +0,0 @@ -name: libreddit -run-name: libreddit -env: - REPO_NAME: libreddit - REMOTE_REPO: https://github.com/libreddit/libreddit.git - BUILD_PLATFORM: linux/amd64 -on: - schedule: - - cron: "0 0 * * *" # at midnight - push: - paths: - - ".gitea/workflows/libreddit.yaml" - -jobs: - build: - runs-on: runner - container: - image: docker:cli - steps: - - name: Install packages - run: apk --no-cache add curl git jq - - - name: Check latest upstream commit - run: | - STORED_COMMIT=$(curl -H "Authorization: Bearer ${{ secrets.NT }}" -s "https://nt.opnxng.com/${REPO_NAME}/raw?poll=1" | tail -n 1) - LATEST_COMMIT=$(git ls-remote ${REMOTE_REPO} | awk '{print $1}' | head -1) - echo "STORED_COMMIT=${STORED_COMMIT}" >> "$GITHUB_ENV" - echo "LATEST_COMMIT=${LATEST_COMMIT}" >> "$GITHUB_ENV" - echo "Stored Commit: ${STORED_COMMIT}" - echo "Latest Commit: ${LATEST_COMMIT}" - - - name: Build and push Docker image - run: | - if [ "$STORED_COMMIT" != "$LATEST_COMMIT" ]; then - echo "Found a new commit, building new image" - # Install Docker Buildx - BUILDX_VERSION=$(wget -q -O- https://api.github.com/repos/docker/buildx/releases/latest | jq -r '.name') - wget -O /usr/bin/docker-buildx https://github.com/docker/buildx/releases/download/$BUILDX_VERSION/buildx-$BUILDX_VERSION.linux-arm64 - chmod +x /usr/bin/docker-buildx - # Create and use Docker Buildx builder - docker-buildx create --use --name buildx - # Login to Package Registry - echo "${{ secrets.TOKEN }}" | docker login git.opnxng.com -u ${{ gitea.repository_owner }} --password-stdin - # Build and push Docker image - mkdir temp - cd temp - git clone ${REMOTE_REPO} . - curl -JL https://git.opnxng.com/opnxng/docker-images/raw/branch/main/copy/libreddit.base.html -o templates/base.html - docker-buildx build \ - --platform ${BUILD_PLATFORM} \ - -t git.opnxng.com/${{ gitea.repository_owner }}/${REPO_NAME}:latest \ - -f ./Dockerfile \ - --push . && \ - curl -H prio:low -d "Built and pushed ${REPO_NAME}" https://ntfy.opnxng.com/build || \ - { curl -H tags:warning -H prio:high -d "Built and pushed ${REPO_NAME} failed!" https://ntfy.opnxng.com/build ; exit 1; } - # Remove Docker Buildx builder - docker-buildx rm buildx - else - echo "No new commit, skipped build" - fi - - - name: Update stored commit - run: | - if [ "$STORED_COMMIT" != "$LATEST_COMMIT" ]; then - curl -H "Authorization: Bearer ${{ secrets.NT }}" -d $(git ls-remote ${REMOTE_REPO} | awk '{print $1}' | head -1) "https://nt.opnxng.com/${REPO_NAME}" - STORED_COMMIT=$(curl -H "Authorization: Bearer ${{ secrets.NT }}" -s "https://nt.opnxng.com/${REPO_NAME}/raw?poll=1" | tail -n 1) - echo "STORED_COMMIT=${STORED_COMMIT}" >> "$GITHUB_ENV" - else - curl -H "Authorization: Bearer ${{ secrets.NT }}" -d $(git ls-remote ${REMOTE_REPO} | awk '{print $1}' | head -1) "https://nt.opnxng.com/${REPO_NAME}" - STORED_COMMIT=$(curl -H "Authorization: Bearer ${{ secrets.NT }}" -s "https://nt.opnxng.com/${REPO_NAME}/raw?poll=1" | tail -n 1) - echo "STORED_COMMIT=${STORED_COMMIT}" >> "$GITHUB_ENV" - exit 1 - fi \ No newline at end of file diff --git a/README.md b/README.md index 3e506ba..31bcf7f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ Source | Image [ThePenguinDev/proxigram](https://codeberg.org/ThePenguinDev/proxigram) | opnxng/proxigram [Bing Chilling/Rat Aint Tieba](https://0xacab.org/johnxina/rat) | opnxng/rat-aint-tieba [syeopite/priviblur](https://github.com/syeopite/priviblur) | opnxng/priviblur -[libreddit/libreddit](https://github.com/libreddit/libreddit) | opnxng/libreddit ([custom html](copy/libreddit.base.html)) [zyachel/quetre](https://github.com/zyachel/quetre) | [pussthecatorg/quetre](https://quay.io/repository/pussthecatorg/quetre?tab=tags&tag=latest) [zyachel/libremdb](https://github.com/zyachel/libremdb) | [pussthecatorg/libremdb](https://quay.io/repository/pussthecatorg/libremdb?tab=tags&tag=latest) [cadence/breezewiki](https://gitdab.com/cadence/breezewiki) | [pussthecatorg/breezewiki](https://quay.io/repository/pussthecatorg/breezewiki?tab=tags&tag=latest) @@ -39,6 +38,7 @@ Source | Image [cinnyapp/cinny](https://github.com/cinnyapp/cinny) | cinnyapp/cinny [Frooodle/Stirling-PDF](https://github.com/Frooodle/Stirling-PDF) | frooodle/s-pdf [teddit/teddit](https://codeberg.org/teddit/teddit) | teddit/teddit +[redlib-org/redlib](https://github.com/redlib-org/redlib) | redlib-org/redlib [caomingjun/warp-docker](https://github.com/cmj2002/warp-docker) | caomingjun/warp [aeharding/voyager](https://github.com/aeharding/voyager) | aeharding/voyager [rystaf/mlmym](https://github.com/rystaf/mlmym) | rystaf/mlmym diff --git a/copy/libreddit.base.html b/copy/libreddit.base.html deleted file mode 100644 index 66ee9a6..0000000 --- a/copy/libreddit.base.html +++ /dev/null @@ -1,80 +0,0 @@ -{% import "utils.html" as utils %} - - - - - {% block head %} - {% block title %}Libreddit{% endblock %} - - - - - - - - - - - - - - - - - - {% endblock %} - - - - - - - {% block body %} -
- {% block content %} - {% endblock %} -
- {% endblock %} - - - {% block footer %} - - {% endblock %} - -