Chat Logs

  1. bluehi phaleth
  2. phalethhi blue
  3. phalethis bun needed to run the website? https://pastequest.com/?b55864df229833ae#21oYrewhiVLj2Ct3kJm7jzpPRMvjDDKevHQm1vRBNZFU
  4. bluemise ERROR Failed to install tools: aqua:npm/cli@latest, npm:npm-check-updates@latest, npm:pnpm@11
  5. blueyou have no idea how much I hate mise
  6. phalethI don't have mise, is that needed?
  7. blueno
  8. blueand yes, I'm using bun right now for development, but it should work with pnpm too
  9. phaleththat means pnpx or whatever?
  10. blueWhile resolving: .@undefined
  11. phalethI do have pnpm
  12. bluewhat is that...
  13. phalethheh
  14. blueoh, nvm, the package is called like that
  15. bluelet me rename it to @repopack/web
  16. blueok, done. you can pull all the changes
  17. blueI just did `pnpm install`, and it worked
  18. phalethcool, now I get: PostgresError: password authentication failed for user "repopack"
  19. phalethor should I pull?
  20. bluegood. now follow the readme, it says you need a postgres db
  21. phalethI can just use pnpx I think
  22. blueyou can use pnpx
  23. phalethyeah, I do have postgres db, no clue why it does not connect
  24. bluedid you create a user repopack with password, or change .env.local?
  25. blueDB_NAME=repopack
  26. blueDB_USERNAME=repopack
  27. blueDB_PASSWORD=repopack
  28. bluePODMAN_SOCKET=/run/user/1000/podman/podman.sock
  29. blueSTORAGE_GIT=./storage/git
  30. blueSTORAGE_APPS=./storage/apps
  31. bluethe easiest is to just get devdb
  32. bluehttps://github.com/terrablue/devdb/releases/tag/v0.1.2
  33. nevetRelease v0.1.2 · terrablue/devdb
  34. bluethen run `./devdb x postgres@17 --name=repopack
  35. phalethnot sure about this https://pastequest.com/?99341d62d45c73de#3qHgkQ8faQU1yNRpDAprVC4Baz6x4QtVuJJbj7Yp6YCF
  36. phalethI already got the postgres db
  37. phalethI got rid of PODMAN_SOCKET=/run/user/1000/podman/podman.sock in the .env.local file, only TCP is needed
  38. blueoh ok, let me fixed that migrate
  39. bluefix*
  40. blueyou can pull
  41. phalethok
  42. phalethtrying to run it in dev mode fails https://pastequest.com/?577abfb267ab66cc#3BznToQup2t3YWHtgP328n9e4UzzP11pEG83dBzmknLo
  43. bluethat's weird, that file's not empty
  44. bluetry `npx primate`
  45. blueor `pnpx primate`
  46. phalethok
  47. bluehm, I'm getting the same error
  48. phalethdifferent error with npx https://pastequest.com/?0ac1d96d643fb320#FTuRJBerfc7X5Cjpri2fXJ2DCB5XzzBWWrMwoYhugnc7
  49. bluedid you pull the latest stuff?
  50. bluewell, bun appears to be reliably crashing
  51. bluemaybe it's just my computer though now
  52. phaleththat's just bun
  53. phalethyeah, pulled latest
  54. bluewell, it didn't crash yesterday, so I wonder what changed
  55. phalethnpm is slow today
  56. phalethnot responsive I mean
  57. phalethit's like everybody decided to do maintenance on this shiny sunday
  58. blueomg, mise is a TOTAL piece of garbage
  59. blueI just did `mise uninstall bun` and then `yay -S bun`, now it's working
  60. phalethI think bun, mise and all those shiny new tools just crash when the service they rely on gets unresponsive
  61. phalethcause they only consider the happy path
  62. blueyeah, it's all the same happy broken nonsense
  63. bluemise I've been angry at for a while though, it's literally a scam
  64. bluethe dude 'maintains' it and begs for donation, meanwhile everything isn't working
  65. bluebtw I'm smelling bun 2.0 or bun 1.4 now with the rust rewrite, it's being a PR circus with anthropic
  66. blueanyway, is repopack working for you?
  67. phalethI'd like to use the stable tools https://pastequest.com/?8fa5e741c0b2edf4#3Cs6B7MG637fKwExqUySLGUthrjGwehKdMdTGGDuPS5a
  68. phalethbut it seems like I have to install bun
  69. phalethno clue what package is that
  70. phalethtrying npm install --force
  71. blueyou can remove @plsp/svelte, it's not that important
  72. phalethok, got first app error https://pastequest.com/?dace3deaf1573fe7#AcsJcjtL1RHZrV47fmYu66KRt85ii4scMzurrpYBBXKm
  73. phalethlet me give you a link on how to setup the REST API connection over HTTP
  74. phalethblue: this is what the code should use, there is no need for unix socket https://gitea.repopack.app/repopack/provision/src/branch/master/podman/README.md#setup-podman-tcp-listener
  75. phalethit's cause podman has to run rootful
  76. phalethalso all podman commands have to be prepended with sudo
  77. bluebut we're not issuing any commands, we're using the API
  78. blue PODMAN_SOCKET: expected string, got undefined [plugin primate/server/live-reload]
  79. blueyou need to put it in .env.local
  80. phalethyeah, I know, but we have to use the API over TCP, not over unix socket, the link above shows how to set that up
  81. phalethotherwise there is no way to connect remotely and use rootful
  82. phaleththe API caller will not be priviledged and that's why it has to be a simple http client
  83. phalethPODMAN_SOCKET has to be replaced with REST_HTTP_URL or soemthing like that
  84. bluewe want to expose podman?
  85. bluealso, this setup is working for me with local unix socket on this computer, I don't think we need to replicate the secure setup on our computers, no?
  86. phalethit'll be behind haproxy
  87. phalethbut you are not running podman as rootful
  88. blueya I'm running it as user systemd on my comp
  89. phalethalso there will be auth
  90. phaleththe goal is to run as rootful and still not require the JS runtime to execute sudo commands
  91. phalethand just use any http client
  92. bluebut is this the goal with local dev as well? I'm not sure we'll have haproxy on our computers
  93. blueeventually it would be nice to test locally with *.repopack.local domains and a selfsigned cert, but this isn't at the top of my priority
  94. phalethnope, but the repopack app should still target TCP HTTP REST API of podman
  95. phalethso that it's deployable
  96. blueis your local setup unix or tcp?
  97. phalethTCP only, I didn't do any UNIX socket configuration
  98. phalethactually deleted that from the docs
  99. phaleththings being able to connect remotely means more flexibility and we will actually need connectivity over TCP, cause podman builds will not be happening on the same machine as where containers run
  100. phalethjust make that a default and only option
  101. blueyeah but I want to run podman rootless on my comp, can I still do that with tcp?
  102. blueI guess I can
  103. phalethif you modify the systemd unit file then sure
  104. phalethbut then you might not be able to test resource limits
  105. blueok, commit incoming
  106. bluechanged the env to PODMAN_HOST
  107. bluedone, you can pull
  108. phalethok, good
  109. phalethit works, looks good, very simple
  110. bluecool
  111. bluedid you manage to create an app & deploy?
  112. phalethnope, just created project
  113. phalethI guess I should read the readme
  114. blueah, ok
  115. bluebtw, I'm patching primate to read an env HOST / PORT variable if the user didn't set config.http.{host,port} explicitly
  116. blueI might even backport it to 0.39 because I'm testing whether I can deploy apps/svelte or any other app from primate's repo
  117. bluethe way it's done right now, every app gets a special port so they don't collide during testing
  118. bluebut I want to transition them to containers, so they can all use 6161 or just env.get("PORT")
  119. bluealso, I now have the problem that apps/svelte won't run in a container because the default host in primate is localhost
  120. phalethit reminds me of arch repo, cause you just have to push to it
  121. bluethat's why in apps/website, we have http.host: "0.0.0.0"
  122. phalethit will not let you create empty repo on the site and then git clone it
  123. blueI think you can clone it after you the create the project, you'll get an empty repo
  124. phaleththe clone button at top right switches to a different tab
  125. blueit's not wired at all
  126. bluelike, the functionality doesn't exist
  127. bluejust clone directly from "storage/git/NAMESPACE/PROJECT"
  128. phalethso this git remote add command seems to know the name of the project and namespace, but can it also figure out where the site is hosted? https://images4.imagebam.com/25/16/68/ME1DTXZ7_o.png
  129. phalethassuming that the ssh server is on the same host as the website app
  130. phalethwhich should always be the case
  131. blueyeah, it'll eventually figure it out
  132. bluefor now though, I'm testing with just locally accessing the bare repo
  133. blueso I did `git remote add ~/projects/repopack/storage/git/primate/primate`
  134. blueor acutally I think you need the name before
  135. blueso I did `git remote add local ~/projects/repopack/storage/git/primate/primate`
  136. bluethis will work, and be a bit faster locally than going over http
  137. blueor ssh
  138. blueyou can put the repos wherever you want for now, so you can set STORAGE_GIT to a location outside the repopack repo
  139. blueon the server they'll be on an fs mount, I imagine
  140. phalethI just went with the following
  141. phalethSTORAGE_GIT=./storage/git
  142. phalethSTORAGE_APPS=./storage/apps
  143. blueyeah, that works. in that case they're inside the location you cloned the repopack/website repo to
  144. phalethno idea what that means, could not find storage subdir being created
  145. blueit should be created
  146. phalethso anyway, I'm not sure about the ssh url
  147. phalethwhat's shown on the picture is not valid
  148. blueyes, it's just nonsense, ignore it
  149. bluefollow the readme
  150. bluein fact, let me update the repo
  151. bluereadme*, since it's outdated in that respect
  152. phalethah, ok, so there is no ssh communication yet
  153. phalethheh
  154. bluek, I've updated the readme
  155. blueand I just checked, when you create a new project, it should definitely create the storage/git directly
  156. bluedirectory*
  157. bluessh communication requires major shenanigans
  158. phalethok, the storage dir is there
  159. bluesince we need to move our normal ssh port to something else, and then configure ssh to pass to git
  160. bluegood
  161. bluenow you can add this local repo to primate's repo, git push local, create an app, and see the magic happen
  162. bluefyi https://github.com/primate-run/primate/commit/936731333293b02c2749af7f14f5f1f0b77f302f
  163. nevetcore: use HOST/PORT fallback for config.http · primate-run/primate@9367313
  164. blueI'm now gonna try to deploy apps/svelte on my local RP instance, and I think it's gonna finally work
  165. phalethnot sure I understand what to do here, I was thinking that I'd not need to touch server side repo, but that's what the readme is saying https://pastequest.com/?75fa6c310bb494de#6vpUa76irt7rVvf6j5RJxVJRwsUWeefhZaoGYnGJK74m
  166. blueyes
  167. blueyou're doing it wrong. those are bare repos
  168. bluewhat you need to do, is this
  169. phalethheh
  170. blueclone primate somewhere, `git clone https://github.com/primate-run/primate`
  171. bluethen enter that directly
  172. bluethen issue
  173. bluegit remote add local /home/user/repopack/website/storage/git/new-ns/new-prj
  174. bluethen do `git push local`
  175. blueand now you've got the entire primate repo inside your local RP instance, and you can play with it
  176. phaleththat makes sense, so the readme is confusing
  177. blues/directly/directory
  178. blueyeah, figures
  179. bluebtw when the app is building, you can click on the `Build image` line to expand it. same for `Write Containerfile`
  180. phalethtried to deploy 4 times, always fails the same way, no logs https://images4.imagebam.com/a6/0b/63/ME1DTZ9Z_o.png
  181. blueyay, it's working
  182. bluephaleth: https://gitea.repopack.app/repopack/website/commit/9bfab6010f6bd2248c0c0c046c5f8579a365758f
  183. bluenow I can deploy apps/svelte, too :)
  184. phalethdoing a git pull now and trying again
  185. blueI don't think it's going to matter, but could you change the exact app path to `apps/website`?
  186. blueotherwise we're gonna need to debug if your podman api is working fine
  187. blueone way to do that is this:
  188. bluehttp://localhost:6161/new-ns/new-prj/apps/podman
  189. bluedoes it show a bunch of json info or errors?
  190. phalethchanged the path and got same error
  191. bluewhat does that url give you?
  192. blueshould start with {"ok":true,
  193. phalethyeah, a json that starts with {"ok":true,
  194. blueand you have podman 5x, right?
  195. blueyeah, otherwise the info call wouldn't have worked
  196. blueok
  197. bluecan you go to /home/user/repoopack/website/storage/apps ?
  198. blueenter the directory there, should be projects/1
  199. bluethen enter apps/ and probably the 1 directory
  200. blueand then deployments, and the highest number
  201. bluedo you have a `build.log` there?
  202. phalethpodman version 5.4.2
  203. blueok, that's good
  204. phaleththe log only has this one line
  205. phalethPodman POST /v5.0.0/libpod/local/build failed: 404 Not Found
  206. phalethso maybe that's a newer API
  207. phalethI think, not sure, otherwise makes no sense
  208. phalethbut it'd be great if that error showed up in server side node logs
  209. blueyeah I think it was added later
  210. phalethyup, podman too old https://pastequest.com/?19b69d1205d29b10#8NxSAVR9VfRLuCuLLW1QFC58ctg738yX7ihSXQWyREaR
  211. bluehttps://gitea.repopack.app/repopack/website/commit/2c004238358d26096969ddaaaa03d0f6d6ae689a
  212. phalethbut don't worry about that, we need to get to podman 6.0 as soon as possible, cause there will be a fix that we need for REST API
  213. blueadded server logging
  214. phalethok, let me try
  215. phalethok, it's logging in the console now, nice
  216. blueyou did a v1.0 there though, try with v5.0.0
  217. blue$ curl -X POST \ "http://127.0.0.1:8080/v5.0.0/libpod/local/build?t=localhost/primate-site-runtime&localcontextdir=/home/user/repopack/provision/podman/deployments/primate-site/runtime&nocache=true"
  218. blueI converted apps/react, now trying to deploy that
  219. bluethis is so nice, it's discovering deployment-related bugs
  220. blue "build": "npm run clean && tsgo && cp src/types/{index,app}.d.ts lib",
  221. bluethis doesn't work inside a container properly, I guess since it assumes bash or whatever
  222. blueso need to make it two cp commands
  223. bluegreat, got apps/react running
  224. blueI now have apps/react, apps/svelte and apps/website running through RP all at the same time
  225. phaleththat still says Not Found, it's just old podman
  226. phalethI will have to figure out how to install latest podman anyway
  227. bluefyi, I'm using podman 5.8.3 here
  228. blueis podman 6 not released yet?
  229. phaleththat's latest
  230. phalethpodman 6 is release candidate atm I think
  231. blueoh nice
  232. blueRequired New Dependencies: Users must now use Pasta for rootless networking (replacing slirp4netns), cgroups v2, and SQLite (replacing BoltDB)
  233. blueNetworking Modernization: The Netavark networking stack has switched from iptables to nftables to align with modern Linux standards.
  234. bluehttps://fedoraproject.org/wiki/Changes/Podman6
  235. nevetChanges/Podman6 - Fedora Project Wiki
  236. bluehttps://github.com/podman-container-tools/podman/releases/tag/v6.0.0-rc1
  237. nevetRelease v6.0.0-RC1 · podman-container-tools/podman
  238. blue2 days ago
  239. blueanyway, we can switch to it once it's GA and arch packages it
  240. blueget the latest podman so you can tinker around with rp :P
  241. blueI'm gonna convert all primate apps so they're deployable via containers
  242. blueeventually, I want the command-line tool `rp` to be able to deploy locally via a locally configured podman, but to still use a repopack subdomain for reverse proxy and being reachable from the web
  243. blueso you can do `rp dev` and it opens a subdomain for you that you can enter into google oauth or whatever
  244. blueI used to use ngrok for this but they charge for a stable subdomain
  245. blueno reason not to give it for free, within the limited free plan
  246. bluethen I could finally test scld locally again
  247. phalethheh
  248. blueman I hate geoblocking
  249. bluetotally ruined the internet
  250. phalethok, got podman 5.8.2
  251. phalethwell, still getting the same error
  252. phalethI guess it's because of one of the podman dependencies and I've only updated podman
  253. bot<discord:blue> Ya
  254. bot<discord:blue> Get debian sid
  255. bot<discord:blue> https://packages.debian.org/unstable/podman
  256. botI Challenge Thee
  257. phalethsort of trying to do that
  258. phalethit's going to upgrade to latest kernel, will prolly break the fonts
  259. bot<discord:blue> Oh no
  260. bot<discord:blue> The Ubuntu community page is full of nonsense
  261. bot<discord:blue> "Debian is a volunteer project that has developed and maintained a GNU/Linux operating system for well over a decade"
  262. bot<discord:blue> More like three decades
  263. bot<discord:blue> Also who says GNU/Linux today other than pedantic buttholes
  264. bot<discord:blue> "Less dangerous, but still problematic behavior can be used as a teaching moment instead."
  265. phalethvery cool https://images4.imagebam.com/24/f9/98/ME1DU1FR_o.png
  266. bot<discord:blue> Why does everything sound like a soviet textbook
  267. phalethcan you expand that panel with build logs by default? so clicking on that is not necessary
  268. bot<discord:blue> Ya
  269. bot<discord:blue> Btw once it finishes building the logs might be red, I need to fix that
  270. bot<discord:blue> And after it finishes building you'll see real time stats on the right
  271. blueok
  272. phalethyeah, the logs at the bottom show
  273. phalethError: Podman GET /v5.0.0/libpod/containers/undefined/logs failed: 404 {"cause":"no such container","message":"no container with name or ID \"undefined\" found: no such container","response":404}
  274. blueyeah I know. if you refresh the page they'll show right
  275. bluebtw if you want you can create another app and deploy from apps/svelte :)
  276. phaleth50s to build the thing, not too bad since it's doing all that pnpm crap
  277. blueyeah, we need to optimise that but 50s is already great
  278. phalethok, so should I convert nevet docs to podman?
  279. bluewe need a deployment plan for it, that's what we need to work on
  280. bluelook into the plans directory
  281. bluethose plans are going to move soon into a db table so we can edit them live, but for now they're in plans/*.yaml
  282. phalethis that something custom or something podman specific?
  283. bluethe plans themselves are custom, the Containerfile are standard podman with variables
  284. phalethok
  285. phalethso we need containerfiles
  286. bluecheck primate_bun_v0.yaml and primate_bun_v0.Containerfile, I think you'll understand
  287. bluea repopack user can override the automatic detection of strategies by creating a `rp.yml` file
  288. blues/strategies/plans
  289. bluethen you put `plan: primate/static/v0` or whatever into rp.yml
  290. blueor I think I called that plan `node/static/v0`
  291. bluesince I needed a node builder and a static runner for primate/openapi
  292. blueso essentially, just to understand the system, the naming convention is BUILDER/RUNNER/VERSION
  293. blueso `primate/bun/v0` builds primate and runs it on bun, `node/static/v0` uses node to build a static website (like the primate/openapi repo)
  294. bluewe'll also have 'default' plans like `primate/v0`, which is just build with node, run with node
  295. bluethis will be the default plan for primate projects unless you choose another plan (bun or deno), by specifying it explicitly in your rp.yml, or by selecting it during the plan detection phase, if more than one plan was detected
  296. bluecurrently the detection strategy just takes the first thing that matches the requirements, so you'll see the primate website is deployed by `primate/bun/v0`
  297. bluebut technically `primate/deno/v0` matches as well, and in this case, since apps/website has no rp.yml stating a preference, the ui will offer you to choose (and remember your choice, if you wish)
  298. bluealso, in the ui, when you create an app, I'll add a field 'deployment plan'. default will be "detect", but you'd be able to also manually select a plan
  299. blueit is my intention to version those deployment plans so they can work with different major versions of a framework/tech, if both are still supported
  300. bluewe're gonna have next/v0, sveltekit/v0, etc., possibly with deno/bun variants
  301. phalethdocker.io/nginxinc/nginx-unprivileged:alpine is too big, can I update that Containerfile?
  302. blueyes, you should in fact
  303. bluejust push it back
  304. blueafter you update
  305. bluethe plans and their containerfiles aren't gonna be in git for long. as I said I plan to add a DEPLOYMENT_PLAN table and then we'll be managing it under an /admin path
  306. bluebecause I don't want to redeploy the entire repopack app just to change a plan
  307. blueI also eventually would like users to submit their own plans, or to be able to use custom plans for their apps
  308. blueall of that kind of requires a database
  309. bluehowever, I think keeping a few plans as a way to seed the db when you're just starting locally is a good idea
  310. blueanyway, for now just edit in git
  311. bluephaleth: build image now autoexpands, logs / stats should autowire when build is finished now
  312. blueso you shouldn't need to manually expand the build image step or refresh the page after the build anymore
  313. phalethI've opened up a PR? can you check your mailbox?
  314. phalethnice
  315. blueya
  316. blueyup, got three emails
  317. bluedone, merged & deleted branch
  318. blueonce we deploy RP on repopack.com, we can use it to manage repopack/web itself, it'll be great
  319. phaleththat's good
  320. bluebut we still have a lot to do with ssh / haproxy
  321. blueand I haven't written any auth code
  322. phalethyou can take a look at how gitea is proxied in haproxy.cfg, it'll be the same for RP except port 22 will be used
  323. phalethfor ssh I have no clue, last time you mentioned some lib
  324. phalethdoes not matter I guess as long as it's at the app level it's all fine
  325. blueyeah, we need to be able to cleverly check permissions
  326. blueso if you do `git clone ssh://git@repopack.com:repopack/web`, we need to be able to check first using the db if you have the permission to do
  327. bluethe path to get to the check itself is clear: pubkey -> user -> acl
  328. bluebut the difficult part is doing this before we let you clone/push/pull
  329. bluethis is where I used the `ssh2` package before
  330. bluelet me see if I can find the code somewhere
  331. phalethcan you take a look at the provison repo to podman/deployments/theanswerisc/nginx dir and can you tell how to include those additional files next to the Containerfile there?
  332. blueya
  333. bluehttps://gitea.repopack.app/blue/adaptivecloud
  334. bluehere is the old code
  335. bluehttps://gitea.repopack.app/blue/adaptivecloud/src/branch/master/server/app.js
  336. bluethis is the key part, essentially
  337. blueit extracts the pubkey from the ssh request (`client.public_key`), and then passes it to the app alongside the project id, the app can then decide whether to allow the user or not, and whether to trigger any hooks after a push
  338. blueanyway, gonna look at the provision repo
  339. blueah I see, you have nginx.conf and proxy_params
  340. bluethose are mostly about passing to fly, no? we won't be having that anymore
  341. bluethe question though, how to include additional files in a build, is valid
  342. phalethyeah, also I'm not sure how to handle passwords
  343. blueone possibility we have is to not put the plans in the db
  344. bluebut rather in a different repo, say repoack/plans
  345. blueand the repopack app periodically syncs them or whatever
  346. bluethat solves the additional files issue
  347. blueyou just have a dir, `primate_deno/v0/`, inside you'll have plan.yml, Containerfile, and any additional files you need
  348. bluein fact this is something we could do right now by restructuring the `plans` dir a bit
  349. bluethe problem is really during development, when you iterate quickly on the plans. I think in production it'll be okay
  350. bluepasswords/secrets we can inject into Containerfiles
  351. blueand the user can define them on the ui, probably
  352. phalethI think it's best to have everything in db to not have more than single data source
  353. bluethat's fair, remains the question how to deal with additional files
  354. bluealso having the plans versioned in git is perhaps not bad
  355. phaletheach containerfile can have many additional_files
  356. phalethand they are just blobs
  357. bluewhat kind of db column would that be?
  358. phalethsome binary
  359. bluecould be another table
  360. bluedeployment_plan_files
  361. phalethyeah, for sure, another table cause of the one to many relatioship
  362. blueya
  363. blueok, that sounds good. so we're gonna have the deployment_plan table with plan: p.json and containerfile: p.string
  364. blueand then deployment_plan_files with deployment_plan_id: p.u32, contents: p.blob
  365. blueyou only need the extra files if a plan is selected, anyway. so for the initial detection you don't need the related table
  366. blueI think for performance, the deployment_plan table will also have `family: p.u8` or so
  367. blueso the package_json family is 1 and so on
  368. bluethe purpose of the family is just for detection. so if you have a package.json file in root, we only look in plans belonging to this family
  369. phalethheh p.u8
  370. bluethose won't be many families. package_json, pom_xml, composer_json, makefile, build_zig
  371. bluecargo_toml etc.
  372. phalethnot sure, there are many software technologies
  373. bluek, p.u16 then
  374. bluemight be more than 256... but not more than 2^16