{% extends "space-settings-base.html" %} {% from "ui.html" import csrf_field, action, when, copyable, reveal_notice with context %} {% set section = "git" %} {% set status_labels = {"never": _("Never synchronized"), "ok": _("Up to date"), "error": _("Error", context="status"), "conflict": _("In conflict")} %} {% set status_class = {"never": "", "ok": "status-ok", "error": "status-error", "conflict": "status-warn"} %} {% block section %}
{{ git_error(space.sync_error) }}
{%- if sync.state == 'running' %}{{ _("Synchronizing…") }} {%- elif sync.state == 'retry' %}{{ (_("Automatic retry on {when}, after {n} failures. “Synchronize now” runs it right away.")|e).format(when=when(sync.at), n=sync.failures) if sync.failures > 1 else (_("Automatic retry on {when}. “Synchronize now” runs it right away.")|e).format(when=when(sync.at)) }} {%- elif sync.stalled %}{{ (_("Synchronization requested on {when}: the worker has not picked it up yet.")|e).format(when=when(sync.at)) }} {%- else %}{{ _("Synchronization requested: it starts as soon as the worker is free.") }}{% endif %} {%- if sync.poll %} {{ _("This page updates by itself.") }}{% endif -%}
{% endif %} {% if contribute %}{{ _("No Git repository is linked: the wiki and the inbox stay empty until one is.") }}{% if not manage %} {{ _("Ask an organization administrator to link it.") }}{% endif %}
{% endif %}{{ _("Space purpose chosen: it will be written to the repository at the first synchronization (unless it already has its own).") }} {{ _("Review or adapt the purpose") }}
{% if credential_kind == 'https' %}{{ _("HTTPS access token saved.") }}{% elif credential_kind == 'ssh' %}{{ _("SSH key saved.") }}{% else %}{{ _("No credentials: only public repositories can be read.") }}{% endif %} {{ _("Secrets are encrypted and never shown again.") }}
{% if space.repo_url.startswith('https://') %} {% elif ssh_remote %} {# Reading reloads the page: to be done before pasting the private key, hence the order. #}{{ _("Compare these fingerprints with those published by your host before saving:") }}
{% for line in fingerprints %}{{ line }}
{{ _("Notifies Synaptane on every push for an immediate synchronization. Without a webhook, synchronization happens every few minutes.") }}
{% if revealed %}{{ reveal_notice(revealed, _("Copy this secret now into the webhook settings: it will not be shown again.")) }}{% endif %}{{ _("GitHub: Settings → Webhooks, content type “application/json”, “push” event. GitLab: Settings → Webhooks, “Secret token”, “Push events”.") }}
{% if has_webhook_secret %} {{ action("/o/" ~ org.slug ~ "/" ~ space.slug ~ "/-/webhook", _("Generate a new secret"), confirm=_("The current webhook will stop working until you paste the new secret at your host. Continue?")) }} {% else %} {{ action("/o/" ~ org.slug ~ "/" ~ space.slug ~ "/-/webhook", _("Generate the secret")) }} {% endif %}