diff --git a/.github/workflows/build-docker-image b/.github/workflows/build-docker-image index 8d5a88a..9c16fe0 100644 --- a/.github/workflows/build-docker-image +++ b/.github/workflows/build-docker-image @@ -1,38 +1,47 @@ -name: Publish Docker Image +name: Build Yarr Docker image on: + workflow_dispatch: push: - tags: [ 'v*.*.*', 'v*.*', 'v*', 'latest' ] -env: - REGISTRY: ghcr.io - IMAGE_NAME: nkanaev/yarr + paths: + - 'yarr-version.txt' jobs: - build-and-push-image: + main: runs-on: ubuntu-latest - permissions: - contents: read - packages: write steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + - + name: Read latest release tag + id: read-tag + run: | + echo ::set-output name=tag::$(curl -sL https://raw.githubusercontent.com/rebron1900/yarr/main/yarr-version.txt) + - + name: Checkout + uses: actions/checkout@v2 with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + repository: 'rebron1900/yarr' + ref: ${{ steps.read-tag.outputs.tag }} + - + name: Remove GOARCH + run: | + sed -i -e 's/GOARCH=amd64//g' makefile + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to registry + uses: docker/login-action@v1 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Push to Docker + uses: docker/build-push-action@v2 with: context: . - file: ./etc/dockerfile + platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: | + ${{ secrets.DOCKER_USERNAME }}/yarr:latest + ${{ secrets.DOCKER_USERNAME }}/yarr:${{ steps.read-tag.outputs.tag }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f5191a..a874d16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,8 +100,6 @@ jobs: with: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} - draft: true - prerelease: true - name: Download Artifacts uses: actions/download-artifact@v2 with: @@ -142,3 +140,38 @@ jobs: asset_path: ./yarr-linux.zip asset_name: yarr-${{ github.ref }}-linux64.zip asset_content_type: application/zip + + build_docker: + runs-on: ubuntu-latest + needs: [create_release] + steps: + - name: Read latest release tag + id: read-tag + run: | + echo ::set-output name=tag::$(curl -sL https://raw.githubusercontent.com/rebron1900/yarr/master/yarr-version.txt) + - name: Checkout + uses: actions/checkout@v2 + with: + repository: 'rebron1900/yarr' + ref: ${{ steps.read-tag.outputs.tag }} + - name: Remove GOARCH + run: | + sed -i -e 's/GOARCH=amd64//g' makefile + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to registry + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Push to Docker + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/arm/v7 + push: true + tags: | + ${{ secrets.DOCKER_USERNAME }}/yarr:latest + ${{ secrets.DOCKER_USERNAME }}/yarr:${{ steps.read-tag.outputs.tag }} diff --git a/makefile b/makefile index f8d3609..4351264 100644 --- a/makefile +++ b/makefile @@ -1,4 +1,4 @@ -VERSION=2.4 +VERSION=2.5 GITHASH=$(shell git rev-parse --short=8 HEAD) CGO_ENABLED=1 @@ -30,4 +30,4 @@ serve: go run -tags "sqlite_foreign_keys" ./cmd/yarr -db local.db test: - go test -tags "sqlite_foreign_keys" ./... + go test -tags "sqlite_foreign_keys" ./... \ No newline at end of file diff --git a/readme.md b/readme.md index 1e1af7c..a2077fb 100644 --- a/readme.md +++ b/readme.md @@ -12,6 +12,29 @@ The app is a single binary with an embedded database (SQLite). The latest prebuilt binaries for Linux/MacOS/Windows AMD64 are available [here](https://github.com/nkanaev/yarr/releases/latest). Installation instructions: +* Command Arges + + ``` + -addr string + address to run server on (default "127.0.0.1:7070") + -auth-file path + path to a file containing username:password + -base string + base path of the service url + -cert-file path + path to cert file for https + -db path + storage file path + -key-file path + path to key file for https + -log-file path + path to log file to use instead of stdout + -open + open the server in browser + -version + print application version + ``` + * MacOS Download `yarr-*-macos64.zip`, unzip it, place `yarr.app` in `/Applications` folder, [open the app][macos-open], click the anchor menu bar icon, select "Open". @@ -27,12 +50,53 @@ and run [the script](etc/install-linux.sh). [macos-open]: https://support.apple.com/en-gb/guide/mac-help/mh40616/mac -For self-hosting, see `yarr -h` for auth, tls & server configuration flags. +* Docker environment + + You can use docker or docker-compose to run yarr, and you can also use environment variables to configure startup parameters. + + - `YARR_ADDR` :address to run server on (default "127.0.0.1:7070") + - `YARR_BASE` :base path of the service url + - `YARR_AUTHFILE` :path to a file containing username:password + - `YARR_CERTFILE` :path to cert file for https + - `YARR_KEYFILE` :path to key file for https + - `YARR_DB` :storage file path + - `YARR_LOGFILE` :path to log file to use instead of stdout + +* Docker run: + ``` + docker run -d \ + --name yarr \ + -p 25255:7070 \ + -e YARR_AUTHFILE="/data/.auth.list" \ + -v /data/yarr-data:/data \ + --restart always \ + arsfeld/yarr:latest + ``` + +* Docker-Compose Run -See more: + Create a file named `.auth.list` under the `/data/` directory, and the content format should be: `username:password`. + Then start by running docker-compose up -d and enjoy! -* [Building from source code](doc/build.md) -* [Fever API support](doc/fever.md) + ```yaml + version: '3.3' + services: + yarr: + container_name: yarr + image: 'arsfeld/yarr:latest' + restart: always + ports: + - '25255:7070' + environment: + YARR_AUTHFILE: "/data/.auth.list" + volumes: + - '/data/yarr-data:/data' + ``` + +* See more: + + * [Building from source code](doc/build.md) + * [Fever API support](doc/fever.md) ## credits diff --git a/src/assets/index.html b/src/assets/index.html index 33e44c0..a736207 100644 --- a/src/assets/index.html +++ b/src/assets/index.html @@ -358,7 +358,7 @@

New Feed

- +