#dev 2024-01-05

2024-01-05 UTC
[tantek], to2ds, barnaby, geoffo, gxt and [cleverdevil] joined the channel
#
[cleverdevil]
Hey folks. I have mentioned to y'all that I have been working on a new version of my site with a bespoke CMS. I am interested in finding other developers who want to collaborate and potentially use it with their own sites. To that end, I have scrubbed the repository for the CMS, and put it here: https://github.com/cleverdevil/dwell
#
[cleverdevil]
In addition, I have a git repo for a recent dump / conversion of over 13,000 posts from my site and historical silos from 20+ years of publishing here: https://github.com/cleverdevil/dwell-content-cleverdevil-io
#
Loqi
[preview] [cleverdevil] dwell-content-cleverdevil-io: A sample content directory for powering the Dwell version of cleverdevil.io, for reference.
#
[cleverdevil]
If you want to see what the in-progress version of the site looks like running that code, with that content repository, take a look here: http://107.20.103.83/
#
[cleverdevil]
Be gentle, but I'd love to get any feedback or see if anyone is interested in maybe sharing the code and approach for our sites!
#
[tantek]
whoa! cool cleverdevil++
#
Loqi
cleverdevil has 2 karma in this channel over the last year (7 in all channels)
#
[aciccarello]
Sounds like a cool concept, storing everything in static files and parsing on startup. I haven't heard much about DuckDB before so I'm curious how that works.
#
[cleverdevil]
DuckDB is pretty great, I hadn't used it much up until now, but I'm a huge fan now.
#
[cleverdevil]
I can run `duckdb < sql/create-database content.db` and it will parse, index, and make queryable the entire directory structure within about 2-3 seconds on a reasonably powered machine.
#
[cleverdevil]
When a new post is created, I can sometimes do an in-place update and others I can just re-initialize the entire site before anyone notices.
#
[cleverdevil]
The monthly summaries are my favorite part of my ported site so far - http://107.20.103.83/archive/2023/1
jacky joined the channel
#
jacky
https://social.skewed.de/@tiago/111697462815803763 might be interesting for building social graphs, perhaps?
#
Loqi
[preview] [Tiago Peixoto] The code for this, as usual, will soon be available in the next release the graph-tool Python library: https://graph-tool.skewed.deIt's implemented in C++ with OpenMP so you can unleash it on your large data. N/N
jacky joined the channel
#
jacky
hm how does one use bridgy to publish to bluesky?
#
jacky
or am I right in guessing it's only backfeed for now
#
jacky
ah yes it's backfeed only okay
#
jacky
how do people indicate unlisted posts on their site?
#
jacky
randomly did that and forgot I had this little marker with a mailbox https://jacky.wtf/2024/1/U6fs
#
Loqi
[preview] a demo
#
[cleverdevil]
For Bluesky publishing I whipped up a really simple and basic integration for Known in PHP. It would be pretty easy to port to other languages and I have it condensed down to the simplest interaction with Bluesky I could make.
#
[cleverdevil]
I do use Bridgy to pull interactions back as webmentions.
geoffo, gerben and alephalpha0 joined the channel
#
GWG
[capjamesg]: Got link?
#
[tantek]
that needs to be a t-shirt
#
GWG
Oops, should have been [cleverdevil], I autocomplete [capjamesg] too often
#
GWG
Going to bed, clearly it's late
#
Loqi
Ok, I'll tell them that when I see them next
oenone joined the channel
#
Zegnat
[cleverdevil]: that link 404s for me
c88 joined the channel
#
[cleverdevil]
Oh right it’s private 🤦‍♂️
#
[cleverdevil]
I’ll put a gist up with the relevant parts tomorrow :)
[campegg] joined the channel
#
[campegg]
[tantek] Sorry, just now reinstalling Slack and other work-related stuff on phone post-vacation and saw your message. Re: Strava, not currently—I broke some stuff and had to take it down for a bit (hence the redirect)… it was on my “should fix before vacation” list, but I just never got it done.
barnaby joined the channel
#
c​apjamesg
[tantek] sknebel The sparkline service takes a URL like: https://sparkline.jamesg.blog/?username=Jamesg.blog&api_url=https://indieweb.org/wiki/api.php&only_image=true and redirects the user to their sparkline.
#
c​apjamesg
I'm not sure how that impacts our caching.
#
c​apjamesg
So, if you get "https://sparkline.jamesg.blog/?username=Jamesg.blog&api_url=https://indieweb.org/wiki/api.php&only_image=true" every hour, you will be taken to the most up-to-date sparkline.
#
c​apjamesg
That is the URL that makes the requests. The URL to which you are redirected is your sparkline.
#
c​apjamesg
[tantek] You could "curl https://sparkline.jamesg.blog/?username=Jamesg.blog&api_url=https://indieweb.org/wiki/api.php&only_image=true" and save the results of the redirect to your file system every hour.
#
c​apjamesg
Now I'm looking at my code, I do a variant of that.
#
c​apjamesg
My sparkline only updates when my site updates.
#
sknebel
should double-check the redirects are cached too then
#
c​apjamesg
I _think_ it is working.
#
c​apjamesg
I set up a 60m cache policy.
#
c​apjamesg
Made an edit to the wiki.
#
c​apjamesg
And now the redirect is the same as it was before the edit.
#
c​apjamesg
And when I clear the cache it works!
#
c​apjamesg
Wow!
#
c​apjamesg
sknebel++
#
Loqi
sknebel has 14 karma in this channel over the last year (38 in all channels)
#
Loqi
[preview] Adventures in nginx caching and redirects
#
c​apjamesg
Small error in the embed. Will fix.
#
rubenwardy
I highly recommend adding `add_header X-Cache-Status $upstream_cache_status;` to your config so you can verify that caching is working
#
rubenwardy
some of my caching was broken because the upstream source was including `nocache` in the Cache-Control
#
c​apjamesg
I love this!!!
#
c​apjamesg
rubenwardy++
#
Loqi
rubenwardy has 8 karma in this channel over the last year (10 in all channels)
#
c​apjamesg
Thank you!
#
c​apjamesg
That makes testing _so much_ easier.
#
rubenwardy
I suggest adding it to your blog post
#
rubenwardy
It needs to be everywhere as it's easy to miss
[KevinMarks] joined the channel
#
[KevinMarks]
embed looks odd in chrome
#
c​apjamesg
What...
#
c​apjamesg
[KevinMarks] What extensions do you have installed?
#
c​apjamesg
I'm running Chrome too and don't see that.
#
c​apjamesg
rubenwardy Will do!
gxt joined the channel
#
[KevinMarks]
If I turn that off the sparkline shows. Looks like it was over-eager in grabbing embeds.
AramZS, jacky, geoffo and to2ds joined the channel
#
[tantek]
this is why it should be img not embed
#
[tantek]
there is no reason to use an embed tag for SVG AFAIK
#
[tantek]
what is X-Cache-Status
#
Loqi
It looks like we don't have a page for "X-Cache-Status" yet. Would you like to create it? (Or just say "X-Cache-Status is ____", a sentence describing the term)
#
[tantek]
would appreciate those using X-Cache-Status on their personal site documenting a stub page on the wiki with code examples of how they're using it! rubenwardy capjamesg and anyone else
to2ds and [Jo] joined the channel
#
c​apjamesg
[tantek] It doesn't work with an img tag.
#
rubenwardy
what is caching
#
Loqi
It looks like we don't have a page for "caching" yet. Would you like to create it? (Or just say "caching is ____", a sentence describing the term)
to2ds joined the channel
#
[KevinMarks]
Why not? Are you not sending the mime type?
#
c​apjamesg
The URL to embed redirects.
#
c​apjamesg
That takes you to the SVG file.
#
c​apjamesg
It doesn't serve it up.
#
[tantek]
it should work per web architecture
#
[tantek]
for the same reason that you might re-organize your site and move images around
#
rubenwardy
it returns a 200 - text/html
#
rubenwardy
nevermind, forgot to quote
#
rubenwardy
curl -I "https://sparkline.jamesg.blog/?username=User%3AJamesg.blog&api_url=https%3A%2F%2Findieweb.org%2Fwiki%2Fapi.php&only_image=true"
#
rubenwardy
HTTP/2 302
#
rubenwardy
content-type: text/html;charset=utf-8
#
rubenwardy
this should be content-type: image/svg
#
rubenwardy
actually maybe not
#
rubenwardy
Ok, changing the embed to an img pointing directly at the svg file results in an error too. So it's not the redirect
#
rubenwardy
console has "Unexpected value NaN% parsing y2 attribute. sparkline.svg"
#
aaronpk
looks like this will not work in img tag due to the javascript in the svg https://security.stackexchange.com/a/212960
#
rubenwardy
makes sense
#
[tantek]
why is there JS in the SVG?!?
#
rubenwardy
that does not make sense
#
[tantek]
a relatively simple line graph like that has no need for JS 😞
#
aaronpk
the SVG is built with JS
#
aaronpk
capjamesg: if you can run server-side code it should be relatively easy to build the SVG server side so that it doesn't require JS
#
rubenwardy
you could also do it at build time if you use something that allows plugins like Eleventy
#
[tantek]
well that's a use-case I wasn't expecting for the embed tag
#
[tantek]
also TIL embed tag can execute JS?!?
#
Loqi
[preview] SVG Sparklines 2016-04-18
#
[tantek]
so we are ok with depending on JS for static images?!?
#
[tantek]
I mean if the sparkline auto-updated while you were looking at the page that would be different
#
[KevinMarks]
That would be more work, but good point.
#
[tantek]
this seems like something I should built into CASSIS
#
[tantek]
build* into CASSIS so you can run a tiny bit of JS/PHP on the server to generate the SVG instead
#
[tantek]
instead of clientside JS and thus requiring an embed tag 🤦‍♂️
#
[KevinMarks]
Seems reasonable, I think me and James were following sil's example
#
aaronpk
that's what i did with mine
#
[tantek]
tinbox << add sparkline SVG generation support to [[CASSIS]] so it can be run on the server and return an SVG to the browser instead of the clientside JS that folks are sending to their site viewers in embed tags
#
Loqi
ok, I added "add sparkline SVG generation support to [[CASSIS]] so it can be run on the server and return an SVG to the browser instead of the clientside JS that folks are sending to their site viewers in embed tags" to the "See Also" section of /User:Tantek.com/tinbox https://indieweb.org/wiki/index.php?diff=91966&oldid=91938
#
[tantek]
^ that diagram though, I feel it belongs somewhere on an IndieWeb development page
#
Loqi
[preview] [Jan Miksovsky] I see so many web platform diagrams that represent HTML/CSS/JS in a tidy, complete arrangement that suggests those are everything you need to know — when in reality those only let you define what happens in individual pages. A more realistic diagra... https://cdn.fosstodon.org/media_attachments/files/111/704/370/707/380/041/original/9ffb2f5afc9067f8.png
#
[tantek]
^ yes that one Loqi. thanks Loqi
to2ds joined the channel
#
c​apjamesg
[KevinMarks] Yep re: following the example.
#
c​apjamesg
aaronpk I could build the svg server side...
to2ds and gRegor joined the channel
#
[tantek]
capjamesg that would be great! what language would you use server side to do that? 👀
#
[tantek]
also it would be a useful demo at least to have a separate service that took a data series and turned it into an SVG
#
[tantek]
what are pipes
#
Loqi
Pipes are IndieWeb tools that produce or consume various building blocks and are useful as part of some other service; pipes may also refer to the defunct Yahoo Pipes service https://indieweb.org/pipes
#
[tantek]
^ any thoughts on that diagram about that expresses the missing pieces web developers need beyond HTML+CSS+JS ?
#
gRegor
remove the JS? 😏 jk
geoffo joined the channel
#
[tantek]
lol, the toot thread points out that flaw in the diagram: https://fosstodon.org/@JanMiksovsky/111704377144794883
#
Loqi
[preview] [Jan Miksovsky] JavaScript developers will happily explain that their preferred language can be used for all those purposes via Node, so for them the first diagram is actually complete. That’s great for them! (I use Node too.)But many people don’t want to learn ...
#
c​apjamesg
[tantek] I don't think it should be a separate service.
#
c​apjamesg
I'd just update the sparkline site.
to2ds joined the channel
#
to2ds
Maybe add WASM? 😄
#
r​eal_devastatia
Is there any detailed documentation on avoiding loopbacks when sending Webmentions? Specifically, what if the origin and target are on shared hosting accounts and hosted on the same server?
#
[tantek]
capjamesg, sure you can integrate it. I see it as an opportunity for a service that can create all kinds of charts & graphs given a small text data set
#
gRegor
Shouldn't be an issue if sending to domains hosted on the same server, or within the same domain
#
[KevinMarks]
If you want that, look at the excellent https://github.com/observablehq/plot
#
Loqi
[preview] [observablehq] plot: Observable Plot: a concise API for exploratory data visualization
#
[KevinMarks]
They have a good site to try things out and get examples from, and the library is js and can run server side or client side https://observablehq.com/plot/
#
aaronpk
r​eal_devastatia: where the site is hosted isn't really relevant to webmention. it's fine if they are hosted on the same shared host, that's not a loopback question
#
r​eal_devastatia
gRegor: That's what I was reading when I asked the question. Is that all they had to say about it? It seems as long as I don't send a Webmention to my own domain, I should be fine. Excluding oneself as a recipient is kind of a no-brainer though. Not sure why such a big to-do has been made of it, if it's only that.
#
aaronpk
you also can send yourself a webmention, that's not a problem
#
gRegor
I love sending myself webmentions :)
#
aaronpk
the note in the spec is about the loopback IP address, which can have other unintended consequences, mainly SSRF
#
r​eal_devastatia
I'm using this in combination with Twitter-style @mentions. It's unlikely I'll ever post @Devastatia in an article. lol
#
gRegor
It's handy to show links on my older posts when I mention them later
#
[tantek]
real_devastatia, people do that all the time in the context of "follow me as @-name on silo foo"
#
gRegor
Here's an example when I linked to a previous post: https://gregorlove.com/2023/09/weekly-roundup/
#
gRegor
Shows up in the responses of the original post
#
r​eal_devastatia
tantek_com[d] In the context of a personal website, "following" means subscribing to their RSS feed. I wouldn't mention myself by name. I have an :rss: shortcode that my CMS translates to an RSS button link for that. (See my front page.)
#
gRegor
you could choose not to send them to yourself, but sounds like extra work
#
r​eal_devastatia
gRegor: I know, right? I don't know if I can refrain from typing "@Devastatia" into my page editor. Somebody stop meeee!!!
#
gRegor
Haha, that's not what I meant, just meant if you want your webmention sender to ignore links to your own domain you could
#
r​eal_devastatia
The internal links on my site are actually <page> pseudo-HTML tags. Not much chance of that.
#
gRegor
Ah, interesting
#
r​eal_devastatia
Here's a (probably incomplete) list of my shortcodes and custom tags: https://devastatia.com/tags
#
[Jo]
@ devastatia these are really cool! Whats the point of pic instead of img tho? Specific css ?
#
r​eal_devastatia
When you click a <pic> it copies the img embed code to the clipboard. I use it in the pic picker in my CMS.
#
r​eal_devastatia
Actually, the one in my CMS just inserts the img tag at the insertion point in the textarea.
#
IWDiscord
<r​eal_devastatia#0>
#
[Jo]
Ah okay. Neat
#
Loqi
Ok, I'll tell them that when I see them next
#
GWG
[cleverdevil]++
#
Loqi
[cleverdevil] has 3 karma in this channel over the last year (8 in all channels)
#
Loqi
GWG: [cleverdevil] left you a message 11 hours, 53 minutes ago: https://github.com/cleverdevil/Known-Bluesky
[schmarty], Jo1, to2ds and [jeremycherfas] joined the channel
#
c​apjamesg
[snarfed] Was granary.io down for any time today?
#
c​apjamesg
I got an email from a reader saying they could not subscribe to my feed.
to2ds and jacky joined the channel
#
aaronpk
yeaaaa
#
aaronpk
hey at least they mention it now tho
#
jacky
been working on touching up the oauth2 dance for sele (abstracted it enough so I can pop in new providers over time, b/c I do want xmpp support lol)
jacky joined the channel