diff --git a/.env.component b/.env.component new file mode 100644 index 000000000..b6c1be94c --- /dev/null +++ b/.env.component @@ -0,0 +1,19 @@ +# Component global secrets + +# Provide your API key for the AI vendors so that you can set the components up +# with default credentials. +CFG_CONNECTOR_SECRETS_OPENAI_APIKEY= +CFG_CONNECTOR_SECRETS_STABILITYAI_APIKEY= +CFG_CONNECTOR_SECRETS_ANTHROPIC_APIKEY= +CFG_CONNECTOR_SECRETS_COHERE_APIKEY= +CFG_CONNECTOR_SECRETS_MISTRALAI_APIKEY= +CFG_CONNECTOR_SECRETS_GROQ_APIKEY= +CFG_CONNECTOR_SECRETS_FIREWORKSAI_APIKEY= + +# Numbers Protocol API key. +CFG_CONNECTOR_SECRETS_NUMBERS_XAPIKEY= + +# OAuth secrets. When these are filled, the specified component will support +# OAuth integrations. +CFG_CONNECTOR_SECRETS_GOOGLEDRIVE_CLIENTID= +CFG_CONNECTOR_SECRETS_GOOGLEDRIVE_CLIENTSECRET= diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 57b75f9bd..ad681058e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -50,6 +50,20 @@ $ make build-dev && make dev Now, you have the Go project set up in the container, in which you can compile and run the binaries together with the integration test in each container shell. +##### Injecting component secrets + +Some components can be configured with global secrets. This has several +applications: + +- By accepting a global API key, some components have a default setup. When + the `setup` block is omitted in the recipe, this API key will be used. +- In order to connect to 3rd party vendors via OAuth, the application + client ID and secret must be injected. + +You can set the values of these global secrets in +[`.env.component`](./.env.component) before running the Docker container in +order to add a global configuration to your components. + #### Run the server and the Temporal worker ```sh @@ -91,12 +105,6 @@ At the end of the tests, some SQL queries are run to clean up the data. `DB_HOST` points to the database host so the SQL connection can be established. If empty, tests will try to connect to `localhost:5432`. -#### Stop the dev container - -```bash -$ make stop -``` - #### Remove the dev container ```bash diff --git a/Makefile b/Makefile index f1e8a91de..c7e98efaa 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ dev: ## Run dev container -v $(PWD):/${SERVICE_NAME} \ -p ${PUBLIC_SERVICE_PORT}:${PUBLIC_SERVICE_PORT} \ -p ${PRIVATE_SERVICE_PORT}:${PRIVATE_SERVICE_PORT} \ + --env-file .env.component \ --network instill-network \ --name ${SERVICE_NAME} \ instill/${SERVICE_NAME}:dev >/dev/null 2>&1