meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ubiquiti:controller [2020/07/20 16:05] – niziak | ubiquiti:controller [2021/03/20 21:41] (current) – niziak | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| * Works correctly only with host type networking = no network separation | * Works correctly only with host type networking = no network separation | ||
| - | ===== In unprivileged LXC ===== | ||
| - | [[https://wiki.debian.org/LXC]] | + | |
| + | ==== Install MongoDB < 4.0.0 ==== | ||
| + | [[https://docs.mongodb.com/ | ||
| <code bash> | <code bash> | ||
| - | apt-get install | + | apt install gnupg2 |
| + | wget -qO - https:// | ||
| + | echo "deb http:// | ||
| + | apt-get | ||
| + | sudo apt install | ||
| + | sudo systemctl start mongod | ||
| </ | </ | ||
| - | Create user: | + | ==== Installing |
| - | <code bash> | + | |
| - | <code bash> | + | |
| - | Find subuids and subgids for created user | + | Inside container: |
| - | <code bash> | + | <code bash> |
| - | < | + | sudo apt-get update && sudo apt-get install ca-certificates apt-transport-https wget |
| - | /etc/subgid:unifi:1738400: | + | echo 'deb https:// |
| - | /etc/subuid:unifi: | + | sudo wget -O /etc/apt/ |
| - | </code> | + | sudo apt update |
| + | sudo apt install unifi | ||
| - | Allow new user create network interfaces: | ||
| - | <file | / | ||
| - | lxcgitlab veth br-lan 10 | ||
| - | </ | ||
| - | [[https:// | ||
| - | |||
| - | Now login as new user (using ssh or su). | ||
| - | Create default lxc configureation in user directory: | ||
| - | <code bash> | ||
| - | mkdir -p ~/ | ||
| - | cp / | ||
| </ | </ | ||
| + | Access running controller on: [[https://< | ||
| - | Edit file below and put subuid and subgid: | + | Unifi controller log location: |
| - | <file | ~/.config/lxc/default.conf> | + | * '' |
| - | lxc.include = /etc/lxc/default.conf | + | * '' |
| - | + | ||
| - | lxc.idmap = u 0 1738400 65536 | + | |
| - | lxc.idmap = g 0 1738400 65536 | + | |
| - | + | ||
| - | # " | + | |
| - | lxc.mount.auto = proc:mixed sys:ro cgroup: | + | |
| - | + | ||
| - | lxc.net.0.type = veth | + | |
| - | lxc.net.0.link = br-lan | + | |
| - | lxc.net.0.flags = up | + | |
| - | lxc.net.0.hwaddr = 00: | + | |
| - | + | ||
| - | # Disable AppArmor confinement for containers started by non-root | + | |
| - | # See https:// | + | |
| - | # https:// | + | |
| - | + | ||
| - | lxc.apparmor.profile = unconfined | + | |
| - | # Unprivileged containers started by ROOT can use lxc.apparmor.profile = generated | + | |
| - | + | ||
| - | /var/lib/lxc/ = ~/.local/ | + | |
| - | / | + | |
| - | </ | + | |
| - | + | ||
| - | Create container: | + | |
| - | <code bash> | + | |
| - | * Distribution: | + | |
| - | * Release: '' | + | |
| - | * Architecture: | + | |
| + | ==== Configure mail agent ==== | ||
| <code bash> | <code bash> | ||
| - | lxc-start -n unifi | + | sudo apt-get install msmtp-mta |
| - | lxc-ls -f | + | |
| - | NAME STATE | + | |
| - | unifi RUNNING 0 | + | |
| </ | </ | ||
| - | <code bash> | + | See how to configure: [[linux: |
| - | lxc-attach -n unifi | + | |
| - | apt install openssh-server | + | === adding own CA cert to controller === |
| + | To send e-mails to own SMTP server | ||
| + | It is enough to add cert to Debian certifcate store and restart unifi controller. | ||
| - | </ | ||
| + | To add certificate directly to JVM store: | ||
| - | ==== Issues ==== | + | [[https:// |
| - | + | ||
| - | === lxc-start: unifi: tools/lxc_start.c: main: 329 The container failed | + | |
| <code bash> | <code bash> | ||
| - | lxc-start -n unifi -l DEBUG -o debug.log | + | sudo cp cacert.crt / |
| - | cat debug.log | + | cd / |
| - | + | keytool -v -import -file cacert.crt -alias my_own_ca -keystore cacerts -storepass changeit | |
| - | ... | + | |
| - | lxc-start unifi 20200720135645.187 ERROR start - start.c: | + | |
| - | ... | + | |
| - | + | ||
| - | sudo setfacl | + | |
| </ | </ | ||
| - | + | < | |
| - | === Error: lxc-create: unifi: confile.c: set_config_net: | + | |
| - | + | ||
| - | LXC3 is using different config keys. Easiest way is to convert config file: | + | |
| - | < | + | |
| - | + | ||
| - | === lxc-create: unifi: conf.c: chown_mapped_root: | + | |
| - | <code bash> | + | |
| - | sysctl kernel.unprivileged_userns_clone | + | |
| - | kernel.unprivileged_userns_clone = 0 | + | |
| - | + | ||
| - | sudo echo " | + | |
| - | sysctl -p | + | |
| - | </ | + | |