~mariusor

https://metalhead.club/@mariusor

Mostly a programmer.

~mariusor/mpris-tools

Last active 11 minutes ago

~mariusor/go-activitypub-dev

Last active 6 days ago

~mariusor/go-activitypub-discuss

Last active 3 months ago
View more

Recent activity

Re: Extra quotes around activitypub.Content 3 months ago

From Marius Orcsik to ~mariusor/go-activitypub-discuss

On 23-12-14 14:07:23, Anders Pitman wrote:
> Is there a way to avoid those quotes? I can't just trim them at print time because I'm passing the entire object into a mustache template for rendering (don't worry I will be sure to sanitize any user input).

Hey Anders, thank you for your interest in GoActivitypub, it's great to
see some other people trying to build fediverse things with Go.

And to answer your question, yes there is a way. :)

The type that Value is based on is a []byte and it has some
functionality[1] (meant for debugging output mostly) that triggers the
behaviour you're experiencing.

To prevent this issue, I think calling .String() on the value should be
enough[2]. So your example would become from:

Re: [PATCH pyonji] Simplified the way we aggregate provider results 4 months ago

From Marius Orcsik to ~emersion/public-inbox

On 23-12-05 17:03:26, Simon Ser wrote:
> An issue is that some providers don't return immediately when the
> context expires. For instance the guess provider attempts to check SMTP,
> but the SMTP library doesn't really handle cancellation.

Returning on the first SMTP config in the channel returned an invalid
SMTP config for my test-case, the same one I mentioned in previous
patch, where I'm using purelymail with a custom domain.

The returned value was the full MX record host which then would hang
indefinitelly when checking the password. (It would try a TLS connection
to mailserver.purelymail.com instead of the guessed one which was
smtp.purelymail.com)

Re: [pyonji/patches/.build.yml] build failed 4 months ago

From Marius Orcsik to ~emersion/public-inbox

On 23-12-03 11:38:38, builds.sr.ht wrote:
> pyonji/patches/.build.yml: FAILED in 1m8s
> ✗ #1106519 FAILED pyonji/patches/.build.yml https://builds.sr.ht/~emersion/job/1106519

This seems to be an issue with strings.ContainsFunc which is not present
in go1.20.11 which is the Go version that the Apline image has available.

/Marius

Re: [pyonji/patches/.build.yml] build failed 4 months ago

From Marius Orcsik to ~emersion/public-inbox

On 23-12-03 11:38:38, builds.sr.ht wrote:
> pyonji/patches/.build.yml: FAILED in 1m8s
> 
> [Simplified the way we aggregate provider results][0] from [Marius Orcsik][1]
> 
> [0]: https://lists.sr.ht/~emersion/public-inbox/patches/47316
> [1]: marius@federated.id
> 
> ✗ #1106519 FAILED pyonji/patches/.build.yml https://builds.sr.ht/~emersion/job/1106519

This seems to be an issue with strings.ContainsFunc which is not present
in go1.20.11 which is the Go version that the Apline image has
available.

[PATCH pyonji] Simplified the way we aggregate provider results 4 months ago

From Marius Orcsik to ~emersion/public-inbox

There's no need to include specific logic for the timeout channel, as
it's being handled automatically in the scope where it was created.

This leaves us a cleaner select for the the provider results.

Because we're only interested in a valid SMTP config, we don't need to
aggregate the full provider results in a slice, so we only do that for
the errors.

We have moved the DNS SRV provider outside of the default providers list
as using it on top of the result provided by the guess provider would be
redundant and, more importantly, might return an invalid result.
---
 mailconfig/mailconfig.go | 64 +++++++++++++++-------------------------
[message trimmed]

Re: Error with a build in alpinelinux with cargo install 4 months ago

From Marius to ~sircmpwn/sr.ht-discuss

On 2023-11-28 09:29, Xavier B. wrote:
> but I don't know how to handle in .build.yml. Can anyone say me how to 
> modify it?
> 

It feels like the easiest solution would be to use a different base 
image.
Are there some other constraints that prevent you from doing that?

/Marius

Re: [PATCH 1/1] Unified the API for DiscoverSMTP for the providers slice 4 months ago

From Marius Orcsik to ~emersion/public-inbox

Hello Simon,

Is there a change for you to look at this?

Thanx,

/Marius

[PATCH 1/1] Unified the API for DiscoverSMTP for the providers slice 4 months ago

From Marius Orcsik to ~emersion/public-inbox

Replaced the private discoverSMTP() function by creating a type for
the slice of providers which conforms to the provider interface.

This removes the need to hardcode the flag for using the DNS backup
provider in favour of having two exported provider list:
DNSFallBackProviders, and DefaultProviders.
---
 mailconfig/guess.go      |  2 +-
 mailconfig/mailconfig.go | 35 ++++++++++++++++++-----------------
 2 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/mailconfig/guess.go b/mailconfig/guess.go
index c6546a4..933ac7e 100644
--- a/mailconfig/guess.go
[message trimmed]

[PATCH 0/1] PATCH Pyonji: Unified API for DiscoverSMTP for the providers slice 4 months ago

From Marius Orcsik to ~emersion/public-inbox

This makes the providers slice a separate type and also modifies the
discoverSMTP internal function to conform to the provider interface.

I'm not sure this type of patch that hasn't been discussed before is
acceptable to you, but I thought it would help in the long run to have
the same API on both the providers slice and the individual providers.

Cheers,
/Marius

Marius Orcsik (1):
  Unified the API for DiscoverSMTP for the providers slice

 mailconfig/guess.go      |  2 +-

Question about mailconfig logic 4 months ago

From Marius Orcsik to ~emersion/public-inbox

Hello Emersion,

I was just playing with pyonji and I think I spotted a bug in its smtp
autoconfig logic[1].

I'm not sure why you treat the ctx.Done() as an early exit with a
NotFound error.

This prevents the other results from being evaluated if they are later
in the slice.

If I treat both branches of the select as noops, I can login to my
server, but with the code as it is now, it fails.