Submit

Back to the channels

#primate

  1. * nevet joined #primate
  2. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  3. * phaleth joined #primate
  4. phaleth nice, that tiny nginx:alpine-slim container is capable of proxying to HTTP/2 site https://theanswerisc.repopack.app/
  5. nevet The Answer Is C
  6. phaleth actually, I don't know if nginx itself supports proxying to HTTP/2, it's prolly defaulting to HTTP/1.1, but anyway
  7. phaleth the traffic goes like this: http client <-> contabo VPS <-> haproxy nspawn container <-> root nspawn container <-> rootless podman nginx container <-> fly.io cloud deployment https://github.com/terrablue/theanswerisc/blob/master/.github/workflows/deployment.yml
  8. blue phaleth: hi
  9. blue I added a readme to the repopack repo
  10. blue phaleth: so ideally we should have: http client <-> contabo VPS <-> haproxy podman container <-> rootless podman nginx container <-> podman machine running the blog
  11. blue or maybe we don't even need that interim podman thingy
  12. blue so one nice thingy the podman API saves us is manual network management
  13. blue you can just do POST networks and it allocates by itself. you can provide a name, which is great, because we'll use that to delete networks when apps are deleted
  14. blue phaleth: https://images4.imagebam.com/d8/24/e6/ME1B5M64_o.png
  15. blue so when you create an app, we add an entry to the app table in postgres, and we can use the id to refer to the network (or generate a network_id UUID column)
  16. blue phaleth: that rootless podman nginx container, it's running under your user, right?
  17. blue btw the podman API is nice. this is what you get if you try to create a network with an existing name:
  18. blue Error: HTTP 409: {"cause":"network already exists","message":"network name testtest already used: network already exists","response":409}
  19. phaleth blue: hi
  20. phaleth yeah, all podman containers and I think haproxy can be installed on arch host directly
  21. phaleth true, everything can be named and names are unique
  22. blue sounds good
  23. phaleth moved haproxy to archlinux host
  24. * nevet joined #primate
  25. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  26. * nevet joined #primate
  27. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  28. phaleth nice, all browsers finally support https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API
  29. nevet Trusted Types API - Web APIs | MDN
  30. * phaleth joined #primate
  31. blue dreamreal: can you now configure nevet for the primate repo?
  32. dreamreal I can but you're going to have to set up the webhook: I'll DM you the token on discord.
  33. dreamreal github webhook primate-run/primate
  34. nevet Error: No registered repository found for primate-run/primate
  35. blue shouldn't *I* send YOU the token?
  36. dreamreal Gah, another bug - the webhook mutates the existing record.
  37. dreamreal Ew, no
  38. dreamreal that means I'm storing the token
  39. dreamreal nevet generates it.
  40. blue yes? you need to store the token anyway to validate the hook
  41. dreamreal I don't, though: it gets the token from outside and encrypts it to match
  42. blue https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries
  43. blue that's literally what the github docs say
  44. blue unless I missed something, I don't get how you can otherwise validate it
  45. blue "After creating a secret token, you should store it in a secure location that your server can access."
  46. blue typically, you put that in an env variable
  47. blue or if you wanna do it programmatically, something like a keyserver
  48. dreamreal I generate a string: aaabbcccdd. Send it to the user via PM. Store the encrypted version so I never have aaabbcccdd again. When I get aaabbcccdd over https, I re-encrypt it and check.
  49. blue yes, so you still store the token
  50. blue you just encrypt it
  51. blue which is... I guess fine
  52. dreamreal yes, and I COULD accept external tokens where you say "set it to this explicitly" but... eh
  53. blue I don't really see the point, but sure
  54. dreamreal give me a minute, workflow oversight
  55. blue honestly I have no idea *how* that can be even work. github sends you a hash signature using the token with each payload. how can you recalculate the signature if you don't have the original token?
  56. blue typically you take the payload + token, calculate a signature, then compare it to what gh sent
  57. blue but if you encrypted the token, that's not gonna work
  58. blue dreamreal: https://github.com/terrablue/gpbot/blob/master/routes/index.js#L25-L27
  59. blue you need to replicate *that* logic
  60. dreamreal It's already there
  61. blue well, that can't work unless you have the plain secret
  62. blue maybe you decrypt it at runtime, but I don't see the point in the indirection, I'd just have it in memory
  63. dreamreal Yes, I have to decrypt it, it's fine
  64. dreamreal but the code's already written, rabbit's dead, no win in changing it
  65. blue but then you need to store a decryption key...
  66. dreamreal I have one, I configure it externally
  67. blue what did you gain in trading a secret for a decryption key?
  68. dreamreal Not a lot, I was doing something dumb and re-using a key that was supplied elsewhere
  69. blue ok. well anyway, it doesn't really matter who of us supplies the secret. but if YOU do, I need the plaintext one obviously
  70. dreamreal yes, you'd get it
  71. dreamreal like I said, it generates a key, sends to the user, then stores something different
  72. blue yes, that's an indirection I wouldn't have chosen in my code, but if you want to do it like that, that's fine
  73. * nevet joined #primate
  74. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  75. dreamreal github webhook primate-run/primate
  76. nevet Webhook enabled for primate-run/primate. Configure GitHub to POST to https://api.bytecode.news/webhooks/github with the provided secret.
  77. dreamreal github subscribe primate-run/primate
  78. nevet Subscribed to primate-run/primate
  79. dreamreal github subscriptions
  80. nevet primate-run/primate
  81. blue would be nice if nevet output the ping
  82. dreamreal Did it report success on the github console?
  83. blue yes
  84. dreamreal Then it worked. And the console will show pings, for what it's worth.
  85. blue I meant here. that's a wait to test full stack working without access to the console
  86. blue that's a way*
  87. dreamreal Well, the thing is, ORDINARILY this is a bit of an odd path
  88. blue how so?
  89. dreamreal admins are the only ones who can subscribe, so ordinarily the admin is the one who A) has access and B) sets the token
  90. dreamreal so *I* as the admin would be the one to validate the ping, not the channel
  91. blue yes but *I* don't have access to the console
  92. dreamreal I know
  93. dreamreal like I said, odd path
  94. blue it's only an odd path if you don't intend for nevet to relay those notifications for non-admins
  95. * dreamreal sighs. But like I said: ODD PATH. You create a subscription for webhooks... THEN you add what channels watch for them.
  96. dreamreal Without the channels, nevet doesn't know where to say "hey, ping succeeded!"
  97. dreamreal it's literally an internal event, and it's internally published
  98. blue that's a weird flow to me. if you do !github webhook primate-run/primate in #primate, I'd think that's intended to be used here
  99. dreamreal I get it
  100. dreamreal but the flow is not that way: I can create subscriptions ANYWHERE, and channel subscriptions are separate
  101. dreamreal same for RSS
  102. dreamreal (in fact, they use the same codebase and design)
  103. blue nonetheless, you can *still* map the ping event, and it works just like every other event: it outputs once it has channels
  104. * nevet joined #primate
  105. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  106. dreamreal crikey
  107. dreamreal version
  108. nevet nevet 1.0 | 84619bb (github-webhook-fixes) | Built 2026-03-08 09:14:24 EDT
  109. dreamreal So try the emulated thing, let's see what it does
  110. blue well it still says successful
  111. blue for the redelivery
  112. dreamreal yep.
  113. blue yes? what changed?
  114. blue I see no message
  115. dreamreal I saw it
  116. blue ...
  117. dreamreal Again, pings are not echoed to subscriptions
  118. blue but why?
  119. dreamreal Because I don't trust them yet. I may turn it on eventually. But I don't know github's ping policy yet.
  120. blue there's no ping policy. it's done when you create a webhook, and when you change it iirc. I had the ping event mapped on gpbot, I'd have noticed it otherwise
  121. blue it's literally a way to test the full stack
  122. blue starting to get tired of claude here
  123. blue it's regularly amnesic, forgetting things discussed like 3 minutes ago
  124. dreamreal https://github.com/jottinger/bytecode.news/issues/196
  125. nevet github: ping should propagate to subscribed channels · Issue #196 · jottinger/bytecode.news
  126. * nevet joined #primate
  127. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  128. dreamreal version
  129. nevet nevet 1.0 | 22fb3be (main) | Built 2026-03-08 09:17:40 EDT
  130. phaleth blue: thanks for the readme, quite useful
  131. blue yw phaleth
  132. blue `Happy DOM has a long history of incomplete default form-submission behavior`
  133. blue this industry is full of idiots
  134. blue time for @rcompat/dom
  135. blue phaleth: https://gitea.repopack.app/repopack/website/commit/3960e135869ad6930e25dbde1916c481b2e6e8e5
  136. blue can now create networks; duplicates are recognised and surfaced as form errors
  137. blue this has been interesting info for the future generation of openapi clients
  138. blue in future style, this will be:
  139. blue await client.createNetwork({ name }).conflict({ field: "name", message: "A network with this name already exists" });
  140. blue (409 is CONFLICT)
  141. blue that means HTTP status codes will be surfaced on the generated openapi client as methods
  142. blue so you can literally do .conflict().forbidden().notFound()
  143. blue the default return value is the OK (2xx) case
  144. phaleth nice, I've made a PR there just to test, it now has a merge conflict, very cool
  145. blue btw, I've noticed gitea is much, MUCH faster than github
  146. blue like orders of magnitude faster
  147. blue monopolies SUCH!
  148. blue SUCK*
  149. phaleth yup, I've noticed gitea has some frontend devs that continuously put effort into modularizing the frontend so it remains fast after features get added
  150. blue well, of course we're not gonna use gitea but repopack itself, but it's still so freshing to see that it doesn't HAVE to be this way
  151. blue or refreshing, rather
  152. phaleth yeah, I kinda refuse to go back to github already
  153. blue ya, github can go to hell
  154. blue phaleth: https://gitea.repopack.app/repopack/website/commit/68422c1c06103eeea93e91c2df3f48425b7e6487
  155. blue I really need to make it easily possible to add woff2 files into your file, it's ridiculous to need a module for that
  156. blue or maybe woff2 being parsed as file by esbuild should just be the default
  157. blue s/into your file/into your app/
  158. phaleth I remember webpack can take in static assets and put them where needed, also with the option to not add content hash to the filename
  159. phaleth maybe esbuild can do that too
  160. phaleth looks like this copy loader can be used https://esbuild.github.io/content-types/#copy
  161. blue yes, essentially it's the file loader
  162. blue the file loader causes esbuild to base64 the file and include it in the bundle
  163. blue https://gitea.repopack.app/repopack/website/commit/68422c1c06103eeea93e91c2df3f48425b7e6487#diff-4abca52bbb0fae9100b8e3e180ca4e8a39cc38a5
  164. blue but for woff2, this should be the standard behaviour. unless you're like a platform that offering woff2 for download, I don't see how you'd ever want different behaviour
  165. blue and even if you are a platform, you wouldn't place the woff2 files for download inside static, but would have them downloaded dynamically
  166. blue and if you DO want a different behaviour, you write a primate module
  167. blue phaleth: did you pull down the nice coloured changes?
  168. blue it's just adding some font and a bit of colours so it doesn't look 100% lame as before
  169. phaleth not yet, I'm gonna try to find some podman REST API reference
  170. phaleth afk
  171. blue phaleth: https://docs.podman.io/en/latest/_static/api.html?version=latest
  172. nevet Reference
  173. blue programmatic: https://storage.googleapis.com/libpod-master-releases/swagger-latest.yaml
  174. blue unfortunately it's swagger 2.0 which the primate openapi generator won't support
  175. blue but I believe it's possible to convert it to openapi 3.0
  176. blue and then I'll add it to the primate/openapi repo so it's av at openapi.primate.run
  177. blue /libpod/networks/create:
  178. blue post:
  179. blue description: Create a new network configuration
  180. blue operationId: NetworkCreateLibpod
  181. blue this operationId is totally dumb
  182. blue dreamreal: why is everyone so dumb in this industry all the time
  183. blue what am I supposed to do with "NetworkCreateLibpod"???
  184. blue the operationId is SUPPOSED to be "CreateNetwork"
  185. blue I suppose that in the swagger converter, I can add a strategy: "drop -Libpod, switch order"
  186. blue ok, I see what they did
  187. blue so we also have
  188. blue /libpod/pods/{name}/exists:
  189. blue get:
  190. blue description: Check if a pod exists by name or ID
  191. blue operationId: PodExistsLibpod
  192. blue can't really deal with that. so we'll be dropping -Libpod and generating as is
  193. blue client.podExists is acceptable. client.networkCreate sounds dumb but ok
  194. blue could've put a non-trivial effort into this though, redhat
  195. blue I sure do hope the nevet operationIds are SLIGHTLY better
  196. blue phaleth: dreamreal: https://github.com/primate-run/openapi/commit/00d9e4e77d2dadc948da6541bbab914eabc817cb
  197. nevet add support for swagger to openapi conversion and stripping operation… · primate-run/openapi@00d9e4e
  198. blue phaleth: https://github.com/primate-run/openapi/commit/7d8c850f277f4d644e6b002e26b1791ef5e8f4b6
  199. nevet add podman/libpod · primate-run/openapi@7d8c850
  200. blue can we redeploy the openapi machine?
  201. blue maybe as a podman container already
  202. blue nice, you created a user podman
  203. dreamreal blue: I gotta get you to learn how to use !article :D
  204. blue wth is THAT, dreamreal
  205. dreamreal It's a way to get nevet to build a draft article online
  206. dreamreal you say "!article title" and can add content blocks with "!content this is some content here", add channel context with "!logs 5m" (include the last five minutes for context), and signal done with !done (it'll time out on its own if you don't, after five minutes of no interaction) - and bam! draft article on bytecode.news
  207. dreamreal the diataxis article was written that way
  208. blue article Primate
  209. nevet Idea session started: "Primate". Use 'content <text>' to add body paragraphs, 'done' to save, or 'cancel' to discard.
  210. blue context Primate is the universal web framework -- the best tool to build websites with
  211. nevet ok, blue: updated context primate.
  212. blue done
  213. nevet Idea saved as draft: "Primate" (0 content blocks).
  214. blue oh, I wrote context, my bad
  215. blue well, at least it did something
  216. dreamreal It did indeed.
  217. blue I have no idea how to edit it
  218. dreamreal YOU don't. *I* would have to.
  219. blue hahaha
  220. dreamreal The !article thing submits DRAFTS. If you're not authenticated, it submits as anonymous.
  221. blue why can't I edit drafts though, if submitted anonymously?
  222. dreamreal This is entirelly intentional.
  223. blue also, wth is THIS
  224. blue https://bytecode.news/factoids/context%20primate
  225. nevet Nevet - Reference UI
  226. dreamreal What about it?
  227. blue so ! randomly creates factoids?
  228. blue that seems like a bug
  229. dreamreal No, you said "context primate" and "is" and some content.
  230. dreamreal That's working as designed. You created a factoid.
  231. blue oh man, that's CRAZY
  232. dreamreal if you'd used "!content primate is..." the internal routing would be different.
  233. blue that should be like +factoid or something
  234. dreamreal But "context" is not a keyword for the article system.
  235. dreamreal "is" is pretty human.
  236. blue yeah but you do realise that having both context words and pattrens like !x is y, is confusing, right?
  237. blue that effectively means that a typo can have wholly unintended consequences
  238. dreamreal Sure. And compare that against the ACTUAL formal syntax: !foo=bar
  239. dreamreal yep, and the consequences cost very very close to nothing so I don't care
  240. dreamreal just like karma
  241. blue so the making of a good system, that a typo does NOT cause wholly unintended behaviour
  242. blue but rather results in the system telling you made a typo
  243. blue something like: "!context does not exist as a operation"
  244. dreamreal in which case you have a formal grammar and not something easy for humans to use.
  245. blue and even nicer: "did you mean `!content`?"
  246. dreamreal So: no.
  247. dreamreal How would teh system know you might have meant "content?"
  248. dreamreal The system has no unified grammar. This is intentional.
  249. blue because it has a very small levenshtein distance
  250. blue stop making excuses, this is totally normal, git has it
  251. * dreamreal sighs
  252. dreamreal no. Because that means the system needs to know a shitload more about the operations than it should. It doesn't KNOW there are operations.
  253. dreamreal Actually, that's not true: the system DOES know there are operations... like, six or seven of them. Out of the close to 80 now.
  254. blue sigh, fine, your system, you know BEST, me typoing content into context is just a FACT of life and should result in garbage in the system
  255. dreamreal Yep! And it does! And again, the actual cost is 0
  256. dreamreal it's fine, it's also trivial to correct
  257. dreamreal context primate.forget
  258. nevet ok, forgot context primate.
  259. dreamreal OH NO SO MUCH SWEATING
  260. blue oh man, nevermind, I'll just shut up, I'm tired of this uphill battle
  261. blue you just do whatever you think is best and I'll stop making suggestions
  262. dreamreal The bot is messy: that's a fact of life. The actual OPERATION usage is absolutely linear; if we had an article *http operation* it can ensure types and make sure such things are unambiguous. Over IRC? not so much.
  263. dreamreal We could even do that for slack and discord, if I supported actual actions.
  264. blue it's really not messy to have a clear way to edit factoids, say with `+factoid title | text` to add, `~factoid title | text` to edit, and `-factoid title` to delete
  265. blue instead of using a pattern nobody understands like x is y
  266. dreamreal Gotta get lunch, later
  267. blue ciao
  268. blue phaleth: should we move primate/openapi to gitea?
  269. blue I'm honestly thinking of keeping just the high profile projects, so primate-run/primate, on GH. all the rest I think can move away
  270. phaleth blue: if you don't want that to be open why not
  271. phaleth same for superarch
  272. blue oh it will be open, in the future, when it's available under repopack.com/primate/primate
  273. phaleth should I redeploy primate/openapi?
  274. blue sorry, repopack.com/primate/openapi
  275. blue yes
  276. phaleth ok
  277. blue did you pull the latest rp colours? :P
  278. blue hm
  279. blue should I call the org primate or primate-run on gitea
  280. blue I guess it doesn't matter much
  281. phaleth call it primate
  282. blue k
  283. phaleth openapi is updated
  284. phaleth actually, no it isn't, forgot to download from git
  285. phaleth github*
  286. blue phaleth: https://gitea.repopack.app/primate/openapi
  287. blue I'm gonna delete the repo on gh
  288. blue btw I got a ton of template repos on gh for primate
  289. blue I'm sure we can do this better with repopack
  290. blue tell me when you've moved this to gitea
  291. blue and I can delete
  292. blue if you need to make it easier for yourself, add a pubkey, that's what I did
  293. blue I have a pubkey blue@vps in my gitea
  294. blue so I don't need to use weird bearer tokens
  295. phaleth you can delete from github all you want
  296. blue done
  297. phaleth https://openapi.primate.run/manifest.json
  298. blue NICE, libpod is there!
  299. blue dreamreal: I FIXED IT!
  300. blue https://openapi.primate.run/spec/podman/libpod.json
  301. blue now we can have a nice `client.networkCreate`
  302. blue phaleth: if you look at the NetworkCreate operation, you see it exposes four responses
  303. blue so the generated openapi client will have:
  304. phaleth no clue what I'm looking at in that json, will have to look into that later
  305. phaleth gotta go now, see ya
  306. blue client.networkCreate(/* params */).badRequest(/* handler */).conflict(/* handler */)
  307. blue ciao
  308. * nevet joined #primate
  309. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  310. * nevet joined #primate
  311. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc
  312. * nevet joined #primate
  313. * blue!~blue@user/blue changed the topic to: https://primate.run | this channel is mirrored to the Primate discord, channel #irc

Search posts