{% extends 'admin/master.html' %} {% macro rule_type_choice(prefix, selected) %}
Select all ยท Select none
{% for rule_type in rule_types %}
{% endfor %}
{% endmacro %} {% macro account_choice(prefix) %}
{% endmacro %} {% block body %}

Rules in Git

Move rules from one Syncer to another, e.g. from test to production: the test instance pushes the selected rule types into a Git repository, production pulls them from there. Every rule type is one JSON file in the repository, so its history shows what changed. Hosts, accounts, users and the Secret Store are not transferred, they belong to each instance. Documentation

{% if not accounts %}
No enabled account of type Git Repository found. Create one with the repository URL as address, the Git user as username and an access token as password.
{% endif %} {% if error %}
{{ error }}
{% endif %} {% if result %}
{% if action == 'push' %}Push{% else %}Pull{% endif %}
{% endif %} {% set push_selected = form.getlist('rule_types') if action == 'push' else [] %} {% set pull_selected = form.getlist('rule_types') if action == 'pull' else [] %}
Push to Git

Writes the rules of the selected types into the repository. Files of other rule types in the repository stay as they are.

{{ account_choice('push') }}
{{ rule_type_choice('push_types', push_selected) }}
Pull from Git

Loads the rules from the repository. A rule from the repository replaces the rule with the same id or name. Without a selection every rule type found in the repository is loaded.

{{ account_choice('pull') }}
{{ rule_type_choice('pull_types', pull_selected) }}
Only for the loaded rule types: afterwards they match the repository exactly, rules deleted on the other instance are deleted here as well.
{% endblock %}