#dev 2020-11-15

2020-11-15 UTC
miklb joined the channel
#
sebbu
i should try to put an indieauth endpoint on my site
Hollandaise, miklb_ and [Simon_Willison] joined the channel
#
[Simon_Willison]
OK, here’s a demo of the first version of my new datasette-indieauth plugin https://latest-with-plugins.datasette.io/-/indieauth
#
[Simon_Willison]
Currently it pushes everything through indieauth.com (to get RelMeAuth working) - next step is for it to first attempt to authenticate on its own, see https://github.com/simonw/datasette-indieauth/issues/2
nsh, [chrisaldrich], GWG, nickodd, [tw2113_Slack_], KartikPrabhu, [asuh], [jeremycherfas] and schmudde joined the channel
#
sebbu
selfauth
#
sebbu
aaronpk, got a weird issue : just set up Inklings-io
#
sebbu
and Zegnat
#
sebbu
php-mintoken on my site, and it works with indieauth.com but not indielogin.com (the opposite!)
#
sebbu
moreover, indieauth.com still list all the recognized endpoints, while indielogin.com directly redirects me to my indieauth login
#
sebbu
(damn, copying the user/repo from github gives a \n instead of the /)
#
sknebel
probably intentional that it prefers the indieauth endpoint to relmeauth
Loqi, [jeremyfelt], [Sue_Hanen], carolline, [tantek], [dmitshur], [hibs], carla-paloma and [schmarty] joined the channel
#
[schmarty]
aaronpk++ for publishing all these bookmarks and for a great site search. looking into maybe setting up an indie livestreaming page today and your site is a huge help!
#
Loqi
aaronpk has 65 karma in this channel over the last year (225 in all channels)
[tonz] joined the channel
#
GWG
Okay. I now have my weather station data displaying on my test site
tracydurnell, [jeremycherfas], geoffo and maxwelljoslyn joined the channel
#
[Raphael_Luckom]
[KevinMarks] do keep up with front-end stuff? I'm looking at where the shoelace page says "You no longer need Less or Sass to do amazing things with CSS." Is that true now? It sounds great.
#
[Raphael_Luckom]
I mean, CSS was always fine, but less & sass had things I liked.
#
[KevinMarks]
CSS has calc and variables now, so you can do a lot more with it. Tantek knows far more about it than I do - I tend to use small amounts or single file toolkits like shoelace 1.0 or https://newcss.net/
#
[Raphael_Luckom]
there were a couple of "features" that sass had that could be O(n^2) in the size of the generated CSS. That was always fun
#
[KevinMarks]
Some of the 'modern' css tools are like that where every element gets 15 custom classes because the cascade is too scary
#
[KevinMarks]
I had a bit of a rant about 'utility classes' a while back http://www.kevinmarks.com/u-means-style.html
#
[Raphael_Luckom]
yeah I agree that using classes to represent arbitrary styles (as opposed to semantically meaningful things that happen to also have styles) is not ideal. My CSS usage is fairly abominable because I only use it for styling and don't do enough to optimize it. That note about class prefixes indicating parsing rules is cool.
#
[Raphael_Luckom]
I think that the class-as-style thing is a common stage on the journey from good idea to cargo cult. A rule like "semantic organization is better than ad-hoc styling" turns into "use classes not style" and people miss the part about actual semantic labeling.
[jeremyfelt], tinfoil-1, ShinyCyril and reed joined the channel
#
KartikPrabhu
also you can use any HTML attribute for styling not just "class"
#
maxwelljoslyn
good point Kartik
#
maxwelljoslyn
[planned site upgrades today: add login; support post visibiility; fix a bunch of crap that broke or degraded when I went from site generator to web app]
#
Loqi
[Jeremy Keith] ARIA in CSS
petermolnar, nekr0z, [snarfed] and tinfoil-1 joined the channel; nickodd left the channel
#
aaronpk
[schmarty]: awesome! Let me know if you need any help, I have it working pretty wel now!
[Simon_Willison] and petermolnar joined the channel; petermolnar left the channel
#
[Simon_Willison]
Moving this conversation here from #indieweb
#
[Simon_Willison]
> So I have a naming challenge I’d like to bounce off people. I’ve been getting increasingly excited about a design pattern that’s somewhere between static side frameworks and dynamic rendered pages from a database
#
[Simon_Willison]
> What makes this interesting is that it’s trivial to scale (just run more copies of the app, each with a copy of the database) and you don’t have to build 1000s of static pages. It can be REALLY cheap to host, thanks to serverless hosting providers like Vercel and Google Cloud Run. And just like static sites, it’s hard to break - the database file is treated as read-only, so you don’t need to worry about many of the complexitie
#
[Simon_Willison]
>
#
[Simon_Willison]
>
#
[Simon_Willison]
> The key idea is that you “bake” your infrequently-changing data into a SQLite database file, then publish that along with your code. Then you have dynamic pages and templates which query that database.
#
[Simon_Willison]
come with running a dynamic site
#
[Simon_Willison]
>
#
[Simon_Willison]
> I want to come up with a name for this pattern, because if you name things it’s much easier to talk about them (see JAMstack, static site generators, etc)
#
[Simon_Willison]
>
#
[Simon_Willison]
> So question: would “cast iron” work for people for this? Does anyone have a better idea for what I can call it?
#
[Simon_Willison]
>
#
[Simon_Willison]
> The largest scale example of this pattern I’m aware of is Mozila.org, which has been doing this (without using a fancy name for it) for a couple of years now: https://mozilla.github.io/meao/2018/03/28/bedrock-the-sqlitening/
#
petermolnar
what you're after is usually called flat file cms
#
[Simon_Willison]
oh that’s interesting - “A flat-file CMS is a platform that requires no database. Instead, it queries its data from a set of text files” (first hit on Google) - except I AM using a database, it’s just it’s SQLite which is a file-based database
#
petermolnar
sqlite is both: it's file and a database. So technically, it's a file based cms...
#
[Simon_Willison]
I’m not took keen on attaching this to the term “CMS” though since a lot of the applications I use this pattern for aren’t really a CMS at all
#
[Simon_Willison]
e.g. global-power-plants.datasettes.com/global-power-plants/global-power-plants
#
petermolnar
I just called my approach - there's a 404.php for all the redirects and the nastyness, and a search.php for search - semi-static
#
petermolnar
btw, I have a recommendation what to throw into datasette: chat logs.
#
[Simon_Willison]
Chat logs would work great! I started working on a slack-to-sqlite tool a while back but never got any further than a proof-of-concept Jupyter notebook
#
sebbu
does dokuwiki counts as a flat file cms ?
#
petermolnar
a few years ago I decided to normalize chat logs, and I put them into pidgin-like text files: https://petermolnar.net/article/instant-messenger-hell/index.html - but I seriously considered going after the SQLite layout of the old skype.
#
GWG
petermolnar: How do you search them?
#
Zegnat
I think I have seen people refer to dokuwiki as flatfile storage too, yes
#
petermolnar
GWG: grep :)
#
GWG
Okay
#
[Simon_Willison]
That’s the other thing about this specific pattern: it’s read-only, deliberately - that’s what gives you the static site generation benefits of cheap and easy scaling and being really hard to break
#
petermolnar
I could really use a built-in thesaurus for grep, but that doesn't exist :D
#
[Simon_Willison]
The moment you have data that changes you have to think about backups, data replication, load-balancing and suchlike - everything gets a lot more complicated than just “run more copies”
#
[Simon_Willison]
oh now you’ve got me thinking about a sqlite-grep tool…
#
Zegnat
So many ways to abuse sqlite... I remember there was a git setting you could use, so you could git-diff your sqlfiles. I think it ran an onthefly schema dump or something
#
petermolnar
oh, I forgot, I had a previous run with chat logs: https://petermolnar.net/article/the-horror-of-chat-logs/index.html - this one included dealing with empathy, hexchat, thunderbird, and ancient trillian logs
#
aaronpk
the indieweb chat logs and my GPS logs are similar. not SQLite, but all the data is stored in text files in JSON, one file per day. so it's not quite a static site like github pages, but also isn't querying a database over the network
#
aaronpk
ooh i gotta rename that branch
#
petermolnar
master still == mastery, as in knowledge
#
aaronpk
yeah but not in git
geoffo joined the channel
#
[Simon_Willison]
oh wow that’s an interesting repo…
#
[Simon_Willison]
Unfortunately it turns out “master” in Git came from “master” in Perforce, and Perforce had “master/slave” replication 😕
#
aaronpk
so when you visit a URL like https://chat.indieweb.org/dev/2020-11-15 it pulls up the one file from that day and then runs the JSON through some templates to turn it into HTML
#
petermolnar
(and thus it should be obvious that there is no pleasing all with naming things)
fwe and gxt joined the channel
#
[Simon_Willison]
So here’s a fun trick…
#
[Simon_Willison]
```git clone --depth 1 https://github.com/indieweb/indieweb-chat-archive
#
[Simon_Willison]
cd indieweb-chat-archive
#
[Simon_Willison]
for file in $(find . -name '*.txt'); do cat $file | cut -f 3- -d ' ' | sqlite-utils insert /tmp/chat.db chat - --nl; done;```
[dmitshur] joined the channel
#
Loqi
[indieweb] indieweb-chat-archive: Full archive of IndieWeb chat log data files
#
[Simon_Willison]
The chat archive logs are timestamped newline-delimited JSON, which means you can pipe them into sqlite-utils insert to load them into a SQLite db file https://sqlite-utils.readthedocs.io/en/stable/cli.html#inserting-json-data
#
aaronpk
that's pretty clever
#
aaronpk
then you get full text search thanks to sqlite!
#
[Simon_Willison]
… it broke because the schema changed, adding `--alter` should fix that though (the tool then adds new columns if they are missing) - but yeah, you can get FTS by running `sqlite-utils configure-fts /tmp/chat.db chat content`
#
[Simon_Willison]
I love how SQLite reduces the barrier to “load this into a full-text search engine” to almost nothing
#
aaronpk
i'm using elasticsearch for searching on my own website but i really don't like the barrier to setting it up, wonder if i should consider switching that to sqlite
#
lahacker
[Simon_Willison]: have you played around at all with https://www.sqlite.org/json1.html ?
[Emma_Humphries] joined the channel
#
lahacker
"The json1 extension is ... useful for managing JSON content stored in an SQLite database."
#
[Simon_Willison]
yes, a ton, it’s brilliant!
#
[Simon_Willison]
I often dump JSON straight into SQLite and then use that to explore it
#
lahacker
do you have any tricks to simplify the syntax or do you write it by hand?
#
lahacker
query syntax, that is
#
[Simon_Willison]
I use JQ for it sometimes - https://github.com/simonw/datasette-jq
#
Loqi
[simonw] datasette-jq: Datasette plugin that adds a custom SQL function for executing jq expressions against JSON values
#
[Simon_Willison]
(different kind of complex syntax though)
#
Zegnat
I had a lot of fun with a 8GB JSON file the other day ... maybe I should have tried importing it into SQLite :P
#
[Simon_Willison]
> Paul Ford: “[On SQLite] The JSON interface is like, “we save the text and when you retrieve it we parse the JSON at several hundred MB/s and let you do path queries against it please stop overthinking it, this is filing cabinet.”
#
petermolnar
aaronpk: https://petermolnar.net/build.py looks for "class SearchDB"
#
petermolnar
jq is brilliant
#
[KevinMarks]
Simon - the classic debate was Baked versus Fried in blogs. You could call it Air Fried
[schmarty] joined the channel
#
[schmarty]
aaronpk i tried to load both owncast and keyframe into my head in terms of what they provide and what they're like to run. do you use either of those? i forgot. 😅
#
[schmarty]
keyframe's focus on low latency is tempting but the docs are heavily focused on NixOS which feels like a yak too far. owncast seems like just barely enough but i am leaning towards trying it.
#
aaronpk
owncast looks cool but i haven't tried it yet. so far i've only put it together from the bare pieces
#
aaronpk
nginx + rtmp module, video.js for the player
#
aaronpk
i even wrote a little livestream chat thing using a websocket thing
#
petermolnar
re Fried vs Baked: Frozen Flask seems like the opposite of what you're doing, so the analogy stands
#
[schmarty]
heh, that is kind of the direction i was leaning in but was feeling intimidated. in addition to simplifying plugging it all together, both keyframe and owncast have a chat built in as well, which is nice.
#
aaronpk
heh keyframe is a terrible name for that project, impossible to search for
#
[schmarty]
absolutely impossible
#
aaronpk
i do want to try owncast at some point, it looks nice
#
[schmarty]
ah this helped me understand keyframe a bit more https://fossil.keyframe.live/doc/trunk/doc/overview.wiki
#
aaronpk
wow xmpp for chat
#
petermolnar
[snarfed]: I have an uncomfortable question: can fed.brid.gy deal with chimera (atom as xml namespace inside rss) feeds or only with "real" atom feeds?
#
[schmarty]
yeah xmpp for video chat feels like a lot!
#
petermolnar
aaronpk: I literally just got turn/stun advertised done via xmpp today, so there's video via Conversations (and, in theory, in Pidgin.)
#
petermolnar
I'm happy to help with Prosody questions, if needed
Ryuno-Ki joined the channel
#
[KevinMarks]
Cast Iron isn't great as Cast tends to to mean streaming media these days
gxt joined the channel
#
[jgmac1106]
And too me cast iron means to enjoy all the seasoning of past cooking. Like you enjoy flavors of your cooking debt
#
[jgmac1106]
If you need a metaphor what is different between your approach and say LAMP vs SSG? That should become your target
gxt joined the channel
#
[KevinMarks]
Could you call it DataBaked? Or does that sound too much like database?
#
[jgmac1106]
EZBakedData
#
[jgmac1106]
Honestly why I am torn between Kirby or really old PHP wikis where I can quickly add mf2. I like the dynamic display with single file storage
#
[jgmac1106]
Cast Iron also evokes feeling of slow cooking. Like a cobbler in a Dutch Oven.
[timothy_chambe] joined the channel
#
[jgmac1106]
[KevinMarks] I still say the blogging tool you built on Glitch with LowDB is close to what I want.... I still think between you [schmarty] and [grantcodes] we should be able to get a fully functional and remixable one button blog on Glitch
#
[Simon_Willison]
Air frying is an interesting alterantive to cast iron - it’s closer to fry/bake - the connection between cast iron and fry/bake is a little obscure
#
[Simon_Willison]
Or there’s a Caribbean dish called a *Fry bake*
#
[Simon_Willison]
Oh! And Fry Bake is how you make Trinidian Doubles which are _delicious_
#
@simonw
@seldo @slightlylate We made them from that recipe. O. M. G. this is the tastiest thing we've ever made not knowing what we were actually making! These things are spectacular. https://pbs.twimg.com/media/Eb98of-VAAALwsj.jpg
(twitter.com/_/status/1278877866587910144)
#
[KevinMarks]
so is this always the same datasette app, or are you meaning a broader pattern?
#
[KevinMarks]
to be mundane, it's a Static Data Site
#
[Simon_Willison]
I see it as a broader pattern (see the Mozilla example) but Datasette is currently one of the easiest ways of implementing it
#
[KevinMarks]
is part of the idea that the db file is downloadable too?
#
[Simon_Willison]
not necessarily
#
[Simon_Willison]
I see the core pattern as: package your data up as a SQLite database, bundle and deploy that database file as part of your application deploy
#
[Simon_Willison]
doesn’t have to be SQLite - could be another file-based database, or could even by MySQL/PostgreSQL if you bundle the entire database server up as part of a Docker container and set it to “read only” so you can scale by deploying more instances of that container
#
[Simon_Willison]
the key benefit is that you don’t have to worry about database maintenance, and you can scale to more traffic by load balancing across more instances
#
[KevinMarks]
Baked Data
#
[Simon_Willison]
that’s pretty good (albeit less of an excuse to talk about delicious Trinidadian cooking)
#
[Simon_Willison]
but yeah, yo’ure baking your data into the container
#
[schmarty]
aaronpk okay owncast was very easy to get started with. but of course needs tweaking to look any different from the baseline.
#
[schmarty]
also the chat seems to have... no features.
#
[KevinMarks]
"instead of Big Data, we have Baked Data"
#
sebbu
petermolnar, i'm missing pidgin plugins for the following protocols : gitter (might be bridged to matrix or irc), keybase, line (there's a plugin, but it's expressively forbidden by line, they'll ban you), battle (doesn't work), snapchat, tiktok, ubisoft, wegamers, etc...
#
sebbu
and the pidgin matrix plugin doesn't support SSO, so i can't use my mozilla account
#
petermolnar
sebbu: I know. It's still the only reasonable option out there for multiple protocols from a single client.
#
petermolnar
but about things like line: don't use it. Seriously, just don't. It's not even omnipresent, like whatsapp, it's just plain bad.
#
petermolnar
I'll take this to -chat, because it's offtopic to indieweb, ok?
#
sebbu
i'm not yet on enough gitter channels, but i was almost reading to start making the plugin myself (i already read the doc, it isn't very hard, just lots of rest endpoint and xml)
#
sebbu
especially when ppl copy LARGE codes on channels, then edit them
#
sebbu
it's horrible through the irc bridge
#
sebbu
pidgin shows the EDIT: line on discord, idk if it can be supported correctly (for edit)
#
petermolnar
again, please come to #indieweb-chat with this topic :)
[tantek] and [Sue_Hanen] joined the channel
#
[Simon_Willison]
Hmmm… the spec at https://indieauth.spec.indieweb.org/ seems to have got a whole lot more complicated since August - it now has PKCE stuff in it, https://indieauth.spec.indieweb.org/#authorization-request
#
[Simon_Willison]
has anything implemented that yet?
#
[tantek]
I'd ask an earlier question, which is, is there a test suite / test cases for that aspect?
#
[Simon_Willison]
+1 to that
#
[Simon_Willison]
https://github.com/simonw/datasette-indieauth works right now, but doesn’t actually implement the spec at all - it just bounces the user through https://indieauth.com/ - my next step is to implement tha actual indieauth protocol so that it can run without that dependency, but I’m trying to flesh out what I need to implement
#
[Simon_Willison]
Is there an IndyAuth identity provider out there that implements the new PKCE stuff which I can test against?
#
Loqi
[simonw] datasette-indieauth: Datasette authentication using IndieAuth and RelMeAuth
#
[Simon_Willison]
Live demo of the plugin so far https://datasette-indieauth-demo.vercel.app/-/indieauth