-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/.git | ||
|
||
# .gitignore | ||
/.meltano/ | ||
/output/ | ||
/logs/ | ||
/.env | ||
/.python-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Build, Test, Push | ||
|
||
on: | ||
push: | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-test-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
### Build | ||
- name: Build / Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build / Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build / Extract Docker metadata (tags, labels) | ||
id: meta | ||
uses: docker/metadata-action@v4.6.0 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build / Build Docker image | ||
uses: docker/build-push-action@v4.1.1 | ||
with: | ||
context: . | ||
load: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
### Test | ||
- name: Test / Render app to image | ||
env: | ||
PLEX_URL: ${{secrets.PLEX_URL}} | ||
PLEX_TOKEN: ${{secrets.PLEX_TOKEN}} | ||
run: | | ||
docker run -v "$(pwd)/output:/project/output" -e TAP_PIXLET_MAGNIFICATION=8 -e PLEX_URL=$PLEX_URL -e PLEX_TOKEN=$PLEX_TOKEN ${{ steps.meta.outputs.tags }} | ||
sudo mv output/**/*.webp output/image.webp | ||
- name: Test / Store image | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: image | ||
path: output/image.webp | ||
|
||
### Push | ||
- name: Push / Log in to the Container registry | ||
uses: docker/login-action@v2.2.0 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push / Push Docker image | ||
uses: docker/build-push-action@v4.1.1 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.meltano | ||
/output/ | ||
/logs/ | ||
/.env | ||
/.python-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ARG PIXBYT_IMAGE=ghcr.io/douwem/pixbyt:main | ||
FROM $PIXBYT_IMAGE as base | ||
|
||
ENV APP_NAME=plex | ||
|
||
WORKDIR /project | ||
|
||
# Copy app files | ||
COPY ./ ./apps/${APP_NAME} | ||
|
||
# Install apt packages for apps | ||
RUN cat ./apps/**/apt-packages.txt | sort | uniq > ./apps/apt-packages.txt | ||
RUN xargs -a apps/apt-packages.txt apt-get install -y | ||
|
||
# Install Meltano plugins for apps | ||
RUN meltano --log-level=debug install extractors tap-pixlet--${APP_NAME} | ||
|
||
ENTRYPOINT [] | ||
CMD meltano run ${APP_NAME}--webp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Tidbyt + Plex | ||
|
||
[Tidbyt](https://tidbyt.com/) app that shows what's currently playing on your [Plex](https://plex.tv) media server. | ||
|
||
![Screenshot](screenshot.webp) | ||
|
||
## Installation | ||
|
||
This app is not available through Tidbyt's mobile app as it uses features that (for security reasons) are not supported in [community apps](https://tidbyt.dev/docs/publish/community-apps) that run on Tidbyt's official app server. | ||
|
||
Instead, it needs to be run using [Pixbyt](https://pixbyt.dev), a self-hosted Tidbyt app server for advanced apps. | ||
|
||
### 1. Set up Pixbyt | ||
|
||
1. [Create your own Pixbyt repo](https://github.com/DouweM/pixbyt#1-create-your-own-pixbyt-repo) | ||
2. [Configure your Tidbyt](https://github.com/DouweM/pixbyt#2-configure-your-tidbyt) | ||
|
||
### 2. Install the app | ||
|
||
1. Add this repo as a submodule under `apps`: | ||
|
||
```bash | ||
git submodule add https://github.com/DouweM/tidbyt-plex.git apps/plex | ||
``` | ||
|
||
1. Add an update schedule to `apps.yml` under `schedules:`: | ||
|
||
```yaml | ||
schedules: | ||
# ... | ||
- name: plex | ||
interval: '* * * * *' # Every minute | ||
job: plex | ||
``` | ||
|
||
## Configuration | ||
|
||
Update `.env` with your configuration: | ||
|
||
```bash | ||
PLEX_URL="<url>" # Plex Server URL. If HTTPS, certificate must be valid. Example: 'http://my-nas:32400' | ||
PLEX_TOKEN="<token>" # Plex API Token. See https://support.plex.tv/ articles/204059436-finding-an-authentication-token-x-plex-token/ | ||
PLEX_USER_NAME="<user name>" # Filter: User Name. Leave blank to consider sessions from all users | ||
PLEX_DEVICE_TYPE="<device type>" # Filter: Device Type. Leave blank to consider sessions from all types of devices. Example: 'Apple TV' | ||
``` | ||
|
||
## Usage | ||
|
||
Build and launch your Pixbyt app server: | ||
|
||
1. [Build the app server](https://github.com/DouweM/pixbyt#4-build-the-app-server) | ||
1. [Launch the app server](https://github.com/DouweM/pixbyt#5-launch-the-app-server) |