Chat Logs

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