[Support] Linuxserver.io - Unifi-Controller


Recommended Posts

Thanks @bmartino1 & @wgstarks for this detailed info about the Mongo & new unifi container in unraid.

 

Unfortunately I'm not getting the init-mongo.js file to work. Every time I try to deploy mongo with the settings you provided above, it will just create some test database. Not the unifi one.

 

Could you elaborate a bit more about this: "*Unraid by default will go to folders you will need to go to where your init-mongo.js file you make is and type in the path to do a docker 1 for 1 file replacement and run."

 

What do you mean exactly? I know that default a init-mongo.js folder is created, do I just remove this folder & replace it with the .js file? Or do i need do do something else?

 

I think it is in this step that something is going wrong for me...

 

Thanks again!

 

Link to comment
9 hours ago, MonYvel said:

Thanks @bmartino1 & @wgstarks for this detailed info about the Mongo & new unifi container in unraid.

 

Unfortunately I'm not getting the init-mongo.js file to work. Every time I try to deploy mongo with the settings you provided above, it will just create some test database. Not the unifi one.

 

Could you elaborate a bit more about this: "*Unraid by default will go to folders you will need to go to where your init-mongo.js file you make is and type in the path to do a docker 1 for 1 file replacement and run."

 

What do you mean exactly? I know that default a init-mongo.js folder is created, do I just remove this folder & replace it with the .js file? Or do i need do do something else?

 

I think it is in this step that something is going wrong for me...

 

Thanks again!

 

 

Hi Yes when I said by default, you will have to know the path location. Clicking in the web gui will go to the folder. But you must maintain file name and path.

 

The container path must be: /docker-entrypoint-initdb.d/init-mongo.js

 

and the 1 for 1 file path must be

/mnt/user/appdata/unifi-controler/mongodb/init-mongo.js

 

^ Except it's where your init-mongo.js file is located.

 

But default unraid if i click the prompts will only do folders.

So I would get /mnt/user/appdata/unifi-controler/mongodb/

 

image.png.87274e1ab4d8087e665ad7ec8bb87f0d.png

 

When I need to specify the file name. to complete the 1 for 1 file passing

Edited by bmartino1
  • Like 1
Link to comment

I recommend using the steps in the github from the package maintainer.


See Application Setup:
https://github.com/linuxserver/docker-unifi-network-application
 

This container requires an external mongodb database instance.


Setting Up Your External Database

Formally only mongodb 3.6 through 4.4 are supported, however, it has been reported that newer versions will work. If you choose to use a newer version be aware that you will not be operating a supported configuration.
 

Make sure you pin your database image version and do not use latest, as mongodb does not support automatic upgrades between major versions.


If you are using the official mongodb container, you can create your user using an init-mongo.js file with the following contents:

 

db.getSiblingDB("MONGO_DBNAME").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME"}]});
db.getSiblingDB("MONGO_DBNAME_stat").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME_stat"}]});

 

Being sure to replace the placeholders with the same values you supplied to the Unifi container, and mount it into your mongodb container.

 

The default template for unifi-network-application

Mongo_User > unifi

Mongo DB > unifi

MONGO_PASS > empty

MONGO_HOST > unifi-db

 

You will need to match the Mongo_User, Mongo_Pass, and Mongo DB form your init-mongo.js
You must fill in the template to have it work.

If following my with host being the network
https://forums.unraid.net/topic/78060-support-linuxserverio-unifi-controller/?do=findComment&comment=1326226
 


the Mongo Host becomes unraids DNS name / Ip Address

following the template, this should be your init-mongo.js file:

db.getSiblingDB("unifi").createUser({user: "unifi", pwd: "MONGO_PASS-setme", roles: [{role: "dbOwner", db: "unifi"}]});
db.getSiblingDB("unifi_stat").createUser({user: "unifi", pwd: "MONGO_PASS-setme", roles: [{role: "dbOwner", db: "unifi_stat"}]});

 

Under the unifi template, you would need to change

MONGO_PASS > MONGO_PASS-setme

MONGO_HOST > unraid ip/hostname

Edited by bmartino1
  • Like 1
Link to comment

@wgstarks & @bmartino1,

Thanks for your detailed answers!

So, if I understand correctly: First create the mongo-init.js file in a location of my choosing and fil it whit the correct content as stated in the github page, After this deploy the MongoDB container with the correct path configured & manually adding the file name to the host path parameter?

 

I do not need to set certain access rights? The defaults from Unraid are sufficient?

 

I will try a new deploy on Friday when I have some time, will report back with my findings.

Edited by MonYvel
Link to comment
4 hours ago, MonYvel said:

So, if I understand correctly: First create the mongo-init.js file in a location of my choosing and fil it whit the correct content as stated in the github page, After this deploy the MongoDB container with the correct path configured & manually adding the file name to the host path parameter?

Add the full path. I posted a screenshot of mine just a couple of posts back.

 

4 hours ago, MonYvel said:

I do not need to set certain access rights? The defaults from Unraid are sufficient?

Correct

 

Be sure to read the documentation in the GitHub page.

  • Like 1
Link to comment

Thanks for your help guys!

 

Creating the path & mongo-init.js file first & then deploying the MongoDB container with added path did the trick!

 

The new Unifi controller is up and running here now. (Restoring from backup was also no issue)

 

Now I hope that having a separate MongoDB container does not complicate things to much & breaks every time an update is installed...

Link to comment
3 hours ago, PeteAsking said:

At some point the community needs to decide

Do they?

 

IMHO more is better, up to a point anyway. I’m not sure having dozens of containers would be better but I think having two or three allows for some redundancy and less dependency on a single maintainer.

 

Just a thought.😁

Link to comment

Still on 7.2.95 but just checking in after a little over year to see what's up.  On first read here's is my two cents opinion:

 

1. One container solution is simpler and less moving parts to break.  The unknown is an unestablished container developer?

 

2. Two containers solution sounds like it would be a nightmare for casual users (like me) to keep updated since there are now twice or more moving parts to worry about.  However, the containers are maintained by established developers.

 

Operating under the KISS mantra, I would prefer a one container solution.  Let's put it this way, if I was brand new to Unifi and looking for a way to run it on unRAID as a docker container, I would most likely opt for the one container vs the two containers solution.

Edited by mifronte
Link to comment
14 hours ago, mifronte said:

Let's put it this way, if I was brand new to Unifi and looking for a way to run it on unRAID as a docker container, I would most likely opt for the one container vs the two containers solution.

I have been running Unraid for 12 years and a Unifi network for six years.  I have used the LSIO versions of the Unifi Network Controller containers since I started with Unifi.  When it was announced the LSIO container would be split into two containers, I thought I'd give the single container solution from @PeteAsking a try.  It installed without a hitch and I am now running it with version 8.0.7 of the controller.  PeteAsking has been very active in this particular forum and knows his stuff when it comes to the Unifi infrastructure; however, I do understand the angst of a single maintainer vs. the resources of LSIO behind their solution.

 

Personally, I plan to stick with the "controller-reborn" version.  As a backup, I will likely transition my currently inactive LSIO controller container to their new dual-container version but I personally prefer what PeteAsking has done.

Edited by Hoopster
  • Like 1
Link to comment
2 hours ago, wayner said:

I have been using unRAID for over five years and I don't mind getting my hands dirty but when I look at bmartino1's post here it looks as gross AF!  Maybe it is not as bad as it looks, but it is going to scare a lot of people away.

Yeah, but I'm just regurgitating the information and at least proved some documentation

 

I entered this form due to no documentation and having to dig through this forum and 3 other websites and then be mini dev with others to help jumpstart. And reinforcing to inform from multiple sources.

I rather have poor documentation than none at all and a message from others through plugins that tigers saying change or no longer work... Unraid is a hobby. With the Macvlan trace issues and other bug report, I think they finally fixed but once unraid loses macvaln docker network driver. Unraid will be dead to me. As this is a staple in most advance network infrastructures to guarantees access of where what is and what's going where in packet tracing... So i'm in and out and new and old can read and decide with the actual info. Original went to this trying to get the data when squid sent something through the Fix common problems Plugin. I couldn't find the weblink as the answer I got was search the post with no clear reason as to what and why.

 

So my part in this just to maintain and help others. This was the only way I knew to document this to my ability and data dump share. You want to make a KB document and fix that to your standards, Be my guest. But at least now you know...

 

Edited by bmartino1
Link to comment
49 minutes ago, bmartino1 said:

I entered this form due to no documentation and having to dig through this forum and 3 other websites and then be mini dev with others to help jumpstart. And reinforcing to inform from multiple sources.

Personally, I thank you for that.  I will be using your documentation to migrate my current LSIO Unifi container to their new dual-container solution.  It will only be a backup to Unifi-Controller-Reborn for me, but at least you made some sense of it when all that existed before was a bit convoluted and seemed to be missing some important information.

 

Anyone choosing to stick with the LSIO solution should be very grateful for you efforts.

  • Thanks 1
Link to comment
4 hours ago, wayner said:

I have been using unRAID for over five years and I don't mind getting my hands dirty but when I look at bmartino1's post here it looks as gross AF!  Maybe it is not as bad as it looks, but it is going to scare a lot of people away.

I did another one a little earlier in this thread that may be more to your liking but honestly, I don’t think LSIO really cares much about unRAID users anymore (JUST MY GUESS) and I recommend switching to unifi-controller-reborn. IMHO it’s much easier to install and setup.

Link to comment
3 hours ago, bmartino1 said:

Yeah, but I'm just regurgitating the information and at least proved some documentation

I didn't mean any offense, and I appreciate your help.  But it just looks a bit painful compared to today where pretty much all you need to do is click on the docker that you want to install.

Link to comment
53 minutes ago, wgstarks said:

I did another one a little earlier in this thread that may be more to your liking but honestly, I don’t think LSIO really cares much about unRAID users anymore (JUST MY GUESS) and I recommend switching to unifi-controller-reborn. IMHO it’s much easier to install and setup.

What is LSIO? I have never heard of them, other than for building unRAID dockers and I had no idea that they did anything other than build dockers for unRAID.

Link to comment
2 minutes ago, wayner said:

What is LSIO? I have never heard of them, other than for building unRAID dockers and I had no idea that they did anything other than build dockers for unRAID.

LSIO is linuxserver.io. They have built many docker containers and at one time they customized them for unRAID and recommended running them on unRAID. That seems to no longer be the case. While some of the LSIO members are still shown as unRAID forum members I don’t believe any are still active here and obviously they are no longer customizing their containers for unRAID.

Link to comment

Short quote from the linuxserver.io landing page- 

Quote

We are a group of like-minded enthusiasts from across the world who build and maintain the largest collection of Docker images on the web, and at our core are the principles behind Free and Open Source Software. Our primary goal is to provide easy-to-use and streamlined Docker images with clear and concise documentation.

 

Link to comment
4 minutes ago, wayner said:

What's the difference in building unRAID docker images vs images for other platforms?  And what other platforms use dockers?  Plain vanilla Linux OSes like Ubuntu?  I know that you can now use Docker under Windows, but that seems to have a bunch of limitations.

I’m really not the best person to answer this so my answer may not be completely correct but AFAIK pretty much any container can be manipulated to work on unRAID. How the containers are built (permissions required, network types, etc) can make it easier or harder to use the container with unRAID. I suspect that most dockers can be run on most Linux builds but I’m not a Linux user so that’s just a guess on my part. I know that docker is also supported on the most recent versions of macOS. I run all of my docker containers on unRAID though (with the help of many other unRAID users).

Link to comment
On 12/10/2023 at 6:51 PM, wayner said:

What's the difference in building unRAID docker images vs images for other platforms?  And what other platforms use dockers?  Plain vanilla Linux OSes like Ubuntu?  I know that you can now use Docker under Windows, but that seems to have a bunch of limitations.

Most of the differences revolve around permissions since unraid is dissimilar to other linux OS’s in that root is still used and to avoid running a docker as root the ‘nobody’ group is used. Many dockers that are created dont take this into account requiring the ‘unraid specific’ changes that makes them suitable for unraid to run. There are a few less interesting differences but this one causes the most issues as unraid cant write files to the locations the docker is being run from which causes many problems. 
 

in terms of ‘the best solution’ I do agree LSIO have a proven track record and that is a very desirable benefit. Very little anyone can do about it. If you need their track record as part of your solution then the 2 docker method is the only path forward. It does function and over time it could become easier to setup. 
 

On the other hand the single solution does provide a simpler setup which is what many unraid users use unraid for. Otherwise why not just install a vm and manage your dockers under a debian vm without the need for unraid. Unraids entire benefit is the click and install and low maintenance approach. So for this benefit the single docker does meet the general requirement of ease of use and ease of management and so on. 
 

Obviously a track record can only be built up over time and since it currently doesnt exist the only thing to do check over time how reliable/well maintained it is. There are just 2 of us involved. Af for the LSIO docker images I have no way of knowing how many people are actually working on it. Depends on how many resources that company is prepared to spend I guess. So kind of thats the situation best I can describe. 

  • Thanks 1
Link to comment

I have found it to be more resources and overhead. I can run an ubuntu VM to install Java JRE and run the unifi program native in the VM.

 

Now I Have cpu, ram, and other in a full Linux environment.

-This is a Machine in a Machine.

 

I can containerize this specific application and run my jar file(the unifi program) and have less overhead of running a full machine.

See Linux terms and packages for LXC / LVM / Docker podman and (Docker in Docker) / Helm / Rancher ...etc ...

 

Then their data and security and easy of access.

https://cloudacademy.com/blog/docker-vs-virtual-machines-differences-you-should-know/#:~:text=Docker vs Virtual Machine%3A main differences

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.