gitlabfs
gitlabfs allows you to mount all projects in a company's GitLab instance as a file system.
About
This project was conceived out of a need to easily browse code in many different repositories within a company. While GitLab does have builtin browsing and search, it's just not as convenient to use as common tools like find and grep.
It sets out to solve that by exposing an entire GitLab instance as a file system with the following hierarchy:
/
/user
/project
/master
README.md
/feature
/abc
/src
main.py
/v1.0
main.py
/group
/subgroup
/project
This allows you to freely browse all of the code in a GitLab instance without having to clone everything. All of the files are loaded from the GitLab API as you access them. The only caveat is that it is a read-only view.
Installation
Install the latest version of gitlabfs from PyPI:
pip install gitlabfs
Usage
-
Go to your profile page in GitLab and generate a new access token with the
apiscope. -
Create a directory where you would like to access your projects from, e.g.
~/gitlab. -
Mount GitLab at that directory:
glfs https://gitlab.mycompany.com ~/gitlab
You will be asked to provide your access token and then the GitLab hierarchy will be mounted.
Configuration
Various options can be passed to configure the properties of the file system:
--tags: Include tags in the list of repository refs.--users: List user repositories as well.--file-times: Better approximate file modification times with commit metadata.--cache-expiry=SEC: Expire the cache after this many seconds (default: 60).--fresh-project-tree: Enable cache expiry for the project tree.--debug: Enable verbose logging for development purposes.
Many of these are not enabled by default because they may result in worse performance or more clutter.
The access token must be provided via a command line prompt by default, but can also be passed via the GITLAB_TOKEN environment variable.
Limitations
- Not designed for GitLab instances with a huge number of projects (e.g. gitlab.com).
- File modification times are not accurate since they are not exposed by the GitLab API.
Development
The file system can be easily run locally with Pipenv:
pipenv install
pipenv run ./glfs <url> <mountpoint> [options]
And the PyPI package is published using the following commands:
pipenv run python setup.py sdist bdist bdist_wheel
pipenv run twine upload dist/*
License
MIT License
Metadata
Release files for gitlabfs 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gitlabfs-1.1.0.linux-x86_64.tar.gz | 9.6 kB | Without provenance | Details for gitlabfs-1.1.0.linux-x86_64.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gitlabfs-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for gitlabfs-1.1.0-py3-none-any.whl |
Total release size: 21.7 kB
Release files / gitlabfs-1.1.0.linux-x86_64.tar.gz
| Download URL | gitlabfs-1.1.0.linux-x86_64.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28e86bcdf34e3095f736bc1065ae1ad7b034479bb657df0f503c21a34ebaec4b
|
|
BLAKE2b-256 checksum How to use checksums |
490a4dd3db4d38ed4d83dfac07575d41819597e94a82e57fdc566afbf12bcc96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Release files / gitlabfs-1.1.0-py3-none-any.whl
| Download URL | gitlabfs-1.1.0-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fbf7abdf5ec3ec3a065308f66a20c98c3799fe95ef8530a018693d8893943832
|
|
BLAKE2b-256 checksum How to use checksums |
f7a5d6494a15162a5202f7357e60baf77f1aa7ca9e11d55dcaae7daec07a05a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Security for gitlabfs 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.