unofficial-unifi / unifi-pfsense

A script that installs the UniFi Controller software on pfSense and other FreeBSD systems
BSD 2-Clause "Simplified" License
754 stars 244 forks source link

Installation should add a link in pfSense to UniFi controller #105

Open cqr opened 6 years ago

cqr commented 6 years ago

I can look into doing this if a PR is welcome

gozoinks commented 6 years ago

Have at it. It was among the original goals of the project.

ghost commented 6 years ago

I got mine working by adding a line to head.inc

$services_menu[] = array(gettext("UniFi Controller"), "/services_unifi.php"); Then creating a services_unifi.php file that contains:

<?php require("guiconfig.inc"); header("location: https://172.16.100.200:8443"); ?>

Only problem is, i had to manually insert my ip of the controller. Anyone know of a better way?

screen shot 2018-10-28 at 5 51 48 pm
jmbwell commented 6 years ago

Wouldn't $_SERVER['SERVER_ADDR'] work for that?

Do you have this in a branch on github we can look at?

jmbwell commented 6 years ago

I suppose the install.sh script could check whether services_unifi.php exists and if not, then add it in the way we do the .rc file, and then check for the line in head.inc and insert it if necessary…

ghost commented 6 years ago

Thanks for your reply John. I'm not a PHP dev by day lol. I don't have anything on github at the moment.

jmbwell commented 6 years ago

Well thanks for the suggestion and example. It’s a simple solution. The next step is to automate.

ghost commented 6 years ago

You're welcome. I like the idea behind this. If I can help in testing in any way let me know.

St4tikk commented 5 years ago

Thanks inetsec! Worked great.

tong2x commented 3 years ago

any updates on this feature? we are currently supporting Pfsense and OPNsense though

hacesoft commented 3 years ago

Have a nice day, is there any progress in this thought? It is almost unknown in Linux, but I am no stranger to PHP, HTML and writing C C code for x86 and PICs. So, if you help me stim. So in the evening I can add this to the original installation script. I would love to have a UniFi driver in the PfSense firewall. So far, I've installed the UniFi driver from the console. But I can't find out if the driver works, I don't know how and I don't know how to get to the UniFi web interface of the driver. If you tell me exactly where to find certain files, I could give it in PHP.

Have a nice evening Pavel Prochazka.zde.cz

hacesoft commented 1 year ago

Wouldn't $_SERVER['SERVER_ADDR'] work for that?

Do you have this in a branch on github we can look at?


require("guiconfig.inc");
$ip_host = "https://" . ($_SERVER['SERVER_ADDR']) . ':8443';
header("location: $ip_host");