Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add run-server #305

Merged
merged 2 commits into from
Mar 19, 2024
Merged

feat: add run-server #305

merged 2 commits into from
Mar 19, 2024

Conversation

virtualroot
Copy link
Contributor

run-server is a small HTTPS server meant for testing in the local environment.

Support HTTPS, which is needed for OpenTofu to reach the registry.

It could also be used for E2E testing (#164)

Examples

$ curl -D - https://localhost:8443/.well-known/terraform.json
HTTP/2 200
accept-ranges: bytes
content-type: application/json
last-modified: Mon, 11 Mar 2024 14:31:37 GMT
content-length: 72
date: Mon, 11 Mar 2024 14:34:19 GMT

{
          "modules.v1": "/v1/modules/",
          "providers.v1": "/v1/providers/"
}

Fetch providers

terraform {
  required_providers {
    random = {
      source  = "localhost:8443/hashicorp/random"
      version = "~> 3"
    }
  }
}

Fetch modules

module "consul" {
  source = "localhost.:8443/hashicorp/consul/aws" # Keep the dot after localhost, it is not a typo
  version = "0.11.0"
}

I have been using this for a while. It allows me to quickly test ideas for the Registry UI. I hope it's as useful to OpenTofu as it is to me.

`run-server` is a small HTTPS server meant for testing in local
environment.

Support HTTPS, which is needed for OpenTofu to reach the registry.

Signed-off-by: Alejandro Lazaro <[email protected]>
@ghost
Copy link

ghost commented Mar 11, 2024

@virtualroot this wouldn't regenerate the data, right?

@virtualroot
Copy link
Contributor Author

@virtualroot this wouldn't regenerate the data, right?

It wouldn't. It can only serve data already created by the generate command.

Signed-off-by: Alejandro Lazaro <[email protected]>
Signed-off-by: Alejandro Lazaro <[email protected]>
@ghost ghost self-requested a review March 16, 2024 18:00
@cam72cam cam72cam merged commit d23a13b into opentofu:main Mar 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants