phalethalso all podman commands have to be prepended with sudo
bluebut we're not issuing any commands, we're using the API
blue PODMAN_SOCKET: expected string, got undefined [plugin primate/server/live-reload]
blueyou need to put it in .env.local
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
phalethotherwise there is no way to connect remotely and use rootful
phaleththe API caller will not be priviledged and that's why it has to be a simple http client
phalethPODMAN_SOCKET has to be replaced with REST_HTTP_URL or soemthing like that
bluewe want to expose podman?
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?
phalethit'll be behind haproxy
phalethbut you are not running podman as rootful
blueya I'm running it as user systemd on my comp
phalethalso there will be auth
phaleththe goal is to run as rootful and still not require the JS runtime to execute sudo commands
phalethand just use any http client
bluebut is this the goal with local dev as well? I'm not sure we'll have haproxy on our computers
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
phalethnope, but the repopack app should still target TCP HTTP REST API of podman
phalethso that it's deployable
blueis your local setup unix or tcp?
phalethTCP only, I didn't do any UNIX socket configuration
phalethactually deleted that from the docs
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
phalethjust make that a default and only option
blueyeah but I want to run podman rootless on my comp, can I still do that with tcp?
blueI guess I can
phalethif you modify the systemd unit file then sure
phalethbut then you might not be able to test resource limits
blueok, commit incoming
bluechanged the env to PODMAN_HOST
bluedone, you can pull
phalethok, good
phalethit works, looks good, very simple
bluecool
bluedid you manage to create an app & deploy?
phalethnope, just created project
phalethI guess I should read the readme
blueah, ok
bluebtw, I'm patching primate to read an env HOST / PORT variable if the user didn't set config.http.{host,port} explicitly
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
bluethe way it's done right now, every app gets a special port so they don't collide during testing
bluebut I want to transition them to containers, so they can all use 6161 or just env.get("PORT")
bluealso, I now have the problem that apps/svelte won't run in a container because the default host in primate is localhost
phalethit reminds me of arch repo, cause you just have to push to it
bluethat's why in apps/website, we have http.host: "0.0.0.0"
phalethit will not let you create empty repo on the site and then git clone it
blueI think you can clone it after you the create the project, you'll get an empty repo
phaleththe clone button at top right switches to a different tab
blueit's not wired at all
bluelike, the functionality doesn't exist
bluejust clone directly from "storage/git/NAMESPACE/PROJECT"
blueanyway, we can switch to it once it's GA and arch packages it
blueget the latest podman so you can tinker around with rp :P
blueI'm gonna convert all primate apps so they're deployable via containers
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
blueso you can do `rp dev` and it opens a subdomain for you that you can enter into google oauth or whatever
blueI used to use ngrok for this but they charge for a stable subdomain
blueno reason not to give it for free, within the limited free plan
bluethen I could finally test scld locally again
phalethheh
blueman I hate geoblocking
bluetotally ruined the internet
phalethok, got podman 5.8.2
phalethwell, still getting the same error
phalethI guess it's because of one of the podman dependencies and I've only updated podman
bot<discord:blue> Why does everything sound like a soviet textbook
phalethcan you expand that panel with build logs by default? so clicking on that is not necessary
bot<discord:blue> Ya
bot<discord:blue> Btw once it finishes building the logs might be red, I need to fix that
bot<discord:blue> And after it finishes building you'll see real time stats on the right
blueok
phalethyeah, the logs at the bottom show
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}
blueyeah I know. if you refresh the page they'll show right
bluebtw if you want you can create another app and deploy from apps/svelte :)
phaleth50s to build the thing, not too bad since it's doing all that pnpm crap
blueyeah, we need to optimise that but 50s is already great
phalethok, so should I convert nevet docs to podman?
bluewe need a deployment plan for it, that's what we need to work on
bluelook into the plans directory
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
phalethis that something custom or something podman specific?
bluethe plans themselves are custom, the Containerfile are standard podman with variables
phalethok
phalethso we need containerfiles
bluecheck primate_bun_v0.yaml and primate_bun_v0.Containerfile, I think you'll understand
bluea repopack user can override the automatic detection of strategies by creating a `rp.yml` file
blues/strategies/plans
bluethen you put `plan: primate/static/v0` or whatever into rp.yml
blueor I think I called that plan `node/static/v0`
bluesince I needed a node builder and a static runner for primate/openapi
blueso essentially, just to understand the system, the naming convention is BUILDER/RUNNER/VERSION
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)
bluewe'll also have 'default' plans like `primate/v0`, which is just build with node, run with node
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
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`
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)
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
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
bluewe're gonna have next/v0, sveltekit/v0, etc., possibly with deno/bun variants
phalethdocker.io/nginxinc/nginx-unprivileged:alpine is too big, can I update that Containerfile?
blueyes, you should in fact
bluejust push it back
blueafter you update
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
bluebecause I don't want to redeploy the entire repopack app just to change a plan
blueI also eventually would like users to submit their own plans, or to be able to use custom plans for their apps
blueall of that kind of requires a database
bluehowever, I think keeping a few plans as a way to seed the db when you're just starting locally is a good idea
blueanyway, for now just edit in git
bluephaleth: build image now autoexpands, logs / stats should autowire when build is finished now
blueso you shouldn't need to manually expand the build image step or refresh the page after the build anymore
phalethI've opened up a PR? can you check your mailbox?
phalethnice
blueya
blueyup, got three emails
bluedone, merged & deleted branch
blueonce we deploy RP on repopack.com, we can use it to manage repopack/web itself, it'll be great
phaleththat's good
bluebut we still have a lot to do with ssh / haproxy
blueand I haven't written any auth code
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
phalethfor ssh I have no clue, last time you mentioned some lib
phalethdoes not matter I guess as long as it's at the app level it's all fine
blueyeah, we need to be able to cleverly check permissions
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
bluethe path to get to the check itself is clear: pubkey -> user -> acl
bluebut the difficult part is doing this before we let you clone/push/pull
bluethis is where I used the `ssh2` package before
bluelet me see if I can find the code somewhere
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?
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
blueanyway, gonna look at the provision repo
blueah I see, you have nginx.conf and proxy_params
bluethose are mostly about passing to fly, no? we won't be having that anymore
bluethe question though, how to include additional files in a build, is valid
phalethyeah, also I'm not sure how to handle passwords
blueone possibility we have is to not put the plans in the db
bluebut rather in a different repo, say repoack/plans
blueand the repopack app periodically syncs them or whatever
bluethat solves the additional files issue
blueyou just have a dir, `primate_deno/v0/`, inside you'll have plan.yml, Containerfile, and any additional files you need
bluein fact this is something we could do right now by restructuring the `plans` dir a bit
bluethe problem is really during development, when you iterate quickly on the plans. I think in production it'll be okay
bluepasswords/secrets we can inject into Containerfiles
blueand the user can define them on the ui, probably
phalethI think it's best to have everything in db to not have more than single data source
bluethat's fair, remains the question how to deal with additional files
bluealso having the plans versioned in git is perhaps not bad
phaletheach containerfile can have many additional_files
phalethand they are just blobs
bluewhat kind of db column would that be?
phalethsome binary
bluecould be another table
bluedeployment_plan_files
phalethyeah, for sure, another table cause of the one to many relatioship
blueya
blueok, that sounds good. so we're gonna have the deployment_plan table with plan: p.json and containerfile: p.string
blueand then deployment_plan_files with deployment_plan_id: p.u32, contents: p.blob
blueyou only need the extra files if a plan is selected, anyway. so for the initial detection you don't need the related table
blueI think for performance, the deployment_plan table will also have `family: p.u8` or so
blueso the package_json family is 1 and so on
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
phalethheh p.u8
bluethose won't be many families. package_json, pom_xml, composer_json, makefile, build_zig
bluecargo_toml etc.
phalethnot sure, there are many software technologies
bluek, p.u16 then
bluemight be more than 256... but not more than 2^16