The registry provides a central place to store and manage your protobuf files.
The protobuf files are usually stored in the same repository as the code that uses them. This approach works well for small projects, but it becomes a problem when you have multiple repositories that use the same protobuf files. In this case, you have to copy manually the files to each repository, which is not only tedious but also error-prone.
The registry solves this problem by providing a central place to store and manage your protobuf files and sync the files with your repositories.
- Clone the repository
- Generate certificates with
make certs-gencommand (they will appear ingen/certsfolder) or put your own certificates in the folder - Export
SERVER_STATIC_TOKENwith static authorization token - Run
make run-prodto start the registry - Run
make stop-prodto stop the running registry
The registry can be configured with environment variables that overrides values in the config/config.yaml file. For instance, to change the database DSN you can set DATA_DATABASE_DSN environment variable that is reflect to data.database.dsn yaml property.
- Helm
- Postgres database should be provisioned separately
Add repository to Helm:
helm repo add pbuf https://pbufio.github.io/helm-chartsTo install the chart with the release name my-pbuf-registry:
helm install my-pbuf-registry pbuf/pbuf-registry --set secrets.databaseDSN=<databaseDSN>More information about the chart can be found in the chart repository
Once the registry is running, try these commands to see it in action:
Prerequisites: Install pbuf
# 1. Configure pbuf to point to your registry
export PBUF_REGISTRY_URL=https://localhost:6777
export PBUF_REGISTRY_TOKEN=${SERVER_STATIC_TOKEN}
# 2. Register a new module (module name comes from pbuf.yaml)
pbuf modules register
# 3. Push your first tag (from a directory with .proto files and pbuf.yaml)
pbuf modules push v1.0.0
# 4. Pull dependencies (add module to pbuf.yaml's modules section, then run)
pbuf vendorNew to pbuf? Check out the examples/ directory for a complete walkthrough with sample protobuf files.
We recommend to use the pbuf CLI to interact with the registry.
The registry provides a REST API (:8080 port by default). You can find the swagger documentation here.
The registry provides a gRPC API (:6777 port by default). You can find the protobuf definition here
We welcome contributions! Please see CONTRIBUTING.md for:
- How to report issues and request features
- Pull request process
- Code style guidelines
- Issue templates and labels
- Run
make buildto build the registry - Run
make build-in-dockerto build linux binaries in docker
- Run
make testto run the tests.
- Run
make runto start the registry and test it. - Run
make stopto stop the running registry.