-
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
13 changed files
with
104 additions
and
25 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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
FROM node:alpine as base | ||
|
||
# File Author / Maintainer | ||
LABEL authors="Ricardo Gonzalez <[email protected]>" | ||
FROM node:lts-alpine as base | ||
|
||
LABEL org.opencontainers.image.title "Scrobblex" | ||
LABEL org.opencontainers.image.description "Self-hosted app that enables Plex scrobbling integration with Trakt via webhooks" | ||
LABEL org.opencontainers.image.url="https://github.com/ryck/scrobblex" | ||
LABEL org.opencontainers.image.source='https://github.com/ryck/scrobblex' | ||
LABEL org.opencontainers.image.licenses='MIT' | ||
|
||
ENV NODE_ENV=production | ||
ENV NODE_ENV $NODE_ENV | ||
|
@@ -12,16 +14,14 @@ ENV PORT $PORT | |
|
||
HEALTHCHECK CMD curl --fail http://localhost:${PORT}/healthcheck || exit 1 | ||
|
||
WORKDIR /usr/src/app | ||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm ci | ||
|
||
COPY . . | ||
|
||
VOLUME /usr/src/app/data | ||
|
||
EXPOSE 3090 | ||
EXPOSE ${PORT} | ||
|
||
CMD ["node", "src/index.js"] |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Ricardo Gonzalez | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 |
---|---|---|
@@ -1,3 +1,69 @@ | ||
# Scrobblex | ||
|
||
[](https://github.com/ryck/scrobblex/actions/workflows/docker-publish.yml) | ||
[](https://github.com/ryck/scrobblex/releases) | ||
[](https://www.apache.org/licenses/LICENSE-2.0) | ||
[](https://hub.docker.com/r/rickgc/scrobblex) | ||
|
||
## Description | ||
|
||
Self-hosted app that enables Plex scrobbling integration with Trakt via webhooks. | ||
|
||
Plex provides webhook integration for all Plex Pass subscribers, and users of their servers. A webhook is a request that the Plex application sends to third party services when a user takes an action, such as watching a movie or episode. | ||
|
||
You can ask Plex to send these webhooks to this tool, which will then log those plays in your Trakt account. | ||
|
||
## Installation | ||
|
||
Scrobblex is designed to be run in Docker. You can host it right on your Plex server! | ||
|
||
To run it yourself, first create an API application through Trakt [here](https://trakt.tv/oauth/applications). Set the Allowed Hostnames to be the URI you will hit to access Scrobblex, plus /authorize. So if you're exposing your server at http://10.20.30.40:3090, you'll set it to http://10.20.30.40:3090/authorize. Bare IP addresses and ports are totally fine, but keep in mind your Scrobblex instance _must_ be accessible to _all_ the Plex servers you intend to play media from. | ||
|
||
Once Scrobblex is running, just go to http://$YOUR_IP:$PORT/ (ie: http://10.20.30.40:3090/) and a web page will guide you to get your token. | ||
|
||
### docker run | ||
|
||
```bash | ||
docker run \ | ||
--name=scrobbler \ | ||
--restart always \ | ||
-v <path to configs>:/app/data \ | ||
-e TRAKT_ID=<trakt_id> \ | ||
-e TRAKT_SECRET=<trakt_secret> \ | ||
-p 3090:3090 \ | ||
ryck/scrobblex:latest | ||
``` | ||
|
||
### docker-compose.yml | ||
|
||
```yaml | ||
services: | ||
scrobbled: | ||
image: ghcr.io/ryck/scrobblex:latest | ||
container_name: scrobblex | ||
restart: always | ||
ports: | ||
- 3090:3090 | ||
environment: | ||
- TRAKT_ID=YOUR_TRAKT_ID | ||
- TRAKT_SECRET=YOUR_TRAKT_SECRET | ||
- LOG_LEVEL=info | ||
volumes: | ||
- ./scrobblex:/app/data | ||
``` | ||
### compile from source | ||
```bash | ||
git clone https://github.com/ryck/scrobblex.git && cd scrobblex | ||
npm install | ||
npm run start | ||
``` | ||
|
||
## Environment Variables | ||
|
||
| Variable | Default | Description | | ||
| ------------ | --------- | ---------------------------------- | | ||
| TRAKT_ID | undefined | Trakt application ID | | ||
| TRAKT_SECRET | undefined | trakt application secret | | ||
| LOG_LEVEL | info | winston log level: ie: info, debug | |
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 |
---|---|---|
@@ -1,19 +1,13 @@ | ||
version: '3.9' | ||
|
||
services: | ||
scrobblex: | ||
image: ghcr.io/ryck/scrobblex:latest | ||
container_name: scrobblex | ||
image: rickgc/scrobblex | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
target: base | ||
ports: | ||
- 3091:$PORT | ||
- $PORT:$PORT | ||
environment: | ||
- TRAKT_ID=$TRAKT_ID | ||
- TRAKT_SECRET=$TRAKT_SECRET | ||
- LOG_LEVEL=$LOG_LEVEL | ||
volumes: | ||
- ./scrobblex:/data | ||
- ./scrobblex:/app/data |
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.