Put the file storage's variables in .env
storage_env_to_fileWrites S3 bucket credentials and settings into a project .env file, returns only the variable names written, updates .gitignore, and keeps the secret key out of the chat.
Instructions
Write the bucket's name, endpoint, region and access key (AWS_S3_BUCKET, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_ENDPOINT_URL_S3, AWS_REGION and the spellings other S3 libraries read) into a .env file in the project directory, and return only the names of what was written. The key goes into the file and never into this conversation, so do not read the file back out to the user. These are the same variables the deployed app receives, so do not copy them into set_env. Variables already in the file are replaced, everything else is kept, and the file is added to .gitignore. The bucket has to exist first: storage_create makes it. Needs the account token that login (or https://antideploy.com/agent.md) saves on this machine: a project key cannot read the access key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | A .env file inside the project directory. Default .env; .env.local suits Next.js. | |
| directory | No | The project folder. Defaults to this server's working directory. |