List for cgit developers and users
 help / color / mirror / Atom feed
From: john at keeping.me.uk (John Keeping)
Subject: [PATCH v3 1/1] snapshot: support tar signature for compressed tar
Date: Wed, 27 Jun 2018 21:14:19 +0100	[thread overview]
Message-ID: <20180627201419.GS6584@john.keeping.me.uk> (raw)
In-Reply-To: <CAHmME9rZSD_+6FJ06ziwOok9XWomzunuYoDQze5RWstvXs=hvg@mail.gmail.com>

On Wed, Jun 27, 2018 at 06:34:56PM +0200, Jason A. Donenfeld wrote:
> I've merged all the surrounding changes, but I'm not quite satisfied
> with the implementation of this one.
> 
> > +       for (f_tar = cgit_snapshot_formats; strcmp(f_tar->suffix, ".tar") != 0; f_tar++)
> > +               /* nothing */ ;
> > +
> > +               } else if (starts_with(f->suffix, ".tar") && cgit_snapshot_get_sig(ref, f_tar)) {
> > +                       strbuf_setlen(&filename, strlen(filename.buf) - strlen(f->suffix));
> > +                       strbuf_addstr(&filename, ".tar.asc");
> > +                       html(" (");
> > +                       cgit_snapshot_link("sig", NULL, NULL, NULL, NULL,
> > +                                          filename.buf);
> > +                       html(")");
> 
> Can we, instead, _not_ special case .tar, but rather just allow for
> all signatures, if the note .asc exists? We don't want to serve
> arbitrary tarballs and archives, because this means load and bandwidth
> for the server that wasn't explicitly opted in by the admin, but all
> signatures are necessarily explicitly uploaded, so why restrict them
> from being downloaded?

I'm not quite sure what you're asking here, this is just printing the
signature link after the snapshow download link.

The idea here is that if you are downloading a .tar.gz then the
signature for the base .tar is better (it's easier to consistently
generate a .tar than it is a .tar.gz), so the admin will choose to
provide .tar.asc instead of .tar.gz.asc.

I would quite like to avoid special-casing .tar in the code like this
and instead allow a fallback option (or even bitmask) in the formats
table as a more generic implementation, but I don't think that's your
complaint here (I also don't think we'll ever add it for other formats,
so hardcoding .tar isn't too bad).


John


  reply	other threads:[~2018-06-27 20:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07 12:12 Custom snapshot prefix & Snapshot signatures list
2018-06-07 12:15 ` [PATCH 1/1] snapshot: support tar signature for compressed tar list
2018-06-07 13:17   ` john
2018-06-07 15:13     ` list
2018-06-07 15:14       ` [PATCH v2 1/2] ui-snapshot: use named constants for snapshot formats list
2018-06-07 15:14         ` [PATCH v2 2/2] snapshot: support tar signature for compressed tar list
2018-06-07 15:21           ` john
2018-06-07 19:36             ` list
2018-06-07 19:38               ` [PATCH v3 1/1] " list
2018-06-27 16:34                 ` Jason
2018-06-27 20:14                   ` john [this message]
2018-07-02  7:10                     ` list
2018-07-03 18:56                       ` Jason
2018-06-08 22:11             ` [PATCH 1/1] snapshot: strip bit from struct cgit_snapshot_format list
2018-06-09 11:16               ` john
2018-06-11  6:51                 ` list
2018-06-11  6:53                   ` [PATCH v2 " list
2018-06-07 13:10 ` Custom snapshot prefix & Snapshot signatures john

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180627201419.GS6584@john.keeping.me.uk \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).