r/unifi: Switching to custom container image
The _linuxserver.io_ image for UniFi Network is deprecated. It sucked anyway. I've created a simple image based on Debian that installs the _unifi_ package from the upstream apt repository. This image doesn't require running anything as _root_, so it doesn't need a user namespace.unifi-restore
parent
a423826fcd
commit
db54b03aa8
5
hosts
5
hosts
|
@ -227,6 +227,11 @@ vps
|
||||||
|
|
||||||
[unifi]
|
[unifi]
|
||||||
|
|
||||||
|
[unifi-test]
|
||||||
|
|
||||||
|
[unifi:children]
|
||||||
|
unifi-test
|
||||||
|
|
||||||
[vm-hosts]
|
[vm-hosts]
|
||||||
vmhost0.pyrocufflink.blue
|
vmhost0.pyrocufflink.blue
|
||||||
vmhost1.pyrocufflink.blue
|
vmhost1.pyrocufflink.blue
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
unifi_version: latest
|
unifi_version: latest
|
||||||
unifi_container_image: lscr.io/linuxserver/unifi-controller
|
unifi_container_image: git.pyrocufflink.net/containerimages/unifi
|
||||||
unifi_storage_path: /var/lib/unifi
|
unifi_storage_path: /var/lib/unifi
|
||||||
|
|
||||||
unifi_exporter_container_image: docker.io/jessestuart/unifi_exporter
|
unifi_exporter_container_image: docker.io/jessestuart/unifi_exporter
|
||||||
|
|
|
@ -1,48 +1,3 @@
|
||||||
- name: ensure unifi group exists
|
|
||||||
group:
|
|
||||||
name: unifi
|
|
||||||
gid: 911
|
|
||||||
system: true
|
|
||||||
state: present
|
|
||||||
tags:
|
|
||||||
- user
|
|
||||||
- group
|
|
||||||
- name: ensure unifi user exists
|
|
||||||
user:
|
|
||||||
name: unifi
|
|
||||||
uid: 911
|
|
||||||
group: unifi
|
|
||||||
home: /var/lib/unifi
|
|
||||||
createhome: false
|
|
||||||
system: true
|
|
||||||
state: present
|
|
||||||
tags:
|
|
||||||
- user
|
|
||||||
|
|
||||||
- name: ensure containers subuid is configured
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/subuid
|
|
||||||
create: true
|
|
||||||
line: containers:39290640:1048576
|
|
||||||
tags:
|
|
||||||
- user
|
|
||||||
- name: ensure containers subgid is configured
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/subgid
|
|
||||||
line: containers:39290640:1048576
|
|
||||||
tags:
|
|
||||||
- user
|
|
||||||
|
|
||||||
- name: ensure unifi storage path exists
|
|
||||||
file:
|
|
||||||
path: '{{ unifi_storage_path }}'
|
|
||||||
owner: unifi
|
|
||||||
group: unifi
|
|
||||||
mode: u=rwx,go=
|
|
||||||
state: directory
|
|
||||||
tags:
|
|
||||||
- datadir
|
|
||||||
|
|
||||||
- name: ensure unifi.container systemd unit exists
|
- name: ensure unifi.container systemd unit exists
|
||||||
template:
|
template:
|
||||||
src: unifi.container.j2
|
src: unifi.container.j2
|
||||||
|
|
|
@ -5,14 +5,17 @@ After=network.target
|
||||||
|
|
||||||
[Container]
|
[Container]
|
||||||
Image={{ unifi_container_image }}:{{ unifi_version }}
|
Image={{ unifi_container_image }}:{{ unifi_version }}
|
||||||
Volume={{ unifi_storage_path }}:/config:rw,Z
|
Volume=%S/%N:/var/lib/unifi:rw,U,Z
|
||||||
|
Volume=%L/%N:/var/log/unifi:rw,U,Z
|
||||||
Network=host
|
Network=host
|
||||||
NoNewPrivileges=yes
|
NoNewPrivileges=yes
|
||||||
UserNS=auto:gidmapping=911:911:1,uidmapping=911:911:1
|
ReadOnly=yes
|
||||||
VolatileTmp=yes
|
ReadOnlyTmpfs=true
|
||||||
Notify=yes
|
Notify=yes
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
StateDirectory=%N
|
||||||
|
LogsDirectory=%N
|
||||||
TimeoutStartSec=5min
|
TimeoutStartSec=5min
|
||||||
Restart=always
|
Restart=always
|
||||||
PrivateTmp=yes
|
PrivateTmp=yes
|
||||||
|
@ -23,7 +26,7 @@ ProtectProc=invisible
|
||||||
ProtectSystem=strict
|
ProtectSystem=strict
|
||||||
ReadWritePaths=/run
|
ReadWritePaths=/run
|
||||||
ReadWritePaths=/var/lib/containers/storage
|
ReadWritePaths=/var/lib/containers/storage
|
||||||
ReadWritePaths={{ unifi_storage_path }}
|
ReadWritePaths=%S/%N
|
||||||
RestrictRealtime=yes
|
RestrictRealtime=yes
|
||||||
UMask=0077
|
UMask=0077
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue