589dd44672
commit 03b7ce95646b8b4452bbf56849127d52a0f98474
Author: aunefyren <oystein.sverre@gmail.com>
Date: Tue Jan 11 14:32:22 2022 +0100
Custom server-wide section
commit 1dce85dd0a7a7d8ad0a31eb8a11ad7fca2de4988
Author: aunefyren <oystein.sverre@gmail.com>
Date: Tue Jan 4 15:29:57 2022 +0100
Link improvements
- Links are deleted if made on different version
- Links also carry Wrapperr settings for that link creation
- Created links are shown on homepage
- Links can be deleted on home page
- CSS tweaks
commit 3c6a7eb05e7d1a4afda2239a8a98706827bf1f96
Author: aunefyren <oystein.sverre@gmail.com>
Date: Mon Jan 3 22:16:56 2022 +0100
Music is now fully custom
commit edfca775004e43518d6258347a3e4c69c9e089a3
Author: aunefyren <oystein.sverre@gmail.com>
Date: Mon Jan 3 12:16:53 2022 +0100
SHow buddy bug fix
commit e5a739631da9c34d8a7c2262bd96430f23d2ea12
Author: aunefyren <oystein.sverre@gmail.com>
Date: Mon Jan 3 12:05:35 2022 +0100
Show section is now fully custom
commit 693eaec76951241a9ef0d76d8284169c87c25fdd
Author: aunefyren <oystein.sverre@gmail.com>
Date: Sun Jan 2 19:56:50 2022 +0100
Fixed movie completion image bug
commit ef2b49969fbbb593e207fabdea42fd2f3f849f42
Author: aunefyren <oystein.sverre@gmail.com>
Date: Sun Jan 2 19:45:10 2022 +0100
pop up issues on iOs
commit 1515db8c1b56ec95f2455df62a82ecdb45a56fac
Author: aunefyren <oystein.sverre@gmail.com>
Date: Sun Jan 2 18:51:22 2022 +0100
URL
commit b8add61a1652ae5d4de8527acf422ae2215adef8
Author: aunefyren <oystein.sverre@gmail.com>
Date: Sun Jan 2 18:39:06 2022 +0100
CSS overhaul for admin-page
commit 40e44fc5b1272d23e4fc6da3a59f9c06a339bcc7
Author: aunefyren <oystein.sverre@gmail.com>
Date: Thu Dec 30 18:55:47 2021 +0100
100% custom movie section, sort buttons
commit 7accc2d006088127e80beebace3c8ac8f0c14960
Author: aunefyren <oystein.sverre@gmail.com>
Date: Thu Dec 23 15:59:04 2021 +0100
Added sorting by plays
And custom text for movie completion
commit 3f24b11fd116669e51fa0256e086f352d35c48b0
Author: aunefyren <oystein.sverre@gmail.com>
Date: Wed Dec 22 14:53:56 2021 +0100
Application title CSS size
commit a8f19370d2ac5723fe397e1fe106e8cec49cd174
Author: aunefyren <oystein.sverre@gmail.com>
Date: Wed Dec 22 14:30:32 2021 +0100
More custom text
- Lists
- Server-wide options
commit 847dd60483065516398e1d52fa209b54f240de01
Author: aunefyren <oystein.sverre@gmail.com>
Date: Tue Dec 21 14:33:27 2021 +0100
Custom language options
Change certain words for alternatives, such as plays, days and so on.
commit fe501ba9e3ffa6098d3c1869ef8a1580f10897be
Author: aunefyren <oystein.sverre@gmail.com>
Date: Tue Dec 21 13:01:15 2021 +0100
Scrambling for answers
commit f99c2f2dff36a45cbe7ccf79d7a6f5ac39f21011
Author: aunefyren <oystein.sverre@gmail.com>
Date: Tue Dec 21 12:42:57 2021 +0100
Cookie settings
commit 5efddfc9d77a69db62d8b979976c42d079c8b4a2
Author: aunefyren <oystein.sverre@gmail.com>
Date: Tue Dec 21 12:21:05 2021 +0100
More headers
commit e1c106534cfbd2d0d62492e6c25a1efdb5a70325
Author: aunefyren <oystein.sverre@gmail.com>
Date: Tue Dec 21 11:52:11 2021 +0100
Trying to fix CURL origin
commit f7a59ed8d21ad731913ba5f5259997361c8ffdbb
Author: aunefyren <oystein.sverre@gmail.com>
Date: Tue Dec 21 11:40:56 2021 +0100
Color bug and headers
commit be604797524de5cb06c66eb593fecd563cbd6592
Author: aunefyren <oystein.sverre@gmail.com>
Date: Tue Dec 21 11:12:02 2021 +0100
Admin stuff
- Added new admin menu
- Admin login session
- Separate config categories
- Added application URL and name
- Config file builds using file, then adds default for variables not found. Less config deletions.
- Admin is separate config to prevent stealing unconfigured platforms.
- Moved caching to admin menu.
- Caching in API requires admin login.
- Added robots.txt for web crawlers.
- New color palette
- Renamed more stuff to Wrapperr
commit 5b62dbb2ef4f05d33e49f0ce7e12c147e2343f06
Merge: 84caa7b
|
||
---|---|---|
.idea | ||
admin | ||
api | ||
assets | ||
config | ||
docker | ||
.gitattributes | ||
.gitignore | ||
admin.js | ||
CODE_OF_CONDUCT.md | ||
functions.js | ||
get_functions.js | ||
get_stats.js | ||
index.html | ||
index.js | ||
README.md | ||
robots.txt |
Wrapperr
Introduction - What is this?
A website-based platform and API for collecting user stats within a set timeframe using Tautulli. The data is displayed as a statistics-summary, sort of like Spotify Wrapped. Yes, you need Tautulli to have been running beforehand and currently for this to work.
Features
- Custom timeframes
- Plex Auth
- Custom introduction
- Movies, shows & music
- Caching of results
- Friendly, dynamic display for statistics with nice illustrations
- Email and username search
- Admin page with authentication for settings
- Pre-caching of data
Credit
- Beautiful illustrations from FreeWebIllustrations
- Amazing statistics gathered using Tautulli
- Wonderful loading icon from icons8
- Splendid web icons from icons8
Instructions - How do I use this?
This is a web-based platform. It is a website hosted on a web-server and it gathers and displays statitics using an API (application programming interface) that interacts with Tautulli's API. Place the files included in this GitHub repository in a web-server, like Apache or Nginx, and make sure it processes PHP scripts, as this is the language the Wrapped API is written in.
There are instructions for this further down.
How does it work?
There are things to know when you are up and running:
- Head to the front page you should see a small navigation menu at the bottom. This will take you between the few pages you need.
- The configuration is stored in config/config.json, but can be configured using the admin menu, located at:
your-domain-or-ip/admin
or by clicking admin in the navigation menu. - The cache is stored in config/cache.json, but can be cleared using the admin menu previously mentioned.
- Your password and encryption token is hashed and stored in the config/config.json. This is a sensetive directory! There is an
.htaccess
file included that blocks traffic to the folder, but this is only effective with Apache, but if you are using Nginx you must add a directory deny in your Nginx configuration! - If you visit
your-domain-or-ip/caching
, or click caching in the navigation menu, you can do a pre-caching. This is very useful if you want to prepare for traffic and reduce PHP errors. PHP scripts will exit if they run longer then a certain timeframe, giving the user an error. - It is recommended to set up the platform at the admin page and then running a pre-cache immediately. The cache is updated automatically if new data in the timeframe becomes available.
Manual setup - Example of setting up a local web-server
Here is an example of running this platform. This is a general approach, as there are multiple ways to host a webserver with PHP installed.
XAMPP
XAMPP is a completely free, easy to install Apache distribution containing MariaDB, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and to use. This is their website. It works on Windows, Linux and MacOs.
Install XAMPP thorugh the installer and open up the GUI. From there you can start the Apache webserver with a single button. We don't need any of the other tools included, but make sure the status of the module is green. PHP should be pre-configured by XAMPP.
Install Wrapperr
Download this repository and place the files inside the document-root of XAMPPs apache server. This is typically C:\xampp\htdocs
on Windows, but this will change depending on your system and configuration of XAMPP during installation.
For instance, I placed this repository in a folder inside the document-root, so my location of XAMPP, with that folder, makes the location: C:\xampp\htdocs\plex-wrapped
, which in turn makes the files accessable on http://localhost/plex-wrapped
. Notice how my folder inside the document-root altered the URL. If I placed the files directly into C:\xampp\htdocs
the URL would be: http://localhost
.
Config folder configuration
You need to give PHP permission to read and write to files in the directory called config
. This is where the API saves the cache, configuration and writes the log.
The directory contains sensitive information that must be only accessed by the PHP scripts! There is an .htaccess
file included that blocks traffic to the folder, but this is only effective with Apache (which XAMPP uses). If you are using Nginx you must add a directory deny in your Nginx configuration!
In Windows I never had to change permissions for the folder, PHP could access it by defult. In Linux I had give read/write access by using the chmod
command. In the example below I change the config directory folder permissions recursively on Linux. This will allow PHP to read/write in the directory.
$ sudo chmod -R 0777 /var/www/html/config
Test
Go to http://localhost
, or your variation as discussed earlier, and you should see the front page.
Everything should now be prepared, and the rest of the setup should be done on the admin page, followed up by a pre-caching on the caching page. You might have to refer to PHP configuration section below if PHP is acting up.
Docker
Docker sets up the environment, but I recommend reading the start of the 'Instructions' section for an explanation of functionality! You might have to refer to the 'PHP Configuration' section below if PHP is acting up.
Docker makes it easy, but you might want to change the setup. The pre-configured Dockerfile is in the docker folder of this repo. It's a really simple configuration, so modify it if you want and then build it. If you just want to launch the pre-built image of Wrapperr, simply execute this docker command, pulling the image from Docker Hub and exposing it on port 80:
$ docker run -p '80:80' --name 'wrapperr' aunefyren/wrapperr:latest
It should now be accessable on: http://localhost
If you use Docker Compose you could do something like this in your docker-compose.yml:
version: '3.3'
services:
wrapperr:
ports:
- '80:80'
container_name: wrapperr
image: 'aunefyren/wrapperr:latest'
And launch the file with:
$ docker-compose up
If you want to mount a volume for the config folder, you can do something like this:
version: '3.3'
services:
wrapperr:
ports:
- '80:80'
container_name: wrapperr
image: 'aunefyren/wrapperr:latest'
volumes:
- './my-folder:/var/www/html/config'
Afterwards, remember to chmod the mounted folder on the host so the container can write to it:
$ sudo chmod -R 0777 ./my-folder
PHP Configuration
PHP will have issues with this API based on the data available in Tautulli and your settings on the admin page. If you have a large time frame for your wrapped period (like a full year), and there are a huge amount of Tautulli entries, you can have multiple issues. The PHP API can, for example, exit because the runtime exceeds the PHP configured runtime, because it takes a long time to interact with your Tautulli server.
Pre-caching deals with a lot of these problems, so make sure you have it enabled and done to avoid these issues. Go to the caching page found in the navigation meny at the bottom.
If you performed pre-caching and you still have issues, check the list below for possible alterations to PHP. These are changes to the php.ini
file found in the PHP installation directory. Do some research or ask for help if you don't know how to do this.
In your php.ini
file you may have to change:
- max_execution_time=enough seconds for the script to finish.
The longer the timeframe, the more execution time. Every unique date in your timeframe is a new Tautulli API call. - memory_limit=enough M for the script to handle JSON data.
If there is a lot of data, PHP needs to have enough memory to manage it without crashing. This still applies if caching is on, as PHP needs to be able to read the cache without crashing. - max_input_time=enough seconds for the script to parse JSON data.
You might not need to change this, depending on Tautulli connection speed.
Need help?
If you have any issues feel free to contact me. I am always trying to improve the project. If I can't, many people on several forums (including /r/plex) might be able to assist you.
Have fun.