{"id":15650844,"url":"https://github.com/rgl/gitlab-vagrant","last_synced_at":"2025-08-24T14:46:49.949Z","repository":{"id":139752224,"uuid":"58884206","full_name":"rgl/gitlab-vagrant","owner":"rgl","description":"Basic GitLab Vagrant Environment","archived":false,"fork":false,"pushed_at":"2025-06-28T11:03:28.000Z","size":235,"stargazers_count":35,"open_issues_count":1,"forks_count":18,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-28T12:22:39.341Z","etag":null,"topics":["gitlab","gitlab-ce","vagrant"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-15T21:02:33.000Z","updated_at":"2025-06-28T11:03:32.000Z","dependencies_parsed_at":"2024-01-20T13:29:53.884Z","dependency_job_id":"1b59a26c-13fd-4fbd-bbb6-76d59817a7cd","html_url":"https://github.com/rgl/gitlab-vagrant","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rgl/gitlab-vagrant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fgitlab-vagrant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fgitlab-vagrant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fgitlab-vagrant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fgitlab-vagrant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgl","download_url":"https://codeload.github.com/rgl/gitlab-vagrant/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fgitlab-vagrant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271409395,"owners_count":24754706,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitlab","gitlab-ce","vagrant"],"created_at":"2024-10-03T12:36:03.204Z","updated_at":"2025-08-21T00:31:14.428Z","avatar_url":"https://github.com/rgl.png","language":"Shell","readme":"# Environment\n\nThis [vagrant](https://www.vagrantup.com/) environment configures a basic [GitLab Community Edition](https://gitlab.com/gitlab-org/gitlab-foss) installation using the [Omnibus GitLab](https://gitlab.com/gitlab-org/omnibus-gitlab) package.\n\nAfter launching this environment, you can test GitLab CI by launching the [rgl/gitlab-ci-vagrant](https://github.com/rgl/gitlab-ci-vagrant) environment.\n\n[Nginx](http://nginx.org/en/) ([HTTP/2](https://en.wikipedia.org/wiki/HTTP/2) enabled) is configured with a self-signed certificate at:\n\n\u003e https://gitlab.example.com/\n\n[PostgreSQL](http://www.postgresql.org/) is configured to allow (and trust) any connection from the host. For example, you can use [pgAdmin III](http://www.pgadmin.org/) with these settings:\n\n    Host: gitlab.example.com\n    Port: 5432\n    Maintenance DB: postgres\n    Username: gitlab-psql\n\nGitLab is also configured to use the optional `ldaps://dc.example.com` Active Directory LDAP endpoint as configured by [rgl/windows-domain-controller-vagrant](https://github.com/rgl/windows-domain-controller-vagrant).\n\nSome example repositories are automatically installed, if you do not want that, comment the line that calls [`create-example-repositories.sh`](create-example-repositories.sh) inside the [`provision.sh` file](provision.sh) before running `vagrant up`.\n\nEmail notifications are sent to a local [mailpit](https://github.com/axllent/mailpit) SMTP server running at localhost:1025 and you can browse them at [http://gitlab.example.com:8025](http://gitlab.example.com:8025).\n\nPrometheus is available at http://gitlab.example.com:9090/.\n\n\n# Usage\n\nInstall the [Ubuntu 22.04 UEFI Base Box](https://github.com/rgl/ubuntu-vagrant).\n\nStart the environment:\n\n```bash\nvagrant up --no-destroy-on-error\n```\n\nConfigure your host system to resolve the `gitlab.example.com` and `vault.gitlab.example.com` domains to this vagrant environment IP address, e.g.:\n\n```bash\nsudo tee -a /etc/hosts \u003c\u003c'EOF'\n10.10.9.99 gitlab.example.com\n10.10.9.99 vault.gitlab.example.com\nEOF\n```\n\nSign In into GitLab using the `root` username and the `HeyH0Password` password at:\n\n\u003e https://gitlab.example.com/users/sign_in\n\nWhen using the default LDAP settings you can also login with LDAP credentials as the following users:\n\n| Username      | Password        |\n|---------------|-----------------|\n| `john.doe`    | `HeyH0Password` |\n| `jane.doe`    | `HeyH0Password` |\n\nAfter login, you should add your [public SSH key](https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key), for that open the SSH Keys page at:\n\n\u003e https://gitlab.example.com/-/user_settings/ssh_keys\n\nAdd a new SSH key with your SSH public key, for that, just copy the contents of\nyour `id_rsa.pub` file. Get its contents with, e.g.:\n\n```bash\ncat ~/.ssh/id_rsa.pub\n```\n\nCreate a new repository named `hello` at:\n\n\u003e https://gitlab.example.com/projects/new\n\nYou can now clone that repository with SSH or HTTPS:\n\n```bash\ngit clone git@gitlab.example.com:root/hello.git\ngit clone https://root@gitlab.example.com/root/hello.git\n```\n\n**NB** This vagrant environment certificates are signed by a private CA, as\nsuch, to prevent TLS verification errors, you must trust it by importing its\ncertificate from the `tmp/gitlab-ca/gitlab-ca-crt.pem` file, or, not\nrecommended, temporarily, disable all the certificate verifications, by\nsetting the [`GIT_SSL_NO_VERIFY` environment variable](https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables)\nwith `export GIT_SSL_NO_VERIFY=true`.\n\nMake some changes to the cloned repository and push them:\n\n```bash\ncd hello\necho '# Hello World' \u003e\u003e README.md\ngit add README.md\ngit commit -m 'some change'\ngit push\n```\n\nList this repository dependencies (and which have newer versions):\n\n```bash\nGITHUB_COM_TOKEN='YOUR_GITHUB_PERSONAL_TOKEN' ./renovate.sh\n```\n\n\n## Hyper-V\n\nCreate the required virtual switches:\n\n```bash\n# NB HYPERV_SWITCH_NAME should be created as described in\n#    https://github.com/rgl/ubuntu-vagrant.\nexport HYPERV_SWITCH_NAME='Vagrant'\npwsh -NoLogo -NoProfile -ExecutionPolicy Bypass \u003c\u003c'EOF'\n@(\n  @{Name='gitlab'; IpAddress='10.10.9.1'}\n) | ForEach-Object {\n  $switchName = $_.Name\n  $switchIpAddress = $_.IpAddress\n  $networkAdapterName = \"vEthernet ($switchName)\"\n  $networkAdapterIpAddress = $switchIpAddress\n  $networkAdapterIpPrefixLength = 24\n\n  # create the vSwitch.\n  New-VMSwitch -Name $switchName -SwitchType Internal | Out-Null\n\n  # assign it an host IP address.\n  $networkAdapter = Get-NetAdapter $networkAdapterName\n  $networkAdapter | New-NetIPAddress `\n      -IPAddress $networkAdapterIpAddress `\n      -PrefixLength $networkAdapterIpPrefixLength `\n      | Out-Null\n}\n\n# remove all virtual switches from the windows firewall.\nSet-NetFirewallProfile `\n    -DisabledInterfaceAliases (\n            Get-NetAdapter -name \"vEthernet*\" | Where-Object {$_.ifIndex}\n        ).InterfaceAlias\nEOF\n```\n\n\n# Git Large File Storage (LFS)\n\nYou can also use Git Large File Storage (LFS). As this is an external Git plugin,\nyou need to [install git-lfs](https://git-lfs.github.com/) before you continue.\n\n**NB** `git-lfs` needs to be on your `PATH`. Normally the installer configures\nyour system `PATH`, but **you still need to restart your shell or Git Client\napplication** for it to pick it up.\n\nGive it a try by cloning the example repository (created by\n[create-example-repositories.sh](create-example-repositories.sh)):\n\n```bash\ngit clone https://root:HeyH0Password@gitlab.example.com/example/use-git-lfs.git\n```\n\n**NB** `git-lfs` always uses an `https` endpoint (even when you clone with `ssh`).\n\nLets get familiar with `git-lfs` by running some commands.\n\nSee the available lfs commands:\n\n```bash\ngit lfs\n```\n\nWhich file patterns are currently being tracked:\n\n```bash\ngit lfs track\n```\n\n**NB** do not forget, only the tracked files are put outside the git repository. So don't forget to\ntrack. e.g., with `git lfs track \"*.iso\"`.\n\nSee which files are actually tracked:\n\n```bash\ngit lfs ls-files\n```\n\nSee the `git-lfs` environment:\n\n```bash\ngit lfs env\n```\n\nFor more information [read the tutorial](https://github.com/github/git-lfs/wiki/Tutorial)\nand [the documentation](https://git-lfs.github.com/).\n\n\n# Troubleshoot\n\nWatch the logs:\n\n```bash\nsudo su -l\ntail -f /var/log/gitlab/gitlab-rails/*.log\n```\n\nDo a self-check:\n\n```bash\nsudo gitlab-rake --trace gitlab:env:info\nsudo gitlab-rake --trace gitlab:check SANITIZE=true\n```\n\n\n# Monitorization\n\nBy default Prometheus is configured to scrap the metric targets every 15 seconds and to store them for 15 days.\n\nYou can see the current targets at:\n\n    http://gitlab.example.com:9090/targets\n\n**WARNING** prometheus is configured to listen at `0.0.0.0`, you probably want to change this.\n\n\n# Command Line Interface\n\nGitLab has an [API](https://docs.gitlab.com/api/) which can be used from different applications, one of those, is the [`gitlab` cli application](https://python-gitlab.readthedocs.io/en/stable/cli-usage.html), which is already installed in the vagrant environment (see [provision-gitlab-cli.sh](provision-gitlab-cli.sh)) and can be used as:\n\n```bash\nvagrant ssh\nsudo su -l\n\n# list all users.\ngitlab -o yaml -f id,name,email user list --get-all\n\n# list all groups and projects.\ngitlab -o yaml -f id,visibility,full_path,web_url group list --get-all\ngitlab -o yaml -f id,visibility,tag_list,path_with_namespace,web_url project list --get-all\n\n# list all the projects protected branches, tags, members.\ngitlab -o json -f id,visibility,tag_list,web_url project list --get-all \u003eprojects.json\njq '.[].id' projects.json | xargs -L1 gitlab project-protected-branch list --get-all --project-id\njq '.[].id' projects.json | xargs -L1 gitlab project-protected-tag list --get-all --project-id\njq '.[].id' projects.json | xargs -L1 gitlab project-member list --get-all --project-id\n```\n\n# Python Interface\n\n[python-gitlab](https://github.com/python-gitlab/python-gitlab) is also available as the `gitlab` python library, which can be used as:\n\n```python\nimport gitlab\n\ngl = gitlab.Gitlab.from_config()\n\n# list all users.\nfor user in gl.users.list(all=True):\n    print(f'{user.id}\\t{user.name}\\t{user.email}')\n\n# list all groups and projects.\nfor group in gl.groups.list(all=True):\n    print(f'{group.id}\\t{group.visibility}\\t{group.full_path}\\t{group.web_url}')\nfor project in gl.projects.list(all=True):\n    print(f'{project.id}\\t{project.visibility}\\t{project.tag_list}\\t{project.path_with_namespace}\\t{project.web_url}')\n\n# list project protected branches.\nfor project in gl.projects.list(all=True):\n    has_i = False\n    for i in project.protectedbranches.list(all=True):\n        print(f'{project.web_url}\\t{i.name}')\n        has_i = True\n    if not has_i:\n        print(project.web_url)\n\n# list project members.\n# NB these members do not include the ones added to the group.\nfor project in gl.projects.list(all=True):\n    has_member = False\n    for member in project.members.list(all=True):\n        # NB the member object does not contain the email attribute, so we also fetch the user.\n        user = gl.users.get(id=member.id)\n        print(f'{project.web_url}\\t{user.username}\\t{user.email}')\n        has_member = True\n    if not has_member:\n        print(project.web_url)\n\n# see more examples at https://python-gitlab.readthedocs.io/en/stable/api-objects.html\n```\n\nAlso check the [set-example-groups-users.py](set-example-groups-users.py) script to see how you could add users to all groups.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fgitlab-vagrant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgl%2Fgitlab-vagrant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fgitlab-vagrant/lists"}