Differences between revisions 5 and 6
Revision 5 as of 2017-08-21 09:10:16
Size: 3165
Editor: ?MichaelLustfield
Comment:
Revision 6 as of 2017-08-21 09:16:49
Size: 3289
Editor: ?MichaelLustfield
Comment:
Deletions are marked like this. Additions are marked like this.
Line 33: Line 33:

To support SMTP, an smtp server is required, sendmail is [[https://github.com/go-gitea/gitea/issues/951|not supported]].

Translation(s): English



Gitea

Gitea is a git front-end, similar to github/gitlab/etc.

Packaging Process

At this time, gitea is not packaged for Debian. Help is needed to complete existing libjs ITP's blocking the Gitea ITP.

Additional work need to be merged upstream. Unfortunately, upstream is being a bit stubborn with this one.

Debian's Gitea

A Gitea instance for Debian is running at https://gitea.debian.net.

Hosting is currently provided by MTecknology

Authentication

Authentication to this service is handled using Debian's SSO service.

To Do

A feature request exists to set the user's email address from Debian's SSO, but it's unlikely to be added any time in the near future.

It would be nice to re-deploy this instance from scratch without demo-imported repos, done with config management, on permanent infrastructure.

To support SMTP, an smtp server is required, sendmail is not supported.

The API

Gitea provides a loosely documented API.

To utilize the API, first log into Gitea and navigate to /user/settings/applications. Use the "Generate New Token" button to generate a key and be sure not to lose it.

Swagger is used to provide a function list underneath /swagger. Two headers will need to be added to API requests: Content-Type and Authorization. Content-Type is simply 'application/json'. Authorization is "token <your_application_token>".

If you were interested in finding your own uid, you would find it with this:

    curl -H 'Content-Type: application/json' \
         -H 'Authorization: token 6c0d842e2ed6ac121fb3f2eeac6951ecc2ea' \
         -X GET  https://gitea.debian.net/api/v1/user

Note: Getting org/team IDs is not currently possible: https://github.com/go-gitea/gitea/issues/1821 (collab-maint=id:2)

To import a project from alioth:

    gitsrc="https://anonscm.debian.org/git/collab-maint/arduino.git"
    gitname="arduino"

    curl -H 'Content-Type: application/json' \
         -H 'Authorization: token 6c0d842e2ed6ac121fb3f2eeac6951ecc2ea' \
         -d "{\"clone_addr\": \"${gitsrc}\", \"uid\": 2, \"repo_name\": \"${gitname}\"}" \
         -X POST https://gitea.debian.net/api/v1/repos/migrate

If it's preferred to keep a repository at it's current location and only import the repository to play with gitea or use a feature it provides, the mirror option can be set.

    -d "{\"clone_addr\": \"${gitsrc}\", \"uid\": 2, \"repo_name\": \"${gitname}\" \"mirror\": true}" \

Note: While it's possible to convert a mirrored (replicated) repo to a cloned one, the reverse is not true.

Additional Reading:

* https://github.com/gogits/go-gogs-client/wiki/Repositories