Coder Social home page Coder Social logo

unofficial-unifi / unifi-pfsense Goto Github PK

View Code? Open in Web Editor NEW
741.0 66.0 241.0 353 KB

A script that installs the UniFi Controller software on pfSense and other FreeBSD systems

License: BSD 2-Clause "Simplified" License

Shell 100.00%
pfsense rc-script shell unifi ubiquiti freebsd unifi-controller

unifi-pfsense's Introduction

unifi-pfsense

A script that installs the UniFi Controller software on pfSense and other FreeBSD systems

Purpose

The objective of this project is to develop and maintain a script that installs Ubiquiti's UniFi Controller software on FreeBSD-based systems, particularly the pfSense firewall.

Status

The project provides an rc script to start and stop the UniFi controller, and an installation script to automatically download and install everything, including the rc script.

This project uses the latest branch from Ubiquiti rather than the LTS branch. From December 2020, this means the 6.x branch.

Compatibility

The script is known to work on FreeBSD-based systems, including pfSense, OPNsense, FreeNAS, and more. Be sure to check the forks for versions specific to other systems.

This script will destroy a legacy BIOS system booting from an MBR formatted ZFS root volume; see #168. Again, using this script on a system with an MBR formatted ZFS root volume will break your system. It appears that one of the dependency packages may cause this. We have not isolated which. To avoid this problem, use UEFI mode if available, use GPT partitions, or use a filesystem other than ZFS. If you have already set up your system to use legacy BIOS, MBR partitons, and ZFS, then do not run this script.

Challenges

Because the UniFi Controller software is proprietary, it cannot be built from source and cannot be included directly in a package. To work around this, we can download the UniFi controller software directly from Ubiquiti during the installation process.

Because Ubiquiti does not provide a standard way to fetch the software (not even a "latest" symlink), we cannot identify the appropriate version to download from Ubiquiti programmatically. It will be up to the package maintainers to keep the package up to date with the latest version of the software available from Ubiquiti.

Upgrading UniFi controller

At the very least, back up your configuration before proceeding.

Be sure to track Ubiquiti's release notes for information on the changes and what to expect. Updates, even minor ones, sometimes change things. Some involve database upgrades that can take some time. Features come and go, and behaviors change. Proceed with caution.

You should know that upgrading from earlier versions may be no small task. Ubiquiti sometimes makes substantial changes, especially between major versions. Carefully consult Ubiquiti's release notes for upgrading considerations. Proceed with caution.

Upgrading pfSense

The pfSense updater will remove everything you install that didn't come through pfSense, including the packages installed by this script.

Before updating pfSense, save a backup of your UniFi controller configuration to another system.

After updating pfSense, you will need to run this script again to restore the dependencies and the software.

Usage

To install the controller software and the rc script:

  1. Log in to the pfSense command line shell as root.
  2. Run this one-line command, which downloads the install script from Github and executes it with sh:
  fetch -o - https://tinyurl.com/3ukj9253 | sh -s

The install script will install dependencies, download the UniFi controller software, make some adjustments, and start the UniFi controller.

The git.io link above should point to https://raw.githubusercontent.com/unofficial-unifi/unifi-pfsense/master/install-unifi/install-unifi.sh

Starting and Stopping

To start and stop the controller, use the service command from the command line.

  • To start the controller:

      service unifi.sh start
    

    The UniFi controller takes a few minutes to start. The 'start' command exits immediately while the startup continues in the background.

  • To stop the controller:

      service unifi.sh stop
    

    The the stop command takes a while to execute, and then the shutdown continues for several minutes in the background. The rc script will wait until the command received and the shutdown is finished. The idea is to hold up system shutdown until the UniFi controller has a chance to exit cleanly.

After Installing

After using this script to install the UniFi Controller software, check the UniFi controller documentation for next steps.

Troubleshooting

Step one is to determine whether the issue you’ve encountered is with this script or with the UniFi controller software.

Issues with the script might include problems downloading packages, installing packages, interactions with pfSense such as dependency packages being deleted after updates, or incorrect dependencies being downloaded. Feel free to open an issue for anything like this.

Issues with the UniFi Controller software or its various dependencies might include not starting up, not listening on port 8443, exiting with a port conflict, crashing after startup, database errors, memory issues, file permissions, dependency conflicts, or the weather. You should troubleshoot these issues as you would on any other installation of UniFi Controller. For some, the first stop is UniFi technical support; for others, ready answers to most questions about setting up UniFi controller are found most quickly on the UniFi forums.

It may turn out that some issue with the UniFi Controller software is caused by something this script is doing, like if MongoDB won’t start because you’re running it on a PDP-8 with 12-bit words, and this script is installing the build of MongoDB for PDP-11 systems with 16-bit words. In a case like that, if you can connect the behavior of the UniFi Controller with the actions taken by the script, please open an issue, or, better yet, fork and fix and submit a PR.

Java compatibility on FreeBSD

This script may create a conflict that breaks Java on a FreeBSD upgrade. To resolve this conflict do the following:

pkg unlock -yq javavmwrapper
pkg unlock -yq java-zoneinfo
pkg unlock -yq openjdk8
pkg unlock -yq snappyjava
pkg unlock -yq snappy
pkg unlock -yq mongodb36
pkg remove -y javavmwrapper
pkg remove -y java-zoneinfo

Compatibility upgrade to MONGODB 4.2 (for those using MongoDB 4.2 or having DB compatibility problems)

The following is a workaround for upgrading MongoDB 3.6 to MonggoDB 4.2 to resolve conflict and crashes in Unifi Controller related to MongoDB versions. contributed by user ccottam and johnkeates.

  1. Install the May 30 version first (https://github.com/unofficial-unifi/unifi-pfsense/blob/e51c3a6f9b55080d1e9b6100a8d42daa30641ba9/install-unifi/install-unifi.sh) to get a working mongo 3.6 database and make sure everything still works. (if you are unable to install this, try going directly to step 2)

  2. Install a mongo 4.0 version: (Jun 1) https://raw.githubusercontent.com/unofficial-unifi/unifi-pfsense/4167b09685d1bdf881d9076ba01d8ff2ab173a81/install-unifi/install-unifi.sh

  3. Set the feature version to 4.0: having installed mongodb 4.0, run the following command in shell to set compatibility feature

cmd> mongo localhost:27117
cmd> db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
response> { "featureCompatibilityVersion" : { "version" : "3.6" }, "ok" : 1 }
cmd>  db.adminCommand( { setFeatureCompatibilityVersion: "4.0" } )
response> { "ok" : 1 }
cmd> db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
response> { "featureCompatibilityVersion" : { "version" : "4.0" }, "ok" : 1 }
  1. Install the newer Jun 1 version next (upgrades to 4.2) (https://raw.githubusercontent.com/unofficial-unifi/unifi-pfsense/c04a44f34f7c9c7c4e358d43dd7d74b1e676ef6a/install-unifi/install-unifi.sh) At this point you have a mongodb that was upgraded from 3.6 to 4.0, the database itself has been upgraded to be 4.0 compatible, finally mongodb 4.2 has been installed. Any database repairs will be handled automatically by the installation script.

  2. Install the latest version of Unifi Controller

Uninstalling

This script does three things:

  1. Download and install required dependency packages
  2. Download and unpack the UniFi controller software binaries from Ubiquiti
  3. Install an rc script so that the UniFi controller can be started and stopped with service

Uninstalling therefore means one of two things:

  • Removing the UniFi controller software at /usr/local/UniFi and removing the rc script at /usr/local/etc/rc.d/unifi.sh
  • Removing the dependency packages that were installed

Uninstall the UniFi controller software

  1. Back up your configuration, if you intend to keep it.
  2. Remove the UniFi controller software binaries and rc script:
      rm -rf /usr/local/UniFi
      rm /usr/local/etc/rc.d/unifi.sh
    

Removing the dependency packages

To remove the packages that were installed by this script, you can go through the list of packages that were installed and remove them (look for the AddPkg lines). You will have to determine for yourself whether anything else on your system might still be using the packages installed by this script. Removing a package that is in use by something else will break that other thing.

Note that, on pfSense, all of them will probably be removed anyway the next time you update pfSense.

Contributing

UniFi controller updates

The main area of concern is keeping up with Ubiquiti's updates. I don't know of a way to automatically grab the URL to the current version, though there has been work done on this. For now we have to commit an update directly to the install.sh script with every UniFi release.

If you're aware of an update before I am:

  1. Create a branch from master, named for the version you are about to test.
  2. Update the URL in install.sh to the latest version.
  3. Test it on your pfSense system.
  4. Optional, but ideal: test it on a fresh pfSense system, as in a VM.
  5. If it checks out, submit a pull request from your branch. This helps bring my attention to the update and lets me know that you have tested the new version.

I will then test on my own systems and merge the PR.

Other enhancements

Other enhancements are most welcome. Much of the script's most intelligent behavior is the work of contributors, including the package dependency resolution and the java version spoofing. This project would not be alive without these efforts. I am excited by this support, and I can't wait to see what else develops.

Potential areas of improvement include but are not limited to:

  • Error handling
  • Automatic latest-version detection
  • More robust backup and restore
  • LTS/Latest branch selection options and defaults. Command line options? Prompts?
  • What else?

Issues and pull requests

Of course. That's why it's on github.

Roadmap

This project may never reach its original goal of becoming a pfSense package. The packaging scheme for pfSense has changed. Doing this as a pfSense package requires doing it as a FreeBSD package first. Doing it as a FreeBSD package means we may as well make it portable to other FreeBSD systems. All of this changes how this would be implemented. Some of the concepts we can borrow, but it's substantially new work. Moreover, because the requirements of the UniFi controller deviate from what's strictly available in the FreeBSD package repos, I'm not even sure it's possible.

As a helper script for installing the UniFi controller, this tool remains effective and robust, which is great. I see no reason not to continue development here.

It is also less pfsense-specific than originally imagined. If you're here to run UniFi on your NAS, welcome!

With all this in mind, the future of this project is clearly as an installation tool, and I envision enhancements to it as such. So let's just make it a smart and capable installer for UniFi Controller on FreeBSD-type systems.

Licensing

This project itself is licensed according to the two-clause BSD license.

The UniFi Controller software is licensed as-is with no warranty, according to the README included with the software.

Ubiquiti has indicated via email that acceptance of the EULA on the web site is not required before downloading the software.

Resources

unifi-pfsense's People

Contributors

ardichoke avatar byeskille avatar celevra avatar danmc85 avatar devangsheth avatar esbernhansen avatar fenichelar avatar forsaked avatar fry-kun avatar fz3n avatar gnkidwell avatar gozoinks avatar idarlund avatar inickt avatar jfinlay1 avatar jmbcpi avatar jmbwell avatar jmcphail avatar kleper avatar oniel10 avatar r-nash avatar reinaldofeitosa avatar sergiorius avatar shaneallgeier avatar slmingol avatar st4tikk avatar stephenradachy avatar thegr8brian avatar tong2x avatar toredash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unifi-pfsense's Issues

document how to disable unifi.sh service and how to remove it

Two sections are missing from the documentation:

  • how to disable service so it would not auto-start
  • how to remove the service

I am asking this because I am migrating from running unifi controller on pfsense router to running it as a docker container on Synology, as that variant sorts two important issues: free upgrades (due to container architecture), and reliability on system upgrades. pfsense still has its role as is used as a frontend which redirects all ports used by unify and also provides SSL encryption (haproxy) for the two ports needing it.

Uninstall / Delete Unifi

Greetings,

just a quick question - how can I remove Unifi and all its data from my pfSense? I was not able to do that with "pgk delete". Somebody got any idea?

Thanks a lot in advance!

Greetings
Wampeee

Package Category

Do you think the UniFi package should fall under net, net-mgmt or other category?
See:

root@bsd-builder:~/pfSense-ports # find . -maxdepth 2 -name "pfSense-pkg*" -print
./benchmarks/pfSense-pkg-iperf
./dns/pfSense-pkg-bind9
./emulators/pfSense-pkg-Open-VM-Tools
./ftp/pfSense-pkg-FTP_Client_Proxy
./ftp/pfSense-pkg-tftpd
./mail/pfSense-pkg-mailreport
./net-mgmt/pfSense-pkg-darkstat
./net-mgmt/pfSense-pkg-iftop
./net-mgmt/pfSense-pkg-net-snmp
./net-mgmt/pfSense-pkg-nrpe
./net-mgmt/pfSense-pkg-softflowd
./net-mgmt/pfSense-pkg-zabbix-agent
./net-mgmt/pfSense-pkg-zabbix-proxy
./net/pfSense-pkg-Avahi
./net/pfSense-pkg-LADVD
./net/pfSense-pkg-OpenBGPD
./net/pfSense-pkg-Quagga_OSPF
./net/pfSense-pkg-Status_Traffic_Totals
./net/pfSense-pkg-arping
./net/pfSense-pkg-cellular
./net/pfSense-pkg-freeradius2
./net/pfSense-pkg-haproxy-devel
./net/pfSense-pkg-haproxy
./net/pfSense-pkg-mtr-nox11
./net/pfSense-pkg-ntopng
./net/pfSense-pkg-pfBlockerNG
./net/pfSense-pkg-routed
./net/pfSense-pkg-siproxd
./www/pfSense-pkg-Lightsquid
./www/pfSense-pkg-squid
./www/pfSense-pkg-squidGuard
./security/pfSense-pkg-acme
./security/pfSense-pkg-nmap
./security/pfSense-pkg-openvpn-client-export
./security/pfSense-pkg-snort
./security/pfSense-pkg-sudo
./security/pfSense-pkg-suricata
./security/pfSense-pkg-tinc
./sysutils/pfSense-pkg-AutoConfigBackup
./sysutils/pfSense-pkg-Backup
./sysutils/pfSense-pkg-Cron
./sysutils/pfSense-pkg-LCDproc
./sysutils/pfSense-pkg-Notes
./sysutils/pfSense-pkg-RRD_Summary
./sysutils/pfSense-pkg-Service_Watchdog
./sysutils/pfSense-pkg-Shellcmd
./sysutils/pfSense-pkg-System_Patches
./sysutils/pfSense-pkg-apcupsd
./sysutils/pfSense-pkg-blinkled
./sysutils/pfSense-pkg-gwled
./sysutils/pfSense-pkg-nut
./sysutils/pfSense-pkg-syslog-ng

Shared object "libz.so.5" not found, required by "java"

pfSense version: 2.3-RELEASE

During startup I get the following error:

Shared object "libz.so.5" not found, required by "java"
$ find / -name 'libz.so.*'
/lib/libz.so.6
/usr/lib32/libz.so.5

Tried installing this, but it didn't help:

/usr/sbin/pkg add http://pkg.freebsd.org/freebsd:10:x86:64/latest/All/lzlib-1.7.txz

eval: /usr/local/bin/java: not found

snappyjava-1.0.4.1_2.txz 100% of 983 kB 932 kBps 00m01s
x +COMPACT_MANIFEST
x +MANIFEST
tar: Removing leading '/' from member names
x usr/local/share/java/classes/snappy-java.jar
x usr/local/lib/libsnappyjava.so
x usr/local/share/licenses/snappyjava-1.0.4.1_2/catalog.mk
x usr/local/share/licenses/snappyjava-1.0.4.1_2/LICENSE
x usr/local/share/licenses/snappyjava-1.0.4.1_2/APACHE20
done.
/usr/local/etc/rc.d/unifi.sh 100% of 1686 B 16 MBps 00m00s
done.
Enabling the unifi service... done.
Starting the unifi service...Starting UniFi controller.
eval: /usr/local/bin/java: not found
done.

2.3.1-RELEASE

Version Checking

While, off the top of my head, I can't think of anything that can break between versions sense, especially since we're using pkg, I still figure that we should allow installation only on "supported" versions of software that we've tested on.

Since there will be multiple versions of pfSense, we should have a list of supported versions, run the version of pfSense that the script is running on by that list. If the version isn't supported, quit.

We should also give the user an option ( perhaps defined by ENV variable )

SKIP_VERSION_CHECK="true" curl .... | /bin/sh -s 

Can't reach website of Unifi Controller

Hi,

I have a standard that I deliver to all my customers. Always PFsense router, Unifi AP AC Lite and a GS108E or better depending on size of installation. It would be neat as hell to manage the Unifi from PFsense as it eliminates the need of a "server", and setup properly I can manage it from remote.

However, I tried now on several different platforms (different hardware and different versions of PFsense) but I can't get the controller website to load. I may be a loon, I don't know, but I tried installing the software from shell with the command "fetch -o - https://git.io/j7Jy | sh -s" with all positive results. I have restarted the service with "service unifi.sh stop" and "service unifi.sh start" and tried again, but I simply cannot load the page at "https://myrouterip:8443", "http://myrouterip:8080" or "https://myrouterip:8443/manage". When I try to connect I get the TLS error and I accept the warning, but then nothing, it simply loads until the end of time but never shows any content. Of course I tried different web browsers too; IE, Firefox and Chrome.

As I said, I may be stupid, but I do need some help.

AP stuck in 'Adopting' state

Hi,
Installed it on my pfSense box, and added my first AP. AP showed up in the console but when I approved it, it got stuck in the 'Adopting' state. Ssh to AP and then ran info, returned 'server reject'. After a long search I found this fix:
wget http://pkg.freebsd.org/freebsd:10:x86:64/release_1/All/snappyjava-1.0.4.1_1.txz
tar vfx snappyjava-1.0.4.1_1.txz
cp ./usr/local/share/java/classes/snappy-java.jar /usr/local/UniFi/lib/snappy-java-1.0.5.jar
From what I read this is a known problem and was supposed to be fixed in the latest releas(es) but apparantly it's not.
br
Danny

Check for tmp space before install, make TMPDIR

The default size of /tmp is 40MB, so the installation fails when installing mongodb, where the size of mongodb-2.6.12_4.txz.XXXXX is 46MB

In case the tmp is too small, the script should either just stop, or offer to make a TMPDIR at for instance /usr/local/tmp or a user-selectable path.

I solved it by

sh 
mkdir /usr/local/tmp
TMPDIR=/usr/local/tmp; export TMPDIR

UniFi 3.2.7

I was wondering if you would be able to guide me through how to get the latest release onto my server? I am sure it’s a simple fix, maybe just changing the url in the code, but then how to I get that new script to run for the install and not yours?

Unable to adopt UAP-LR after update

Hello,

I have updated the controller to the latest version 4.8.14, everything went fine.
Then I have updated the firmware on one of the AP and it seems it is unable to adopt it again.

In /var/log/messages on the AP in question I receive a server reject error:

Mar 24 09:41:29 UBNT user.err syslog: ace_reporter.reporter_fail(): Server Reject (http://10.0.0.1:8080/inform) Mar 24 09:41:29 UBNT user.err syslog: ace_reporter.reporter_fail(): initial contact failed #68, url=http://10.0.0.1:8080/inform, rc=5

The other APs on the older firmware work fine.
I've tried the usual, reseting the AP to default, doing a clean install of the controller, changing the inform url with set-inform, etc and nothing worked.
Also tried to install the controller on windows to see if it's an AP problem but it worked just fine.

Any ideas on this one ?
Thank you.

can not be used on 32bit pfsense

Have you considered catering for 32bit pfsense with this script?
Being that the UniFi software is written in java, I cannot see a reason why this could not be adapted to be architecture independent.
I don't have enough knowledge to be able to so it myself however.

Coudn't enable Cloud Access

pf 2.4.3
unifi controller ver. 5.7.23
/usr/sbin/pkg config abi = FreeBSD:11:amd64

"Cloud access is not compatible with this OS architecture."

UBNT Support wright: "You will need to install 64 Bit java on your computer"

Describe what to do next once installed in the README

I installed this (thanks, BTW!) but, having not used the controller before, I was then confused about what to do next. I googled about, but got various conflicting information about how to connect to the Unifi controller.

It might make it easier for newbies to point out that:

  • The default port is 8080 for HTTP and 8443 for HTTPS, ie once installed you go to http://your-server-ip:8080/ or https://your-server-ip:8443/ (and there will probably be a TLS certificate mismatch)
  • A Unifi option will not appear in the pfSense menus (though it might be rather neat if it did that :-)

Installation script broken on pfSense 2.1.5

THe installation script seems to fail due to some packages not being installable. It says the file is not found for mongo, java, etc. I haven't been able to test changing of repos yet to see if it fixes it. I'm not super familiar with pkg_add works, so I'm hoping someone else can step up and determine where the issue is.

README contains no info regarding install and logs paths

I think that the README file should mention where it does install unifi controller software and where we can find the logs. As someone new to the project I was surprised not to find any mention on this and I found nothing related to it in /var/log, so I ended up raising this enhancement request ;)

Update: I was able to spot installed UniFi inside /usr/local/UniFi but the logs directory from there contains only mongodb.log even if the web gui is clearly running.... so I am still looking for a way to find what is causing #90

Oracle Java Branch

Hello,

cloud you please add an Oracle Java Branch? Though I have issues with the guest portal.
I installed unifi on an Arch VM with Oracel Java instead and the guest portal works there.

thx

Making mongod to be installed with proper dependency

In some default installation, using "pkg install mongod" will still result a broken installation, the symptoms could be follows:

  1. Executing: /usr/local/etc/rc.d/mongod onestart
    Result: /usr/local/etc/rc.d/mongod: WARNING: failed to start mongod
  2. Executing: /usr/local/bin/mongod
    Result: Missing libpcrecpp.so.0

When the above symptoms were shown , which imply that the pcre package may not be installead. However, execurint "pkg install pcre" may got a message of "pcre is up-to-date".

The workaround is to force all packages to be reinstalled, by executing follow command:
pkg upgrade -f

How to uninstall?

I have installed it on my pfSense box and it was running great.
But I sold my Ubiquiti systems and now I want to uninstall the software.

How can I do that?

Mongodb use small files instead

As my pfsense have only 4GB SSD and only 3.1GB root partition, there was a error that my disk space is not enough for mongodb

my workaround is to remove the symbolic link in /usr/local/UniFi/bin/mongodb, but using following shell script instead

!/bin/sh

/usr/local/bin/mongod --smallfiles "$@"

Failure after upgrading to pfsense 4/13/15

After running the updater, the unifi controller refused to start. I found that mongodb was failing due to libpcrecpp.so.0 missing. Running

pkg install -f pcre

fixed the issue of mongodb. Hopefully this helps someone who runs into this problem.

snappyjava version embedded in pathname

The unifi package includes a version of snappyjava that we have to replace with our own. The name of the bundled snappyjava file includes a version string, but the name of the file we need to swap in does not. We should automate detecting the name of the file we need to replace and renaming our file to match, so that upstream changes in that file don't break our script.

Manual upgrade

Not an issue but maybe useful - I've been using these simple steps about 10 times to upgrade my UniFi controller on our pfSense box - worked like a charm every time ...

get the new version

cd ~
fetch https://www.ubnt.com/downloads/unifi//UniFi.unix.zip (or whatever the URL you have is).
unzip UniFi.unix.zip

copy the data

cp -R /usr/local/UniFi/data ./UniFi/data

compare snappyjava files

ls -al /usr/local/UniFi/lib/snappy*
ls -al ./UniFi/lib/snappy*

evaluate and copy snappyjava if needed

cp /usr/local/UniFi/lib/snappy* ./UniFi/lib

Note:

When AP is stuck in 'Adopting' state, this is very likely related to snappy-java

Rename snappy-java so that it matches the name of the snappy-java in the new release if needed

Stop unifi

service unifi.sh stop

Backup and replace UniFi

mv /usr/local/UniFi /usr/local/UniFi_backup
mv UniFi /usr/local/

Make symbolic link for mongod point to the right target

cd /usr/local/UniFi/bin
ls -al
rm mongod
ln -s /usr/local/bin/mongod mongod

start unifi again

cd /usr/local/UniFi/lib
service unifi.sh start

Unable to adopt after update 5.5.20

pfSense 2.3.4p1

Fresh Install unifi 5.5.20

Sep 17 16:26:44 UBNT user.err syslog: ace_reporter.reporter_fail(): Server Reject (http:/x.x.x.x:8080/inform)
Sep 17 16:26:44 UBNT user.err syslog: ace_reporter.reporter_fail(): initial contact failed #20, url=http://x.x.x.x:8080/inform, rc=5
Sep 17 16:26:44 UBNT user.info syslog: ace_reporter.reporter_next_inform_url(): next inform url[0]=http://unifi:8080/inform
Sep 17 16:26:44 UBNT user.info syslog: ace_reporter.reporter_next_inform_url(): authkey=ba86f2bbe107c7c57eb5f2690775c712

Cannot adopt access point with 4.8.x - Unifi local copy of snappy missing FreeBSD native library

Unifi software 4.8.14 seems to start and work fine after upgrade. However; it cannot adopt my access point.

Turns out that the following error is preventing adoption:

server.log.1:[2016-04-04 16:05:36,869] WARN system - cannot load native lib - ubnt_webrtc_jni
server.log.1:org.xerial.snappy.SnappyError: [FAILED_TO_LOAD_NATIVE_LIBRARY] no native library is found for os.name=FreeBSD and os.arch=amd64

I resolved this by symlinking the FreeBSD snappy package jar into the Unifi directory. Not sure if something is unique about my setup causing this issue (it worked fine for older releases including if I revert now) or if others are facing the same problem.

Won't start after pfsense upgrade to 2.2.6

I'm happy to troubleshoot, but I can't find any logs apart from the mongod.

The service is running, but I don't see it fork mongod or start listening on the web port.

Error with mongod

Hi, im upgrade pfsense from a previous version to 2.2 and do a clean install, when i tried to install Unifi but im get this error
[2.2.2-RELEASE][[email protected]]/usr/local/bin: ./mongod
Illegal instruction (core dumped)

Any idea ?

Thks.

Packages Updated

Greetings,

New install on 2.3.3.a.20170203.1331

It appears these packages in the script may need to be updated:
pcre-8.39_1.txz --> pcre-8.40.txz
openjdk8-8.112.16_3.txz --> openjdk8-jre-8.121.13.txz

Possible mongodb install fail & "How do you use this?"

Hi!

First of all - thanks! Really grateful for your work.
Tried this the first time now and I think (see below) that it installed OK and sorry for this very basic question:

  1. How do you actually use it? I mean when I installed UniFi on my computer I had an icon in the systray where I launched the application and I saw on the "ToDo"-list that:
    "pfSense user interface elements for managing the UniFi Controller." is something that is in the pipe but not implemented yet. If I try my AP:s IP with or without the port I can't connect to it (using my browser) although using the UniFi program on my computer launches the webgui for the AP.
  2. It seems that I get an error regarding mongodb but unsure if it affects the package (since, well I haven't figured out how to actually use it yet). Please see attached output, row 22 & 23: http://pastebin.com/dUAjw53v

Thanks a lot once again and sorry for my stupid questions - TheSwede86

Guest portal broken after upgarding to pfSense2.4

Hi,
I upgraded my pfSense box to 2.4 - that went well. After that, restored my UniFi software, that went fairly smooth too. I jut noticed one problem: the guest portal is not working anymore. I did some research and found this is very likely related to a bug in zlib:
https://community.ubnt.com/t5/UniFi-Wireless/ERR-CONTENT-DECODING-FAILED-on-guest-portal-customisation/td-p/1903419
I'm now trying to figure out how to get this fixed - if anyone could provide some guidance I would be very grateful ...
Danny

Java CoreDump on Execution

Hi,

I tried to install the controller software on my firewall. Unfortunately, I receive a segfault on startup. For a more detailed error message, I startet the unify controller software directly from console. Error message is shown below:

# /usr/local/bin/java -jar /usr/local/UniFi/lib/ace.jar start
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000003c9ab02b0c0, pid=17994, tid=0x000000000001878e
#
# JRE version: OpenJDK Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11)
# Java VM: OpenJDK 64-Bit Server VM (25.131-b11 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# J 378 C1 java.net.URLClassLoader$1.run()Ljava/lang/Object; (5 bytes) @ 0x000003c9ab02b0c0 [0x000003c9ab02b080+0x40]
#
# Core dump written. Default location: /usr/local/etc/rc.d/java.core
#
# An error report file with more information is saved as:
# /usr/local/etc/rc.d/hs_err_pid17994.log
AHE@0x000003c9aa65b030: 0xb0000000 i2c: 0x000003c9aae88ae0 c2i: 0x000003c9aae88b43 c2iUV: 0x000003c9aae88b04
Compiled method (c1)    3449  378       3       java.net.URLClassLoader$1::run (5 bytes)
 total in heap  [0x000003c9ab02af10,0x000003c9ab02b2b8] = 936
 relocation     [0x000003c9ab02b038,0x000003c9ab02b070] = 56
 main code      [0x000003c9ab02b080,0x000003c9ab02b1a0] = 288
 stub code      [0x000003c9ab02b1a0,0x000003c9ab02b248] = 168
 metadata       [0x000003c9ab02b248,0x000003c9ab02b258] = 16
 scopes data    [0x000003c9ab02b258,0x000003c9ab02b270] = 24
 scopes pcs     [0x000003c9ab02b270,0x000003c9ab02b2b0] = 64
 dependencies   [0x000003c9ab02b2b0,0x000003c9ab02b2b8] = 8
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Abort (core dumped)

Any suggestions?

Thanks,
Xatru

Package installation behavior

pfSense 2.2 & 2.2.1 don't come with pkg-ng installed.

In order to make installation process easier, we should install pkg-ng for the user if it's not already installed, and then install the packages that UniFi depends on (mongodb, java, etc)...while also verifying that the packages were installed.

if pkg not installed
attempt install it.
verify its installed

for each required package
attempt to install
verify it's installed

unable to pass install wizard on pfsense 2.4.1

I successfully run the installer on a new pfsense-2.4.1 and the service started but when I try to pass the Unify Setup Wizard, I get a wheel moving for some time and in the end I get the same page. I tried import settings or without, without any difference.

PS. Thanks for creating this project, I really appreciate your work and I will do my best to help with it as I find very useful to run UniFi Controller on the router.

1x1 pixel page loading after install

I have a fairly new install on a pfSense 2.4 box where everything worked fine for about 3 weeks and then it started loading a blank page with "1x1 pixel GIF" in the browser title instead of the Unifi Controller when I go the address/port I was using to sign in. It does look like it's displaying a single pixel that's a slightly different color in the middle.

I've tried re-running the installer and manually deleting the /usr/local/UniFi folder (as well as the automatically generated backups) to no avail! Any ideas? My hunch is a Java problem but this script looks like it would take care of that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.