Deactivate Authentication

Talks about metering
Post Reply
mstuetz
Posts: 73
Joined: Sun Dec 29, 2013 1:20 pm

Deactivate Authentication

Post by mstuetz » Mon May 29, 2017 6:18 am

Hi Jean-Marc!
I know you are tired of people not getting rid of the authentication on their webservers.
But I need to get your help on this issue one more time :oops: : I want to install meterN on a synology NAS (DS213+ running DSM6.1). Almost all my friends/relatives are not "technical" at all - but most of them own a NAS. Off course all of them want to log their power consumption.
So I am working on a implementation of meterN (and maybe also for 123solar). Unfortunately the webserver(s) on the synology (Nginx/Apache) do not support authentication and I did not find any successful hack for that.
Due the fact, that the server is not reachable from the internet at all, I guess it is ok to bypass it.

Is there a simple and quick way, to completely disable authentication for meterN?

jeanmarc
Posts: 1586
Joined: Thu Aug 29, 2013 7:16 am

Re: Deactivate Authentication

Post by jeanmarc » Mon May 29, 2017 6:35 am

Hi,
You can simply remove the line :

Code: Select all

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    header("Location: ../");
    exit;
}
at the top of every admin pages. But that won't survive to the updates.. maybe i rather just make a warning and allow access to admin.. :geek:

mstuetz
Posts: 73
Joined: Sun Dec 29, 2013 1:20 pm

Re: Deactivate Authentication

Post by mstuetz » Mon May 29, 2017 7:04 am

Ok, thx a lot.
If the installation works once, I usually do not update there.

mstuetz
Posts: 73
Joined: Sun Dec 29, 2013 1:20 pm

Re: Deactivate Authentication

Post by mstuetz » Mon May 29, 2017 8:25 am

How can I bypass the dialog to create a password, when I first login and get forwarded to site http://xxxxxxx/metern/admin/

jeanmarc
Posts: 1586
Joined: Thu Aug 29, 2013 7:16 am

Re: Deactivate Authentication

Post by jeanmarc » Mon May 29, 2017 9:20 am

Oh forgot that one, better create this as admin/index.php

Code: Select all

<?php      
  header('Location: admin.php');      
?>

mstuetz
Posts: 73
Joined: Sun Dec 29, 2013 1:20 pm

Re: Deactivate Authentication

Post by mstuetz » Mon May 29, 2017 12:06 pm

Ok, thx - that worked. :D

Dunno if anybody else runs meterN on a synology NAS? If requested, I can post a step-by-step how-to.

jeanmarc
Posts: 1586
Joined: Thu Aug 29, 2013 7:16 am

Re: Deactivate Authentication

Post by jeanmarc » Mon May 29, 2017 12:30 pm

Maybe that. I wonder, does the USB converters works on synology ?

mstuetz
Posts: 73
Joined: Sun Dec 29, 2013 1:20 pm

Re: Deactivate Authentication

Post by mstuetz » Tue May 30, 2017 6:52 am

Same as with meterN: The chance is pretty high, that after a DSM upgrade this settings are lost. Some changes don't even survive a reboot. So I'd rather change meterN - that's ok now.

Regarding USB converters: Since all my meters are capable of IP, this should not matter. Most of the inverters just use cheap USB2serial internaly, so I guess even that should be possible with a synology.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests