mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 13:45:52 +03:00
[PR #1925] [MERGED] Add environment variable support for all configuration options #1945
Labels
No labels
bug
compatibility-issue
docker
documentation
enhancement
help wanted
needs information
pull-request
question
stale
unfortunate
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-gcs-server#1945
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fsouza/fake-gcs-server/pull/1925
Author: @ota2000
Created: 3/7/2025
Status: ✅ Merged
Merged: 2/14/2026
Merged by: @fsouza
Base:
main← Head:feature/env-var-configuration📝 Commits (10+)
f33a671feat: add environment variable support for all configuration optionsddb7641test: add test for environment variable handling with invalid port value type8817d9adocs: update README to include environment variable configuration for server flags4c066fbFix line breaks in README.md04ef8e5Remove volume mount from docker run example8e7df30refactor: rename envVarOrDefaultT to envVarOrDefault for clarity5532a7dMerge branch 'feature/env-var-configuration' of https://github.com/ota2000/fake-gcs-server into feature/env-var-configuration08e8860test: enhance TestEnvVarOrDefault with uint parsing and validationdf84061refactor: rename variables for environment port configuration for clarityc8bda94Update Docker command in README.md📊 Changes
3 files changed (+366 additions, -26 deletions)
View changed files
📝
README.md(+23 -0)📝
internal/config/config.go(+81 -24)📝
internal/config/config_test.go(+262 -2)📄 Description
This PR adds environment variable support for all configuration options in fake-gcs-server. This is particularly useful when running the server in containerized environments like GitHub Actions service containers.
Changes
docker run --rm fsouza/fake-gcs-server:1.52.2 -helpand implemented environment variable support for all configuration optionsenvVarOrDefaultthat returns the environment variable value if set, otherwise the default value, supporting string and uint typesFAKE_GCS_*(e.g.,FAKE_GCS_PORTfor-port)Related Issues/PRs
Testing
I've prepared a custom image with these changes at https://hub.docker.com/repository/docker/ota1200/fake-gcs-server/general and tested it in a production-like environment.
I'll delete this custom image when this PR is released.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.