unifi/variables.yml

186 lines
5.0 KiB
YAML
Raw Normal View History

2023-08-23 23:16:59 +02:00
---
# Unifi controller has several components :
# - The controller itself (which also include the inform, the guest_portal and the stun service)
# - A small nginx proxy to expose all the various web service of unifi through a single port
# - A mongodb server (optional, can use an external mongodb)
# - A firmware downloader helper : this is because the Unifi Controller can't use an outbound web proxy
2024-01-22 21:47:02 +01:00
# The name of the nomad job
instance: unifi
2023-08-23 23:16:59 +02:00
unifi:
# This is for the web management console
2023-08-23 23:16:59 +02:00
controller:
# The driver to use (docker or podman)
2023-08-23 23:16:59 +02:00
driver: docker
2024-01-29 20:28:01 +01:00
# Version of the controller to deploy
2024-05-02 15:06:17 +02:00
version: 8.1.127
2024-01-29 20:28:01 +01:00
# The image for the controller
2024-01-29 20:28:01 +01:00
image: '[[ .docker.repo ]]unifi:[[ .unifi.controller.version ]]-1'
2024-01-22 21:47:02 +01:00
vault:
policies:
- '[[ .instance ]][[ .consul.suffix ]]'
2023-08-23 23:16:59 +02:00
# Resource allocation for the controller
2023-08-23 23:16:59 +02:00
resources:
cpu: 200
memory: 1024
2023-10-30 23:41:49 +01:00
wait_for:
- service: '[[ .unifi.controller.mongo.service_name ]]'
# Mongo instance to use
mongo:
# The address of the mongo service. Leave the default
# unless you use an external mongo service
2023-08-31 22:59:39 +02:00
address: mongodb://127.0.0.1:27017/unifi
# For stats
stats_address: mongodb://127.0.0.1:27017/unifi_stats
2023-08-31 22:43:12 +02:00
# If username is set, the password must be available in vault at [[ .env.suffix ]]/kv/service/unifi in key mongo_pwd
# user: unifi
# Service name of the mongo service. This is used to wait for mongo to be
# up before starting the controller
service_name: unifi-mongo
# Set to true if you want to use an external mongo service
is_external: False
2023-08-25 15:07:57 +02:00
# Additional environment vars to pass to the container
2023-08-23 23:16:59 +02:00
env: {}
# Public URL to reach the controller web interface
2023-08-23 23:16:59 +02:00
public_url: https://unifi.example.org
# Traefik settings
traefik:
2023-08-23 23:16:59 +02:00
# List of entrypoints where the management console will be exposed
#entrypoints:
# - https
2024-01-29 11:29:09 +01:00
middlewares:
# Tune inflight and rate-limit as the controller can require a high number of requests
inflight:
- inflightreq.amount=300
rate-limit:
- ratelimit.average=100
- ratelimit.burst=200
2023-08-23 23:16:59 +02:00
2024-01-05 15:07:43 +01:00
# Volumes
volumes:
data:
type: csi
source: unifi-data
# The inform endpoint is used by the devices to contact the controller
2023-08-23 23:16:59 +02:00
inform:
# Public URL of the inform endpoint
# Note : this MUST be http, not https
2023-08-23 23:16:59 +02:00
public_url: http://unifi-inform.example.org:8080/inform
# Traefik settings
2023-08-23 23:16:59 +02:00
traefik:
2024-01-29 11:29:09 +01:00
# Traefik router name
router: inform
# Use a custom rule for the inform service
rule: '(Path(`/inform`) && Method(`POST`)) || (PathPrefix(`/dl/firmware-cached`) && (Method(`GET`) || Method(`HEAD`)))'
# We do not want Traefik to strip the /inform prefix
strip_prefix: false
# List of entrypoints where the inform endpoint will be exposed.
2024-01-29 11:29:09 +01:00
# Note : this should be a list of dedicated entrypoint, as there's no Host header sent with the requests
# This entrypoint must also listen on port 8080
2023-08-23 23:16:59 +02:00
entrypoints:
- unifi-inform
2024-01-29 11:29:09 +01:00
# There's no need to add CSP headers here
csp: false
2024-01-29 11:29:09 +01:00
# Also, as the inform endpoint is using plain http, remove useless middlewares
# We also disable compression until Traefik stops compressing when no Accept-Encoding is sent
middlewares:
hsts: false
security: false
proto: false
compression: false
2023-08-23 23:16:59 +02:00
# The guest portal
2023-08-23 23:16:59 +02:00
guest_portal:
# Public URL where the guest portal will be reachable
2024-01-29 11:29:09 +01:00
public_url: https://unifi-portal.example.org:8843/guest
# Traefik settings
2023-08-23 23:16:59 +02:00
traefik:
2024-01-29 11:29:09 +01:00
# Name of the router
router: portal
# Do not strip prefix in the auto generated rule
strip_prefix: false
# List of entrypoints on which the service will be exposed
# Note: UniFi doesn't allow custommisation of the port, this entrypoint must be listening on port 8843
2023-08-23 23:16:59 +02:00
entrypoints:
- unifi-portal
# List of middlewares to load
2024-01-29 11:29:09 +01:00
middlewares: {}
2023-08-23 23:16:59 +02:00
# The STUN service
2023-08-23 23:16:59 +02:00
stun:
# Traefik settings
2023-08-23 23:16:59 +02:00
traefik:
2024-01-29 11:29:09 +01:00
# Stun is an UDP service
proto: udp
# Name of the router
router: stun
# List of entrypoints the STUN service wil be exposed on
# Note: This must be UDP entrypoints !
2023-08-23 23:16:59 +02:00
entrypoints:
- unifi-stun
# The nginx reverse proxy is used to expose all Unifi service over a single port
# So we don't need to run one envoy proxy per port
2023-08-23 23:16:59 +02:00
nginx:
# The image to use
2023-08-23 23:16:59 +02:00
image: nginxinc/nginx-unprivileged:alpine
# Resource allocation
2023-08-23 23:16:59 +02:00
resources:
cpu: 10
memory: 15
# MongoDB service.
# Note : this will be ignored if .unifi.controller.mongo.is_external is set to true
2023-08-23 23:16:59 +02:00
mongo:
# The image to use
2023-10-18 12:23:12 +02:00
image: '[[ .docker.repo ]][[ .docker.base_images.mongo50.image ]]'
# Resource allocation
2023-08-23 23:16:59 +02:00
resources:
cpu: 100
2023-08-24 11:08:39 +02:00
memory: 256
2024-01-05 15:07:43 +01:00
# Volumes
volumes:
mongo:
type: csi
source: unifi-mongo