{"id":15167085,"url":"https://github.com/lkubb/salt-unifios-formula","last_synced_at":"2026-02-23T16:31:23.963Z","repository":{"id":210318597,"uuid":"726277341","full_name":"lkubb/salt-unifios-formula","owner":"lkubb","description":"Manage UniFi OS 3.x with Salt-SSH.","archived":false,"fork":false,"pushed_at":"2024-11-13T23:40:42.000Z","size":125,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-19T04:47:12.773Z","etag":null,"topics":["saltstack","saltstack-formula","ubiquiti","udm-pro","udm-se","unifi","unifi-os","uxg-pro"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lkubb.png","metadata":{"files":{"readme":"docs/README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-01T23:30:19.000Z","updated_at":"2025-05-16T17:30:04.000Z","dependencies_parsed_at":"2024-02-17T19:32:22.335Z","dependency_job_id":"a0312a79-82ca-46fb-b252-21cefd5208f5","html_url":"https://github.com/lkubb/salt-unifios-formula","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"26dd2c315121cfeabcd0ead7dde57b01df5aa9fc"},"previous_names":["lkubb/salt-unifios-formula"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lkubb/salt-unifios-formula","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkubb%2Fsalt-unifios-formula","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkubb%2Fsalt-unifios-formula/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkubb%2Fsalt-unifios-formula/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkubb%2Fsalt-unifios-formula/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lkubb","download_url":"https://codeload.github.com/lkubb/salt-unifios-formula/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkubb%2Fsalt-unifios-formula/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29748180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["saltstack","saltstack-formula","ubiquiti","udm-pro","udm-se","unifi","unifi-os","uxg-pro"],"created_at":"2024-09-27T05:24:31.533Z","updated_at":"2026-02-23T16:31:23.946Z","avatar_url":"https://github.com/lkubb.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":".. _readme:\n\nUniFi OS Formula\n================\n\n|img_sr| |img_pc|\n\n.. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n   :alt: Semantic Release\n   :scale: 100%\n   :target: https://github.com/semantic-release/semantic-release\n.. |img_pc| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white\n   :alt: pre-commit\n   :scale: 100%\n   :target: https://github.com/pre-commit/pre-commit\n\nManage UniFi OS with Salt.\n\nProvides several mods that are intended to run on UniFi OS 3.x.\n\n.. contents:: **Table of Contents**\n   :depth: 1\n\nGeneral notes\n-------------\n\nSee the full `SaltStack Formulas installation and usage instructions\n\u003chttps://docs.saltproject.io/en/latest/topics/development/conventions/formulas.html\u003e`_.\n\nIf you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section\n\u003chttps://docs.saltproject.io/en/latest/topics/development/conventions/formulas.html#writing-formulas\u003e`_.\n\nIf you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``,\nwhich contains the currently released version. This formula is versioned according to `Semantic Versioning \u003chttp://semver.org/\u003e`_.\n\nSee `Formula Versioning Section \u003chttps://docs.saltproject.io/en/latest/topics/development/conventions/formulas.html#versioning\u003e`_ for more details.\n\nIf you need (non-default) configuration, please refer to:\n\n- `how to configure the formula with map.jinja \u003cmap.jinja.rst\u003e`_\n- the ``pillar.example`` file\n- the `Special notes`_ section\n\nSpecial notes\n-------------\n* This formula is intended to be executed via ``salt-ssh``.\n* Note that for UniFi OS 2.x, the inbuilt Python is too old for current Salt.\n* If a mod installs a script, it will usually install a Sytemd service and possibly timer unit with it to schedule runs.\n* It currently relies heavily on wrapper modules that are not yet part of Salt core, but are submitted in several of my PRs.\n* If you want to interact with certificates, you will need to install the ``python3-cryptography`` package before running ``salt-ssh``.\n\nConfiguration\n-------------\nAn example pillar is provided, please see `pillar.example`. Note that you do not need to specify everything by pillar. Often, it's much easier and less resource-heavy to use the ``parameters/\u003cgrain\u003e/\u003cvalue\u003e.yaml`` files for non-sensitive settings. The underlying logic is explained in `map.jinja`.\n\n\nAvailable states\n----------------\n\nThe following states are found in this formula:\n\n.. contents::\n   :local:\n\n\n``unifios``\n^^^^^^^^^^^\n*Meta-state*.\n\nThis installs a service that will run all scripts in\na directory after booting and syncs this directory\nfrom the fileserver.\n\nIn addition, you can use this formula to apply some mods\nthat don't rely on this service or write custom ones.\n\n\n``unifios.package``\n^^^^^^^^^^^^^^^^^^^\nInstalls a service that runs all executable scripts\nin a directory after boot, syncs this directory from\nthe fileserver and enables/starts the service.\n\nThis allows you to sync simple scripts that you require\nto run on each reboot without writing the\ncorresponding state file as a mod.\n\nThe service is slightly modified from https://github.com/unifi-utilities/unifios-utilities/tree/main/on-boot-script-2.x\n\n\n``unifios.helpers.pip_pkgs``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nOn Debian, installing pip pulls in a lot of dependencies.\nInstalling pure Python or pre-compiled wheels for the platform\ndoes not require them though.\n\nThis state downloads the ``pip`` wheel and uses it to install\nother specified packages without pulling all those dev dependencies.\nThe specified packages **must** either be pure Python packages\nor have binary wheel distributions for the platform (``aarch64``).\n\n\n``unifios.mods.api_ratelimit``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nThe login API has several rate limits. For automations, especially\nthe success login rate limit can be detrimental - you will receive\nHTTP 429 Too Many Requests if the client does not do caching.\nThis state manages the mentioned rate limit as configured.\n\n\n``unifios.mods.authorized_keys``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nManages SSH keys that can authenticate as root.\n\nEither specify present/absent OR sync.\nJust paste the whole key as a list item.\n\nThis is just a helper. For more comprehensive OpenSSH management,\nI would advise using https://github.com/lkubb/salt-openssh-formula,\nwhich works with Salt-SSH.\n\n\n``unifios.mods.dns_dnat``\n^^^^^^^^^^^^^^^^^^^^^^^^^\nManages a script that ensures firewall rules are in place that redirect\nall outgoing TCP/UDP packets directed to port 53 and originating from\nselect interfaces/subnets to a specified destination.\n\nIn short, ensures that clients on these subnets/interfaces will use\na local DNS resolver (does not account for DoH/DoT etc.).\n\n\n``unifios.mods.pip_pkgs``\n^^^^^^^^^^^^^^^^^^^^^^^^^\nInstalls global Python packages with ``pip``.\n\nNote that pip is not installed by default. You can either install the\n``python3-pip`` system package or use `unifios.helpers.pip_pkgs`_\nto avoid pulling in a lot of dev dependencies.\n\n\n``unifios.mods.pkgs``\n^^^^^^^^^^^^^^^^^^^^^\nManages installed system packages.\n\n\n``unifios.mods.webui_cert``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\nManages a certificate for the GUI.\n\nWhen using a ``ca_server``, will rely on the SSH wrapper emulation\nof ``x509.certificate_managed`` since the remote does not have access\nto the event bus.\n\nThe wrapper is found in my PR #65654 or in my formula for a private CA:\nhttps://github.com/lkubb/salt-private-ca-formula\n\n\n``unifios.clean``\n^^^^^^^^^^^^^^^^^\n*Meta-state*.\n\nUndoes everything performed in the ``unifios`` meta-state\nin reverse order, i.e. removes mods and scripts, stops\nand removes the on_boot service.\n\n\n``unifios.package.clean``\n^^^^^^^^^^^^^^^^^^^^^^^^^\nStops and disables the on_boot service, removes synced scripts\nand the corresponding unit file.\n\n\n``unifios.helpers.pip_pkgs.clean``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nRemoves pip and wanted packages.\n\n\n``unifios.mods.api_ratelimit.clean``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nResets managed rate limits to defaults.\n\n\n``unifios.mods.authorized_keys.clean``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nRemoves wanted SSH keys for the root account.\nIf this removes all of them, you will have to login\nusing the password specified in the GUI.\n\n\n``unifios.mods.dns_dnat.clean``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nDisables dns_nat service and timer and removes all related files.\n\n\n``unifios.mods.pip_pkgs.clean``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nRemoves wanted pip packages.\n\n\n``unifios.mods.pkgs.clean``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\nRemoves wanted system packages.\n\n\n``unifios.mods.webui_cert.clean``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nDoes not remove the certificate/key because this would break\nthe UI service. You will need to do this manually.\n\n\n\nContributing to this repo\n-------------------------\n\nCommit messages\n^^^^^^^^^^^^^^^\n\n**Commit message formatting is significant!**\n\nPlease see `How to contribute \u003chttps://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst\u003e`_ for more details.\n\npre-commit\n^^^^^^^^^^\n\n`pre-commit \u003chttps://pre-commit.com/\u003e`_ is configured for this formula, which you may optionally use to ease the steps involved in submitting your changes.\nFirst install  the ``pre-commit`` package manager using the appropriate `method \u003chttps://pre-commit.com/#installation\u003e`_, then run ``bin/install-hooks`` and\nnow ``pre-commit`` will run automatically on each ``git commit``. ::\n\n  $ bin/install-hooks\n  pre-commit installed at .git/hooks/pre-commit\n  pre-commit installed at .git/hooks/commit-msg\n\nState documentation\n~~~~~~~~~~~~~~~~~~~\nThere is a script that semi-autodocuments available states: ``bin/slsdoc``.\n\nIf a ``.sls`` file begins with a Jinja comment, it will dump that into the docs. It can be configured differently depending on the formula. See the script source code for details currently.\n\nThis means if you feel a state should be documented, make sure to write a comment explaining it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkubb%2Fsalt-unifios-formula","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flkubb%2Fsalt-unifios-formula","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkubb%2Fsalt-unifios-formula/lists"}