{"id":13375814,"url":"https://github.com/MatthewJohn/terrareg","last_synced_at":"2025-03-13T01:31:51.688Z","repository":{"id":40046039,"uuid":"485272500","full_name":"MatthewJohn/terrareg","owner":"MatthewJohn","description":"Open source Terraform module registry with UI, optional Git integration and deep analysis","archived":false,"fork":false,"pushed_at":"2024-04-01T16:42:19.000Z","size":10659,"stargazers_count":236,"open_issues_count":3,"forks_count":19,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-11T11:37:37.926Z","etag":null,"topics":["python","terraform","terraform-modules","terraform-registry"],"latest_commit_sha":null,"homepage":"https://gitlab.dockstudios.co.uk/pub/terrareg","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatthewJohn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-25T07:48:57.000Z","updated_at":"2024-06-03T06:29:17.884Z","dependencies_parsed_at":"2023-11-12T17:38:49.819Z","dependency_job_id":"4c118115-6833-481d-a0df-8f20ed4886bd","html_url":"https://github.com/MatthewJohn/terrareg","commit_stats":null,"previous_names":[],"tags_count":207,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewJohn%2Fterrareg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewJohn%2Fterrareg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewJohn%2Fterrareg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatthewJohn%2Fterrareg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatthewJohn","download_url":"https://codeload.github.com/MatthewJohn/terrareg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243322494,"owners_count":20272889,"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":["python","terraform","terraform-modules","terraform-registry"],"created_at":"2024-07-30T05:01:59.091Z","updated_at":"2025-03-13T01:31:50.889Z","avatar_url":"https://github.com/MatthewJohn.png","language":"Python","funding_links":[],"categories":["Tools","Python","Go"],"sub_categories":["Registry"],"readme":"# Terrareg\n\nOpen source Terraform Registry.\n\nProvides features to aid usage and discovery of modules, providing:\n\n * Fully implemented Terraform modules API\n * Completely API driven for automating all features\n * Host Terraform modules internally or from an external Git source\n * Analytics about the usage of modules\n * All information about a module - README, inputs, outputs, provider requirements and managed resources\n * Security alerts for each module, submodule and examples\n * Cost estimation for each module example\n * Module example source code within the UI, with automatic rewriting of 'source' arguments\n * Interactive 'Usage builder', helping users build terraform to use the terraform modules\n * Hooks for git SCM applications to automatically index modules\n * Authentication via SSO (OpenIDConnect/SAML2) and GitHub\n * Terraform provider support (very early alpha version)\n\nIf you like and use this project and are happy to let us know, please raise a GitHub issue, create a PR or contact [MatthewJohn](https://github.com/matthewjohn) so it can be added to the README :)\n\nFor a full list of issues and pull requests, please see [https://gitlab.dockstudios.co.uk/pub/terrareg](https://gitlab.dockstudios.co.uk/pub/terrareg)\n\n## Screenshots\n\n![Homepage](./docs/screenshots/homepage.png)\n\n![Search](./docs/screenshots/search.png)\n\n![Module Provider](./docs/screenshots/module_provider.png)\n\n![Example](./docs/screenshots/example.png)\n\n## Getting started\n\n    # Create secret key for session data\n    export SECRET_KEY=$(python -c 'import secrets; print(secrets.token_hex())')\n\n    # Run container, specifying secret key and admin password\n    docker run -ti -p 5000:5000 \\\n        -e PUBLIC_URL=http://localhost:5000 \\\n        -e MIGRATE_DATABASE=True \\\n        -e SECRET_KEY=$SECRET_KEY \\\n        -e ADMIN_AUTHENTICATION_TOKEN=MySuperSecretPassword \\\n        ghcr.io/matthewjohn/terrareg:latest\n\nThe site can be accessed at http://localhost:5000, which will provide a 'Initial Setup' guide for getting started.\n\nFor information about running with docker-compose, SSL certificate generation or running without docker, see [docs/LOCAL_DEVELOPMENT.md](./docs/LOCAL_DEVELOPMENT.md).\n\n## Upload a terraform module:\n\n**Warning**: Terrareg downloads and analyses modules. Be careful when using untrusted modules or modules that use untrusted Terraform providers, as this can allow arbitrary code execution.\n\n### From a git repo\n\n\n* Goto http://localhost:5000\n* Login, using the button in the top-right hand corner\n* Goto 'Create' -\u003e 'Namespace' (http://localhost:5000/create-namespace)\n  * Provide a name for the namespace and create.\n* Goto 'Create' -\u003e 'Modules' (http://localhost:5000/create-module)\n* Fill in the details for your module and 'Create'\n* Use the 'Manually index version' form of your module, filling out the version and select 'Publish' and then press 'Index Version'\n\n### From source\n\n    terrareg_root=$PWD\n    \n    cd source/of/my/module\n    \n    # OPTIONAL: Create an terrareg meta-data file\n    echo '{ \"description\": \"My first module\", \"owner\": \"ME!\", \"source\": \"https://github.com/me/my-tf-module\" }' \u003e ./terrareg.json\n    \n    # Zip up module\n    zip -r ../my-tf-module.zip *\n    \n    # Upload to terrareg\n    bash $terrareg_root/scripts/upload_module.sh http://localhost:5000 helloworld my-tf-module aws 1.0.0 ../my-tf-module.zip\n\n  Navigate to http://localhost:5000 to get started, or http://localhost/modules/helloworld/my-tf-module to see the uploaded example!\n\n\n**NOTE:** To use modules from the registry in Terraform, a valid SSL certificate is incredibly highly recommended. Terraform will not work if you supply `http://` as a protocol for the module URL, as it will treat this as a direct HTTP download, rather than treating it as a registry. Whilst Terrareg does handle these types of requests, you will not be able to the module version ranges that Terraform provides.\n\n\n## Additional configuration\n\nFor a full list of environment variables, please see [Deployment Guide](https://matthewjohn.github.io/terrareg/deployment) and [docs/CONFIG.md](https://matthewjohn.github.io/terrareg/CONFIG)\n\n## User Guide\n\nFor documentation about features, deployment, configuration and using Terrareg, please see: [https://matthewjohn.github.io/terrareg](https://matthewjohn.github.io/terrareg)\n\n## Terraform Provider\n\nThe Terrareg Terraform provider can be used to create namespaces, modules and manage other aspects of Terrareg:\n\n * [https://registry.terraform.io/providers/dockstudios/terrareg](https://registry.terraform.io/providers/dockstudios/terrareg)\n * [https://github.com/DockStudios/terraform-provider-terrareg](https://github.com/DockStudios/terraform-provider-terrareg)\n\n## Upgrading\n\nFor notes on upgrading, please see: [https://matthewjohn.github.io/terrareg/UPGRADE](https://matthewjohn.github.io/terrareg/UPGRADE)\n\n## API Documentation\n\nSee the [API Docs](./docs/API.md) for a list of all API endpoint.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md)\n\n\n## Local development\n\nFor all installation about local development, see [https://matthewjohn.github.io/terrareg/LOCAL_DEVELOPMENT](https://matthewjohn.github.io/terrareg/LOCAL_DEVELOPMENT).\n\nSince terraform requires HTTPS with a valid SSL cert, this must be provided in local development\n\nOn linux, by default, non-privileged users cannot listen on privileged ports, so the following can be used to route requests locally to port 5000:\n\n```\nsudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 5000\n```\n\nExample to run in local development environment:\n```\nvirtualenv -ppython3.8 venv\n. venv/bin/activate\npip install -r requirements.txt\npip install -r requirements-dev.txt\n\n# Without SSL cert\nPUBLIC_URL=http://localhost:5000 ALLOW_CUSTOM_GIT_URL_MODULE_PROVIDER=False ALLOW_CUSTOM_GIT_URL_MODULE_VERSION=False GIT_PROVIDER_CONFIG='[{\"name\": \"GitHub\", \"base_url\": \"https://github.com/{namespace}/{module}\", \"clone_url\": \"ssh://git@github.com/{namespace}/{module}.git\", \"browse_url\": \"https://github.com/{namespace}/{module}/tree/{tag}/{path}\"}, {\"name\": \"Bitbucket\", \"base_url\": \"https://bitbucket.org/{namespace}/{module}\", \"clone_url\": \"ssh://git@bitbucket.org/{namespace}/{module}-{provider}.git\", \"browse_url\": \"https://bitbucket.org/{namespace}/{module}-{provider}/src/{tag}/{path}\"}, {\"name\": \"Gitlab\", \"base_url\": \"https://gitlab.com/{namespace}/{module}\", \"clone_url\": \"ssh://git@gitlab.com/{namespace}/{module}-{provider}.git\", \"browse_url\": \"https://gitlab.com/{namespace}/{module}-{provider}/-/tree/{tag}/{path}\"}]' SECRET_KEY=ec9b8cc5ed0404acb3983b7836844d828728c22c28ecbed9095edef9b7489e85 ADMIN_AUTHENTICATION_TOKEN=password ANALYTICS_AUTH_KEYS=xxxxxx.atlasv1.zzzzzzzzzzzzz:dev,xxxxxx.atlasv1.xxxxxxxxxx:prod VERIFIED_MODULE_NAMESPACES=hashicorp TRUSTED_NAMESPACES=test DEBUG=True AUTO_PUBLISH_MODULE_VERSIONS=False LISTEN_PORT=5001 python ./terrareg.py\n\n# With SSL Cert\n# Add the following argument\n#  --ssl-cert-private-key ./example/ssl-certs/private.pem --ssl-cert-public-key ./example/ssl-certs/public.pem\n\n```\n\n\n## Committing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n# License\n\nThis project and all associated code is covered by GNU General Public License v3.0.\n\nFor full license, see [LICENSE](LICENSE).\n\nFor licenses of third party software and libraries used in this project, see [LICENSE.third-party](LICENSE.third-party).\n\n# Contributors\n\n * @mholttech for usage builder improvements and docker-compose dev environment\n * @Davidsoff for implementing GitHub hook support\n * @0xken for impleenting a custom Cherry Dark theme\n * @chriscunningham-trivago for fixing tfswitch bug in docker build\n * @bmaximuml for fixing typos and Dockerfile improvements\n * @cayce-hengeveld for grammar fixes\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMatthewJohn%2Fterrareg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMatthewJohn%2Fterrareg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMatthewJohn%2Fterrareg/lists"}