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

Unable to configure S3 storage using environment variables #261

Open
tomtaylor opened this issue Feb 4, 2025 · 11 comments
Open

Unable to configure S3 storage using environment variables #261

tomtaylor opened this issue Feb 4, 2025 · 11 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@tomtaylor
Copy link
Contributor

I'm trying to configure the S3 destination using environment variables as described in the documentation, but Greenmask doesn't seem to respect them. For example, I'm running:

STORAGE_S3_ACCESS_KEY_ID="foo" STORAGE_S3_SECRET_ACCESS_KEY="bar" STORAGE_S3_BUCKET="bucket" STORAGE_S3_ENDPOINT="https://storage.googleapis.com" STORAGE_S3_REGION="europe-west2" STORAGE_S3_PREFIX="greenmask-dumps" PGHOST="host" PGUSER="postgres" PGDATABASE="database" PGPASSWORD="password" greenmask --config greenmask.yml --log-level debug dump

The PG variables are respected, while the STORAGE variables aren't. Have I misunderstood how this is meant to work or is this a bug? Thanks a lot!

@wwoytenko
Copy link
Contributor

Thanks you for reporting.
I will check it

@wwoytenko wwoytenko self-assigned this Feb 5, 2025
@wwoytenko
Copy link
Contributor

I belive you need to set variable that determines a storage type STORAGE_TYPE=s3.

In config it is like

storage:
  type: "s3"

It works for me with your case

@wwoytenko wwoytenko added the help wanted Extra attention is needed label Feb 5, 2025
@wwoytenko
Copy link
Contributor

@tomtaylor let me know if it works for you

@tomtaylor
Copy link
Contributor Author

Thanks for checking this, but that still doesn't work for me. In my first example I had the storage type configured in the config file, which is why I didn't include it. Is there anything I can do to try and trace what's going on here?

@wwoytenko
Copy link
Contributor

wwoytenko commented Feb 5, 2025

Got it. I will double check it today

@wwoytenko
Copy link
Contributor

@tomtaylor have you build it manually or just used docker container let's say?

@wwoytenko
Copy link
Contributor

If it was downloaded from brew, I see a lost build flag -tags=viper_bind_struct. So that's why it does work for me and might not work for you.

https://github.com/Homebrew/homebrew-core/blob/23a8b3c85228096037258d50536af7e4e88a0197/Formula/g/greenmask.rb

@tomtaylor
Copy link
Contributor Author

Ah, yes, that will do it. I was using the Brew version.

@wwoytenko
Copy link
Contributor

wwoytenko commented Feb 6, 2025

Noted. I will open issue in homebrew or open MR by myself

@tomtaylor
Copy link
Contributor Author

Excellent, thank you.

@wwoytenko
Copy link
Contributor

This MR have to resove this issue

Homebrew/homebrew-core#206868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants