{"id":13505723,"url":"https://github.com/devoteamgcloud/petra","last_synced_at":"2025-03-30T00:31:29.368Z","repository":{"id":165728028,"uuid":"459742187","full_name":"devoteamgcloud/petra","owner":"devoteamgcloud","description":"Private Terraform Registry Manager","archived":false,"fork":false,"pushed_at":"2024-06-06T20:17:34.000Z","size":14388,"stargazers_count":43,"open_issues_count":10,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T14:55:59.924Z","etag":null,"topics":["go","google-cloud-platform","google-cloud-storage","private-registry","terraform"],"latest_commit_sha":null,"homepage":"https://devoteamgcloud.github.io/petra/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devoteamgcloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-02-15T20:40:01.000Z","updated_at":"2025-01-27T17:58:36.000Z","dependencies_parsed_at":"2024-06-21T07:31:32.794Z","dependency_job_id":"e27353ed-efb0-48eb-a2f9-8c24449f873d","html_url":"https://github.com/devoteamgcloud/petra","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devoteamgcloud%2Fpetra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devoteamgcloud%2Fpetra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devoteamgcloud%2Fpetra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devoteamgcloud%2Fpetra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devoteamgcloud","download_url":"https://codeload.github.com/devoteamgcloud/petra/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262490,"owners_count":20749170,"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","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":["go","google-cloud-platform","google-cloud-storage","private-registry","terraform"],"created_at":"2024-08-01T00:01:12.279Z","updated_at":"2025-03-30T00:31:24.357Z","avatar_url":"https://github.com/devoteamgcloud.png","language":"Go","funding_links":[],"categories":["Tools","Self-Hosted Registries"],"sub_categories":["Registry","Miscellaneous"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/logo.png\" width=\"250\" \u003e\n  \u003ch1\u003ePetra (Private Terraform Registry)\u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cp\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/devoteamgcloud/petra/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/devoteamgcloud/petra.svg\" alt=\"Latest Release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/devoteamgcloud/petra/actions\"\u003e\u003cimg src=\"https://github.com/devoteamgcloud/petra/workflows/qa/badge.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/devoteamgcloud/petra/actions\"\u003e\u003cimg src=\"https://github.com/devoteamgcloud/petra/workflows/doc/badge.svg\" alt=\"Documentation\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/devoteamgcloud/petra/actions\"\u003e\u003cimg src=\"https://github.com/devoteamgcloud/petra/workflows/golangci-lint/badge.svg\" alt=\"Linter\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/devoteamgcloud/petra/actions\"\u003e\u003cimg src=\"https://github.com/devoteamgcloud/petra/workflows/goreleaser/badge.svg\" alt=\"Release\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nPetra is a lightweight tool that allows to host your own private Terraform registry using Google Cloud Storage as a storage backend.\n\nPetra is not an official Devoteam product and is provided as-is to the community.\n\n\u003cimg alt=\"Welcome to VHS\" src=\"./docs/assets//petractl.gif\" width=\"600\" /\u003e\n\n\n## Components\n\n### petra (server)\nServer to get a terraform module versions / get a signed URL to download a module from a private registry (Google Cloud Storage bucket). \nConfigured by the following env vars :  \n  - `GCS_BUCKET`: Bucket used to host Terraform modules  \n  - `SIGNED_URL`: (Optional) Enables the use of a Signed URL for the download api routes. Defaults to false and just forwards a gcs:// link\n\n### petractl (cli)\n\nCLI to upload / remove / upload a terraform module to a private registry (Google Cloud Storage bucket).\n  \nExample usage :  \n    ```bash\n    petractl push  --bucket tf-registry-petra  ../tests/mod1\n    ```\n\n\n## Deployment\n#### Deploy Server on Cloud Run\n\nCloud Run's service account must have the following roles:\n\n- Service Account Token Creator (used to create signed url)\n- Storage Object Admin (access objects in bucket) for the bucket where you store the terraform modules.\n\nThen `terraform init`:\n\n```terraform\n// main.tf\nmodule \"my_module\" {\n  source  = \"{CLOUD_RUN_URL}/{NAMESPACE}/{MODULE}/{PROVIDER}/{VERSION}\"\n}\n```\n\nor specify the module version separately :\n\n```terraform\n// main.tf\nmodule \"my_module\" {\n  source  = \"{CLOUD_RUN_URL}/{NAMESPACE}/{MODULE}/{PROVIDER}\"\n  version = \"{VERSION}\"\n}\n```\n\n### Deploy Server on GKE with Workload Identity\n\nActivate [Workload Identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) and the service account must have the following roles:\n\n- Service Account Token Creator (create signed url)\n- Storage Object Admin (access objects in bucket) for the bucket where you store the terraform modules\n\nThen `terraform init`:\n\n```terraform\n// main.tf\nmodule \"my_module\" {\n  source  = \"{PETRA_SERVER}/{NAMESPACE}/{MODULE}/{PROVIDER}\"\n  version = \"{VERSION}\"\n}\n```\n\n## Development\n\nFollow these steps if you are OK installing and using Go on your machine.\n\n1. Install [Go](https://golang.org/doc/install).\n1. Install [Visual Studio Code](https://code.visualstudio.com/).\n1. Install [Go extension](https://code.visualstudio.com/docs/languages/go).\n1. Clone and open this repository.\n1. `F1` -\u003e `Go: Install/Update Tools` -\u003e (select all) -\u003e OK.\n\n## Release\n\nThe release workflow is triggered each time a tag with `v` prefix is pushed.\n\n_CAUTION_: Make sure to understand the consequences before you bump the major version. More info: [Go Wiki](https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher), [Go Blog](https://blog.golang.org/v2-go-modules).\n\n## Maintainance\n\nRemember to update Go version in [.github/workflows](.github/workflows)\n\nNotable files:\n\n- [.github/workflows](.github/workflows) - GitHub Actions workflows,\n- [.github/dependabot.yml](.github/dependabot.yml) - Dependabot configuration,\n- [.goreleaser.yml](.goreleaser.yml) - GoReleaser configuration,\n- [go.mod](go.mod) - [Go module definition](https://github.com/golang/go/wiki/Modules#gomod),\n\n## Contributing\n\nSimply create an issue or a pull request.\n\n## FAQ\n\n### How can I customize the release or add deb/rpm/snap packages, Homebrew Tap, Scoop App Manifest etc\n\nTake a look at GoReleaser [docs](https://goreleaser.com/customization/) as well as [its repo](https://github.com/goreleaser/goreleaser/) how it is dogfooding its functionality.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevoteamgcloud%2Fpetra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevoteamgcloud%2Fpetra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevoteamgcloud%2Fpetra/lists"}