Produce stable *.patch file downloads
There are two sources of instability with this endpoint:
- the version number for git itself is added by default as a trailer,
and changes on a frequent basis whenever the server upgrades git
- the "index xxxxxxx..xxxxxxx 10064" line in the diff header contains a
reference to git blobs, and by default git blobs are abbreviated as
much as possible in order to produce a "short and succinct"
description, but the cutoff changes over time as the repo gets larger
Fix both of these issues, by passing the relevant options whenever
running `git format-patch`. Although passing `--full-index` for the
latter case might ordinarily be considered a breaking change, the
checksum of the patch file contents was always completely unreliable due
to the former case, so this is our chance to get it correct for all
time.
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
Replace all occurences of pygit2 Commit.oid with Commit.id
Pygit has moved away from oid to id in Commit type,
oid field has been deprecated (and then removed)
in favor of id.
This means that with newer pygit2 it's impossible
to do some actions in the git.sr.ht instance.
There has already been some work put into
this that changed this in one place,
but this changes it everywhere.
Note that the Pygit2.Oid no longer has
oid nor id fields. But I don't think these
are used anywhere in the codebase, only
Commit.oid has been used, so it's fine.
shell: return "Access denied." for redirects to private repositories the pusher can't access
Fixes: ~sircmpwn/git.sr.ht#380
Upgrade core-go and gqlgen
Use permalinks in .commit-info template section
Change the URL for the commit link when browsing a file, blame, or tree
to go to the commit itself, rather than the head of the branch. This
makes it a more useful permalink.
Implementation copied from the `gitsrht.rss.commit_url` function.
Signed-off-by: Noelle Leigh <noelle_leigh@fastmail.com>
git.sr.ht-periodic: address minio breaking change
minio changed the API for remove_objects to use this indirection via
DeleteObject.
Makefile: make SHAREDIR consistent with core.sr.ht
The SHAREDIR variable has slightly different semantics in core.sr.ht vs
in all the services. The services will be converted to the same
semantics as core.sr.ht.
web: remove unnecessary print statement
git.sr.ht-initdb: drop obsolete script
web: retain visibility on validation errors during repo create
Fix service name in config reference
types: drop SSHKey implementation
It is no longer used. All key handling is happening in meta.sr.ht.
Stop using scmsrht.BaseScmOAuthService
Currently, both the git.sr.ht and hg.sr.ht OAuth implementation is based
on `scmsrht.BaseScmOAuthService`. The main value that class provides is
handling of SSH keys in a DB table for that service (including webhooks
to update them). However, this is exactly what we want to get rid of.
In fact this table is already never read - all SSH key reads already go
through meta.sr.ht.
Since this was the main feature of this base class, simply stop using it
and base the service on `srht.oauth.AbstractOAuthService`, like all
non-SCM-services do. Once the same has been done for hg.sr.ht, the code
in scm.sr.ht can be dropped.
Note that this commit will cause the (still active on meta.sr.ht) SSH
key update webhooks to 404. This was deemed acceptable. If so desired,
the hooks can be cleaned out of the database by running the following
query against meta.sr.ht:
DELETE FROM user_webhook_subscription
WHERE url = 'https://git.sr.ht/webhook/notify/keys'
Set rel=nofollow on link trap
Add invisible link to honeypot to all repo pages