#@Erik Sipsma @vito Hey ๐
1 messages ยท Page 1 of 1 (latest)
Yeah part of the changes are that now if you want files/dirs from outside your module's source directory they need to be explicit arguments to the module (probably to it's constructor).
What the use case here specifically? Like what files do you want want that exist outside of ci/? Can give more specific suggestions based on that
For my typescript dev modules, I created it inside a sub directory named ci but it requires source from parent
Oh that's not cool ๐ฆ
can't you put dagger.json at the top-level, and then have source: "ci"?
Adds a new dev module for the Typescript SDK.
Adds the reference node module.
Fixes tsconfig updator relative path to point to the correct one.
Fixes DEV-3308
Fixes DEV-3345
Related to DEV-3352
Would this work?
Yes that's the recommended pattern. dagger.json at the root of your repo, and if you don't want to pollute your repo with module source, use source: "./other/dir".
No not yet, source was actually removed in the previous changes (see this thread #1202321084016513044 message) so there's currently only a concept of a "root" and a source dir that contains all the module implementation code, but you can't separately configure a third variable of "subdir where the module implementation is"
But being able to configure that "source subdir" is coming in this PR https://github.com/dagger/dagger/pull/6575
phew โค๏ธ i had a moment where i worried that we'd decided to get rid of this entirely ๐
So python dev module is also broken?
Is there any workaround? Because I cannot access the source code from my module then :/
My need is
repo source code # <- how do I access this in the current state of dagger
ci/
# Module implementation
You pass the source code as argument to your build function
Ughh I don't like this pattern
Sorry
You would like even less what will happen to the ecosystem if we let that backdoor open
Wdym?
Inconsistent API for passing inputs. Maybe you pass the source code as an argument. Maybe it's implicitly available to the module because of where it's hosted. Maybe it's both, with co-located directory used as a default to the argument. There's no way to know! Just look at the README.
I see
It's the same problem as ambient access to environment variables
Well, an argument in the top level object it will be then
Yeah, I still need to fix it, but it's fine. Fixed dagger.json locally, but not dag.host use.
Can also be to the constructor, which may simplify further if the dir is needed in multiple functions across the module
@calm bough but don't worry there is hope ๐ #daggernauts message
yeah I've landed on putting it in the constructor, feels nice so far
My line become: dagger --source=$PWD/../ call project terminal --cmd=/bin/sh
Sounds okay
@errant yoke Here's the solution for your issue ๐
../ should work instead of $PWD/../, looks less scary ๐
Or: dagger call -m dev --source=. project terminal
It says it requires an absolute path
I like this one!
host: directory: host directory ../: path ".." escapes workdir; use an absolute path instead โ input: resolve: host: directory: host directory ../: path ".." escapes workdir; use an absolute path instead
Seems like something we can fix in the CLI
We can also have the CLI automatically make it an abs path, which I think would be safe and extremely quick (or lift the limitation in the underlying host api)
Yep!
For now I'll use Helder's method, it works well
I kinda like the new way, it feels more generic
hm, i was thinking actually. we should probably change this entire logic.
atm, it's a bit of an issue that a dagger server can effectively request any file from the client, since the checks are on the server
e.g. a modified server could grab a bunch of extra stuff
My assumption is that we trust the server (since it's our code and lives in the dagger engine binary that you need to trust anyways, can't be changed by clients) and thus it can read files from the client as it wants but just needs to have guardrails around what clients can do (i.e. can't read each others files, etc.), which are in place. What changes were you thinking of?
Like a modified server would have to be a fork of dagger, at which point users are on their own ๐
i think the weird scenario i'm imagining is like in the context of a remote dagger engine (like one in kubernetes), or the future with compute drivers.
essentially, if i can trick you into connecting to my dagger engine, i can grab any file from your machine
super unlikely today, but i would potentially classify it as a bit of a security issue. but very minor, since it's only possible for weirder configurations of dagger (and not the default we ship)
There is actually an option for the engine client to disable the filesync attachables already: https://github.com/sipsma/dagger/blob/49392773866282928a35f1590e210c01a5ed9827/engine/client/client.go#L65-L65 (think playground uses it), which could be exposed in the CLI for the paranoid if we wanted. But generally speaking if you connect to an evil engine, it can do all sorts of awful things outside of just reading files so I think we just need to approach the problem as ensuring clients connect to an engine they trust
hm, maybe we should do both.
i know buildkit considers client<->server like this as a security boundary: https://github.com/moby/buildkit/blob/master/PROJECT.md#client
Yeah also totally possible for the client to specifically allow only some paths. Would also need the same thing for our h2c/c2h attachables, etc.