... | ... | @@ -527,6 +527,34 @@ $ curl -s 'https://gitlab.torproject.org/api/v4/projects/647' | jq .web_url |
|
|
"https://gitlab.torproject.org/tpo/core/arti"
|
|
|
```
|
|
|
|
|
|
## Find the project associated with a hashed repository name
|
|
|
|
|
|
Git repositories are not stored under the project name in GitLab
|
|
|
anymore, but under a hash of the project ID. The easiest way to get to
|
|
|
the project URL from a hash is [through the rails console](https://docs.gitlab.com/ee/administration/repository_storage_paths.html#from-hashed-path-to-project-name), for
|
|
|
example:
|
|
|
|
|
|
sudo gitlab-rails console
|
|
|
|
|
|
then:
|
|
|
|
|
|
ProjectRepository.find_by(disk_path: '@hashed/b1/7e/b17ef6d19c7a5b1ee83b907c595526dcb1eb06db8227d650d5dda0a9f4ce8cd9').project
|
|
|
|
|
|
The project's full path is also available in the `config` file in the
|
|
|
git repository, under the `fullpath` config entry.
|
|
|
|
|
|
Finally, you can also generate a rainbow table of all possible hashes
|
|
|
to get the project ID, and from there, find the project using the API
|
|
|
above. Here's a Python blob that will generate a hash for every
|
|
|
project ID up to 2000:
|
|
|
|
|
|
import hashlib
|
|
|
|
|
|
for i in range(2000):
|
|
|
h = hashlib.sha256()
|
|
|
h.update(str(i).encode('ascii'))
|
|
|
print(i, h.hexdigest())
|
|
|
|
|
|
## Connect to the PostgreSQL server
|
|
|
|
|
|
The GitLab Omnibus setup is special: it ships its own embedded
|
... | ... | |