remove stupid 1000 limit

This commit is contained in:
Ben Sarmiento
2023-10-21 23:54:26 +02:00
parent 882cb3d853
commit a41024aec9
3 changed files with 6 additions and 64 deletions

View File

@@ -1,59 +0,0 @@
name: Build zurg-1000 image
on:
push:
branches: main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-1000
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: zurg-1000
run: |
find . -type f -name "*.go" -exec sed -i 's/GetTorrents(t.token, 0)/GetTorrents(t.token, 1000)/g' {} +
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

View File

@@ -1,4 +1,4 @@
name: Build zurg image
name: Build zurg-testing image
on:
push:
@@ -6,7 +6,7 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_NAME: ${{ github.repository }}-testing
jobs:
build-and-push-image:

View File

@@ -19,11 +19,12 @@ func HandleGetRequest(w http.ResponseWriter, r *http.Request, t *torrent.Torrent
requestPath := path.Clean(r.URL.Path)
segments := strings.Split(requestPath, "/")
fmt.Println(segments, len(segments))
// If there are less than 3 segments, return an error or adjust as needed
if len(segments) < 3 {
log.Println("Invalid url", requestPath)
if len(segments) < 4 {
// log.Println("Invalid url", requestPath)
// http.Error(w, "Cannot find file", http.StatusNotFound)
handleSingleTorrent(requestPath, w, r, t)
HandlePropfindRequest(w, r, t, c)
return
}