~zash

Sweden

http://www.zash.se/

I mostly hack on XMPP things. Mostly.

Trackers

~zash/prosody

Last active 4 years ago

~zash/whatarethis

Last active 5 years ago

#168 OAuth 2.0 authorization grant_type checks for "code" instead of "authorization_code" 4 years ago

Ticket created by ~zash on ~sircmpwn/meta.sr.ht

After getting an authorization code and requesting a token

POST https://meta.sr.ht/oauth2/access-token
Authorization: Basic b64(client_id:client_secret)

grant_type=authorization_code@code=...

I got back this answer:

{"error": "unsupported_grant_type",
"error_description": "Unsupported grant type 'authorization_code'",
"error_uri": "https://man.sr.ht/meta.sr.ht/oauth.md"}

RFC6749 section 4.1.3 states:

grant_type REQUIRED. Value MUST be set to "authorization_code".

The relevant code in metasrht/blueprints/oauth2.py does this:

if grant_type != "code":
    return access_token_error("unsupported_grant_type",
            f"Unsupported grant type '{grant_type}'")

#254 Invalid mailbox name: Name must not have '/' characters 5 years ago

Comment by ~zash on ~sircmpwn/aerc2

I ended up reconfiguring Dovecot

#25 Mercurial bookmarks aren't pushed 5 years ago

Comment by ~zash on ~sircmpwn/hg.sr.ht

It appears that mercurial says "exporting bookmark ..." even if the bookmark is pointed at a secret commit, which wouldn't be sent to the remote.

https://paste.sr.ht/%7Ezash/92e4750048a037eae8308ac15f2c52cc8371d1d5

#25 Mercurial bookmarks aren't pushed 5 years ago

Comment by ~zash on ~sircmpwn/hg.sr.ht

ignored 11 secret changesets

Is master by any chance pointed at one of those secret changesets?

#20 Traceback after pushing repeatedly amended draft commit 5 years ago

Comment by ~zash on ~sircmpwn/hg.sr.ht

#279 Wrong part of multipart message shown 5 years ago

Ticket created by ~zash on ~sircmpwn/aerc2

A signed multipart message with plain text and html parts is shows raw html instead of the text part.

Here's the email: https://paste.sr.ht/%7Ezash/d863e889ab2d3d272fcb40daf5fee3170e37f300

The structure tree at the bottom of aerc looks like

multipart/signed                                                                                                                                                                                                                               
multipart/mixed                                                                                                                                                                                                                                
multipart/alternative                                                                                                                                                                                                                          
        text/plain (this line is highlighted)                                                                                                                                                                                                                            
        text/html                                                                                                                                                                                                                              
    application/pgp-signature (signature.asc)                                                                                                                                                                                                  
  text/plain                                                                                                                                                                                                                                   

#254 Invalid mailbox name: Name must not have '/' characters 5 years ago

Ticket created by ~zash on ~sircmpwn/aerc2

Dovecot default directory separator which is apparently '.'

:archive year

#20 Traceback after pushing repeatedly amended draft commit 5 years ago

Ticket created by ~zash on ~sircmpwn/hg.sr.ht

#!/bin/bash

set -v
# Create repo 'test' via web ui at https://hg.sr.ht/create

# Enable non-publishing / evolve in settings -> features

hg clone ssh://hg@hg.sr.ht/~SR_HT_USER/test
cd test

# An initial commit to avoid "repo is unrelated" when pushing amended commit

echo 1 > file
hg ci -A -m initial

# Another commit which we'll amend some

echo 2 > file
hg ci -m change
hg push

# Amend and push once

echo 3 > file
hg amend
hg push


# Amend and push again

echo 4 > file
hg amend
hg push

# And now it's broken?

hg push
hg pull

Last command(s) produce a traceback like:

pushing to ssh://hg@hg.sr.ht/~zash/test
searching for changes
remote: ** Unknown exception encountered with possibly-broken third-party extension srht
remote: ** which supports versions unknown of Mercurial.
remote: ** Please disable srht and try your action again.
remote: ** If that fixes the bug please report it to the extension author.
remote: ** Python 2.7.16 (default, May  6 2019, 19:35:26) [GCC 8.3.0]
remote: ** Mercurial Distributed SCM (version 4.9.1)
remote: ** Extensions loaded: srht, clonebundles, strip, evolve.serveronly
remote: Traceback (most recent call last):
remote:   File "/usr/bin/hg-ssh", line 97, in <module>
remote:     main()
remote:   File "/usr/bin/hg-ssh", line 82, in main
remote:     dispatch.dispatch(req)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 225, in dispatch
remote:     ret = _runcatch(req) or 0
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 376, in _runcatch
remote:     return _callcatch(ui, _runcatchfunc)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 384, in _callcatch
remote:     return scmutil.callcatch(ui, func)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/scmutil.py", line 165, in callcatch
remote:     return func()
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 367, in _runcatchfunc
remote:     return _dispatch(req)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 1021, in _dispatch
remote:     cmdpats, cmdoptions)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 756, in runcommand
remote:     ret = _runcommand(ui, options, cmd, d)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 1030, in _runcommand
remote:     return cmdfunc()
remote:   File "/usr/lib/python2.7/site-packages/mercurial/dispatch.py", line 1018, in <lambda>
remote:     d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/util.py", line 1670, in check
remote:     return func(*args, **kwargs)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/commands.py", line 5270, in serve
remote:     s.serve_forever()
remote:   File "/usr/lib/python2.7/site-packages/mercurial/wireprotoserver.py", line 794, in serve_forever
remote:     self.serveuntil(threading.Event())
remote:   File "/usr/lib/python2.7/site-packages/mercurial/wireprotoserver.py", line 800, in serveuntil
remote:     _runsshserver(self._ui, self._repo, self._fin, self._fout, ev)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/wireprotoserver.py", line 655, in _runsshserver
remote:     rsp = wireprotov1server.dispatch(repo, proto, request)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/wireprotov1server.py", line 74, in dispatch
remote:     return func(repo, proto, *args)
remote:   File "/usr/lib/python2.7/site-packages/hgext3rd/evolve/obsdiscovery.py", line 778, in srv_obshashrange_v1
remote:     hashes = _obshashrange_v0(repo, ranges)
remote:   File "/usr/lib/python2.7/site-packages/hgext3rd/evolve/obsdiscovery.py", line 736, in _obshashrange_v0
remote:     repo.obsstore.rangeobshashcache.update(repo)
remote:   File "/usr/lib/python2.7/site-packages/hgext3rd/evolve/obscache.py", line 175, in update
remote:     upgrade = self._upgradeneeded(repo)
remote:   File "/usr/lib/python2.7/site-packages/hgext3rd/evolve/obscache.py", line 279, in _upgradeneeded
remote:     markers = markersfrom(obsstore, keyobssize, keyobslength)
remote:   File "/usr/lib/python2.7/site-packages/hgext3rd/evolve/obscache.py", line 90, in markersfrom
remote:     return obsolete._readmarkers(obsdata, byteoffset)[1]
remote:   File "/usr/lib/python2.7/site-packages/mercurial/util.py", line 1621, in wrapper
remote:     return func(*args, **kwargs)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/obsolete.py", line 475, in _readmarkers
remote:     return diskversion, formats[diskversion][0](data, off, stop)
remote:   File "/usr/lib/python2.7/site-packages/mercurial/obsolete.py", line 454, in _fm1readmarkers
remote:     return native(data, off, stop)
remote: ValueError: overflow in obsstore
abort: unexpected response: empty string

Local version of hg & evolve:

$ hg version -v
Mercurial Distributed SCM (version 5.0)
(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2019 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Enabled extensions:

  evolve  external  8.5.1

#19 Differentiate draft vs public commits 5 years ago

Ticket created by ~zash on ~sircmpwn/hg.sr.ht

Different style or a label to show which phase a commit is in would be good.

#1 Figure stuff out 6 years ago

cyan added by ~zash on ~zash/whatarethis