Commit Graph

984 Commits

Author SHA1 Message Date
Bor Grošelj Simić 94489852d6 gitsrht-update-hook: update fnmatch upstream location 2021-10-25 08:48:19 +02:00
Drew DeVault d9f5a6d2b7 repo.html: update visibility UI per todo.sr.ht change 2021-10-06 10:11:30 +02:00
Eli Schwartz 75f35929cb archive .asc endpoint: handle junk data 2021-10-01 09:15:37 +02:00
Eli Schwartz 38c6cda7ba archive .asc endpoint: fix incorrect accounting of tag vs. format
flask does not document this well, but url rule converters apparently
*can* accept arguments, and one of them is for providing a limited
choice of values. Use this to restrict the formats to the list of
supported formats, which we hardcode because it must be built into the
string.

This avoids interpreting 1.0.tar.gz.asc as tag="1", format=".0.tar.gz"
which causes the server to explode.
2021-10-01 09:15:35 +02:00
Drew DeVault 0a3366b07a Fix diffs with invalid UTF-8 paths 2021-09-27 12:43:30 +02:00
Drew DeVault 69e2dd1555 Fix issue with repos without tags 2021-09-23 10:23:30 +02:00
Drew DeVault 23c8463d66 API: createRepository may return null
In case of validation errors.
2021-09-23 10:14:52 +02:00
Eli Schwartz db19ed8c95 Implement a UI for discovering the existence of notes-based tarball signatures 2021-09-23 10:11:28 +02:00
Eli Schwartz fa4ef72f8b add backend route to retrieve cgit-style git notes as PGP sig
For any available tarball {gitref}.tar.gz, attempt to see if there is a
`git notes` attachment in:

refs/signatures/tar    -> {gitref}.tar.asc
refs/signatures/tar.gz -> {gitref}.tar.gz.asc

cgit supports this for any of its configurable archive compression
formats, and additionally always supports delivering the signature for an
uncompressed tarball.

This is useful in at least two cases:

- Some people may mirror to, or migrate between, multiple forges,
  including cgit with lots of compression formats enabled. One notes
  attachment then works for all formats.

- git-archive guarantees to be a fully stable tarball output format, but
  the compressor program it pipes to may not be, depending on
  implementation (GNU gzip is, busybox gzip used to not be but now is,
  zstd dedicatedly breaks output reproducibility on every release).
  Some people rely on this, some people don't.

Since sourcehut only supports tar.gz, only tar.gz-compatible signatures
are implemented here.

Implements https://todo.sr.ht/~sircmpwn/git.sr.ht/231
2021-09-23 09:53:35 +02:00
Drew DeVault ab1183a2ec default_query: write ops now work 2021-09-22 09:47:31 +02:00
Arsen Arsenović 3173bdddcd refs: show the accurate annotated tag time
After this patch, the ref and refs pages will show the time based on the
tagger line of tags for annotated tags.
2021-09-17 10:03:31 +02:00
Drew DeVault 7b9c23f745 API: Update core-go 2021-09-09 10:54:58 +02:00
Drew DeVault 9a4f4f04ea API: Upgrade core-go 2021-08-25 12:21:28 +02:00
Drew DeVault ed118f6653 refs: include strip_pgp_signature in template 2021-08-23 11:27:40 +02:00
Daniel P 33df248951 Remove whitespace after repo description 2021-08-23 10:12:45 +02:00
Sol Fisher Romanoff aad9e67805 Make repo names match [A-Za-z0-9._-]+
Repository names in URLs are now case-insensitive --
This might break existing repositories.

Also prohibits use of '.git' and '.hg' as repo names.
2021-08-11 09:44:40 +02:00
Drew DeVault 6652abb720 .builds/alpine.yml: upgrade to 3.14 2021-08-03 12:29:37 +02:00
Drew DeVault 2fa3611936 Hide large diffs from commit UI
Ref ~sircmpwn/git.sr.ht#346
2021-07-27 09:27:36 +02:00
Drew DeVault 48b896bcca API: Upgrade core-go 2021-07-21 09:37:32 +02:00
Drew DeVault d952c18e18 API: Upgrade core-go 2021-07-21 09:27:38 +02:00
Noelle Leigh d370ef33ab Fix link from commit to view commit in log
If a commit is old enough, it won't appear on the first page of the
git log, which means that the anchor in the URL won't work.

This change makes it so that the link always goes to a log page where
the commit is visible.

Note: This same change will fix the same issue for links on the log
page.
2021-07-13 13:07:37 +02:00
Simon Ser 644d32a430 Strip PGP signature from annotated tag message 2021-07-10 16:27:47 -04:00
Drew DeVault 4b5db16457 Fix error with unannotated tags 2021-07-08 10:01:38 -04:00
Drew DeVault fa62201a5a Fix (another) issue with non-commit tags
~gregkh/linux-stable has a tag which points to a tree.
2021-07-08 09:53:25 -04:00
Eli Schwartz 91333aaf1c fix typo in sources for the api binary which broke the build
Regression from commit 8a769ecedb.
2021-07-01 15:47:42 -04:00
Drew DeVault f6e05d0655 send-email: fix bug selecting addl. branches
After Nab's updates adding binary ref support, this was broken.
2021-07-01 08:21:53 -04:00
Drew DeVault 8a769ecedb Prohibit repos named . or .. 2021-06-12 11:41:30 -04:00
Solomon Victorino 4e04d5ba97 Show commit date instead of modified date for tags
- Display the original commit date in /refs and the RSS feature.
- Fix the RSS feed's sort order (/refs sort is correct)
2021-06-06 12:12:27 -04:00
Martin Vahlensieck 98040e0efc Fix logic for displaying "next" link on log page
Fetch one more commit from get_log and only display a "next" link if it
exists.  The current logic checks whether the last commit in the list
has a parent.  This doesn't work if the log is shown for a path, because
when the first commit for the path is not the initial commit it has a
parent, but there are no more log entries for the path.

The parameter name for the template is copied from hg.sr.ht which solves
this problem with an additional return parameter from get_log.
2021-06-06 12:11:35 -04:00
Martin Vahlensieck 5cb8a00743 Fix off-by-one error in get_log 2021-06-06 12:11:35 -04:00
Drew DeVault b8a5b7b405 updateRepository: fix visibility updates 2021-06-06 11:40:27 -04:00
pyxel 50c5dc14a0 adapt code-view to window height 2021-06-06 11:27:36 -04:00
Drew DeVault 6bdca99ab5 all: fix Flask 2.0.x incompatible Blueprint names 2021-05-26 10:00:48 -04:00
pyxel 15116fa8bc when using dark mode change the ruler color 2021-05-24 09:51:30 -04:00
Gregory Anders ca6cee2e43 Update export ok file on repo visibility change 2021-05-21 14:21:13 -04:00
jack gleeson 462dcebc6d Fix breadcrumb text clipping issue
Fixing issue on low resolutions / narrow screens where the breadcrumb
menu items overlap under the reference items to the right. This is
closer to the hg.sr.ht layout which wraps on narrow screens.
2021-05-17 09:44:10 -04:00
Drew DeVault dc8013d1fd API: Cursor items are non-nullable 2021-05-17 07:29:25 -04:00
Drew DeVault 4ed68d5edb repo.html: fix link macro following jinja2 release 2021-05-16 15:09:58 -04:00
Armin Weigl 9ded7e5cfd Remove executable bit from blame.html 2021-04-30 14:30:26 -04:00
Drew DeVault c270776e0e gitsrht-update-hook: handle 402 from builds.sr.ht 2021-04-22 07:37:53 -04:00
Alexey Yerin 8bb62e89e8 Use "PATCH projectname" in format.subjectPrefix
Git formats the subject as following: [subjectprefix] title. Running
commands suggested there results in something like this:
[git.sr.ht] Fix bug
2021-04-15 13:43:22 -04:00
Marco Sirabella 9079966323 Always link to the log view on commit time
This is a bit more useful than being redirected to the same page you're
on when you're on summary or refs, and seeing no change
2021-04-08 08:17:32 -04:00
Drew DeVault 41b9b5e610 update-hook: remove shell: true from manifests 2021-04-07 08:03:47 -04:00
Marco Sirabella 171b41b0b2 Add minio dependency
It is used in `gitsrht/repos.py`
2021-04-02 13:56:08 -04:00
Drew DeVault 68dcdd33fd API: clarify schema license 2021-03-25 09:09:04 -04:00
Armin Weigl 06d89a7e5e Fix 500 on invalid file or directory name
This fixes server errors occuring when displaying a commit or tree, which
contains an non decodeable file or directory name
2021-03-22 10:21:55 -04:00
Armin Weigl b0e6248819 Fix common prefix dectection
Previously a rename that should have been rendered as:
	1/2 => 2/2
was rendered as:
	1/{2 => 2}
2021-03-17 11:03:01 -04:00
Armin Weigl 5df8556284 Fix /~o/r/log 500ing if default branch is invalid utf-8 2021-03-15 12:09:32 -04:00
Armin Weigl 0df2a1a953 Fix /api/~o/repos/r/refs 500ing on non utf-8 ref 2021-03-15 12:09:32 -04:00
Thorben Günther 24a7219e80 API: Run go mod tidy 2021-03-09 08:52:35 -05:00