Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Privately hosted Devbox Plugins on non-Github Git Servers #2048

Open
Bee-Mar opened this issue May 13, 2024 · 3 comments
Open

Privately hosted Devbox Plugins on non-Github Git Servers #2048

Bee-Mar opened this issue May 13, 2024 · 3 comments
Assignees
Labels
feature New feature or request triage Issue needs triage

Comments

@Bee-Mar
Copy link

Bee-Mar commented May 13, 2024

What problem are you trying to solve?

Devbox plugins are great, however I would like to retrieve privately hosted Devbox plugins that are stored on my Gitlab server. If this is possible, it's not clear how to go about using the correct address & protocol. It doesn't appear Devbox even supports public facing plugins hosted on Gitlab.

What solution would you like?

Support the same protocols and syntax flakes currently do:

ie.:

{
  "packages:": [],
  "include:" [
     "git+ssh://git@gitlab.private-server.com/devbox-plugins/my-plugin?dir=test"
  ]
}

Alternatives you've considered

If this is not currently supported, I'm more than happy to create a PR with the feature.

@Bee-Mar Bee-Mar added feature New feature or request triage Issue needs triage labels May 13, 2024
@Lagoja
Copy link
Contributor

Lagoja commented May 16, 2024

I think Gitlab is supported, but the flake reference is a little different. I'm looking at the Docs here:

https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html

Since GitLab allows for self-hosting, you can specify host as a parameter, to point to any instances other than gitlab.com.

Some examples:

gitlab:veloren/veloren
gitlab:veloren/veloren/master
gitlab:veloren/veloren/80a4d7f13492d916e47d6195be23acae8001985a
gitlab:openldap/openldap?host=git.openldap.org

So I think the right reference for your private hosted Gitlab would be:

gitlab:devbox-plugins/my-plugin?host=gitlab.private-server.com&dir=test

If this doesn't work, we'd definitely welcome a pull request to add the support

@Lagoja Lagoja self-assigned this May 16, 2024
@Bee-Mar
Copy link
Author

Bee-Mar commented May 18, 2024

@Lagoja thank you for the recommendation. My exact situation adds some complexity since the GitLab server I'm attempting to access is done via tunnel using the aws ssm start-session subcommand (I don't expect awareness/understanding of that CLI). However, it unfortunately seems that using the a scheme other than gitlab returns an error of the form:

Error: unsupported flake reference URL scheme: X

After starting the tunnel, repos are cloned using git clone ssh://git@localhost:1234/namespace/repo (the port may differ), and attempted this:

{
  // other sections in the devbox.json
  "include:" [
     "gitlab:namespace/repo?host=localhost:1234&dir=plugin"
  ]
 // other sections in the devbox.json
}

Below are a few of the others I tried, and returned a message of Error: unsupported flake reference URL scheme: X or Error: unsupported ref type "X".

"git+ssh:namespace/repo?host=localhost:1234&dir=plugin"
"git+ssh://namespace/repo?host=localhost:1234&dir=plugin"

"gitlab+ssh:namespace/repo?host=localhost:1234&dir=plugin"
"gitlab+ssh://namespace/repo?host=localhost:1234&dir=plugin"

"ssh:namespace/repo?host=localhost:1234&dir=plugin"\
"ssh://namespace/repo?host=localhost:1234&dir=plugin"

"git:namespace/repo?host=localhost:1234&dir=plugin"
"git://namespace/repo?host=localhost:1234&dir=plugin"

It does seem like I'll need to create a PR to support the additional scheme. Also, just as an FYI, I'm using devbox version 0.10.5

@Bee-Mar
Copy link
Author

Bee-Mar commented May 26, 2024

@Lagoja currently working on an implementation, and will submit a PR ASAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request triage Issue needs triage
Development

No branches or pull requests

2 participants