diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index fd12dbc5..70584da2 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -22,6 +22,11 @@ fi [ -d "$AHRIMAN_REPOSITORY_ROOT" ] || mkdir "$AHRIMAN_REPOSITORY_ROOT" chown "$AHRIMAN_USER":"$AHRIMAN_USER" "$AHRIMAN_REPOSITORY_ROOT" +# create .gnupg directory which is required for keys +AHRIMAN_GNUPG_HOME="$(getent passwd "$AHRIMAN_USER" | cut -d : -f 6)/.gnupg" +[ -d "$AHRIMAN_GNUPG_HOME" ] || mkdir -m700 "$AHRIMAN_GNUPG_HOME" +chown "$AHRIMAN_USER":"$AHRIMAN_USER" "$AHRIMAN_GNUPG_HOME" + # run built-in setup command AHRIMAN_SETUP_ARGS=("--build-as-user" "$AHRIMAN_USER") AHRIMAN_SETUP_ARGS+=("--packager" "$AHRIMAN_PACKAGER") diff --git a/docs/ahriman.web.views.service.rst b/docs/ahriman.web.views.service.rst index 62c1d3fd..788b978a 100644 --- a/docs/ahriman.web.views.service.rst +++ b/docs/ahriman.web.views.service.rst @@ -12,6 +12,14 @@ ahriman.web.views.service.add module :no-undoc-members: :show-inheritance: +ahriman.web.views.service.pgp module +------------------------------------ + +.. automodule:: ahriman.web.views.service.pgp + :members: + :no-undoc-members: + :show-inheritance: + ahriman.web.views.service.remove module --------------------------------------- @@ -36,6 +44,14 @@ ahriman.web.views.service.search module :no-undoc-members: :show-inheritance: +ahriman.web.views.service.update module +--------------------------------------- + +.. automodule:: ahriman.web.views.service.update + :members: + :no-undoc-members: + :show-inheritance: + Module contents --------------- diff --git a/docs/faq.rst b/docs/faq.rst index 8506876f..7973b289 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -219,6 +219,62 @@ Also, there is command ``repo-remove-unknown`` which checks packages in AUR and Remove commands also remove any package files (patches, caches etc). +How to sign repository +^^^^^^^^^^^^^^^^^^^^^^ + +Repository sign feature is available in several configurations. The recommended way is just to sign repository database file by single key instead of trying to sign each package. However, the steps are pretty same, just configuration is a bit differ. For more details about options kindly refer to :doc:`configuration reference `. + +#. + First you would need to create the key on your local machine: + + .. code-block:: shell + + gpg --full-generate-key + + This command will prompt you for several questions. Most of them may be left default, but you will need to fill real name and email address with some data. Because at the moment the service doesn't support passphrases, it must be left blank. + +#. + The command above will generate key and print its hash, something like ``8BE91E5A773FB48AC05CC1EDBED105AED6246B39``. Copy it. + +#. + Export your private key by using the hash above: + + .. code-block:: shell + + gpg --export-secret-keys -a 8BE91E5A773FB48AC05CC1EDBED105AED6246B39 > repository-key.gpg + +#. + + Copy the specified key to the build machine (i.e. where the service is running). + +#. + Import the specified key to the service user: + + .. code-block:: shell + + sudo -u ahriman gpg --import repository-key.gpg + + Don't forget to remove the key from filesystem after import. + +#. + Change trust level to ``ultimate``: + + .. code-block:: shell + + sudo -u ahriman gpg --edit-key 8BE91E5A773FB48AC05CC1EDBED105AED6246B39 + + The command above will drop you into gpg shell, in which you will need to type ``trust``, choose ``5 = I trust ultimately``, confirm and exit ``quit``. + +#. + Proceed with service configuration according to the :doc:`configuration `: + + .. code-block:: ini + + [sign] + target = repository + key = 8BE91E5A773FB48AC05CC1EDBED105AED6246B39 + + How to rebuild packages after library update ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/package/share/ahriman/templates/build-status.jinja2 b/package/share/ahriman/templates/build-status.jinja2 index 961e78ef..4e405ac8 100644 --- a/package/share/ahriman/templates/build-status.jinja2 +++ b/package/share/ahriman/templates/build-status.jinja2 @@ -26,15 +26,18 @@
{% if not auth.enabled or auth.username is not none %} - - - + {% endif %}
diff --git a/package/share/ahriman/templates/build-status/key-import-modal.jinja2 b/package/share/ahriman/templates/build-status/key-import-modal.jinja2 new file mode 100644 index 00000000..90188463 --- /dev/null +++ b/package/share/ahriman/templates/build-status/key-import-modal.jinja2 @@ -0,0 +1,92 @@ + + + diff --git a/package/share/ahriman/templates/build-status/login-modal.jinja2 b/package/share/ahriman/templates/build-status/login-modal.jinja2 index d2e7a3fb..7e9a8416 100644 --- a/package/share/ahriman/templates/build-status/login-modal.jinja2 +++ b/package/share/ahriman/templates/build-status/login-modal.jinja2 @@ -1,4 +1,4 @@ -