The reverse direction looks easier (telling which repo bellongs to a known path). Gitlab stores the "Gitlab path" in the repo, called fullpath
eg:
cat /var/opt/gitlab/git-data/repositories/@hashed/ff/2c/ff2ccb6ba423d326bd549ed4cfb76e96976a0dcde05a01996a1cdb9f83422ec4.git/config
output:
[core]
repositoryformatversion = 0
filemode = true
bare = true
[gitlab]
fullpath = mygroup/myproject
If you don't have too many repos you can go through all of them and make a map:
for GITDIR in $(find /var/opt/gitlab/git-data/repositories/@hashed/ -maxdepth 3 -type d -name '*[0-9a-f].git'); do
echo "$(cat ${GITDIR}/config | grep fullpath | awk -F " = " '{print $2}') $GITDIR"
done
The output is a list off all your repos (except wikis) in a gitlab path - dir path pairs format.
Eg:
mygroup/myproject /var/opt/gitlab/git-data/repositories/@hashed/ff/2c/ff2ccb6ba423d326bd549ed4cfb76e96976a0dcde05a01996a1cdb9f83422ec4.git
ps: I have ~150 repos now and this little script finishes in no time (~half sec)