[PHP] PlexAuth - Authentication for your domain using Plex

@hjone72 said:

Hmmm. Could you confirm that the following JavaScript file is accessible? http://plexauth.domain.com/js/muximux.js

Yes, it displays the contents of the file if I browse to it.

@Kaninm said:

Yes, it displays the contents of the file if I browse to it.

Yup. Found the error. Just me being stupid again… Pushing a fix to GitHub in the next few minutes.

EDIT:
Here is the commit:

If you just replace the old inc/pages/main.page.php with the new one it should work :slight_smile:

Please report back.

Thanks,

Haha, now something weird happens. As I log on it seems to load my page for a second, but then redirects to here: https://secure.yourtechbase.com/?return=blog.yourtechbase.com/

I cant find anything in any of the files that should make it do this (but I’m at work and just did a quick once over). I’ll look more closely once I get home.

Please see the change here:

I have a local JavaScript file with a few changes specifically for my local version. Just remove that change and all will be good.

That did it. Thank you so much again. Excited to finish configuration and see how the family likes it.

Recently switch from Apache to Nginx and let’s encrypt SSL. Going to try this out and report back any issues, If any.

EDIT: Any users here running unRAID? I’m confused on how I would install RememberMe if i’m running Nginx on a docker

@jrdnlc said:
Recently switch from Apache to Nginx and let’s encrypt SSL. Going to try this out and report back any issues, If any.

EDIT: Any users here running unRAID? I’m confused on how I would install RememberMe if i’m running Nginx on a docker

RememberMe is included within the github repo now. You shouldn’t have to install anything. Just download the repo and it should work :slight_smile:

I’d love to see this work with unRaid in a docker container.

With docker you will need to attach to the container.

docker exec -it DOCKERID bash

Then you can use normal commands to install. But be aware, if you update the container, you will lose all changes that are not mounted outside the container.

It would probably be very beneficial to talk to someone about creating container specifically for this. Probably someone at Linuxserver.io (love their containers).

Good luck, I really hope to see this!

It shouldn’t be all that hard to dockerize… I have no experience but if anyone wants to do it go ahead! :slight_smile:

You can fairly easily create a docker that has php and nginx… should be able to just point the webroot at PlexAuth folder.

I’m trying to get this to work in linuxserver.io nginx letsencrypt docker and I’ve gotten through a lot of hurdles and now I’m stuck. I keep getting this error

2016/12/28 12:15:06 [alert] 324#0: *10 socket() failed (97: Address family not supported by protocol) while connecting to upstream, client: 192.168.2.1, server: mydomain.com, request: “GET /?return=mydomain.com/htpc HTTP/1.1”, subrequest: “/auth/”, upstream: “http://[::1]:8087/auth/”, host: “mydomain.com
2016/12/28 12:15:06 [error] 324#0: *10 auth request unexpected status: 500 while sending to client, client: 192.168.2.1, server: mydomain.com, request: “GET /?return=mydomain.com/htpc HTTP/1.1”, host: “mydomain.com

Attached is my nginx config. Can someone help me out?

Thanks

Hi,
I’ve only had a small chance to take a look at this. It looks like there is an IPv6 issue…

I wont get a chance to take a full look at this until the 3rd of Jan.

Hope this is able to help you out.

Thanks,

Thanks, I got it working. I had to remove my localhost references and change them to 127.0.0.1. This stopped ipv6 from being used. I also had to make sure I referenced a root directory in the main server file. Thanks!

Awesome! Glad to hear it’s up and going

I can’t seem to figure out why, but when I log in, it just redirects me back to the login again.

@xxrazorxx, Could you please PM me your log file?

I sent you the pm. Thanks!

@xxrazorxx said:
I’m trying to get this to work in linuxserver.io nginx letsencrypt docker and I’ve gotten through a lot of hurdles and now I’m stuck. I keep getting this error

2016/12/28 12:15:06 [alert] 324#0: *10 socket() failed (97: Address family not supported by protocol) while connecting to upstream, client: 192.168.2.1, server: mydomain.com, request: “GET /?return=mydomain.com/htpc HTTP/1.1”, subrequest: “/auth/”, upstream: “http://[::1]:8087/auth/”, host: “mydomain.com
2016/12/28 12:15:06 [error] 324#0: *10 auth request unexpected status: 500 while sending to client, client: 192.168.2.1, server: mydomain.com, request: “GET /?return=mydomain.com/htpc HTTP/1.1”, host: “mydomain.com

Attached is my nginx config. Can someone help me out?

Thanks

Any chance you have a functioning docker you could share? New to docker and nginx, not virtualization and web servers, and it’s a bit of a struggle for me to get this up and running.

Any chance you have a functioning docker you could share? New to docker and nginx, not virtualization and web servers, and it’s a bit of a struggle for me to get this up and running.

Sorry @borsaid, I don’t have a docker for the system yet. @xxrazorxx has got it going using the “linuxserver.io nginx letsencrypt docker”. He had to make a small modification to one of the php files though. Still researching why.

I’ll make a brief write up on how to setup the docker container once I have everything working. :smiley:

So here are the steps I used to get this working in Linuxserver.io’s letsencrypt nginx docker.

  1. Get https://hub.docker.com/r/linuxserver/letsencrypt/
  2. Enable php-openssh - docker exec -it letsencrypt apk add --no-cache php5-openssl
    • Note, you may want to add this as a cron job, I am unsure if this will be wiped out when the docker updates
      /mnt/user/appdata/letsencrypt/cron edit the root file
      @reboot apk add --no-cache php5-openssl
  3. Download and unzip plexauth to the /config/www/ dir of letsencrypt
  4. Configure /mnt/user/appdata/letsencrypt/nginx/site-confs (attached is a sample)
    • Note, I used a subdirectory plexauth, you do not need to do this, unless you want to. I also used a subdomain secure.mysite.com.
  5. Edit /plexauth/inc/sample-config.ini.php and rename to config.ini.php
  6. Edit /plexauth/inc/footer-sample.php and rename to footer.php
  7. Edit /plexauth/inc/nav-sample.php and rename to nav.php
  8. Lastly open up /plexauth/inc/include.php and comment out line 20 - //session_regenerate_id($bool);
    • NOTE!!! removing the session regeneration reduces security and is a workaround until a permanent solution can be found.
  9. From here you can edit the template site by modifying the dynamic_menu.module.php and dynamic_management.module.php in /plexauth/inc/modules

I really hope this helps some of you out. Let me know if there are questions!