Skip to content

Commit

Permalink
fix: plex scan request if path contains '&' character
Browse files Browse the repository at this point in the history
Autoscan

format with black
removed python2 support
PLEX_CHECK_BEFORE_SCAN defaults to true.
checks if plex media scanner is running before analyzing media file.

Docker

umask support
bump rclone to 1.62.2
added more dockerfile labels
cleaned up dockerfile

Misc

update github action workflow deps
uses docker manifest allowing users to pull a latest tag across amd64 or aarch64.
update README.md
update CONTRIBUTING.md
renamed LICENSE.md -> LICENSE
  • Loading branch information
NiNiyas committed Mar 22, 2023
1 parent d979e9c commit c3ec62b
Show file tree
Hide file tree
Showing 24 changed files with 1,085 additions and 846 deletions.
5 changes: 0 additions & 5 deletions .github/SUPPORT.md

This file was deleted.

52 changes: 31 additions & 21 deletions .github/workflows/ghcr-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,67 @@ jobs:
build-and-push-to-ghcr:
runs-on: ubuntu-latest
steps:
- uses: benjlevesque/[email protected]
- name: Get Short SHA
uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- uses: actions/checkout@v2
- name: Log into GitHub Container Registry

- name: Checkout
uses: actions/[email protected]

- name: Log into GHCR
run: echo "${{ secrets.GIT_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2.1.0
with:
image: tonistiigi/binfmt:latest
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/[email protected]
with:
install: true
version: latest
driver-opts: image=moby/buildkit:master

- name: Build and push amd64
uses: docker/build-push-action@v4
with:
context: ./
file: ./Dockerfile
push: true
provenance: false
tags: |
ghcr.io/${{ secrets.GIT_USER }}/autoscan:amd64
ghcr.io/${{ secrets.GIT_USER }}/autoscan:amd64_commit-${{ steps.short-sha.outputs.sha }}
platforms: linux/amd64
build-args: |
OVERLAY_ARCH=amd64
ARCH=amd64
- name: Build and push aarch64
id: docker_build_aarch64
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: ./
file: ./Dockerfile
push: true
provenance: false
tags: |
ghcr.io/niniyas/autoscan:arm64
ghcr.io/${{ secrets.GIT_USER }}/autoscan:arm64
ghcr.io/${{ secrets.GIT_USER }}/autoscan:arm64_commit-${{ steps.short-sha.outputs.sha }}
platforms: linux/arm64
build-args: |
OVERLAY_ARCH=aarch64
ARCH=arm64
- name: Build and push amd64
id: docker_build_amd64
uses: docker/build-push-action@v2
- name: Create and push manifest images
uses: Noelware/docker-manifest-action@master
with:
context: ./
file: ./Dockerfile
inputs: ghcr.io/${{ secrets.GIT_USER }}/autoscan:latest
images: ghcr.io/${{ secrets.GIT_USER }}/autoscan:amd64,ghcr.io/${{ secrets.GIT_USER }}/autoscan:arm64
push: true
tags: |
ghcr.io/niniyas/autoscan:amd64
ghcr.io/${{ secrets.GIT_USER }}/autoscan:amd64_commit-${{ steps.short-sha.outputs.sha }}
platforms: linux/amd64
build-args: |
OVERLAY_ARCH=amd64
ARCH=amd64

- name: ntfy success notifications
uses: niniyas/ntfy-action@master
Expand Down
23 changes: 6 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,24 @@
Guide below will explain the process of submitting a pull request (PR).

1. Fork it.

1. Clone your forked project:

2. Clone your forked project:
```
git clone http://github.com/<your_github_username>/plex_autoscan
```

1. Create a feature branch off of the **develop** branch:

3. Create a feature branch off of the **develop** branch:
```
git checkout -b 'feature/my-new-feature' develop
```

1. Keep up to date with latest **develop** branch changes:

4. Keep up to date with latest **develop** branch changes:
```
git pull --rebase upstream develop
```

1. Commit your changes:

5. Commit your changes:
```
git commit -am 'Added some feature'
```

1. Push commits to the feature branch:

6. Push commits to the feature branch:
```
git push origin feature/my-new-feature
```

1. Submit feature branch as a PR to _our_ **develop** branch.
7. Submit feature branch as a PR to _our_ **develop** branch.
53 changes: 31 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ FROM alpine:latest

ARG ARCH
ARG OVERLAY_ARCH
ARG RCLONE_VERSION=1.59.1
ARG RCLONE_VERSION=1.62.2
ARG OVERLAY_VERSION=v2.2.0.3

LABEL org.opencontainers.image.source = "https://github.com/NiNiyas/autoscan"

ARG RCLONE_URL="https://github.com/rclone/rclone/releases/download/v${RCLONE_VERSION}/rclone-v${RCLONE_VERSION}-linux-${ARCH}.zip"
ARG S6_URL="https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}-installer"

ENV TZ Europe/Brussels

WORKDIR /opt/autoscan

RUN apk add --no-cache --update tzdata tini python3 git py3-pip py3-setuptools logrotate shadow bash docker-cli && \
pip3 install --upgrade pip idna wheel
ENV CONFIG_DIR="/config" \
PUID="1000" \
PGID="1000" \
UMASK="002" \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
PYTHONUNBUFFERED=1 \
PATH=/opt/plex_autoscan:${PATH} \
TZ=Europe/Brussels \
AUTOSCAN_CONFIG=/config/config.json \
AUTOSCAN_LOGFILE=/config/autoscan.log \
AUTOSCAN_LOGLEVEL=INFO \
AUTOSCAN_QUEUEFILE=/config/queue.db \
AUTOSCAN_CACHEFILE=/config/cache.db

COPY . .
ARG RCLONE_URL="https://github.com/rclone/rclone/releases/download/v${RCLONE_VERSION}/rclone-v${RCLONE_VERSION}-linux-${ARCH}.zip"
ARG S6_URL="https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}-installer"

RUN wget -q -O rclone.zip $RCLONE_URL && \
unzip rclone.zip && \
Expand All @@ -30,20 +35,24 @@ RUN wget -q $S6_URL -O /tmp/s6-overlay-${OVERLAY_ARCH}-installer && \
/tmp/s6-overlay-${OVERLAY_ARCH}-installer / && \
rm /tmp/s6-overlay-${OVERLAY_ARCH}-installer

RUN apk -U --no-cache --virtual .build-deps add gcc linux-headers musl-dev python3-dev && \
pip3 install --no-cache-dir -r requirements.txt && \
apk -U --no-cache del .build-deps && \
COPY . .

RUN apk add --no-cache --update python3 git py3-pip py3-setuptools shadow bash docker-cli && \
apk --no-cache --virtual=build-deps add gcc linux-headers musl-dev python3-dev && \
pip3 install --upgrade pip idna wheel && \
pip3 install --upgrade --no-cache-dir --no-cache -r requirements.txt && \
apk --purge del build-deps && \
ln -s /opt/plex_autoscan/config /config

ENV DOCKER_CONFIG=/home/autoscan/docker_config.json \
AUTOSCAN_CONFIG=/config/config.json \
AUTOSCAN_LOGFILE=/config/autoscan.log \
AUTOSCAN_LOGLEVEL=INFO \
AUTOSCAN_QUEUEFILE=/config/queue.db \
AUTOSCAN_CACHEFILE=/config/cache.db \
PATH=/opt/plex_autoscan:${PATH}
COPY /root /

RUN addgroup -S autoscan && adduser -S autoscan -G autoscan
RUN useradd -u 1000 -U -d "${CONFIG_DIR}" -s /bin/false autoscan && \
usermod -G users autoscan

LABEL org.opencontainers.image.source = "https://github.com/NiNiyas/autoscan"
LABEL MAINTAINER="NiNiyas"
LABEL org.opencontainers.image.description="Autoscan is a python script that assists in the importing of Sonarr, Radarr, and Lidarr downloads into Plex and/or Jellyfin/Emby."
LABEL org.opencontainers.image.licenses="GNU General Public License v3.0"

VOLUME ["/config", "/plexDb"]

Expand Down
File renamed without changes.
Loading

0 comments on commit c3ec62b

Please sign in to comment.