Skip to content

Commit

Permalink
Implementation of the provider registry protocol v1 (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
anjanikshree12 authored Feb 19, 2024
1 parent e54feae commit cfa0cf4
Show file tree
Hide file tree
Showing 17 changed files with 8,296 additions and 8,374 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN apt-get update && \
apt-get install -y ca-certificates

FROM scratch
COPY --from=build /workspace/random.json /
COPY --from=build /workspace/terrarium /
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
ENTRYPOINT [ "/terrarium" ]
32 changes: 32 additions & 0 deletions cmd/rest_providers_v1.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package cmd

import (
providersv1 "github.com/terrariumcloud/terrarium/internal/restapi/providers/v1"

"github.com/spf13/cobra"
)

var mountPathProviders string

var providersV1Cmd = &cobra.Command{
Use: "providers.v1",
Short: "Starts the Terrarium REST API service implementing a read only version of the provider.v1 registry protocol",
Long: "Runs the Terrarium REST server for the implementation of the provider.v1 protocol",
Run: runRESTProvidersV1Server,
}

func init() {
providersV1Cmd.Flags().StringVarP(
&mountPathProviders,
"mount-path",
"m",
"providers",
"Mount path for the rest API server used to process request relative to a particular URL in a reverse proxy type setup",
)
rootCmd.AddCommand(providersV1Cmd)
}

func runRESTProvidersV1Server(cmd *cobra.Command, args []string) {
restAPIServer := providersv1.New()
startRESTAPIService("rest-providers-v1", mountPathProviders, restAPIServer)
}
23 changes: 23 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,29 @@ services:
- 4318:4318
networks:
- terrarium
providers_api_v1:
build: .
image: terrarium:dev
container_name: terrarium-providers-api-v1
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_DEFAULT_REGION
- OTEL_EXPORTER_OTLP_ENDPOINT=jaeger:4317
ports:
- 50009:3001
networks:
- terrarium
command:
- providers.v1
- "--aws-access-key-id"
- "$AWS_ACCESS_KEY_ID"
- "--aws-secret-access-key"
- "$AWS_SECRET_ACCESS_KEY"
- "--aws-region"
- "$AWS_DEFAULT_REGION"
- --mount-path
- "/providers"

networks:
terrarium:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"modules.v1": "/modules/v1"
"modules.v1": "/modules/v1",
"providers.v1": "/providers/v1"
}
10 changes: 5 additions & 5 deletions internal/restapi/browse/frontend/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"files": {
"main.css": "/static/css/main.a593e941.css",
"main.js": "/static/js/main.248c1869.js",
"main.js": "/static/js/main.d65f24d1.js",
"static/js/496.c4cdc242.chunk.js": "/static/js/496.c4cdc242.chunk.js",
"static/media/not-found-1.jpg": "/static/media/not-found-1.3eec1753dacc2df2dcac.jpg",
"static/media/providers.svg": "/static/media/providers.6ba0b53e84665662440dd84573d617fb.svg",
"static/media/providers.svg": "/static/media/providers.b23747e853582f7fef85d036a949de8f.svg",
"static/media/server-error-1.jpg": "/static/media/server-error-1.6a4af50aed762b81d561.jpg",
"static/media/release.svg": "/static/media/release.08bd319f2eeb6be6a24e6af1ceb025dd.svg",
"static/media/release.svg": "/static/media/release.75050f51cb3da5cd45e3eb3dba9b8991.svg",
"static/media/modules.png": "/static/media/modules.df4734ecc28bffc1b755.png",
"index.html": "/index.html",
"main.a593e941.css.map": "/static/css/main.a593e941.css.map",
"main.248c1869.js.map": "/static/js/main.248c1869.js.map",
"main.d65f24d1.js.map": "/static/js/main.d65f24d1.js.map",
"496.c4cdc242.chunk.js.map": "/static/js/496.c4cdc242.chunk.js.map"
},
"entrypoints": [
"static/css/main.a593e941.css",
"static/js/main.248c1869.js"
"static/js/main.d65f24d1.js"
]
}
2 changes: 1 addition & 1 deletion internal/restapi/browse/frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Terrarium: Synamedia Terraform Registry</title><script defer="defer" src="/static/js/main.248c1869.js"></script><link href="/static/css/main.a593e941.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Terrarium: Synamedia Terraform Registry</title><script defer="defer" src="/static/js/main.d65f24d1.js"></script><link href="/static/css/main.a593e941.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"modules.v1": "/modules/v1"
"modules.v1": "/modules/v1",
"providers.v1": "/providers/v1"
}
Loading

0 comments on commit cfa0cf4

Please sign in to comment.