mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 05:24:22 +01:00
support self hosted GitLab server
This commit is contained in:
1 parent
79a8983bac
commit
1ea773ddfb
2 files changed
+6
No files matched your search
@@ -107,6 +107,7 @@ The code return codes are:
|
|||||||
|
|
||||||
### GitLab
|
### GitLab
|
||||||
To audit public repositories for user on GitLab use `--gitlab-user=` and for group `--gitlab-org=`. For private repositories add `GITLAB_TOKEN` environment variable with your personal access token (is used to list all repositories via API) also add key `-p` with `--ssh-key=` for SSH key path (is used to clone repository).
|
To audit public repositories for user on GitLab use `--gitlab-user=` and for group `--gitlab-org=`. For private repositories add `GITLAB_TOKEN` environment variable with your personal access token (is used to list all repositories via API) also add key `-p` with `--ssh-key=` for SSH key path (is used to clone repository).
|
||||||
|
If self hosted GitLab server add `GITLAB_URL` environment variable with your URL.
|
||||||
|
|
||||||
#### Additional information
|
#### Additional information
|
||||||
* Additional documentation about how gitleaks functions can be found on the [wiki page](https://github.com/zricethezav/gitleaks/wiki)
|
* Additional documentation about how gitleaks functions can be found on the [wiki page](https://github.com/zricethezav/gitleaks/wiki)
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ func auditGitlabRepos() ([]Leak, error) {
|
|||||||
page := 1
|
page := 1
|
||||||
cl := gitlab.NewClient(nil, os.Getenv("GITLAB_TOKEN"))
|
cl := gitlab.NewClient(nil, os.Getenv("GITLAB_TOKEN"))
|
||||||
|
|
||||||
|
// if self hosted GitLab server
|
||||||
|
if url := os.Getenv("GITLAB_URL"); url != "" {
|
||||||
|
cl.SetBaseURL(url)
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ps []*gitlab.Project
|
ps []*gitlab.Project
|
||||||
resp *gitlab.Response
|
resp *gitlab.Response
|
||||||
|
|||||||
Reference in new issue
Block a user