diff --git a/.github/workflows/free.yml b/.github/workflows/free.yml deleted file mode 100644 index 2907e25..0000000 --- a/.github/workflows/free.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/pro.yml b/.github/workflows/testing.yml similarity index 94% rename from .github/workflows/pro.yml rename to .github/workflows/testing.yml index 47627b6..2dc925a 100644 --- a/.github/workflows/pro.yml +++ b/.github/workflows/testing.yml @@ -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: diff --git a/internal/dav/getfile.go b/internal/dav/getfile.go index 68a911a..0aeba0f 100644 --- a/internal/dav/getfile.go +++ b/internal/dav/getfile.go @@ -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 }