Create common repository configurations
The upstream repositories should be configured at the application level, called 'repository_providers' This repository_providers should include:
- name of repository,
- a templated clone URL,
- a templated 'browse' URL.
The templated URLs should include {namespace}, {module} and, optionally {provider}.
Uploading/direct downloading of version of a module provider that has a repository_provider configured, which has a clone URL, should be disabled.
Two configurations should be setup to determine:
- Whether manual uploading of modules is allowed - if disabled, the repository will be enforced
- Whether a repository URL can be manually provided.
When creating a module provider, the repository will be (possibly optionally, based on above config) provided. The UI for creating a module should have a drop-down for the repository.
The module configs should be stored in a table. On startup, the repository repository_providers in the database will be updated from the config. Any repository_providers removed from the config will be left in the database, but will not be selectable when creating new module providers. This allows old modules using older repository_providers to still work. It also means the details of the module providers can be updated.
The source_url from the module_provider should be removed and removed from terrareg.json examples/extraction and replaced with the repository_provider browse URL. The URL used for cloning during extraction should be obtained using the repository_providers. The URL used for downloading modules should be obtained using the repository_providers.
At a later date, the repository_providers should be updatable in the UI (#78)