* Re: [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge
[not found] ` <20210530185720.C7394209BF@vcs0.savannah.gnu.org>
@ 2021-05-30 19:56 ` Stefan Monnier
2021-05-31 4:56 ` Daniel Mendler
0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2021-05-30 19:56 UTC (permalink / raw)
To: Daniel Mendler; +Cc: emacs-devel
> +#+html: <a href="http://elpa.gnu.org/packages/marginalia.html"><img alt="GNU ELPA" src="https://img.shields.io/badge/GNU%20ELPA-marginalia-bb3955"/></a>
Would someone be interested in helping us make elpa.gnu.org serve those
"GNU ELPA badges" instead of asking shields.io to do it for us?
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge
2021-05-30 19:56 ` [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge Stefan Monnier
@ 2021-05-31 4:56 ` Daniel Mendler
2021-05-31 13:18 ` Daniel Mendler
0 siblings, 1 reply; 12+ messages in thread
From: Daniel Mendler @ 2021-05-31 4:56 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
On 5/30/21 9:56 PM, Stefan Monnier wrote:
>> +#+html: <a href="http://elpa.gnu.org/packages/marginalia.html"><img alt="GNU ELPA" src="https://img.shields.io/badge/GNU%20ELPA-marginalia-bb3955"/></a>
>
> Would someone be interested in helping us make elpa.gnu.org serve those
> "GNU ELPA badges" instead of asking shields.io to do it for us?
The shields.io code is available at https://github.com/badges/shields.
It is of course possible to use that svg builder code during the ELPA
build process. MELPA accesses shields.io during the build process, see
https://github.com/melpa/melpa/blob/master/package-build/package-build-badges.el.
Daniel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge
2021-05-31 4:56 ` Daniel Mendler
@ 2021-05-31 13:18 ` Daniel Mendler
2021-05-31 14:27 ` Stefan Monnier
0 siblings, 1 reply; 12+ messages in thread
From: Daniel Mendler @ 2021-05-31 13:18 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 946 bytes --]
On 5/31/21 6:56 AM, Daniel Mendler wrote:
>> Would someone be interested in helping us make elpa.gnu.org serve those
>> "GNU ELPA badges" instead of asking shields.io to do it for us?
>
> The shields.io code is available at https://github.com/badges/shields.
> It is of course possible to use that svg builder code during the ELPA
> build process. MELPA accesses shields.io during the build process, see
> https://github.com/melpa/melpa/blob/master/package-build/package-build-badges.el.
Stefan, I attached a "badge.sh" script which can be used to generate
badges without depending on an external service. It uses imagemagick
convert to compute the string width.
This script can be used as follows:
./badge.sh "GNU ELPA" "consult 0.8" bb3955 > consult.svg
./badge.sh "nonGNU ELPA" "markdown-mode 2.4" bb3955 > markdown-mode.svg
Depending on how the ELPA build process works it may make more sense to
convert this to an elisp script?
Daniel
[-- Attachment #2: badge.sh --]
[-- Type: application/x-sh, Size: 1962 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge
2021-05-31 13:18 ` Daniel Mendler
@ 2021-05-31 14:27 ` Stefan Monnier
2021-06-03 14:42 ` Basil L. Contovounesios
0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2021-05-31 14:27 UTC (permalink / raw)
To: Daniel Mendler; +Cc: emacs-devel
> Stefan, I attached a "badge.sh" script which can be used to generate
> badges without depending on an external service. It uses imagemagick
> convert to compute the string width.
Thanks, that looks like just what we need.
> This script can be used as follows:
>
> ./badge.sh "GNU ELPA" "consult 0.8" bb3955 > consult.svg
> ./badge.sh "nonGNU ELPA" "markdown-mode 2.4" bb3955 > markdown-mode.svg
>
> Depending on how the ELPA build process works it may make more sense to
> convert this to an elisp script?
You can see the code we use at:
http://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/elpa-admin.el?h=elpa-admin
In other words it's in the `elpa-admin.el` file in `elpa-admin` branch
of the `elpa.git` repository. So yes, using ELisp will make more sense.
So we'd want the badge URL used in the `README.(md|org)`s such that the
badge indicates the latest version of the package?
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge
2021-05-31 14:27 ` Stefan Monnier
@ 2021-06-03 14:42 ` Basil L. Contovounesios
2021-06-03 14:51 ` Daniel Mendler
0 siblings, 1 reply; 12+ messages in thread
From: Basil L. Contovounesios @ 2021-06-03 14:42 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Daniel Mendler, emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> So we'd want the badge URL used in the `README.(md|org)`s such that the
> badge indicates the latest version of the package?
Yes, and thanks for setting up this nice eye candy.
Only minor issue is that the new badges don't play well with hosting
services that aggressively cache images, such as GitHub:
https://github.com/magnars/dash.el
Note that the GNU-devel ELPA version trails the corresponding MELPA one
due to server-side caching.
MELPA seems to solve this by configuring their NGINX web server to serve
badges with the HTTP header 'Cache-Control: no-cache':
https://github.com/melpa/melpa/pull/2231
https://github.com/melpa/melpa/commit/d75f22a6
https://github.com/melpa/melpa/commit/1834069f
$ wget -Sq https://elpa.gnu.org/devel/dash.svg
HTTP/1.1 200 OK
Date: Thu, 03 Jun 2021 14:27:49 GMT
Server: Apache/2.4.38 (Debian)
Last-Modified: Wed, 02 Jun 2021 21:02:33 GMT
ETag: "522-5c3cec70ecf29"
Accept-Ranges: bytes
Content-Length: 1314
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: image/svg+xml
$ wget -Sq https://melpa.org/packages/dash-badge.svg
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Jun 2021 14:28:05 GMT
Content-Type: image/svg+xml
Content-Length: 1165
Last-Modified: Thu, 03 Jun 2021 13:27:58 GMT
Connection: keep-alive
ETag: "60b8d8de-48d"
Cache-Control: no-cache
Accept-Ranges: bytes
Is there someone here with access to GNU ELPA's Apache configuration
that would make a similar change? If not, where should this request go?
Thanks,
--
Basil
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge
2021-06-03 14:42 ` Basil L. Contovounesios
@ 2021-06-03 14:51 ` Daniel Mendler
2021-06-03 15:16 ` Stefan Monnier
0 siblings, 1 reply; 12+ messages in thread
From: Daniel Mendler @ 2021-06-03 14:51 UTC (permalink / raw)
To: Basil L. Contovounesios, Stefan Monnier; +Cc: emacs-devel
On 6/3/21 4:42 PM, Basil L. Contovounesios wrote:
> Only minor issue is that the new badges don't play well with hosting
> services that aggressively cache images, such as GitHub:
>
> https://github.com/magnars/dash.el
Thank you for reporting this. I've also noticed this with my packages.
One can reset the caching by making a `curl -X PURGE` request to the
correct cache url, but this is of course no viable solution.
> MELPA seems to solve this by configuring their NGINX web server to serve
> badges with the HTTP header 'Cache-Control: no-cache':
>
> https://github.com/melpa/melpa/pull/2231
> https://github.com/melpa/melpa/commit/d75f22a6
> https://github.com/melpa/melpa/commit/1834069f
>
> $ wget -Sq https://elpa.gnu.org/devel/dash.svg
> HTTP/1.1 200 OK
> Date: Thu, 03 Jun 2021 14:27:49 GMT
> Server: Apache/2.4.38 (Debian)
> Last-Modified: Wed, 02 Jun 2021 21:02:33 GMT
> ETag: "522-5c3cec70ecf29"
> Accept-Ranges: bytes
> Content-Length: 1314
> Keep-Alive: timeout=5, max=100
> Connection: Keep-Alive
> Content-Type: image/svg+xml
> $ wget -Sq https://melpa.org/packages/dash-badge.svg
> HTTP/1.1 200 OK
> Server: nginx
> Date: Thu, 03 Jun 2021 14:28:05 GMT
> Content-Type: image/svg+xml
> Content-Length: 1165
> Last-Modified: Thu, 03 Jun 2021 13:27:58 GMT
> Connection: keep-alive
> ETag: "60b8d8de-48d"
> Cache-Control: no-cache
> Accept-Ranges: bytes
>
> Is there someone here with access to GNU ELPA's Apache configuration
> that would make a similar change? If not, where should this request go?
I was about to suggest something along those lines, but it was not clear
to me that "no-cache" is sufficient to disable the aggressive caching. I
assume Stefan can adjust the Apache setting to serve *.svg files with
"no-cache" from the packages directory.
Daniel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge
2021-06-03 14:51 ` Daniel Mendler
@ 2021-06-03 15:16 ` Stefan Monnier
2021-06-03 16:07 ` Jean Louis
2021-06-03 23:12 ` chad
0 siblings, 2 replies; 12+ messages in thread
From: Stefan Monnier @ 2021-06-03 15:16 UTC (permalink / raw)
To: Daniel Mendler; +Cc: Basil L. Contovounesios, emacs-devel
>> Is there someone here with access to GNU ELPA's Apache configuration
>> that would make a similar change?
I do have access, but it's been too many years since the last time
I played with Apache's config, so I'd welcome some hand-holding.
>> If not, where should this request go?
> I was about to suggest something along those lines, but it was not clear
> to me that "no-cache" is sufficient to disable the aggressive caching.
> I assume Stefan can adjust the Apache setting to serve *.svg files with
> "no-cache" from the packages directory.
Any change we can use something less aggressive than `no-cache`,
e.g. indicate that it should be considered stale after, say, 24h?
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge
2021-06-03 15:16 ` Stefan Monnier
@ 2021-06-03 16:07 ` Jean Louis
2021-06-03 23:12 ` chad
1 sibling, 0 replies; 12+ messages in thread
From: Jean Louis @ 2021-06-03 16:07 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Basil L. Contovounesios, Daniel Mendler, emacs-devel
* Stefan Monnier <monnier@iro.umontreal.ca> [2021-06-03 18:17]:
> >> Is there someone here with access to GNU ELPA's Apache configuration
> >> that would make a similar change?
>
> I do have access, but it's been too many years since the last time
> I played with Apache's config, so I'd welcome some hand-holding.
>
> >> If not, where should this request go?
> > I was about to suggest something along those lines, but it was not clear
> > to me that "no-cache" is sufficient to disable the aggressive caching.
> > I assume Stefan can adjust the Apache setting to serve *.svg files with
> > "no-cache" from the packages directory.
>
> Any change we can use something less aggressive than `no-cache`,
> e.g. indicate that it should be considered stale after, say, 24h?
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 day"
ExpiresByType image/jpeg "access plus 1 day"
ExpiresByType image/gif "access plus 1 day"
ExpiresByType image/png "access plus 1 day"
ExpiresByType text/css "access plus 1 day"
ExpiresByType application/pdf "access plus 1 day"
ExpiresByType text/x-javascript "access plus 1 day"
ExpiresByType application/x-shockwave-flash "access plus 1 day"
ExpiresByType image/x-icon "access plus 1 day"
ExpiresDefault "access plus 1 day"
</IfModule>
## EXPIRES CACHING ##
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge
2021-06-03 15:16 ` Stefan Monnier
2021-06-03 16:07 ` Jean Louis
@ 2021-06-03 23:12 ` chad
2021-06-09 20:54 ` Stefan Monnier
1 sibling, 1 reply; 12+ messages in thread
From: chad @ 2021-06-03 23:12 UTC (permalink / raw)
To: Stefan Monnier
Cc: Basil L. Contovounesios, Daniel Mendler, EMACS development team
[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]
On Thu, Jun 3, 2021 at 8:16 AM Stefan Monnier <monnier@iro.umontreal.ca>
wrote:
> Any change we can use something less aggressive than `no-cache`,
> e.g. indicate that it should be considered stale after, say, 24h?
>
You can try using the s-maxage setting for Cache Control, ala:
s-maxage=<seconds>
Overrides max-age or the Expires header, but only for shared caches (e.g.,
proxies). Ignored by private caches.
I would definitely test it before investing too much effort; in a past
life, I spent waaay too much time dealing with the general internet's
understanding/respect for the refinements of communication between clients,
servers, proxies, and caches. (tl;dr: The internet is more broken than you
expect. Yes, even you, for nearly all values of "you".)
If s-maxage doesn't work, you might have more luck with max-age (which I
guess is consistent in the number of hyphens?) instead.
You should be able to use the Apache "Header" directive, something like:
Header set Cache-control "s-maxage=86400, public"
put inside the relevant <Directory "/mumble/badges"> or <Filesmatch
"\.svg$"> or whatnot wrapper.
I haven't actually done this in a very long time, but a quick net-search
suggests that it's still basically as functional. Hope this helps,
~Chad
[-- Attachment #2: Type: text/html, Size: 1964 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge
2021-06-03 23:12 ` chad
@ 2021-06-09 20:54 ` Stefan Monnier
2021-06-09 21:41 ` Basil L. Contovounesios
2021-06-10 0:19 ` Jean Louis
0 siblings, 2 replies; 12+ messages in thread
From: Stefan Monnier @ 2021-06-09 20:54 UTC (permalink / raw)
To: chad; +Cc: Daniel Mendler, Basil L. Contovounesios, EMACS development team
> You should be able to use the Apache "Header" directive, something like:
>
> Header set Cache-control "s-maxage=86400, public"
I tried adding
<Filesmatch "\.svg$">
Header set Cache-control "s-maxage=86400, public"
</Filesmatch>
to apache2.conf, but it gave me:
... apachectl[..]: AH00526: Syntax error on line 189
... apachectl[..]: Invalid command 'Header', perhaps
-- Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge
2021-06-09 20:54 ` Stefan Monnier
@ 2021-06-09 21:41 ` Basil L. Contovounesios
2021-06-10 0:19 ` Jean Louis
1 sibling, 0 replies; 12+ messages in thread
From: Basil L. Contovounesios @ 2021-06-09 21:41 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Daniel Mendler, chad, emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> You should be able to use the Apache "Header" directive, something like:
>>
>> Header set Cache-control "s-maxage=86400, public"
>
> I tried adding
>
> <Filesmatch "\.svg$">
> Header set Cache-control "s-maxage=86400, public"
> </Filesmatch>
>
> to apache2.conf, but it gave me:
>
> ... apachectl[..]: AH00526: Syntax error on line 189
> ... apachectl[..]: Invalid command 'Header', perhaps
Could it be a missing module? (I've never used Apache.)
https://stackoverflow.com/a/34554701/3084001
Thanks,
--
Basil
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge
2021-06-09 20:54 ` Stefan Monnier
2021-06-09 21:41 ` Basil L. Contovounesios
@ 2021-06-10 0:19 ` Jean Louis
1 sibling, 0 replies; 12+ messages in thread
From: Jean Louis @ 2021-06-10 0:19 UTC (permalink / raw)
To: Stefan Monnier
Cc: Basil L. Contovounesios, Daniel Mendler, chad,
EMACS development team
* Stefan Monnier <monnier@iro.umontreal.ca> [2021-06-09 23:55]:
> > You should be able to use the Apache "Header" directive, something like:
> >
> > Header set Cache-control "s-maxage=86400, public"
>
> I tried adding
>
> <Filesmatch "\.svg$">
> Header set Cache-control "s-maxage=86400, public"
> </Filesmatch>
>
> to apache2.conf, but it gave me:
>
> ... apachectl[..]: AH00526: Syntax error on line 189
> ... apachectl[..]: Invalid command 'Header', perhaps
Maybe you have to enable module:
https://httpd.apache.org/docs/2.4/mod/mod_cache.html
$ a2enmod
then enable `headers' and `cache'
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2021-06-10 0:19 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20210530185719.10480.76043@vcs0.savannah.gnu.org>
[not found] ` <20210530185720.C7394209BF@vcs0.savannah.gnu.org>
2021-05-30 19:56 ` [elpa] externals/marginalia 94fc7f0: README: Add ELPA badge Stefan Monnier
2021-05-31 4:56 ` Daniel Mendler
2021-05-31 13:18 ` Daniel Mendler
2021-05-31 14:27 ` Stefan Monnier
2021-06-03 14:42 ` Basil L. Contovounesios
2021-06-03 14:51 ` Daniel Mendler
2021-06-03 15:16 ` Stefan Monnier
2021-06-03 16:07 ` Jean Louis
2021-06-03 23:12 ` chad
2021-06-09 20:54 ` Stefan Monnier
2021-06-09 21:41 ` Basil L. Contovounesios
2021-06-10 0:19 ` Jean Louis
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).