Git Product home page Git Product logo

Comments (7)

Southclaws avatar Southclaws commented on June 14, 2024 1

It suddenly got a whole lot more complex:

Currently, all the targets are bundled together into a single gitwatch instance with a single auth method (either nil or ssh). This means different auth methods for different targets won't work simply with the current setup.

I think it will be easier to update gitwatch to support per-repo settings such as auth instead of messing around with clustering targets with shared auth, firing multiple gitwatch instances and multiplexing their channels.

from pico.

Southclaws avatar Southclaws commented on June 14, 2024

Given the following configuration:

Configs in GitLab: pico run https://gitlab.com/ns/config

A target on GitHub and BitBucket

T({
  name: "app",
  url: "https://github.com/ns/repo",
  up: "./run"
});
T({
  name: "app",
  url: "https://bitbucket.org/ns/repo",
  up: "./run"
});

There are three sets of credentials to acquire. They may have the following names in Vault:

  • pico-gitlab-auth
  • pico-github-auth
  • pico-bitbucket-auth

To close this issue, there needs to be some logic that maps from the above configuration to these Vault secrets.


from pico.

ADRFranklin avatar ADRFranklin commented on June 14, 2024

Why not have some global config in the main file which can be used to setup what these values could be.

For example:

G({
    "respository" {
        "gitlab": {
            "ssh": false,                
            "url": "https://${GITLAB_USERNAME}:${GITLAB_TOKEN}@gitlab.com",
            "path": "${VAULT_PATH}/core_deployment"
        },
        "bitbucket": {
            "ssh": true,
            "ssh_use_vault": true,
            "path": "/path" // since `ssh_use_vault` is true, this is the vault path
        },
        "github": {
            "ssh": true,
            "ssh_use_vault": false,
            "path": "~/.ssh/github.com_rsa" // this would be a volume in docker
        }        
    }
});

T({
  name: "app",
  repo: "github:/my_name/my_repo",
  up: "./run"
});

T({
  name: "app",
  repo: "bitbucket:/my_org/new_repo",
  up: "./run"
});

T({
  name: "app",
  repo: "gitlab:/my_name/my_repo",
  up: "./run"
});

I might have made a mistake in the way I did it, I didn't check it syntax issues, but you get the idea. I think it might also make sense to make use of Vault's SSH storage, but be able to use that to also automate it using SSH and if it was done via pico, it could make it extremely simple.

from pico.

Southclaws avatar Southclaws commented on June 14, 2024

Yes I was thinking something like this. Instead of changing the repo key I'd introduce an auth key that pointed to some additionally declared resource.

from pico.

Southclaws avatar Southclaws commented on June 14, 2024
T({
  name: "app",
  url: "https://github.com/ns/repo",
  auth: "github_01",
  up: "./run"
});
T({
  name: "app",
  url: "https://bitbucket.org/ns/repo",
  auth: "bb_01",
  up: "./run"
});

A({
  name: "github_01",
  source: "vault",
  path: "pico_auth",
  method: "http",
  user_key: "GITHUB_USERNAME",
  pass_key: "GITHUB_PASSWORD"
});

Would read from /secret/pico_auth the keys for username/password. (Assuming /secret is where the KV engine is mounted).

from pico.

Southclaws avatar Southclaws commented on June 14, 2024

I have a feeling I will regret the single-letter function names in configuration files...

from pico.

ADRFranklin avatar ADRFranklin commented on June 14, 2024

haha probably, but I do like the concept. It could work out nicely.

from pico.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.