From 79c65ee1dc53c6c637d443a756c0f1005b1008f6 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 12 2020 21:23:22 +0000 Subject: [PATCH 1/2] Add some documentation on how git push over http works in pagure Signed-off-by: Pierre-Yves Chibon --- diff --git a/doc/usage/http_push.rst b/doc/usage/http_push.rst new file mode 100644 index 0000000..fc00be5 --- /dev/null +++ b/doc/usage/http_push.rst @@ -0,0 +1,73 @@ +HTTP PUSH +========= + +When using git push over http against a pagure instance, there are two +situations to distinguish. + +Git push over http with API token +--------------------------------- + +This is going to be the most supported approach. Any user can generate API +tokens with the ``commit`` ACL which reads in the UI as: `Commit to a git +repository via http(s)`. +These API tokens can be specific to a project if generated in the settings +page of the project, or generic to all projects if generated in the +user's settings page. +In either case, they will no work if the user does not have at commit access +to the project. + +Once the API token has been generate, the user needs to enter it with git +prompts for a password (instead of their actual password). + +For example: + +:: + + $ git push + username: pingou + password: ABC123... + + +Git push over http with Username & Password +------------------------------------------- + +This is only supported on pagure instance that are using the ``local`` +authentication system (ie: where pagure manages the registration of the +user accounts, email confirmation, etc). + +For these pagure instances and for these only, when being prompted by git +for an username and password the user can choose to enter either their +username and actual password or their username and an API token. + + +Storing the password/token +-------------------------- + +If you interact with git regularly, typing you password or API token will +quickly become tiring. +Thanksfully, git has a built-in mechanism named `git credential store +`_ which can take care of this +for you. + +You can use two modes for the store, either ``cache`` or ``store``. +- `cache` will cache your credential in memory for 15 minutes (by default) +- `store` will actually store your credentials in **plain text** on disk + +You can set this using either: +:: + + $ git config credential.helper store + $ git config credential.helper cache + +The timeout of the cache can be configured using: +:: + + $ git config credential.helper 'cache --timeout=3600' + +Where the timeout value is a number of seconds (so here the cache is extended +to one hour). + +Finally, if you wish to use this configuration on multiple project, you can +add the ``--global`` argument to these commands which will make the +configuration work for all your git repo instead of just the one in which +you run the command. diff --git a/doc/usage/index.rst b/doc/usage/index.rst index e6e97ef..1b31ec9 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -43,6 +43,7 @@ Contents: first_steps forks read_only + http_push pull_requests markdown project_settings From f73c6e715cb32fdf67485269962410e8ff9ab0d9 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 12 2020 21:23:22 +0000 Subject: [PATCH 2/2] Fix a few warning shown when building the docs Signed-off-by: Pierre-Yves Chibon --- diff --git a/doc/configuration.rst b/doc/configuration.rst index 117f35b..1dd29fb 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -792,6 +792,7 @@ Source: https://en.wikipedia.org/wiki/Content_Security_Policy Defaults to: :: + CSP_HEADERS = ( "default-src 'self' https:; " "script-src 'self' 'nonce-{nonce}'; " @@ -1244,7 +1245,7 @@ FEDORA_MESSAGING_NOTIFICATIONS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This configuration key can be used to turn on or off sending notifications via -`fedora-messaging <>`_. +`fedora-messaging `_. Defaults to: ``False``. diff --git a/doc/usage/pagure_ci_jenkins.rst b/doc/usage/pagure_ci_jenkins.rst index 6561e4b..bacfc23 100644 --- a/doc/usage/pagure_ci_jenkins.rst +++ b/doc/usage/pagure_ci_jenkins.rst @@ -10,6 +10,7 @@ How does it work? ----------------- The principal is: + * pagure will trigger a build on jenkins when a pull-request is created, updated or when someone explicitly asks pagure to do so or when a new commit is pushed (if pagure-ci is configured to trigger on commit). diff --git a/doc/usage/using_webhooks.rst b/doc/usage/using_webhooks.rst index 7ca369c..c3c7a7e 100644 --- a/doc/usage/using_webhooks.rst +++ b/doc/usage/using_webhooks.rst @@ -6,7 +6,7 @@ Basically, pagure will make a HTTP POST request to one or more third party server/application with information about what is or just happened. Activating web-hooks notifications --------------------------------- +---------------------------------- To set-up a web-hook, simply go to the settings page of your project and enter the URL to the server/endpoint that will receive the notifications.