Unifi network application (#374)

Closes #371 

As said in issue #371, casaos currently offers unifi-controller, which
is being deprecated starting January 1st.
Linuxserver has replaced it with unifi-network-application. However
deployment is a bit more complicated.
You can read more
[here](https://docs.linuxserver.io/images/docker-unifi-network-application/).

I wrote a compose file that deploys both unifi-network-application and
mongodb.

For mongoDB the chosen version is 3.6 and I believe it should not be
changed, because:
- it is officially supported by unifi-network-application
- it is the latest mongodb version supported by ARMv8A devices (aka
Raspberry Pis), newer versions require ARMv8.2

For unifi-network-application I tested the latest version (as of today
8.0.24) and it seems to work well, however I'm asking for more testing
and opinions, reason why in the compose I left the "latest" tag.

The compose also creates a bridge network, needed for hostname
resolution between the two services, needed at least until [this
issue](https://github.com/IceWhaleTech/CasaOS/issues/1348) is resolved.

The only caveats, from a user perspective, are described in the app
"tips", I paste them here:

To properly initialize the database, before installing, create a file
named `init-mongo.js` in the `/DATA/AppData` folder, with
        the following content:
        ```
db.getSiblingDB("unifi-db").createUser({user: "unifi", pwd: "pass",
roles: [{role: "dbOwner", db: "unifi-db"}]});
db.getSiblingDB("unifi-db_stat").createUser({user: "unifi", pwd: "pass",
roles: [{role: "dbOwner", db: "unifi-db_stat"}]});
        ```
This file is used only upon the first container start, to perform
initial configuration.
If you want, you can change the password `pass` modifying this file and
then the container's environment variables.

Because the network application runs inside Docker by default it uses an
IP address not accessible by other devices.
So, for it to adopt other devices, it is required to use port `8080` and
change the inform IP address. To do so, go in settings
and search for the `Inform Host` option, there select override and set
the address to that of the host.
Often, it is also needed to ssh into the devices you want to adopt and
manually set the inform IP address, the command
needed for doing so is `set-inform http://HOST-ADDRESS:8080/inform`.

For more
[information](https://docs.linuxserver.io/images/docker-unifi-network-application/)

I'm currently using an almost identical compose, deployed through
portainer on a Raspberry Pi 3 not using CasaOS, and it is working
flawlessly. (be careful on low memory devices because this application
can use about 500MB of memory)
I tested this PR on an x86 device and I can confirm deployment is
succesful and the network-application launches and configures correctly.
However I didn't test the adoption of unifi devices and everyday usage.
I believe there should be no issue, but any other test is warmly
welcomed.
Other useful info:
https://github.com/GiuseppeGalilei/Ubiquiti-Tips-and-Tricks/blob/main/Unifi%20network%20application%20-%20CasaOS/instructions.md

Happy holidays!

---------

Co-authored-by: Tiger Wang <tigerwang@outlook.com>
This commit is contained in:
Giuseppe Galilei 2024-01-26 10:54:26 +01:00 committed by GitHub
parent 19b9149ce0
commit ba4ae76a55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 122 additions and 0 deletions

View File

@ -0,0 +1,122 @@
name: unifi-network-application
services:
unifi-db:
container_name: unifi-db
image: docker.io/mongo:3.6
configs:
- source: init-mongo.js
target: /docker-entrypoint-initdb.d/init-mongo.js
environment:
- PGID=$PGID
- PUID=$PUID
- TZ=$TZ
ports:
- target: 27017
published: "27017"
protocol: tcp
restart: unless-stopped
volumes:
- type: bind
source: /DATA/AppData/unifi-db
target: /data/db
networks:
- unifi-bridge
privileged: false
unifi-network-application:
container_name: unifi-network-application
depends_on:
unifi-db:
condition: service_started
required: true
environment:
- MONGO_DBNAME=unifi-db
- MONGO_HOST=unifi-db
- MONGO_PASS=pass
- MONGO_PORT=27017
- MONGO_USER=unifi
- PGID=$PGID
- PUID=$PUID
- TZ=$TZ
image: lscr.io/linuxserver/unifi-network-application:latest
ports:
- target: 8443
published: "8443"
protocol: tcp
- target: 3478
published: "3478"
protocol: udp
- target: 10001
published: "10001"
protocol: udp
- target: 8080
published: "8080"
protocol: tcp
restart: unless-stopped
volumes:
- type: bind
source: /DATA/AppData/unifi-network-application
target: /config
networks:
- unifi-bridge
privileged: false
networks:
unifi-bridge:
driver: bridge
configs:
init-mongo.js:
content: |
db.getSiblingDB("unifi-db").createUser({user: "unifi", pwd: "pass", roles: [{role: "dbOwner", db: "unifi-db"}]});
db.getSiblingDB("unifi-db_stat").createUser({user: "unifi", pwd: "pass", roles: [{role: "dbOwner", db: "unifi-db_stat"}]});
x-casaos:
architectures:
- amd64
- arm64
main: unifi-network-application
author: "Giuseppe Galilei"
developer: "Ubiquiti and Linuxserver.io"
category: Network
description:
en_us: |
Only mandatory ports are enabled by default, to extend functionality consider exposing 1900:1900/udp, 8843:8843, 8880:8880, 6789:6789, 5514:5514/udp.
Other ports specifications [here](https://docs.linuxserver.io/images/docker-unifi-network-application/#ports-p).
Because the network application runs inside Docker by default it uses an IP address not accessible by other devices.
So, for it to adopt other devices, it is required to use port `8080` and change the inform IP address. To do so, go in settings and search for the `Inform Host` option, there select override and set the address to that of the host.
Often, it is also needed to ssh into the devices you want to adopt and manually set the inform IP address, the command needed for doing so is `set-inform http://HOST-ADDRESS:8080/inform`.
For more [information](https://docs.linuxserver.io/images/docker-unifi-network-application/)
hostname: ""
icon: ""
screenshot_link: ""
tagline:
en_us: The Unifi network application software is a powerful, enterprise wireless software engine ideal for high-density client deployments requiring low latency and high uptime performance.
zh_cn: Unifi控制器软件是一种功能强大的企业级无线软件引擎适用于需要低延迟和高可用性性能的高密度客户端部署。
ar_sa: يعد برنامج Unifi network application محرك برمجيات لاسلكي متطور ومتخصص للمؤسسات، مثالي للتركيبات العميلية ذات الكثافة العالية التي تتطلب أداءً منخفضًا للتأخير وأداءً عالٍ للتواجد.
de_de: Die Unifi network application-Software ist ein leistungsstarker, unternehmensweiter Wireless-Software-Engine, der für hochdichte Client-Implementierungen mit niedriger Latenz und hoher Verfügbarkeitsleistung ideal ist.
es_es: El software Unifi network application es un poderoso motor de software inalámbrico empresarial ideal para implementaciones de clientes de alta densidad que requieren baja latencia y alto rendimiento de disponibilidad.
fr_fr: Le logiciel Unifi network application est un puissant moteur logiciel sans fil d'entreprise idéal pour les déploiements de clients à haute densité nécessitant une faible latence et une haute disponibilité.
hu_hu: A Unifi network application szoftver egy erőteljes, vállalati vezeték nélküli szoftvermotor, amely tökéletesen alkalmas a magas sűrűségű kliensek telepítésére, amelyek alacsony késleltetést és magas rendelkezésre állást igényelnek.
it_it: Il software Unifi network application è un potente motore software wireless aziendale ideale per implementazioni client ad alta densità che richiedono bassa latenza e alto rendimento di disponibilità.
ru_ru: ПО Unifi network application - это мощный корпоративный беспроводной программный двигатель, идеально подходящий для реализации клиентов с высокой плотностью, требующих низкую задержку и высокую производительность доступности.
pl_pl: Oprogramowanie Unifi network application to potężny, korporacyjny silnik oprogramowania bezprzewodowego, idealny do implementacji klientów o wysokiej gęstości, wymagających niskiej opóźnienia i wysokiej wydajności dostępności.
pt_br: O software Unifi network application é um poderoso motor de software sem fio corporativo ideal para implantações de clientes de alta densidade que exigem baixa latência e alto desempenho de disponibilidade.
sv_se: Unifi network application-programvaran är ett kraftfullt, företagsinriktat trådlöst programvarumotor som är idealiskt för kundimplantationer med hög kundtäthet som kräver låg latens och hög tillgänglighet.
uk_ua: ПО Unifi network application - це потужний корпоративний бездротовий програмний двигун, ідеально підходящий для реалізації клієнтів з високою щільністю, які вимагають низької затримки та високої доступності.
tips:
before_install:
en_us: |
Only mandatory ports are enabled by default, to extend functionality consider exposing 1900:1900/udp, 8843:8843, 8880:8880, 6789:6789, 5514:5514/udp.
Other ports specifications [here](https://docs.linuxserver.io/images/docker-unifi-network-application/#ports-p).
Because the network application runs inside Docker by default it uses an IP address not accessible by other devices.
So, for it to adopt other devices, it is required to use port `8080` and change the inform IP address. To do so, go in settings and search for the `Inform Host` option, there select override and set the address to that of the host.
Often, it is also needed to ssh into the devices you want to adopt and manually set the inform IP address, the command needed for doing so is `set-inform http://HOST-ADDRESS:8080/inform`.
For more [information](https://docs.linuxserver.io/images/docker-unifi-network-application/)
thumbnail: ""
index: /
port_map: "8443"
scheme: https
store_app_id: unifi-network-application
title:
en_us: Unifi Network Application

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB