ninthwalker Posted April 22, 2016 Share Posted April 22, 2016 App name: plexReport Docker Hub: https://hub.docker.com/r/ninthwalker/plexreport/ Github: https://github.com/ninthwalker/plexReport Original Application site: https://github.com/bstascavage/plexReport This docker generates an email summary of new additions to Plex to send to your users. This is a dockerized version of bstascavage's plexReport app which has fallen by the wayside. Similar in nature to the current PlexEmail, but I personally think this email is a lot better looking and doesn't rely on external image site support. Directions: Preferred installation method: From the Community Applications 'APPS' section in unRAID. You can also install by adding the following template repository to unraid: https://github.com/ninthwalker/docker-templates/ After installing, run the following commands from the command line: docker exec -it plexReport ./initial_setup.sh Follow Prompts This script only needs to be run once. Any other re-installs of the docker will not require it. plexReport can be run with the following command from unraid: docker exec plexReport plexreport [-options] You can now edit the config.yaml (and optionally email_body.erb) with your own settings in your appdata dir. See /config/config.yaml.example for an example. To schedule the report to occur regularly, please use the new unRAID 6 Dynamix .cron system: Edit the "plexreport_schedule.cron" file found in the plexreport appdata folder with your own time/date. Copy that file to the following location. Each time unraid is started it will load your plexreport_schedule. /boot/config/plugins/dynamix/ To have it added immediately without restarting unRAID, at the command prompt type 'update_cron' See this page for help creating a time/date in cron: http://abunchofutils.com/u/computing/cron-format-helper/ Please see https://github.com/ninthwalker/plexReport for config.yaml settings and command line options. -= CHANGELOG =- 04NOV2016: Initial_setup.sh changes: no longer need to rerun this after a docker reinstall. Moved Movies Section to the top of the email. Makes more sense to have new Movies shown first than the same TV shows each week. Removed config backup option: instead check on existing config, and if exists, just use that. Code refinement changes to streamline installation and not rely on scripts 28SEP2016: unRAID 6.2 Compatible - Updated Docker to Latest API. 13JUN2016: Updated to same phusion/baseimage that other docker maintainers are using. Added a check to backup current config files before replacing with new ones after updating. Fixed image sizes to be uniform across most email platforms. Updated schedule to be based off using new unRAID 6 .cron file. - See directions. Fixed bundle world writeable error. Removed unnecessary files. Quote Link to comment
Jimmy90 Posted April 26, 2016 Share Posted April 26, 2016 Outstanding work Walker! Works A1, on time, everytime! Goodbye Plexemail! Quote Link to comment
ninthwalker Posted April 27, 2016 Author Share Posted April 27, 2016 Outstanding work Walker! Works A1, on time, everytime! Goodbye Plexemail! Thanks! Glad it's working out for you. - Ninthwalker Quote Link to comment
a_n_d_y Posted May 7, 2016 Share Posted May 7, 2016 This is awesome! Is there a way to pull larger size movie posters? Quote Link to comment
Stix Posted May 7, 2016 Share Posted May 7, 2016 This is awesome! Is there a way to pull larger size movie posters? I think the posters are a set size, but you can try and re-size them by modifying the email_body.erb file and specifying the width / height Quote Link to comment
Paul_Ber Posted May 8, 2016 Share Posted May 8, 2016 Hi, Ninthwalker what is your opinion on changing the Docker-template area that says /mnt/cache/.Programs/plexreport to /mnt/cache/appdata/Programs/plexreport ? Most other Devs are using /mnt/cache/appdata/someapp. My fault not not paying attention to the /mnt/cache/.Programs area of the /config. I had to edit and change it to appdata and manually go and delete the /mnt/cache/.Programs/plexreport files and directories. So the email probably will not work for Gmail with 2 factor? When I go bash into the Docker to run the config, the Docker doesn't have its' own hash for a container? A bit confusing as to whether one is actually in the Container or not? Quote Link to comment
Paul_Ber Posted May 8, 2016 Share Posted May 8, 2016 [Feature Request] During the setup it gets the sending email account but actually sends to email to the Plex email account. Is there a way to have to option set multiple email addresses that the email goes to? I.e. [email protected],[email protected],[email protected] etc This way you can send it to the whole family. Quote Link to comment
Stix Posted May 8, 2016 Share Posted May 8, 2016 [Feature Request] During the setup it gets the sending email account but actually sends to email to the Plex email account. Is there a way to have to option set multiple email addresses that the email goes to? I.e. [email protected],[email protected],[email protected] etc This way you can send it to the whole family. Inside the config.yaml.example, there is a section for recipients_email: ['[email protected]', '[email protected]'] You can add that to your config.yaml and then have the cron job trigger using -n so it doesn't send a plex email. (plex owner will still get an email even when this option is selected IIRC) Quote Link to comment
ninthwalker Posted May 8, 2016 Author Share Posted May 8, 2016 Hi, Ninthwalker what is your opinion on changing the Docker-template area that says /mnt/cache/.Programs/plexreport to /mnt/cache/appdata/Programs/plexreport ? Most other Devs are using /mnt/cache/appdata/someapp. My fault not not paying attention to the /mnt/cache/.Programs area of the /config. I had to edit and change it to appdata and manually go and delete the /mnt/cache/.Programs/plexreport files and directories. So the email probably will not work for Gmail with 2 factor? When I go bash into the Docker to run the config, the Docker doesn't have its' own hash for a container? A bit confusing as to whether one is actually in the Container or not? I may change the default mapping at some point, but there is a lot of people that don't use appdata either, so for now users will just need to make it their own. 2 Factor may work if you go and add it as an app in your security settings in the place that gives you a one-time app code. I have not tried this however, so you are on your own. A lot of people setup a separate email account for their plex distro, so that's an option too. The docker exec command to enter into the docker is a standard docker command, and how that presents itself can't really be changed. The bash prompt should change to the ID of the docker I think though, so that kind of lets you know what prompt you are at. [Feature Request] During the setup it gets the sending email account but actually sends to email to the Plex email account. Is there a way to have to option set multiple email addresses that the email goes to? I.e. [email protected],[email protected],[email protected] etc This way you can send it to the whole family. After you create the docker you should modify the config.yaml. This file holds all of the configuration options. By default it will send to all of your users based off their plex email account. However, As Stix mentioned above, you can specify the exact emails it will send to in the config.yaml and use the '-n' switch after the command to send to only those emails. Note that it will always send to your own plex email account. See my https://github.com/ninthwalker/plexReport for info on the various config settings. Thanks. - Ninthwalker Quote Link to comment
PhilUK Posted May 8, 2016 Share Posted May 8, 2016 2 Factor may work if you go and add it as an app in your security settings in the place that gives you a one-time app code. I have not tried this however, so you are on your own. A lot of people setup a separate email account for their plex distro, so that's an option too. Providing a one time app code in Gmail definitely works as this is the way I have plexReport set up. This is a great docker ninthwalker, working perfectly to send out updates to family after a bit of trial and error with config.yaml! Do you have any plans to introduce a GUI for this? Cheers, Phil Quote Link to comment
a_n_d_y Posted May 8, 2016 Share Posted May 8, 2016 This is awesome! Is there a way to pull larger size movie posters? I think the posters are a set size, but you can try and re-size them by modifying the email_body.erb file and specifying the width / height The reason I bring this up is that the movie poster images are a lot smaller than the TV posters. When I was looking at the test e-mails on my phone, the TV posters filled the screen's width, but the movie posters only filled about 1/3. I modified that file and limited the maximum size of the posters so now they all appear the same size regardless of device. Quote Link to comment
Stix Posted May 8, 2016 Share Posted May 8, 2016 The reason I bring this up is that the movie poster images are a lot smaller than the TV posters. When I was looking at the test e-mails on my phone, the TV posters filled the screen's width, but the movie posters only filled about 1/3. I modified that file and limited the maximum size of the posters so now they all appear the same size regardless of device. Nice! Would you be able to share those modifications? I've just been dealing with the TV posters being super wide lol Quote Link to comment
a_n_d_y Posted May 8, 2016 Share Posted May 8, 2016 Of course. Just make these changes to the email_body.erb file. On lines 368 and 392, change "max-width: 100%" to "max-width: 154px" This is the width of the movie posters being pulled. You can make this change to line 416, but its not necessary since 100% is the same as 154px. Also I updated the Plex logo used. The current one is a bit dated looking. On line 342, change the img src to use this URL instead: "http://i.imgur.com/lw1B3el.png" Quote Link to comment
Stix Posted May 9, 2016 Share Posted May 9, 2016 Of course. Just make these changes to the email_body.erb file. On lines 368 and 392, change "max-width: 100%" to "max-width: 154px" This is the width of the movie posters being pulled. You can make this change to line 416, but its not necessary since 100% is the same as 154px. Also I updated the Plex logo used. The current one is a bit dated looking. On line 342, change the img src to use this URL instead: "http://i.imgur.com/lw1B3el.png" Thanks, that helps a lot! Quote Link to comment
_vern_ Posted June 5, 2016 Share Posted June 5, 2016 I'm running into an error while trying install this and was wondering if you could help me out. The error comes after launching initial_setup.sh. I get the prompt asking if I'm sure I want to run this and then after a few second...this is what I get... Creating plexreport library at /var/lib/plexReport Moving plexreport and plexreport-setup to /usr/local/sbin Moving plexreport libraries to /var/lib/plexreport Moving email_body.erb to /config Creating /config/config.yaml Creating /config/plexReport.log Installing ruby gem dependency Fetching: bundler-1.12.5.gem (100%) Successfully installed bundler-1.12.5 1 gem installed Installing ri documentation for bundler-1.12.5... Installing RDoc documentation for bundler-1.12.5... Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. --- ERROR REPORT TEMPLATE ------------------------------------------------------- - What did you do? I ran the command `/usr/local/bin/bundle install` - What did you expect to happen? I expected Bundler to... - What happened instead? Instead, what actually happened was... Error details ArgumentError: parent directory is world writable, FileUtils#remove_entry_secure does not work; abort: "/root/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/versions20160605-49-h1m9vj" (parent directory mode 40777) /usr/lib/ruby/1.9.1/fileutils.rb:708:in `remove_entry_secure' /usr/lib/ruby/1.9.1/tmpdir.rb:85:in `ensure in mktmpdir' /usr/lib/ruby/1.9.1/tmpdir.rb:85:in `mktmpdir' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:29:in `update' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb:64:in `update' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb:55:in `update_and_parse_checksums!' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/fetcher/compact_index.rb:65:in `available?' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/fetcher/compact_index.rb:15:in `call' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/fetcher/compact_index.rb:15:in `block in compact_index_request' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/fetcher.rb:154:in `use_api' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/source/rubygems.rb:331:in `block in api_fetchers' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/source/rubygems.rb:331:in `select' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/source/rubygems.rb:331:in `api_fetchers' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/source/rubygems.rb:336:in `block in remote_specs' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/index.rb:10:in `build' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/source/rubygems.rb:335:in `remote_specs' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/source/rubygems.rb:82:in `specs' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/lazy_specification.rb:56:in `__materialize__' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/spec_set.rb:91:in `block in materialize' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `map!' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `materialize' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/definition.rb:140:in `specs' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/definition.rb:129:in `resolve_remotely!' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/installer.rb:195:in `resolve_if_need' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/installer.rb:70:in `run' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/installer.rb:22:in `install' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/cli/install.rb:102:in `run' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/cli.rb:175:in `install' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/cli.rb:11:in `start' /var/lib/gems/1.9.1/gems/bundler-1.12.5/exe/bundle:27:in `block in <top (required)>' /var/lib/gems/1.9.1/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors' /var/lib/gems/1.9.1/gems/bundler-1.12.5/exe/bundle:19:in `<top (required)>' /usr/local/bin/bundle:23:in `load' /usr/local/bin/bundle:23:in `<main>' Environment Bundler 1.12.5 Rubygems 1.8.23 Ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux] GEM_HOME /var/lib/gems/1.9.1 GEM_PATH /var/lib/gems/1.9.1:/root/.gem/ruby/1.9.1 Git 1.9.1 Bundler settings orig_path Set via BUNDLE_ORIG_PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" --- TEMPLATE END ---------------------------------------------------------------- Unfortunately, an unexpected error occurred, and Bundler cannot continue. First, try this link to see if there are any existing issue reports for this error: https://github.com/bundler/bundler/search?q=parent+directory+is+world+writable%2C+FileUtils%23remove_entry_secure+does+not+work%3B+abort%3A+%22%2Froot%2F.bundle%2Fcache%2Fcompact_index%2Frubygems.org.443.29b0360b937aa4d161703e6160654e47%2Fversions20160605-49-h1m9vj%22+%28parent+directory+mode+40777%29&type=Issues If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at: https://github.com/bundler/bundler/issues/new Running /usr/local/sbin/plexreport-setup /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- httparty (LoadError) from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /usr/local/sbin/plexreport-setup:4:in `<main>' Setup complete! Please create a cronjob from within unRAID to call the plexReport on a schedule. Thank you for any assistance that you can provide... thanx, Quote Link to comment
_vern_ Posted June 7, 2016 Share Posted June 7, 2016 Just wanted to pass along that I sort of figured out what the issue is. Apparently there are some directories where the permissions are not being set that satisfies the Ruby bundle installer. By running... chmod +t -R ~/.bundle/cache ...seems to do the trick. It obviously just sets the sticky bit on everything below the /cache directory there by making everything not world writable, which is what it was complaining about. After that, it appears to run normally. Quote Link to comment
hernandito Posted June 7, 2016 Share Posted June 7, 2016 Just trying this for the first time. It seems to be working OK, with the exception of looking at the resulting email in MS Outlook. The posters for TV Episodes are HUUUUGE. The movie ones looks right. Any ideas how to fix? I tried a-n-d-y's fix, but it did not reduce the TV poster size. Please see below: TV Episode: Movies: Quote Link to comment
_vern_ Posted June 7, 2016 Share Posted June 7, 2016 I get different results with different viewers...in Windows 10 "Mail App" I see what you see. In google mail in the browser, it renders the posters all the same size...the smaller size. In Edge, they render correctly as well. I don't have Outlook running. Apparently the HTML being used for displaying these email don't comply with all the various means of displaying the email... Quote Link to comment
hernandito Posted June 7, 2016 Share Posted June 7, 2016 Thanks -vern-..... what a drag though. I wish I have the skills and patience to tweak the email_body.erb file. Quote Link to comment
hernandito Posted June 7, 2016 Share Posted June 7, 2016 Ooops.... solved it: Line 369 should be: <img class="moviePoster" src="<%= episode[:image] %>" style="outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; width: 154px !important; max-width: 154px !important; float: left; clear: both; display: block; border: 1px solid #888888;" width=154 align="left" /> I hope this helps! :D :D Quote Link to comment
_vern_ Posted June 8, 2016 Share Posted June 8, 2016 Thank you for the reply...I just want to double check something...I see line 368 that starts out with "<img class="moviePoster"...", is this the line that your line should be replacing? If so, that would appear to be line 368 unless you are intending something different like to insert your line as line 369 pushing everything beyond that down a line. I wasn't sure...I was going to play with this later this evening and figure it out. Thanx for the information! Quote Link to comment
hernandito Posted June 8, 2016 Share Posted June 8, 2016 Thank you for the reply...I just want to double check something...I see line 368 that starts out with "<img class="moviePoster"...", is this the line that your line should be replacing? If so, that would appear to be line 368 unless you are intending something different like to insert your line as line 369 pushing everything beyond that down a line. I wasn't sure...I was going to play with this later this evening and figure it out. Thanx for the information! Sorry... In my trying to fix, I probably moved a few things around and the line numbers do not match with originals. Do make a backup of the file before you edit it.... Basically the change was changing the width and max-width values, and adding the !important statement. Also aded the width=154 outside of the style definition. Quote Link to comment
_vern_ Posted June 8, 2016 Share Posted June 8, 2016 Just wanted to pass along that your change corrected the issue. Thank you very much! Quote Link to comment
ninthwalker Posted June 9, 2016 Author Share Posted June 9, 2016 Sorry for the email_body issues. I'm not that great with html/css/5/etc so when I adapted the original script I did not make much changes to it. I will take some of your finding for the images and update the docker with them. Also, the 'world writable' was a new issue that I did not change yet in the docker. I will fix this as well. Thanks for everyoens feedback. - Ninthwalker Quote Link to comment
jrdnlc Posted June 10, 2016 Share Posted June 10, 2016 Is there an option to create a html file like plexemail does? That way I can host it on my apache server and users can see what's new. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.