├── .gitignore ├── .mdlrc ├── .github ├── autolabeler.yml ├── FUNDING.yml ├── CODEOWNERS ├── PULL_REQUEST_TEMPLATE.md ├── invite-contributors.yml ├── ISSUE_TEMPLATE.md ├── potential-duplicates.yml ├── move.yml ├── lock.yml ├── no-response.yml ├── support.yml ├── stale.yml ├── config.yml └── settings.yml ├── unifi ├── icon.png ├── logo.png ├── build.json ├── rootfs │ └── etc │ │ ├── services.d │ │ └── unifi │ │ │ ├── finish │ │ │ └── run │ │ └── cont-init.d │ │ └── unifi.sh ├── config.json ├── Dockerfile ├── .README.j2 └── DOCS.md ├── images └── screenshot.jpg ├── .editorconfig ├── .gitlab-ci.yml ├── LICENSE.md ├── CONTRIBUTING.md ├── .yamllint ├── CODE_OF_CONDUCT.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.mdlrc: -------------------------------------------------------------------------------- 1 | rules "~MD024" -------------------------------------------------------------------------------- /.github/autolabeler.yml: -------------------------------------------------------------------------------- 1 | --- 2 | "Type: Documentation": ["*.md", "*.j2"] 3 | -------------------------------------------------------------------------------- /unifi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasbedrich/addon-unifi/master/unifi/icon.png -------------------------------------------------------------------------------- /unifi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasbedrich/addon-unifi/master/unifi/logo.png -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | --- 2 | github: frenck 3 | patreon: frenck 4 | custom: https://frenck.dev/donate/ 5 | -------------------------------------------------------------------------------- /images/screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomasbedrich/addon-unifi/master/images/screenshot.jpg -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Require maintainer's :+1: for changes to the .github/ repo-config files 2 | # mainly due to https://github.com/probot/settings privilege escalation 3 | .github/* @frenck 4 | .gitlab-ci.yml @frenck 5 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Proposed Changes 2 | 3 | > (Describe the changes and rationale behind them) 4 | 5 | ## Related Issues 6 | 7 | > ([Github link][autolink-references] to related issues or pull requests) 8 | 9 | [autolink-references]: https://help.github.com/articles/autolinked-references-and-urls/ -------------------------------------------------------------------------------- /unifi/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "build_from": { 3 | "aarch64": "hassioaddons/ubuntu-base-aarch64:5.2.2", 4 | "amd64": "hassioaddons/ubuntu-base-amd64:5.2.2", 5 | "armv7": "hassioaddons/ubuntu-base-armv7:5.2.2", 6 | "i386": "hassioaddons/ubuntu-base-i386:5.2.2" 7 | }, 8 | "args": {} 9 | } 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_style = space 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | ident_size = 4 10 | 11 | [*.md] 12 | ident_size = 2 13 | trim_trailing_whitespace = false 14 | 15 | [*.json] 16 | ident_size = 2 17 | 18 | [{.gitignore,.gitkeep,.editorconfig}] 19 | ident_size = 2 20 | -------------------------------------------------------------------------------- /.github/invite-contributors.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # If true, this will add new contributors as outside collaborators 3 | # to the repo their PR was merged in. Team name is ignored if this 4 | # flag is set to true. 5 | isOutside: false 6 | 7 | # Specify team name to add new contributors to a specific team 8 | # within your organization. 9 | # Use team name or team-name-slug 10 | team: Contributors 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Problem/Motivation 2 | 3 | > (Why the issue was filed) 4 | 5 | ## Expected behavior 6 | 7 | > (What you expected to happen) 8 | 9 | ## Actual behavior 10 | 11 | > (What actually happened) 12 | 13 | ## Steps to reproduce 14 | 15 | > (How can someone else make/see it happen) 16 | 17 | ## Proposed changes 18 | 19 | > (If you have a proposed change, workaround or fix, 20 | > describe the rationale behind it) 21 | -------------------------------------------------------------------------------- /unifi/rootfs/etc/services.d/unifi/finish: -------------------------------------------------------------------------------- 1 | #!/usr/bin/execlineb -S0 2 | # ============================================================================== 3 | # Home Assistant Community Add-on: UniFi Controller 4 | # Take down the S6 supervision tree when UniFi Controller fails 5 | # ============================================================================== 6 | if -n { s6-test $# -ne 0 } 7 | if -n { s6-test ${1} -eq 256 } 8 | 9 | s6-svscanctl -t /var/run/s6/services 10 | -------------------------------------------------------------------------------- /.github/potential-duplicates.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Label name and color to set, when potential duplicates are detected 3 | issueLabel: "Potential duplicate" 4 | labelColor: e6e6e6 5 | 6 | # If similarity is higher than this threshold, issue will be marked as duplicate 7 | threshold: 0.70 8 | 9 | # Comment to post when potential duplicates are detected 10 | referenceComment: > 11 | Potential duplicates found: 12 | {{#issues}} 13 | - [#{{ number }}] {{ title }} ({{ accuracy }}%) 14 | {{/issues}} 15 | -------------------------------------------------------------------------------- /.github/move.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Delete the command comment when it contains no other content 3 | deleteCommand: true 4 | 5 | # Close the source issue after moving 6 | closeSourceIssue: true 7 | 8 | # Lock the source issue after moving 9 | lockSourceIssue: true 10 | 11 | # Mention issue and comment authors 12 | mentionAuthors: true 13 | 14 | # Preserve mentions in the issue content 15 | keepContentMentions: false 16 | 17 | # Set custom aliases for targets 18 | # aliases: 19 | # r: repo 20 | # or: owner/repo 21 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | include: https://raw.githubusercontent.com/hassio-addons/organization/master/gitlabci/addon.yml 3 | 4 | variables: 5 | ADDON_GITHUB_REPO: "hassio-addons/addon-unifi" 6 | ADDON_SLUG: "unifi" 7 | ADDON_TARGET: "unifi" 8 | 9 | ADDON_ARMHF: "false" 10 | 11 | ADDON_AARCH64_BASE: "hassioaddons/ubuntu-base-aarch64:5.2.2" 12 | ADDON_AMD64_BASE: "hassioaddons/ubuntu-base-amd64:5.2.2" 13 | ADDON_ARMV7_BASE: "hassioaddons/ubuntu-base-armv7:5.2.2" 14 | ADDON_I386_BASE: "hassioaddons/ubuntu-base-i386:5.2.2" 15 | -------------------------------------------------------------------------------- /.github/lock.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Configuration for lock-threads - https://github.com/dessant/lock-threads 3 | # Number of days of inactivity before a closed issue or pull request is locked 4 | daysUntilLock: 30 5 | 6 | # Comment to post before locking. Set to `false` to disable 7 | lockComment: > 8 | This thread has been automatically locked because it has not had recent 9 | activity. Please open a new issue for related bugs and link to relevant 10 | comments in this thread. 11 | 12 | # Issues or pull requests with these labels will not be locked 13 | # exemptLabels: 14 | # - no-locking 15 | 16 | # Limit to only `issues` or `pulls` 17 | # only: issues 18 | 19 | # Add a label when locking. Set to `false` to disable 20 | lockLabel: false 21 | -------------------------------------------------------------------------------- /.github/no-response.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Configuration for probot-no-response - https://github.com/probot/no-response 3 | # Number of days of inactivity before an Issue is closed for lack of response 4 | daysUntilClose: 14 5 | # Label requiring a response 6 | responseRequiredLabel: "Status: Awaiting response" 7 | # Comment to post when closing an Issue for lack of response. Set to `false` to disable 8 | closeComment: > 9 | This issue has been automatically closed because there has been no response 10 | to our request for more information from the original author. With only the 11 | information that is currently in the issue, we don't have enough information 12 | to take action. Please reach out if you have or find the answers we need so 13 | that we can investigate further. 14 | -------------------------------------------------------------------------------- /unifi/rootfs/etc/services.d/unifi/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bashio 2 | # ============================================================================== 3 | # Home Assistant Community Add-on: UniFi Controller 4 | # Runs the UniFi Controller 5 | # ============================================================================== 6 | declare -a options 7 | declare xmx 8 | declare xms 9 | 10 | bashio::log.info 'Starting the UniFi Controller...' 11 | 12 | xmx=1024 13 | if bashio::config.has_value 'memory_max'; then 14 | xmx=$(bashio::config 'memory_max') 15 | fi 16 | 17 | xms=512 18 | if bashio::config.has_value 'memory_init'; then 19 | xms=$(bashio::config 'memory_init') 20 | fi 21 | 22 | options+=("-Xmx${xmx}m") 23 | options+=("-Xms${xms}m") 24 | options+=(-jar /usr/lib/unifi/lib/ace.jar) 25 | options+=(start) 26 | 27 | # Run UniFi 28 | exec /usr/bin/java "${options[@]}" 29 | -------------------------------------------------------------------------------- /.github/support.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Configuration for support-requests - https://github.com/dessant/support-requests 3 | 4 | # Label used to mark issues as support requests 5 | supportLabel: "Type: Support" 6 | 7 | # Comment to post on issues marked as support requests. Add a link 8 | # to a support page, or set to `false` to disable 9 | supportComment: > 10 | :wave: We use the issue tracker exclusively for bug reports and feature requests. 11 | However, this issue appears to be a support request. Please use our 12 | support channels to get help with the project. 13 | 14 | Head over to the 15 | [Home Assistant community forum](https://community.home-assistant.io/t/home-assistant-community-add-on-unifi-controller/56297?u=frenck) 16 | or join our [Discord](https://discord.me/hassioaddons) chat. 17 | 18 | # Close issues marked as support requests 19 | close: true 20 | 21 | # Lock issues marked as support requests 22 | lock: false 23 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2018-2020 Franck Nijhof 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | When contributing to this repository, please first discuss the change you wish 4 | to make via issue, email, or any other method with the owners of this repository 5 | before making a change. 6 | 7 | Please note we have a code of conduct, please follow it in all your interactions 8 | with the project. 9 | 10 | ## Issues and feature requests 11 | 12 | You've found a bug in the source code, a mistake in the documentation or maybe 13 | you'd like a new feature? You can help us by submitting an issue to our 14 | [GitHub Repository][github]. Before you create an issue, make sure you search 15 | the archive, maybe your question was already answered. 16 | 17 | Even better: You could submit a pull request with a fix / new feature! 18 | 19 | ## Pull request process 20 | 21 | 1. Search our repository for open or closed [pull requests][prs] that relates 22 | to your submission. You don't want to duplicate effort. 23 | 24 | 1. You may merge the pull request in once you have the sign-off of two other 25 | developers, or if you do not have permission to do that, you may request 26 | the second reviewer to merge it for you. 27 | 28 | [github]: https://github.com/hassio-addons/addon-unifi/issues 29 | [prs]: https://github.com/hassio-addons/addon-unifi/pulls 30 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | rules: 3 | braces: 4 | level: error 5 | min-spaces-inside: 0 6 | max-spaces-inside: 1 7 | min-spaces-inside-empty: -1 8 | max-spaces-inside-empty: -1 9 | brackets: 10 | level: error 11 | min-spaces-inside: 0 12 | max-spaces-inside: 0 13 | min-spaces-inside-empty: -1 14 | max-spaces-inside-empty: -1 15 | colons: 16 | level: error 17 | max-spaces-before: 0 18 | max-spaces-after: 1 19 | commas: 20 | level: error 21 | max-spaces-before: 0 22 | min-spaces-after: 1 23 | max-spaces-after: 1 24 | comments: 25 | level: error 26 | require-starting-space: true 27 | min-spaces-from-content: 2 28 | comments-indentation: 29 | level: error 30 | document-end: 31 | level: error 32 | present: false 33 | document-start: 34 | level: error 35 | present: true 36 | empty-lines: 37 | level: error 38 | max: 1 39 | max-start: 0 40 | max-end: 1 41 | hyphens: 42 | level: error 43 | max-spaces-after: 1 44 | indentation: 45 | level: error 46 | spaces: 2 47 | indent-sequences: true 48 | check-multi-line-strings: false 49 | key-duplicates: 50 | level: error 51 | line-length: 52 | ignore: | 53 | .github/support.yml 54 | level: warning 55 | max: 120 56 | allow-non-breakable-words: true 57 | allow-non-breakable-inline-mappings: true 58 | new-line-at-end-of-file: 59 | level: error 60 | new-lines: 61 | level: error 62 | type: unix 63 | trailing-spaces: 64 | level: error 65 | truthy: 66 | level: error 67 | -------------------------------------------------------------------------------- /unifi/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "UniFi Controller", 3 | "version": "dev", 4 | "slug": "unifi", 5 | "description": "Manage your UniFi network using a web browser", 6 | "url": "https://github.com/hassio-addons/addon-unifi", 7 | "webui": "https://[HOST]:[PORT:8443]", 8 | "startup": "services", 9 | "arch": ["aarch64", "amd64", "armv7", "i386"], 10 | "init": false, 11 | "map": ["backup:rw", "ssl"], 12 | "boot": "auto", 13 | "ports": { 14 | "161/udp": null, 15 | "1900/udp": null, 16 | "3478/udp": 3478, 17 | "5514/udp": 5514, 18 | "6789/tcp": 6789, 19 | "8080/tcp": 8080, 20 | "8443/tcp": 8443, 21 | "8843/tcp": 8843, 22 | "8880/tcp": 8880, 23 | "10001/udp": 10001 24 | }, 25 | "ports_description": { 26 | "161/udp": "Used for SNMP Access", 27 | "1900/udp": "L2 discoverable port", 28 | "3478/udp": "Used for STUN", 29 | "5514/udp": "Used for remote syslog debugging", 30 | "6789/tcp": "Used for UniFi mobile speed test", 31 | "8080/tcp": "Used for device and controller communication", 32 | "8443/tcp": "Used for controller web interface and API", 33 | "8843/tcp": "Used for HTTPS portal redirection", 34 | "8880/tcp": "Used for HTTP portal redirection", 35 | "10001/udp": "Used for device discovery" 36 | }, 37 | "hassio_api": true, 38 | "hassio_role": "default", 39 | "options": { 40 | "ssl": true, 41 | "certfile": "fullchain.pem", 42 | "keyfile": "privkey.pem" 43 | }, 44 | "schema": { 45 | "log_level": "list(trace|debug|info|notice|warning|error|fatal)?", 46 | "ssl": "bool", 47 | "certfile": "str", 48 | "keyfile": "str", 49 | "memory_max": "int?", 50 | "memory_init": "int?" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Configuration for probot-stale - https://github.com/probot/stale 3 | 4 | # Number of days of inactivity before an Issue or Pull Request becomes stale 5 | daysUntilStale: 60 6 | 7 | # Number of days of inactivity before a stale Issue or Pull Request is closed. 8 | # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. 9 | daysUntilClose: 7 10 | 11 | # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable 12 | exemptLabels: 13 | - "Status: On hold" 14 | - "Status: In progress" 15 | - "Status: Awaiting response" 16 | - "Status: Blocked" 17 | - "Idea" 18 | - "Security" 19 | 20 | # Set to true to ignore issues in a project (defaults to false) 21 | exemptProjects: false 22 | 23 | # Set to true to ignore issues in a milestone (defaults to false) 24 | exemptMilestones: false 25 | 26 | # Label to use when marking as stale 27 | staleLabel: "Status: Stale" 28 | 29 | # Comment to post when marking as stale. Set to `false` to disable 30 | markComment: > 31 | This issue has been automatically marked as stale because it has not had 32 | recent activity. It will be closed if no further activity occurs. Thank you 33 | for your contributions. 34 | 35 | # Comment to post when removing the stale label. 36 | # unmarkComment: > 37 | # Your comment here. 38 | unmarkComment: false 39 | 40 | # Comment to post when closing a stale Issue or Pull Request. 41 | # closeComment: > 42 | # Your comment here. 43 | closeComment: false 44 | 45 | # Limit the number of actions per hour, from 1-30. Default is 30 46 | limitPerRun: 30 47 | 48 | # Limit to only `issues` or `pulls` 49 | only: issues 50 | 51 | # Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': 52 | # pulls: 53 | # daysUntilStale: 30 54 | # markComment: > 55 | # This pull request has been automatically marked as stale because it has not had 56 | # recent activity. It will be closed if no further activity occurs. Thank you 57 | # for your contributions. 58 | 59 | # issues: 60 | # exemptLabels: 61 | # - confirmed 62 | -------------------------------------------------------------------------------- /.github/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Configuration for request-info - https://github.com/behaviorbot/request-info 3 | 4 | # *OPTIONAL* Comment to reply with 5 | # Can be either a string : 6 | requestInfoReplyComment: 7 | - "We would appreciate it if you could provide us with more info about this issue/pr!" 8 | - "Hmmm... That issue/PR is kinda low on text. Could you please provide some more content?" 9 | 10 | # *OPTIONAL* default titles to check against for lack of descriptiveness 11 | # MUST BE ALL LOWERCASE 12 | requestInfoDefaultTitles: [] 13 | 14 | # *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given 15 | requestInfoLabelToAdd: "Incomplete" 16 | 17 | # *OPTIONAL* Require Pull Requests to contain more information than what is provided in the PR template 18 | # Will fail if the pull request's body is equal to the provided template 19 | checkPullRequestTemplate: true 20 | 21 | # *OPTIONAL* Only warn about insufficient information on these events type 22 | # Keys must be lowercase. Valid values are 'issue' and 'pullRequest' 23 | requestInfoOn: 24 | pullRequest: true 25 | issue: true 26 | 27 | # *OPTIONAL* Add a list of people whose Issues/PRs will not be commented on 28 | # keys must be GitHub usernames 29 | requestInfoUserstoExclude: [] 30 | 31 | # Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome 32 | 33 | # Comment to be posted to on first time issues 34 | newIssueWelcomeComment: > 35 | :wave: Thanks for opening your first issue here! 36 | If you're reporting a :bug: bug, please make sure you include steps to reproduce it. 37 | Also, logs, error messages and information about your hardware might be useful. 38 | 39 | # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome 40 | 41 | # Comment to be posted to on PRs from first time contributors in your repository 42 | newPRWelcomeComment: > 43 | :sparkling_heart: Thanks for opening this pull request! :sparkling_heart: 44 | If your PR gets accepted and merged in, we will invite you to the project :tada: 45 | 46 | # Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge 47 | 48 | # Comment to be posted to on pull requests merged by a first time user 49 | firstPRMergeComment: > 50 | Congrats on merging your first pull request! :tada::tada::tada: 51 | -------------------------------------------------------------------------------- /unifi/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BUILD_FROM=hassioaddons/ubuntu-base:5.2.2 2 | # hadolint ignore=DL3006 3 | FROM ${BUILD_FROM} 4 | 5 | # Set shell 6 | SHELL ["/bin/bash", "-o", "pipefail", "-c"] 7 | 8 | # Setup base system 9 | ARG BUILD_ARCH=amd64 10 | RUN \ 11 | URL="http://archive.ubuntu.com/ubuntu/" \ 12 | && if [ "${BUILD_ARCH}" = "armv7" ] \ 13 | || [ "${BUILD_ARCH}" = "aarch64" ]; then \ 14 | URL="http://ports.ubuntu.com/ubuntu-ports/"; \ 15 | fi \ 16 | && echo "deb ${URL} xenial universe" \ 17 | > /etc/apt/sources.list.d/xenial-universe.list \ 18 | \ 19 | && echo "deb ${URL} xenial main" \ 20 | > /etc/apt/sources.list.d/xenial-main.list \ 21 | \ 22 | && apt-get update \ 23 | \ 24 | && apt-get install -y --no-install-recommends \ 25 | binutils=2.30-21ubuntu1~18.04.4 \ 26 | jsvc=1.0.15-8 \ 27 | libcap2=1:2.25-1.2 \ 28 | logrotate=3.11.0-0.1ubuntu1 \ 29 | mongodb-server=1:2.6.10-0ubuntu1 \ 30 | openjdk-8-jdk-headless=8u275-b01-0ubuntu1~18.04 \ 31 | \ 32 | && curl -J -L -o /tmp/unifi.deb \ 33 | "https://dl.ui.com/unifi/6.0.43/unifi_sysvinit_all.deb" \ 34 | \ 35 | && dpkg --install /tmp/unifi.deb \ 36 | \ 37 | && rm -fr \ 38 | /tmp/* \ 39 | /root/.gnupg \ 40 | /var/{cache,log}/* \ 41 | /var/lib/apt/lists/* 42 | 43 | # Copy root filesystem 44 | COPY rootfs / 45 | 46 | # Build arguments 47 | ARG BUILD_DATE 48 | ARG BUILD_REF 49 | ARG BUILD_VERSION 50 | 51 | # Labels 52 | LABEL \ 53 | io.hass.name="UniFi Controller" \ 54 | io.hass.description="Manage your UniFi network using a web browser" \ 55 | io.hass.arch="${BUILD_ARCH}" \ 56 | io.hass.type="addon" \ 57 | io.hass.version=${BUILD_VERSION} \ 58 | maintainer="Franck Nijhof " \ 59 | org.opencontainers.image.title="UniFi Controller" \ 60 | org.opencontainers.image.description="Manage your UniFi network using a web browser" \ 61 | org.opencontainers.image.vendor="Home Assistant Community Add-ons" \ 62 | org.opencontainers.image.authors="Franck Nijhof " \ 63 | org.opencontainers.image.licenses="MIT" \ 64 | org.opencontainers.image.url="https://addons.community" \ 65 | org.opencontainers.image.source="https://github.com/hassio-addons/addon-unifi" \ 66 | org.opencontainers.image.documentation="https://github.com/hassio-addons/addon-unifi/blob/master/README.md" \ 67 | org.opencontainers.image.created=${BUILD_DATE} \ 68 | org.opencontainers.image.revision=${BUILD_REF} \ 69 | org.opencontainers.image.version=${BUILD_VERSION} 70 | -------------------------------------------------------------------------------- /unifi/.README.j2: -------------------------------------------------------------------------------- 1 | # Home Assistant Community Add-on: UniFi Controller 2 | 3 | [![Release][release-shield]][release] ![Project Stage][project-stage-shield] ![Project Maintenance][maintenance-shield] 4 | 5 | [![Discord][discord-shield]][discord] [![Community Forum][forum-shield]][forum] 6 | 7 | [![Sponsor Frenck via GitHub Sponsors][github-sponsors-shield]][github-sponsors] 8 | 9 | [![Support Frenck on Patreon][patreon-shield]][patreon] 10 | 11 | The UniFi Controller allows you to manage your UniFi network 12 | using a web browser. 13 | 14 | ## About 15 | 16 | This add-on runs Ubiquiti Networks' UniFi Controller software, which allows 17 | you to manage your UniFi network via the web browser. The add-on provides a 18 | single-click installation and run solution for Home Assistant, allowing users 19 | to get their network up, running, and updated, easily. 20 | 21 | This add-on supports all Home Assistant supported architectures, including the 22 | Raspberry Pi. 23 | 24 | ![UniFi Controller][screenshot] 25 | 26 | {% if channel == "edge" %} 27 | ## WARNING! THIS IS AN EDGE VERSION! 28 | 29 | This Home Assistant Add-ons repository contains edge builds of add-ons. 30 | Edge builds add-ons are based upon the latest development version. 31 | 32 | - They may not work at all. 33 | - They might stop working at any time. 34 | - They could have a negative impact on your system. 35 | 36 | This repository was created for: 37 | 38 | - Anybody willing to test. 39 | - Anybody interested in trying out upcoming add-ons or add-on features. 40 | - Developers. 41 | 42 | If you are more interested in stable releases of our add-ons: 43 | 44 | 45 | 46 | {% endif %} 47 | {% if channel == "beta" %} 48 | ## WARNING! THIS IS A BETA VERSION! 49 | 50 | This Home Assistant Add-ons repository contains beta releases of add-ons. 51 | 52 | - They might stop working at any time. 53 | - They could have a negative impact on your system. 54 | 55 | This repository was created for: 56 | 57 | - Anybody willing to test. 58 | - Anybody interested in trying out upcoming add-ons or add-on features. 59 | 60 | If you are more interested in stable releases of our add-ons: 61 | 62 | 63 | 64 | {% endif %} 65 | 66 | [discord-shield]: https://img.shields.io/discord/478094546522079232.svg 67 | [discord]: https://discord.me/hassioaddons 68 | [forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg 69 | [forum]: https://community.home-assistant.io/t/home-assistant-community-add-on-unifi-controller/56297?u=frenck 70 | [github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png 71 | [github-sponsors]: https://github.com/sponsors/frenck 72 | [maintenance-shield]: https://img.shields.io/maintenance/yes/2020.svg 73 | [patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png 74 | [patreon]: https://www.patreon.com/frenck 75 | [project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg 76 | [release-shield]: https://img.shields.io/badge/version-{{ version }}-blue.svg 77 | [release]: {{ repo }}/tree/{{ version }} 78 | [screenshot]: https://github.com/hassio-addons/addon-unifi/raw/master/images/screenshot.jpg 79 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of conduct 2 | 3 | ## Our pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | - Using welcoming and inclusive language 18 | - Being respectful of differing viewpoints and experiences 19 | - Gracefully accepting constructive criticism 20 | - Focusing on what is best for the community 21 | - Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | - The use of sexualized language or imagery and unwelcome sexual attention 26 | or advances 27 | - Trolling, insulting/derogatory comments, and personal or political attacks 28 | - Public or private harassment 29 | - Publishing others' private information, such as a physical or 30 | electronic address, without explicit permission 31 | - Other conduct which could reasonably be considered inappropriate 32 | in a professional setting 33 | 34 | ## Our responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project lead at frenck@addons.community. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project lead is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 71 | version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 72 | 73 | [homepage]: http://contributor-covenant.org 74 | [version]: http://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /unifi/rootfs/etc/cont-init.d/unifi.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/with-contenv bashio 2 | # ============================================================================== 3 | # Home Assistant Community Add-on: UniFi Controller 4 | # Configures the UniFi Controller 5 | # ============================================================================== 6 | readonly KEYSTORE="/usr/lib/unifi/data/keystore" 7 | readonly properties="/data/unifi/data/system.properties" 8 | declare certfile 9 | declare keyfile 10 | declare tempcert 11 | 12 | bashio::config.require.ssl 13 | 14 | # Ensures the data of the UniFi controller is store outside the container 15 | if ! bashio::fs.directory_exists '/data/unifi/data'; then 16 | mkdir -p /data/unifi/data 17 | fi 18 | rm -fr /usr/lib/unifi/data 19 | ln -s /data/unifi/data /usr/lib/unifi/data 20 | 21 | if ! bashio::fs.directory_exists '/backup/unifi'; then 22 | mkdir -p /backup/unifi 23 | fi 24 | rm -fr /usr/lib/unifi/data/backup 25 | ln -s /backup/unifi /usr/lib/unifi/data/backup 26 | 27 | # Enable small files on MongoDB 28 | if ! bashio::fs.file_exists "${properties}"; then 29 | touch "${properties}" 30 | echo "unifi.db.extraargs=--smallfiles" > "${properties}" 31 | fi 32 | 33 | #shellcheck disable=SC2016 34 | sed -i \ 35 | '/^unifi.db.extraargs=/{h;s/=.*/=--smallfiles/};${x;/^$/{s//unifi.db.extraargs=--smallfiles/;H};x}' \ 36 | "${properties}" 37 | 38 | # Identrust cross-signed CA cert needed by the java keystore for import. 39 | # Can get original here: https://www.identrust.com/certificates/trustid/root-download-x3.html 40 | readonly ROOT_CHAIN=$(cat <<-END 41 | -----BEGIN CERTIFICATE----- 42 | MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ 43 | MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT 44 | DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow 45 | PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD 46 | Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB 47 | AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O 48 | rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq 49 | OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b 50 | xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw 51 | 7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD 52 | aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV 53 | HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG 54 | SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 55 | ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr 56 | AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz 57 | R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 58 | JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo 59 | Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ 60 | -----END CERTIFICATE----- 61 | END 62 | ) 63 | 64 | # Stop running this script if SSL is disabled 65 | if bashio::config.false 'ssl'; then 66 | exit 0 67 | fi 68 | 69 | # Initialize keystore, in case it does not exist yet 70 | if ! bashio::fs.file_exists "${KEYSTORE}"; then 71 | bashio::log.debug 'Intializing keystore...' 72 | keytool \ 73 | -genkey \ 74 | -keyalg RSA \ 75 | -alias unifi \ 76 | -keystore "${KEYSTORE}" \ 77 | -storepass aircontrolenterprise \ 78 | -keypass aircontrolenterprise \ 79 | -validity 1825 \ 80 | -keysize 4096 \ 81 | -dname "cn=UniFi" || \ 82 | bashio::exit.nok "Failed creating UniFi keystore" 83 | fi 84 | 85 | bashio::log.debug 'Injecting SSL certificate into the controller...' 86 | 87 | certfile="/ssl/$(bashio::config 'certfile')" 88 | keyfile="/ssl/$(bashio::config 'keyfile')" 89 | tempcert=$(mktemp) 90 | 91 | # Adds Identrust cross-signed CA cert in case of letsencrypt 92 | if [[ $(openssl x509 -noout -ocsp_uri -in "${certfile}") == *"letsencrypt"* ]]; then 93 | echo "${ROOT_CHAIN}" > "${tempcert}" 94 | cat "${certfile}" >> "${tempcert}" 95 | else 96 | cat "${certfile}" > "${tempcert}" 97 | fi 98 | 99 | bashio::log.debug 'Preparing certificate in a format UniFi accepts...' 100 | openssl pkcs12 \ 101 | -export \ 102 | -passout pass:aircontrolenterprise \ 103 | -in "${tempcert}" \ 104 | -inkey "${keyfile}" \ 105 | -out "${tempcert}" \ 106 | -name unifi 107 | 108 | bashio::log.debug 'Removing existing certificate from UniFi protected keystore...' 109 | keytool \ 110 | -delete \ 111 | -alias unifi \ 112 | -keystore "${KEYSTORE}" \ 113 | -deststorepass aircontrolenterprise 114 | 115 | bashio::log.debug 'Inserting certificate into UniFi keystore...' 116 | keytool \ 117 | -trustcacerts \ 118 | -importkeystore \ 119 | -deststorepass aircontrolenterprise \ 120 | -destkeypass aircontrolenterprise \ 121 | -destkeystore "${KEYSTORE}" \ 122 | -srckeystore "${tempcert}" \ 123 | -srcstoretype PKCS12 \ 124 | -srcstorepass aircontrolenterprise \ 125 | -alias unifi 126 | 127 | # Cleanup 128 | rm -f "${tempcert}" 129 | -------------------------------------------------------------------------------- /.github/settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | repository: 3 | description: "UniFi Controller - Home Assistant Community Add-ons" 4 | homepage: https://addons.community 5 | topics: unifi, unifi-controller, ubiquiti, addon, addons, home-assistant, homeassistant 6 | private: false 7 | has_issues: true 8 | has_projects: false 9 | has_wiki: false 10 | has_downloads: false 11 | default_branch: master 12 | allow_squash_merge: true 13 | allow_merge_commit: false 14 | allow_rebase_merge: true 15 | labels: 16 | # Priority labels 17 | - name: "Priority: Critical" 18 | color: ee0701 19 | description: "This should be dealt with ASAP. Not fixing this issue would be a serious error." 20 | - name: "Priority: High" 21 | color: b60205 22 | description: "After critical issues are fixed, these should be dealt with before any further issues." 23 | - name: "Priority: Medium" 24 | color: 0e8a16 25 | description: "This issue may be useful, and needs some attention." 26 | - name: "Priority: Low" 27 | color: e4ea8a 28 | description: "Nice addition, maybe... someday..." 29 | 30 | # Type labels 31 | - name: "Type: Bug" 32 | color: ee0701 33 | description: "Inconsistencies or issues which will cause a problem for users or implementors." 34 | - name: "Type: Documentation" 35 | color: 0052cc 36 | description: "Solely about the documentation of the project." 37 | - name: "Type: Enhancement" 38 | color: 1d76db 39 | description: "Enhancement of the code, not introducing new features." 40 | - name: "Type: Feature" 41 | color: 0e8a16 42 | description: "New features or options." 43 | - name: "Type: Support" 44 | color: 5319e7 45 | description: "Marks an issue as a support ticket." 46 | - name: "Type: Discussion" 47 | color: d4c5f9 48 | description: "Marks an issue as a generic discussion ticket." 49 | - name: "Type: Maintenance" 50 | color: 2af79e 51 | description: "Generic maintenance tasks, e.g., package updates." 52 | 53 | # Additional markers 54 | - name: "Security" 55 | color: ee0701 56 | description: "Marks a security issue that needs to be resolved asap." 57 | - name: "Idea" 58 | color: fef2c0 59 | description: "Marks an idea, which might be excepted and implemented." 60 | - name: "Incomplete" 61 | color: fef2c0 62 | description: "Marks a PR or issue that is missing information." 63 | - name: "Pull request" 64 | color: fbca04 65 | description: "There is an PR opened for this issue." 66 | - name: "Accepted" 67 | color: c2e0c6 68 | description: "This issue or PR has been accepted." 69 | - name: "Declined" 70 | color: f9d0c4 71 | description: "This issue or PR has been declined." 72 | - name: "Potential duplicate" 73 | color: e6e6e6 74 | description: "This issue has been automatically marked as a potential duplicate." 75 | 76 | # Ongoing Status labels 77 | - name: "Status: Triage" 78 | color: fbca04 79 | description: "This issue needs to be triaged." 80 | - name: "Status: On hold" 81 | color: cccccc 82 | description: "Issue or PR that has been placed on hold for now." 83 | - name: "Status: In progress" 84 | color: fbca04 85 | description: "Issue is currently being resolved by a developer." 86 | - name: "Status: Stale" 87 | color: fef2c0 88 | description: "There has not been activity on this issue or PR for quite some time." 89 | - name: "Status: Awaiting response" 90 | color: fef2c0 91 | description: "Issue or PR awaits response from the creator." 92 | - name: "Status: Blocked" 93 | color: fef2c0 94 | description: "Progress on this issue is currently not possible." 95 | 96 | # Closing status labels 97 | - name: "Closed: Known limitation" 98 | color: e6e6e6 99 | description: "Issue is closed, it is a known limitation." 100 | - name: "Closed: Expected behavior" 101 | color: e6e6e6 102 | description: "Issues is closed, it is expected behavior." 103 | - name: "Closed: Duplicate" 104 | color: e6e6e6 105 | description: "Issue is closed, duplicate of an existing issue." 106 | - name: "Closed: Invalid" 107 | color: e6e6e6 108 | description: "Issue is closed, marked as not a valid issue (e.g., an user error)." 109 | - name: "Closed: Wrong repository" 110 | color: e6e6e6 111 | description: "Issue is closed, was created in the wrong repository." 112 | - name: "Closed: Won't Fix" 113 | color: e6e6e6 114 | description: "Issue is closed, it won't be fixed." 115 | - name: "Closed: Done" 116 | color: c2e0c6 117 | description: "Issue closed, work on this issue has been marked complete." 118 | 119 | # Others 120 | - name: "Beginner Friendly" 121 | color: 0e8a16 122 | description: "Good first issue for people wanting to contribute to the project." 123 | - name: "Help wanted" 124 | color: 0e8a16 125 | description: "We need some extra helping hands or expertise in order to resolve this." 126 | - name: "Hacktoberfest" 127 | description: "Issues/PRs are participating in the Hacktoberfest" 128 | color: fbca04 129 | 130 | branches: 131 | - name: master 132 | protection: 133 | required_pull_request_reviews: 134 | # required_approving_review_count: 1 135 | dismiss_stale_reviews: true 136 | require_code_owner_reviews: true 137 | dismissal_restrictions: 138 | users: [] 139 | teams: 140 | - Admins 141 | - Masters 142 | required_status_checks: 143 | strict: false 144 | contexts: [] 145 | enforce_admins: false 146 | restrictions: 147 | users: [] 148 | teams: 149 | - Admins 150 | - Masters 151 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Home Assistant Community Add-on: UniFi Controller 2 | 3 | [![GitHub Release][releases-shield]][releases] 4 | ![Project Stage][project-stage-shield] 5 | [![License][license-shield]](LICENSE.md) 6 | 7 | ![Supports aarch64 Architecture][aarch64-shield] 8 | ![Supports amd64 Architecture][amd64-shield] 9 | ![Supports armhf Architecture][armhf-shield] 10 | ![Supports armv7 Architecture][armv7-shield] 11 | ![Supports i386 Architecture][i386-shield] 12 | 13 | [![GitLab CI][gitlabci-shield]][gitlabci] 14 | ![Project Maintenance][maintenance-shield] 15 | [![GitHub Activity][commits-shield]][commits] 16 | 17 | [![Discord][discord-shield]][discord] 18 | [![Community Forum][forum-shield]][forum] 19 | 20 | [![Sponsor Frenck via GitHub Sponsors][github-sponsors-shield]][github-sponsors] 21 | 22 | [![Support Frenck on Patreon][patreon-shield]][patreon] 23 | 24 | The UniFi Controller allows you to manage your UniFi network 25 | using a web browser. 26 | 27 | ![The UniFi Controller add-on](images/screenshot.jpg) 28 | 29 | ## About 30 | 31 | This add-on runs Ubiquiti Networks' UniFi Controller software, which allows 32 | you to manage your UniFi network via the web browser. The add-on provides a 33 | single-click installation and run solution for Home Assistant, allowing users 34 | to get their network up, running, and updated, easily. 35 | 36 | This add-on supports all Home Assistant supported architectures, including the 37 | Raspberry Pi. 38 | 39 | [:books: Read the full add-on documentation][docs] 40 | 41 | ## Support 42 | 43 | Got questions? 44 | 45 | You have several options to get them answered: 46 | 47 | - The [Home Assistant Community Add-ons Discord chat server][discord] for add-on 48 | support and feature requests. 49 | - The [Home Assistant Discord chat server][discord-ha] for general Home 50 | Assistant discussions and questions. 51 | - The Home Assistant [Community Forum][forum]. 52 | - Join the [Reddit subreddit][reddit] in [/r/homeassistant][reddit] 53 | 54 | You could also [open an issue here][issue] GitHub. 55 | 56 | ## Contributing 57 | 58 | This is an active open-source project. We are always open to people who want to 59 | use the code or contribute to it. 60 | 61 | We have set up a separate document containing our 62 | [contribution guidelines](CONTRIBUTING.md). 63 | 64 | Thank you for being involved! :heart_eyes: 65 | 66 | ## Authors & contributors 67 | 68 | The original setup of this repository is by [Franck Nijhof][frenck]. 69 | 70 | For a full list of all authors and contributors, 71 | check [the contributor's page][contributors]. 72 | 73 | ## We have got some Home Assistant add-ons for you 74 | 75 | Want some more functionality to your Home Assistant instance? 76 | 77 | We have created multiple add-ons for Home Assistant. For a full list, check out 78 | our [GitHub Repository][repository]. 79 | 80 | ## License 81 | 82 | MIT License 83 | 84 | Copyright (c) 2018-2020 Franck Nijhof 85 | 86 | Permission is hereby granted, free of charge, to any person obtaining a copy 87 | of this software and associated documentation files (the "Software"), to deal 88 | in the Software without restriction, including without limitation the rights 89 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 90 | copies of the Software, and to permit persons to whom the Software is 91 | furnished to do so, subject to the following conditions: 92 | 93 | The above copyright notice and this permission notice shall be included in all 94 | copies or substantial portions of the Software. 95 | 96 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 97 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 98 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 99 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 100 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 101 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 102 | SOFTWARE. 103 | 104 | [aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg 105 | [amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg 106 | [armhf-shield]: https://img.shields.io/badge/armhf-no-red.svg 107 | [armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg 108 | [commits-shield]: https://img.shields.io/github/commit-activity/y/hassio-addons/addon-unifi.svg 109 | [commits]: https://github.com/hassio-addons/addon-unifi/commits/master 110 | [contributors]: https://github.com/hassio-addons/addon-unifi/graphs/contributors 111 | [discord-ha]: https://discord.gg/c5DvZ4e 112 | [discord-shield]: https://img.shields.io/discord/478094546522079232.svg 113 | [discord]: https://discord.me/hassioaddons 114 | [docs]: https://github.com/hassio-addons/addon-unifi/blob/master/unifi/DOCS.md 115 | [forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg 116 | [forum]: https://community.home-assistant.io/t/home-assistant-community-add-on-unifi-controller/56297?u=frenck 117 | [frenck]: https://github.com/frenck 118 | [github-sponsors-shield]: https://frenck.dev/wp-content/uploads/2019/12/github_sponsor.png 119 | [github-sponsors]: https://github.com/sponsors/frenck 120 | [gitlabci-shield]: https://gitlab.com/hassio-addons/addon-unifi/badges/master/pipeline.svg 121 | [gitlabci]: https://gitlab.com/hassio-addons/addon-unifi/pipelines 122 | [i386-shield]: https://img.shields.io/badge/i386-yes-green.svg 123 | [issue]: https://github.com/hassio-addons/addon-unifi/issues 124 | [license-shield]: https://img.shields.io/github/license/hassio-addons/addon-unifi.svg 125 | [maintenance-shield]: https://img.shields.io/maintenance/yes/2020.svg 126 | [patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png 127 | [patreon]: https://www.patreon.com/frenck 128 | [project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg 129 | [reddit]: https://reddit.com/r/homeassistant 130 | [releases-shield]: https://img.shields.io/github/release/hassio-addons/addon-unifi.svg 131 | [releases]: https://github.com/hassio-addons/addon-unifi/releases 132 | [repository]: https://github.com/hassio-addons/repository 133 | -------------------------------------------------------------------------------- /unifi/DOCS.md: -------------------------------------------------------------------------------- 1 | # Home Assistant Community Add-on: UniFi Controller 2 | 3 | This add-on runs Ubiquiti Networks' UniFi Controller software, which allows 4 | you to manage your UniFi network via the web browser. The add-on provides a 5 | single-click installation and run solution for Home Assistant, allowing users 6 | to get their network up, running, and updated, easily. 7 | 8 | This add-on supports all Home Assistant supported architectures, including the 9 | Raspberry Pi. 10 | 11 | ## Installation 12 | 13 | The installation of this add-on is pretty straightforward and not different in 14 | comparison to installing any other Home Assistant add-on. 15 | 16 | 1. Search for the "UniFi Controller" add-on in the Supervisor add-on store 17 | and install it. 18 | 1. Start the "UniFi Controller" add-on. 19 | 1. Check the logs of the "UniFi Controller" to see if everything went well. 20 | 1. Click the "OPEN WEB UI" button, and follow the initial wizard. 21 | 1. After completing the wizard, log in with the credentials just created. 22 | 1. Go to the settings (gears icon in the bottom left) -> Controller (tab). 23 | 1. Change the `Controller Hostname/IP` to match the IP or hostname of 24 | the device running Home Assistant. 25 | 1. Check the box `Override inform host with controller hostname/IP`. 26 | 1. Hit the "Apply Changes" button to activate the settings. 27 | 1. Ready to go! 28 | 29 | ## Configuration 30 | 31 | **Note**: _Remember to restart the add-on when the configuration is changed._ 32 | 33 | Example add-on configuration, with all available options: 34 | 35 | ```yaml 36 | log_level: info 37 | ssl: true 38 | certfile: fullchain.pem 39 | keyfile: privkey.pem 40 | memory_max: 2048 41 | memory_init: 512 42 | ``` 43 | 44 | **Note**: _This is just an example, don't copy and paste it! Create your own!_ 45 | 46 | ### Option: `log_level` 47 | 48 | The `log_level` option controls the level of log output by the addon and can 49 | be changed to be more or less verbose, which might be useful when you are 50 | dealing with an unknown issue. Possible values are: 51 | 52 | - `trace`: Show every detail, like all called internal functions. 53 | - `debug`: Shows detailed debug information. 54 | - `info`: Normal (usually) interesting events. 55 | - `warning`: Exceptional occurrences that are not errors. 56 | - `error`: Runtime errors that do not require immediate action. 57 | - `fatal`: Something went terribly wrong. Add-on becomes unusable. 58 | 59 | Please note that each level automatically includes log messages from a 60 | more severe level, e.g., `debug` also shows `info` messages. By default, 61 | the `log_level` is set to `info`, which is the recommended setting unless 62 | you are troubleshooting. 63 | 64 | ### Option: `ssl` 65 | 66 | Enables/Disables the use of a custom SSL (HTTPS) certificate with the in UniFi 67 | web interface. Set it `true` to enable it, `false` otherwise. 68 | 69 | **Note**: _When leaving this option disabled, UniFi will use a 70 | custom/self-signed SSL certificate._ 71 | 72 | ### Option: `certfile` 73 | 74 | The certificate file to use for SSL. 75 | 76 | **Note**: _The file MUST be stored in `/ssl/`, which is the default_ 77 | 78 | ### Option: `keyfile` 79 | 80 | The private key file to use for SSL. 81 | 82 | **Note**: _The file MUST be stored in `/ssl/`, which is the default_ 83 | 84 | ### Option: `memory_max` 85 | 86 | This option allows you to change the amount of memory the UniFi Controller 87 | is allowed to consume. By default, this is limited to 1 GB. You might want 88 | to increase this, in order to reduce CPU load or reduce this, in order 89 | to optimize your system for lower memory usage. 90 | 91 | This option takes the number of Megabyte, for example, the default is 1024. 92 | 93 | ### Option: `memory_init` 94 | 95 | This option allows you to change the amount of memory the UniFi Controller 96 | will initially reserve/consume when starting. By default, this is limited to 97 | 512M. 98 | 99 | This option takes the number of Megabyte, for example, the default is 512. 100 | 101 | ## Automated backups 102 | 103 | The UniFi Controller ships with an automated backup feature. This feature works 104 | but has been adjusted to put the created backups in a different location. 105 | 106 | Backups are created in `/backup/unifi`. You can access this folder using 107 | the normal Home Assistant methods (e.g., using Samba, Terminal, SSH). 108 | 109 | ## Migrating from an existing controller 110 | 111 | If you want to migrate from an existing controller to the controller provided 112 | by this addon, Ubiquiti has an excellent tutorial on this: 113 | 114 | 115 | 116 | This article explains in detail how to use the UniFi Site Export Wizard 117 | to quickly and easily export sites from one Controller 118 | (including configuration and devices) to another (e.g., this add-on). 119 | 120 | ## Manually adopting a device 121 | 122 | Alternatively to setting up a custom inform address (installation steps 7-9) 123 | you can manually adopt a device by following these steps: 124 | 125 | - SSH into the device using `ubnt` as username and `ubnt` as password 126 | - `$ mca-cli` 127 | - `$ set-inform http://:/inform` 128 | - for example `$ set-inform http://192.168.1.14:8080/inform` 129 | 130 | ## Known issues and limitations 131 | 132 | - The AP seems stuck in "adopting" state: Please read the installation 133 | instructions carefully. You need to change some controller settings 134 | in order for this add-on to work properly. Using the Ubiquiti Discovery 135 | Tool, or SSH'ing into the AP and setting the INFORM after adopting 136 | will resolve this. (see: *Manually adopting a device*) 137 | - This add-on does support ARM-based devices, nevertheless, they must 138 | at least be an ARMv7 device. (Raspberry Pi 1 and Zero is not supported). 139 | - When using SSL, the following warning is shown in the add-on logs: 140 | `Warning: The JKS keystore uses a proprietary format.`. This warning can 141 | be safely ignored. There is nothing wrong and your add-on will function 142 | normally. 143 | - The following error can show up in the log, but can be safely ignored: 144 | `INFO: I/O exception (java.net.ConnectException) caught when 145 | processing request: Connection refused (Connection refused)`. 146 | This is a known issue, however, the add-on functions normally. 147 | - Due limitation, renewed SSL certificates are not picked up automatically. 148 | You'd have to restart the add-on in order for UniFi to pick up the change. 149 | - Due to security policies in the UniFi Controller software, it is currently 150 | impossible to add the UniFI web interface to your Home Assistant frontend 151 | using a `panel_iframe`. 152 | - The broadcast feature of the EDU type APs are currently not working with 153 | this add-on. Due to a limitation in Home Assistant, is it currently impossible 154 | to open the required "range" of ports needed for this feature to work. 155 | - This add-on cannot support Ingress due to technical limitations of the 156 | UniFi software. 157 | 158 | ## Changelog & Releases 159 | 160 | This repository keeps a change log using [GitHub's releases][releases] 161 | functionality. The format of the log is based on 162 | [Keep a Changelog][keepchangelog]. 163 | 164 | Releases are based on [Semantic Versioning][semver], and use the format 165 | of ``MAJOR.MINOR.PATCH``. In a nutshell, the version will be incremented 166 | based on the following: 167 | 168 | - ``MAJOR``: Incompatible or major changes. 169 | - ``MINOR``: Backwards-compatible new features and enhancements. 170 | - ``PATCH``: Backwards-compatible bugfixes and package updates. 171 | 172 | ## Support 173 | 174 | Got questions? 175 | 176 | You have several options to get them answered: 177 | 178 | - The [Home Assistant Community Add-ons Discord chat server][discord] for add-on 179 | support and feature requests. 180 | - The [Home Assistant Discord chat server][discord-ha] for general Home 181 | Assistant discussions and questions. 182 | - The Home Assistant [Community Forum][forum]. 183 | - Join the [Reddit subreddit][reddit] in [/r/homeassistant][reddit] 184 | 185 | You could also [open an issue here][issue] GitHub. 186 | 187 | ## Authors & contributors 188 | 189 | The original setup of this repository is by [Franck Nijhof][frenck]. 190 | 191 | For a full list of all authors and contributors, 192 | check [the contributor's page][contributors]. 193 | 194 | ## License 195 | 196 | MIT License 197 | 198 | Copyright (c) 2018-2020 Franck Nijhof 199 | 200 | Permission is hereby granted, free of charge, to any person obtaining a copy 201 | of this software and associated documentation files (the "Software"), to deal 202 | in the Software without restriction, including without limitation the rights 203 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 204 | copies of the Software, and to permit persons to whom the Software is 205 | furnished to do so, subject to the following conditions: 206 | 207 | The above copyright notice and this permission notice shall be included in all 208 | copies or substantial portions of the Software. 209 | 210 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 211 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 212 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 213 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 214 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 215 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 216 | SOFTWARE. 217 | 218 | [contributors]: https://github.com/hassio-addons/addon-unifi/graphs/contributors 219 | [discord-ha]: https://discord.gg/c5DvZ4e 220 | [discord]: https://discord.me/hassioaddons 221 | [forum]: https://community.home-assistant.io/t/home-assistant-community-add-on-unifi-controller/56297?u=frenck 222 | [frenck]: https://github.com/frenck 223 | [issue]: https://github.com/hassio-addons/addon-unifi/issues 224 | [keepchangelog]: http://keepachangelog.com/en/1.0.0/ 225 | [reddit]: https://reddit.com/r/homeassistant 226 | [releases]: https://github.com/hassio-addons/addon-unifi/releases 227 | [semver]: http://semver.org/spec/v2.0.0.htm 228 | --------------------------------------------------------------------------------